Saturday, November 27, 2010

Just bought an Arduino, What's next?


This article briefly explain what is to be done just after purchasing an Arduino board. Even though the prerequisites of Arduino is less compared to other development boards, I think this article will be useful because Arduino is being popular among beginners. This article deals with the latest version of Arduino at the time of writing - it is Arduino UNO.
Setting up drivers
Connect Arduino to your computer via USB cable. It will power up from USB power. Now start Arduino IDE. If you have not Arduino IDE download from here. No need to install the software. Just extract using your favourite decompressing utility (my favourite is 7zip) and run the executable named 'Arduino'. Now you have to set up your IDE to work with your Arduino UNO. First select your hardware from Tools -> Board -> Arduino UNO (or your exact hardware name. If it is not listed, try to download the latest version). Next, select your serial port from Tools -> Serial Port. Selecting serial port is in different way different OS.
Linux
If the 'Serial Port' menu is not active, probably, your device is not connected properly. Try to reconnect. If more than one serial ports are shown in the menu, we need to find out which is the correct one. To do that, disconnect your arduino first. Then you probably need to restart the IDE. Then look at the 'Serial Port' menu and note down the listed COM ports. Then reconnect your device and track the newcomer. This is the easy way. Select it.
One of the problem I suffered while playing with arduino in my Ubuntu 10.04 LTS was that, the compilation of the program was a failure. It was a dependancy problem. So what I did is that, installed Arduino IDE as described here. But it was an older version and my device UNO is not listed in it. Then downloaded the newer version from the downloads page. That was really a tricky step!
MS Windows
In Windows, just after connecting your device to the PC, a device driver wizard appears and try to find the appropriate device driver for the device. It will take a while and at the end of the fight, it fails to find an appropriate driver. Close the wizard and go to 'Device Manger' (Either via Control Panel or by right clicking 'My Computer' then 'Manage'). Then you can find Aduino UNO as the unknown device. Right click on that and choose the option to manually install the driver. Then locate the directory where you have installed Arduino IDE. Then the system install the appropriate driver and now you can see your device on the list named 'Ports' in the Device Manger. In parenthesis, there will be the curresponding COM port number (eg: COM 4) . Then choose that COM port in the Arduino IDE.
Starting with 'Hello World'
The commonly accepted 'Hello World' in embedded devices is LED blinking. There is an example in the IDE itself. Open the file from File -> Examples -> Basics -> Blink
Look at the program. For an average C programmer, the program seems self-explanatory. To compile your program, choose Sketch -> verify/compile. Then to upload the executable to your device, choose,File -> upload to I/O board. If everything you have done is correct, you will get your Arduino programmed and starts working just after burning the program using the USB power. Disconnect it from USB and use in your standalone applications.
Read more..
Arduino Lanugage reference
Arduino Playground

Sunday, November 14, 2010

SMS email alert in mobile phone

One of the major disadvantage while handling e-mail services is that we need to check mails by intervals. Most people checks their account more than once a day. Some people start up their computer to only check the e-mail and finds that 'No e-mail today' and continue their frustrating work after a couple of hours. This type of services are 'pull-email' type services. Conversely, there's a 'push e-mail' service which will send the mail to your mobile devices. But this service is not available in all mobile phones or services. So here is a method which can be used virtually in any mobile phone. This service will alert you whenever you get a new mail with some information about the sender. The alert is done by sending an SMS. Unfortunately, this method can only be applied in INDIA. Sometimes, all mails receiving in your mailbox including spam may not be important to alert. So by setting up your gmail, you can select which type of mails should be alerted.
I assume you have a gmail account. If not, either you can make a new gmail account or a similar approach will work on your other accounts also- explore it. Moreover, you need to have an account in way2sms.com . Register on way2sms (The service of way2sms is currently limited to India only). You will get your own free email address in way2sms domain.
Setup in gmail account
Go Settings->Filters
Click 'Create a new filter'. Then a box will appear which shows that which type of mails are to be forwarded to way2sms.com. For example, if you type user@gmail.com in the 'from line-box', all mails from user@gmail.com will be filtered. There are several other options also. You can test your filter by clicking 'Test Search'.
Click 'Next Step' button. Then a new box will appear. Check 'Forward it to' option and enter your way2sms email address.
Click 'Create Filter'.
Now onwards, all your filtered mails will be sent to your way2sms email.
Set up in way2sms account
Log in to your way2sms account.
Click 'Mail Alerts' link in the top right corner of the page. Here you can activate mail alerts for 14 days. After 14days, it will be automatically deactivated. So it is needed to activate the alerts in every two weeks. You can deactivate it at any time.
Done. Now you will get an alert SMS whenever you receive a new e-mail.

Sunday, November 7, 2010

Set up Toshiba L650 laptops after ubuntu installation

This article explains how to set up device drivers after installing Ubuntu in Toshiba laptops. Most probably Ubuntu will not support LAN, WiFi, Bluetooth and in some systems, anomaly in working of fan, battery are reported. Some of my problems like LAN setup, WiFi and Bluetooth have overridden and my battery is still showing some problems. I hope these instructions will be helpful for Toshiba Laptop users. Note that this article is a "how I did" type article rather than a "how to".
Some models of Toshiba Satellite are preloaded with Windows and some are not. In pre-installed models, try to make the system dual boot. There are a lot of tutorials for that and in Ubuntu, this is pretty easy compared to other distros. Anyway, I assume you have Toshiba system with a fresh Ubuntu installed. I used Ubuntu 10.04 LTS on by Toshiba L650-i5310.
Setting up Ethernet
My ethernet card was from Atheros Communications. A driver for Atheros is available from http://linuxwireless.org/download/compat-wireless-2.6 . Download and unzip the file. Then in terminal, cd into that folder. Then type the following code:
scripts/driver-select atheros
make
sudo make install

Then reboot the system.
Setting up Wireless
My Wireless LAN card was from Broadcom Corporation. The driver is readily available from ubuntu repository.
sudo apt-get install bcmwl-kernel-source
echo wl | sudo tee -a /etc/modules

Reboot the system.
Setting up Bluetooth
In bluetooth, I did nothing in Ubuntu and I installed a bluetooth driver from Toshiba in Windows 7. After that incident, my Ubuntu also start detecting bluetooth adapter and don't know how this happened.