Category Archives: Arduino

DFRobot Shield library for LCD Keypad Shield from DX

If you have ordered “LCD Keypad Shield for Arduino Duemilanove & LCD 1602” from DealExtreme and are wondering about how to get this thing working without datasheet, you are in the right place ūüôā

This product seems to be very similar(!) a product called “DFRobot LCD Keypad Shield for Arduino” and the Datasheet and even a library (LCD4bit_mod) for easy programming of it is available at following link,,¬†under useful links.

The only issue with the library is that this is built for old versions of Arduino and if one to make it work with newest version (Arduino 1.0), then some parts of the code should change. First you need to install the additional library in your Arduino on your computer (by copying the content of the zip file in the “libraries” folder of Arduino program). Afterwards one should change the content of LCD4bit_mod.cpp¬†

Continue reading DFRobot Shield library for LCD Keypad Shield from DX

Flame Detector Sensor, Arduino | – Programming Tutorial

This is a sample code to show how this cheap component from DealExtreme works with Ardunio (2.5$ with free shipping). These are very useful sensors for building [b]firefighting robots[/b] ūüėÄ Look at the sample code for more info.

Sensor detecting match flame
Sensor detecting match flame

purchase link:
Continue reading Flame Detector Sensor, Arduino | – Programming Tutorial

Arduino Mega 2560 driver could not be found on Windows 7

Issue: Arduino Mega 2560 driver could not be found on Windows 7
Solution:¬†Simply go to¬†Start¬†– right click on¬†Computer¬†–¬†Properties¬†¬†Device Manager–¬†¬†Under¬†Other Devices,¬†Find¬†Arduino Mega 256¬†– right click and choose¬†update driver¬†– Choose¬†Browse computer for driver software¬†– Click¬†Browse¬†and Navigate to your¬†Arduino home folder(where you installed Arduino)¬†and choose¬†drivers¬†folder and ¬†click Next. The windows 7 would find the right driver inside the folder.

Happy coding with Arduino ūüôā

Arduino Mega 2560 driver issue on Windows 7

Issue: Arduino Mega 2560 driver could not be found on Windows 7
Solution: Simply go to Start – right click on Computer – Properties – Device Manager – Under Other Devices, Find Arduino Mega 256 – right click and choose update driver – Choose Browse computer for driver software – Click Browse and Navigate to your Arduino home folder(where you installed Arduino) and choose drivers folder and click Next. The windows 7 would find the right driver inside the folder.

Happy coding with Arduino ūüôā

Computer based instrumentation and micro controllers, FYS4240 / FYS3240

FYS4240 / FYS3240, is all about how Micro-controllers, PC Processors and busses are made and gives you a very wide perspective in choice of connection technologies and micro controllers. Topics from internal structure of micro controllers to interfaces on it and parallel programming on multi core / multi processor machines. It also includes LABView and C programming for AVR micro controllers in the lab assignments. This course is recommended to take by all electronics, Robotics students and I would have a much wider point of view if I had taken this course in the beginning of my studies (something that did not happen because of lack of communication between physics department and departments of informatic). Here you can download the exam paper for spring 2011. Continue reading Computer based instrumentation and micro controllers, FYS4240 / FYS3240

RxTx / Serial Communication on Windows

Serial communication through COM ports are very common both in prototyping and industry. To be able to read / listen to COM ports on Java, Arudino or Processing you need to install the RxTx library. Follow the instruction to install Serial and Parallel communication installed on your Windows.
  1. unzip rxtx-*
  2. copy rxtxSerial.dll / rxtxParallel.dll to %JAVA_HOME%bin
    (e.g. c:Program FilesJavaj2re1.4.1_01)
  3. copy RXTXcomm.jar to %JAVA_HOME%libext

Download RxTx

Arduino Ethernet shield problem when on External Power

When Arduino/ethernet shield is connected with an external voltage source I have to press reset button to make it work. But when I use it with the USB source everything works fine. This code is not exactly pretty, but it solves the problem of the need to restart on Ethernet shield startup. Open relay and hooked the coil pins to ground and digital pin 02, and the switched pins to ground and the reset pin. The trick is to before initializing the Ethernet library, check an address in EEPROM. If the flag is 0, we set it to 1 and then trigger the relay, and the unit resets. If the flag is 1, we assume that we just did a warm reset and set the flag back to 0, for next time we power up.

<pre>int relayPin = 02;
int addr = 128;

void eepThang() {
eep_value =;
if (eep_value == 1) {
Serial.println("already reset. writing 0");
EEPROM.write(addr, 0);
else {
Serial.println("not reset.. writing 1, restarting");
EEPROM.write(addr, 1);
Serial.println("done wrote… here we go");
digitalWrite(relayPin, HIGH);

source :

Processing, the key for Arduino board independent programming

When it comes to Arduino, there are several ways to do things. Using simple Arduino IDE to communicate with the board through serial port. Write a Java program to do it, or maybe do send orders to Arduino through your program that is not uploaded on Arduino card and can be changed anytime without even updating the pde file on the board. The tool that gives you  the power to do this is called Processing & the library used exactly for Arduino is called StandardFirmdata. The very good thing about Processing is that it is based on Java and all Java codes works right out of the box on it. You can also import processing libraries into your Java framwork and enjoy the power of processing right in the middle of your Java project(in Eclipse).

The instruction to get Processing & Arduino talk together :

  1. Download this file.
  2. Unzip the library and copy the “arduino” folder into the “libraries” sub-folder of your Processing Sketchbook. (You can find the location of your Sketchbook by opening the Processing Preferences. If you haven’t made a “libraries” sub-folder, create one.)
  3. Run Arduino, open the Examples > Firmata > StandardFirmata sketch, and upload it to the Arduino board.
  4. Configure Processing for serial:
  5. In Processing, open one of the examples that comes with with the Arduino library(in the same folder that we just unzipped).
  6. Edit the example code to select the correct serial port.
  7. Run the example.

RxTx 64 bit on Windows 7

As it is recommended by RxTx official homepage, we can download the 64 bit version from this link(Cloudhopper RxTx page). Later it is just to unzip the file and follow the folloing instruction :

Choose your binary build – x64 or x86 (based on which version of
the JVM you are installing to)

NOTE: You MUST match your architecture. You can’t install the i386
version on a 64-bit version of the JDK and vice-versa.

For a JDK installation:
Copy RXTXcomm.jar —> jrelibext
Copy rxtxSerial.dll —> jrebin
Copy rxtxParallel.dll —> jrebinÔĽŅ

and then you are done”

I am using RxTx to communicate with my Arduino boards over serial communication. With this tool I can use Java to directly read the active ports and connect to Arduino cards. This(not needing to use Arduino IDE to show what is coming from the micro-controller) gives me the chance to process the received data and write back the commands automatically.