Tag Archive: arduino

It is my first week back in college and the start of a new semester. One of my first tasks was to prepare a report of the progress of my final year project. I found it hard to summarize the work I had done as I have not been keeping as much documentation as I should. Below is the report I handed in.

Final Year Project Semester One Assessment.

• Reviewed current cycling performance measuring devices on the market.

• Tested and experimented with Nuelectronics data logging/Ethernet shields.

• Found Petit FAT File System library did not meet the needs of the project.

• Moved to sdfatlib library, modified and adapted it to work with data logging shield’s SD card.

• Tested Sparkfun’s GPS shield using raw NMEA codes and TinyGPS library.

• Wrote test program to save GPS data to Nuelectronics data logging shield.

• Tested basic examples of the Openlayer’s library using GPS data logged.

• Prototyped different SPI Bus configurations (Daisy chain vs Independent slave) to determine if the Nuelectronics data logging shield could be used with the Nuelectronics Ethernet shield.

• Determined the Nuelectronics shields are not a viable option.

• Researched a viable alternative for the project’s SD card/Ethernet needs.

• Determined the latest official Ethernet shield fulfilled the requirements of the project.

• Reviewed current accelerometers and gyroscopes on the market.

• Analyzed the needs of the project and determined a full IMU(inertial measurement unit) system was


• Reviewed a range of IMU systems available to the hobbyist market.

• Decided ArduIMU V2 (Flat) IMU best meet the project needs.

• Due to limitations of ArduIMU a second microcontroller was found to be needed for the project.

• Analysed inter microcontroller communications systems , SPI , I2C , UART.

• Determined I2C was the best fit for the system.

• Sourced and tested a viable real-time clock (RTC) DS1307.

• Wrote test code for each individual sub system part. i.e. RTC, IMU, SD Card, Ethernet and I2C Bus.

Plans for Semester 2

• Connect all individual elements together.

• Create a XML file format for the data captured.

• Scrape GPS information for use in Google maps overlay.

• Investigate different 3D rendering options for the captured movement data.

• To develop a Web front end server solution to handle the captured data.

• Perform real world data capture tests using the system.

• Compile detailed documentation of hardware design using Eagle.

• Complete an end to end solution.

I received some good feedback from my supervisor on the progress of my fyp. One of the key points made clear to me  was the need of much better documentation. The report counts for 50% of the overall marks. I am due to make a formal power point  presentation  in a week on my work to date.

Engineers week takes place this year between the 14th and 20th of February .  There are a host of events around the country for all age groups. Last year I ran a number of events for engineers week. I found it very worth while and enjoyable. This year I am giving a soldering workshop and an Arduino programming tutorial.

In the Soldering Workshop I will be showing people how to solder through-hole components and finishing off the class with the students building an astable multivibrator aka flashing lights.

For the Arduino 101 – Learn to Blink night, I will be showing people how to get started writing arduino programmes. All the basics will be covered.

For more information on these events check out www.tog.ie or for a full listing of the Engineers Week events check out www.engineersweek.ie .

Over the last number of weeks I have been working on the high level design of my Motion Capture system for my FYP. I have come up with the design below.

Parts List

Over the next week or so I hope to work on getting the I2C and SPI buses working.

To save me looking at the serial monitor or the times I don’t have my arduino attached to a computer.  I bought a LCD screen. I use to have but I used it for a project some time ago. After a bit of ebay browsing I found a 20 character 4 line display. That would suit my details down to the ground. While I was at it I decided to order a new breadboard and some jumper wires(very handy). The order was from the US so just over a week I got a nice box with all the bits I ordered.

Interfacing with the HD44780 LCD.

Taken from Fritzing LiquidCrystalDisplay example

The HD44780 is one of the most common LCD screens for embedded
projects around. The screen is very easy to hook up to an arduino. There is already a great library to get you started LiquidCrystal . I wirted mine up as showen on the right.

Opening up the Arduino IDE I just selected the HelloWorld example from the LiquidCrystal Library. Their example is made for a 16 character 2 line display. If your screen is different you need to change line 45. for me it changed to lcd.begin(20, 4).

And now you should have “hello, world!” displaying on your screen.

There are loads of examples showcasing the features of this library.

As part of my FYP I hope to use a GPS to track the moment of an object outdoors. The college had an Arduino GPS shield which I took a loan of.

The shield is from Sparkfun. The GPS shield came pre-assembled. A previous student must have have put it together. They used the wrong type of headers, now making the shield non stackable. This means I can’t get access to the pins once I put the shield on. Its fine in most case, but means I don’t have access to the 5V, GND and other useful pins.


The shield has the EM406 GPS receiver. It has a on/off button and a switch to change the serial output pins from 0 and 1(default serial on an Arduino) to 2 and 3.

Getting Started

To start off I wrote the simplest sketch to see if the GPS was working. The GPS has a baud rate of 4800 bps. My sketch just listens for incoming serial from the GPS on the RX pin 0 and sends it on the TX pin 1. Note you have to take off the shield when uploading your code as it interferes with it and you need to have the switch on the shield set to UART. My sample code is below.

void setup()
Serial.println("GPS DEMO");
void loop()
if(Serial.available()>0) {

Turn on your serial monitor and see the output. Remember to set the baud rate to 4800bps.

You should get some thing like this.


These are called NMEA codes. It is the format GPS devices use to talk to other devices. There are lots of online tools for converting these codes and then showing you where you are on the top. I great one I found was gpsvisualizer.com. Also you if want to read more about NMEA check out gpsinformation.org.

This is all well and good getting the NMEA codes, but I just wanted my location. There is a library for that. The Sparkfun product page pointed me to the TinyGPS library. I downloaded and installed it. Which is very easy to do. I found the library very easy to use. The examples that come with the library show you all functions that are possibly with it. I found the default example did not work with my Arduino. It looks like other people have ran into the same problems. After a lot of debugging I found a bug in the example on line 10. You need to change NewSoftSerial nss(2, 3); to NewSoftSerial nss(3, 2). All should be working now and you will get an output like this.

Edit To call it a Bug was wrong. In order to get TinyGPS to work with my hardware you need to set TX/RX to different pins than are given in the sample code.

Testing TinyGPS library v. 9
by Mikal Hart

Sizeof(gpsobject) = 103

Acquired Data
Lat/Long(10^-5 deg): 5253430, -605161 Fix age: 304ms.
Lat/Long(float): 52.53430, -6.05161 Fix age: 309ms.
Date(ddmmyy): 241010 Time(hhmmsscc): 13230300 Fix age: 330ms.
Date: 10/24/2010  Time: 13:23:3.0  Fix age: 337ms.
Alt(cm): 5660 Course(10^-2 deg): 32889 Speed(10^-2 knots): 194
Alt(float): 56.60 Course(float): 328.89
Speed(knots): 1.94 (mph): 2.23 (mps): 1.00 (kmph): 3.59
Stats: characters: 1696 sentences: 13 failed checksum: 1

It you are still not getting an output check the bun rate on your serial monitor and check the switch on the shied is set to DLINE. Also make sure you are beside a window. The GPS does not work very well indoors.