March 4th, 2010
No Comments
Here is a quick guide on how to upgrade Thunderbird 2 that comes with Ubuntu 9.10 Karmic Koala to glorious Thunderbird 3. Hopefully this will save some lost souls out there. :)
Open Terminal and copy folder ~/.mozilla-thunderbird to the new location expected by Thunderbird 3:
copy ~/.mozilla-thunderbird ~/.thunderbird
All emails, settings and extensions in ~/.mozilla-thunderbird will be your backup.
Get Ubuntuzilla package signing key to your keyring:
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com C1289A29
Add Ubuntuzilla repositories to the list of your sources either by using main menu System > Administration > Software Sources on the Other Software tab:
deb http://switch.dl.sourceforge.net/project/ubuntuzilla/mozilla/apt all main
Hit Reload button when asked to update software list.
Alternativelly the above step can be done with the following two commands in your terminal:
echo -e "\ndeb http://switch.dl.sourceforge.net/project/ubuntuzilla/mozilla/apt all main" | sudo tee -a /etc/apt/sources.list > /dev/null
sudo apt-get update
And finally you can install the latest version of Thunderbird by running the following command:
sudo apt-get install thunderbird-mozilla-build
Don’t forget that you can erase the folder ~/.mozilla-thunderbird if the upgrade was successful. Have fun using the best email client in the world – Thunderbird 3! You can find it in the main menu Applications > Internet > Mozilla Build of Thunderbird.
January 12th, 2010
7 Comments
It’s hard to find good resources of electronic components and sensors for your projects, especially if you are just starting hardware hacking. Well, this is at least the way I felt a few months back, so here is my list of best UK based electronics hardware stores online where you can find pretty much everything you need for you next Arduino project.
Cool Components

www.coolcomponents.co.uk – great resource for Arduino shields, sensors and wireless communication hardware.
Robot Bits

www.robotbits.co.uk – wheels, chassis, gearboxes and various robotic kits ready for you to assemble based on Arduino.
Oomlout

oomlout.co.uk – great store for Arduino stuff, value starter bundles, essential tools, outstanding customer service and prompt delivery. With every component purchased you will get a very nice bonus – printed schematic for breadboard with instructions on how to connect the component to Arduino like this one.
Rapid Online

www.rapidonline.com – if you are more a do-it-yourself guy, this is an ideal resource for you. Store features everything from microcontroler ICs, LEDs to discrete semiconductors, sensors, gearboxes and complete robotic kits. Very competitive prices and free shipping for orders over £40.
I’d be very happy to hear of any resources that you know in the comments. :)
January 8th, 2010
No Comments

This is a another sample demonstrating Arduino MEGA, LCD screen and SRF05 ultrasonic range finder. The distance measurement from SRF05 is displayed on the LCD screen in centimetres.
Different from Infra Red range finder witch uses IR light to measure distance, ultrasonic range finder sends short high pitch sound pulses and measures the time for the echo to come back to the microphone. Here is a very good comparison of the two types of range finders. The code running on the Arduino:
// include the library code:
#include <LiquidCrystal.h>
#define echoPin 6 // the SRF05's echo pin
#define initPin 7 // the SRF05's init pin
unsigned long pulseTime = 0; // variable for reading the pulse
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// set up the LCD's number of rows and columns:
lcd.begin(16, 2);
// make the init pin an output:
pinMode(initPin, OUTPUT);
// make the echo pin an input:
pinMode(echoPin, INPUT);
}
void loop() {
digitalWrite(initPin, HIGH);
delayMicroseconds(10);
digitalWrite(initPin, LOW);
pulseTime = pulseIn(echoPin, HIGH);
lcd.setCursor(0,0);
lcd.print(pulseTime / 58, DEC);
lcd.print("cm");
delay(100);
lcd.clear();
}
Another application for SRF05 is a basic theremin by LuckyLarry. You can see it in action here:
Flickr Video Flickr Video
Read on here:
January 7th, 2010
8 Comments
The Arduino MEGA I got had and issue with automatic reset during sketch upload. The error message in the Arduino IDE looked something like this:
<pre>avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51
I had to hit Reset button just before uploading a sketch. This issue was due to some sort of defect in the Reset capacitor. The fix is very simple: just solder a 100nF capacitor on top of the defect one.

(via)
January 6th, 2010
1 Comment

This is a bit enhanced version of the “hello world” blink application for Arduino: traffic lights emulator. The top three LEDs control car traffic and the bottom two are fore pedestrians.
int carRedPin = 13;
int carYellowPin = 12;
int carGreenPin = 11;
int pedestrianRedPin = 10;
int pedestrianGreenPin = 9;
// The setup() method runs once, when the sketch starts
void setup() {
pinMode(carRedPin, OUTPUT);
pinMode(carYellowPin, OUTPUT);
pinMode(carGreenPin, OUTPUT);
pinMode(pedestrianRedPin, OUTPUT);
pinMode(pedestrianGreenPin, OUTPUT);
}
// the loop() method runs over and over again,
// as long as the Arduino has power
void blink(int light)
{
digitalWrite(light, LOW);
delay(500);
digitalWrite(light, HIGH);
delay(500);
digitalWrite(light, LOW);
delay(500);
digitalWrite(light, HIGH);
delay(500);
digitalWrite(light, LOW);
delay(500);
digitalWrite(light, HIGH);
delay(500);
digitalWrite(light, LOW);
}
void loop()
{
digitalWrite(carRedPin, HIGH);
digitalWrite(pedestrianGreenPin, HIGH);
delay(3000);
blink(pedestrianGreenPin);
digitalWrite(pedestrianRedPin, HIGH);
digitalWrite(pedestrianGreenPin, LOW);
delay(1000);
digitalWrite(carYellowPin, HIGH);
delay(1000);
digitalWrite(carRedPin, LOW);
digitalWrite(carYellowPin, LOW);
digitalWrite(carGreenPin, HIGH);
delay(3000);
blink(carGreenPin);
digitalWrite(carYellowPin, HIGH);
delay(2000);
digitalWrite(carYellowPin, LOW);
digitalWrite(carRedPin, HIGH);
delay(1000);
digitalWrite(pedestrianRedPin, LOW);
}
The code above is straightforward: just enabling and disabling LED at certain time. Traffic lights in action:
January 5th, 2010
No Comments

This was one of my first projects to try out various features of Arduino. I got this 2×16 LCD screen from Oomlout. The breadboard schematics came together with the LCD screen and is relatively simple.

Here is the sample code I uploaded to the controller:
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// set up the LCD's number of rows and columns:
lcd.begin(16, 2);
}
void loop() {
lcd.print(" arvydas.net");
lcd.setCursor(16,1);
lcd.autoscroll();
for (int thisChar = 0; thisChar < 28; thisChar++) {
lcd.print(" ");
delay(250);
}
lcd.noAutoscroll();
lcd.clear();
}
Just a simple scrolling text and here is the video:
November 26th, 2009
No Comments

Started thinking about the logic for the robot. The first one that I used in my prototype from LuckyLarry’s website seems to be too basic, so I did a quick brainstorm and came up with the flowchart above. The logic adds the complexity of using a range finder sensor on top of the servo. Robot should drive forward, unless it encounters an obstacle closer than 20cm. Then it should stop, look around and determine the next free path it should go. The most challenging bits are the ones that I colored in red: this requires some sort of sensory “knowledge” of the direction of the robot. If I had a spare accelerometer, everything should seem more simple: just get the data from the accelerometer and calculate the direction of the robot when it turns. All I have now is just SRF05 range finder so another thought came to my mind. At the point after robot scans the surrounding area, it should know the distance to the surrounding area with 10 degree resolution. For example:
- -90 deg | 70 cm
- -80 deg | 60 cm
- -70 deg | 50 cm
- -60 deg | 50 cm
- -50 deg | 40 cm
- -40 deg | 40 cm
- -30 deg | 30 cm
- -20 deg | 20 cm
- -10 deg | 20 cm
- 0 deg | 20 cm
- 10 deg | 20 cm
- 20 deg | 20 cm
- 30 deg | 20 cm
- …
According to the logic, robot should choose path (1) by turning -90 degrees. Considering that before the turning head is facing 0 degrees, it should continue turning, until it determines that the distance is more than 70cm to the closes object, so the range finder should read all the way from 20cm to 70cm with a threshold of +-5cm.
Huh, seems that hardware setup was the easiest bit. Building smart software to run the robot is a bigger challenge and that’s what makes this project so interesting. :)
November 24th, 2009
4 Comments

This Saturday I had a chance to attend a fantastic Howduino event in Birmingham – a one day hackers workshop. This was my first experience in this type of event, so I came without any expectations. :) Once the the welcoming announcements were made everybody started hacking either by going to beginners workshops or working on their own projects. Steward from Kre8 joined me at my desk and we had a lot of fun working together.
The task
My task for the day was to transform this R/C toy car from ELC into an obstacle avoiding robot.

I chose this cute little toy, because each side of the wheels is controlled by a separate motor. This allows the car to turn around 360 degrees in one spot. There was one big challenge involved in hacking this toy car: I had to be able to assemble it back again, because my son had already announced the ownership. :)
November 23rd, 2009
1 Comment
Hello and welcome to my new blog arvydas.co.uk!
Let me quickly introduce myself. I am Arvydas – a software developer and electronics hobbyist based in Hertfordshire, UK. I was born in Lithuania and just a few years ago moved to work in UK. I have been into software development for more than 15 years and have significant experience in PHP, Ruby on Rails, C# (Mono/Microsoft.NET) and Delphi. I am a huge fan of Open Source initiative and love Linux even though my primary desktop is Windows due to the majority of my day-to-day work involved in the latter OS. Quite recently I got a chance to work with Arduino open source hardware and was very impressed by the openness and easy of use of the platform.
I am not new to blogging and have been writing arvydas.net in Lithuanian, but decided to finally spread my thoughts to a wider audience in English. :) So what can you expect to find here? Just on top of my head in no particular order the topics might be:
- Software development in general;
- Arduino and other electronics projects;
- Development with Ruby on Rails and C# languages;
- Life in UK;
- Whatever interesting is on my mind at the moment.
Thanks for visiting and I hope you will find something useful here. :)