Review: Gravitech 7-Segment Arduino Shield
Hello Readers
In this article we examine the “7-Segment Arduino Shield” received for review from the team at Gravitech in the United States. This is an Arduino Uno/Duemilanove-type compatible shield that contains four very useful items:
- Four 7-segment LED numerical displays – driven by the NXP SAA1064 LED display driver IC;
- A large 10mm RGB LED;
- A Microchip 24LC128 EEPROM, and
- A TI TMP75 digital temperature sensor.
That is all very good, but how do we use the features of the board? Let’s look at each of the aforementioned features individually. First of all, the numeric display. The four seven-segment LED displays are controlled by the NXP SAA1064 LED display driver (data sheet (.pdf)). I have written a separate tutorial on how to use this IC, and it is completely compatible with this shield. So visit the tutorial here and put the numbers to work! Please note the I2C bus address for the SAA1064 is 0×38.
Next we have the RGB LED. Red, green and blue are connected to digital pins 3, 5 and 6 respectively. These are also pulse-width modulation pins, so you can have altering the brightness. Here is a simple demonstration sketch (download):
/*
PWM LED example sketch
for Gravitech 7-segment Shield - http://www.gravitech.us/7segmentshield.html
*/
int red = 3; // the pins for the LED
int green = 5;
int blue = 6;
int i = 0; // for loops
int j = 0;
void setup() {
pinMode(red, OUTPUT); // tell Arduino LED is an output
pinMode(green, OUTPUT);
pinMode(blue, OUTPUT);
}
void loop()
{
// first, cycle up each primary colour twice
for (j = 1; j < 2; j++) { // loop 5 times
for (i = 0; i < 255; i++) { // loop from 0 to 254 (fade in)
analogWrite(red, i); // set the LED brightness
delay(20); // Wait 10ms because analogWrite isn't instant
}
analogWrite(red,0);
delay (20);
for (i = 0; i < 255; i++) { // loop from 0 to 254 (fade in)
analogWrite(green, i); // set the LED brightness
delay(20); // Wait 10ms because analogWrite isn't instant
}
delay (20);
analogWrite(green,0);
for (i = 0; i < 255; i++) { // loop from 0 to 254 (fade in)
analogWrite(blue, i); // set the LED brightness
delay(20); // Wait 10ms because analogWrite isn't instant
}
delay (20);
analogWrite(blue,0);
}
// psychadelic time
for (j = 1; j < 10000; j++) {
analogWrite(red,random(255)); // set red at random brightness between 0 and 254
delay (random(21)+100); // wait for a random duration between 10 and 30 milliseconds
analogWrite(green,random(255));
delay (random(21)+100);
analogWrite(blue,random(255));
delay (random(21)+100);
}
}
And for the curious, here it is in action:
Next, the Microchip 24LC128 EEPROM. It has 128kbit storage space, which translates to 16 kilobytes. The I2C bus address is 0×50. Once again there is a complete explanation of how to use this sort of EEPROM in another tutorial – check it out. But for quick reference the following demonstration sketch writes the numbers 0~255 to memory locations 0~255 (download):
/*
24LC128 EEPROM example sketch
for Gravitech 7-segment Shield - http://www.gravitech.us/7segmentshield.html
*/
#include // for I2C
#define chip1 0x50 // device address for 24LC128
// always have your values in variables
unsigned int pointer = 69; // we need this to be unsigned, as you may have an address > 32767
byte d=0; // example variable to handle data going in and out of EERPROMS
void setup()
{
Serial.begin(57600); // for screen output
Wire.begin(); // wake up, I2C!
}
void writeData(int device, unsigned int add, byte data)
// writes a byte of data 'data' to the chip at I2C address 'device', in memory location 'add'
{
Wire.beginTransmission(device);
Wire.send((int)(add >> 8)); // left-part of pointer address
Wire.send((int)(add & 0xFF)); // and the right
Wire.send(data);
Wire.endTransmission();
delay(10);
}
byte readData(int device, unsigned int add)
// reads a byte of data from memory location 'add' in chip at I2C address 'device'
{
byte result; // returned value
Wire.beginTransmission(device); // these three lines set the pointer position in the EEPROM
Wire.send((int)(add >> 8)); // left-part of pointer address
Wire.send((int)(add & 0xFF)); // and the right
Wire.endTransmission();
Wire.requestFrom(device,1); // now get the byte of data...
result = Wire.receive();
return result; // and return it as a result of the function readData
}
void loop()
{
Serial.println("Writing data...");
for (int a=0; a<255; a++)
{
writeData(chip1,a,a);
}
Serial.println("Reading data...");
for (int a=0; a<255; a++)
{
Serial.print("EEPROM pointer ");
Serial.print(a);
Serial.print(" holds ");
d=readData(chip1,a);
Serial.println(d, DEC);
}
}
And now time to work with the Texas Instruments TMP75 temperature sensor (data sheet.pdf). It has a reasonable operating temperature range of between -40 and 125 degrees Celsius – however this would exceed the range in which your Arduino is capable of working, so no leaving the shield on the car dashboard during a hot summer’s day. The I2C bus address for the TMP75 is 0×49. We will deconstruct the Gravitech demonstration sketch to explain how the temperature works.
The TMP75 needs to be initialised before measurement can take place, by sending the following data:
Wire.beginTransmission(0x49);
Wire.send(1); Wire.send(B01100000); Wire.endTransmission(); Wire.beginTransmission(0x49); Wire.send(0); Wire.endTransmission();
The temperature data is received in two bytes of data, as it spans 12 bits. Thankfully the demonstration sketch has done the work for us. Have a look at the Cal_temp() function, which converts the two raw bytes of data from the TMP75. There is some bitwise arithmetic in there, however if you are not keen on going down to that level, it is easy enough to cut and paste the temperature and numeric display functions. Here is a quick video of the demonstration sketch in action:
So there you have it – another useful and educational shield for use with your Arduino. If you have any questions or enquiries please direct them to Gravitech via their contact page. Gravitech products including the 7-segment shield are available directly from their website or these distributors.
As always, thank you for reading and I look forward to your comments and so on. Furthermore, don’t be shy in pointing out errors or places that could use improvement. Please subscribe using one of the methods at the top-right of this web page to receive updates on new posts, follow on twitter, facebook, or join our Google Group.
[Disclaimer - the shield reviewed in this article was a promotional consideration made available by Gravitech]
High resolution photos are available on flickr.
Otherwise, have fun, be good to each other – and make something!
Tutorial: Gravitech Arduino Nano MP3 Player
Hello readers
[Update: 21/05/2013. Tutorial now out of date, and I don't have a Nano to test it with the new code. Try this instead.]
In this article we will introduce playing MP3 files using the Gravitech Arduino Nano and MP3 add-on board as shown earlier. This board utilises the VLSI VS1053B decoder IC, which is quite well specified (download the data sheet [.pdf]). However in the interests of keeping things simple we will look at the most popular use – playback of MP3 files. The MP3 files can be in stereo, see the data sheet for more information with regards to bit rate etc. Here again is our board, both top:
… and bottom:

Using this board we can initiate playback to a pair of earphones, or an external amplifier. There is also a tiny speaker connected to the left audio channel, however it is not made for loud broadcasting. However if you place a piece of tape over it you can increase the volume and bass response Some of you may be thinking “oh wow!, let’s make our own MP3 player” – which is a pretty normal thought after seeing this shield for the first time. However due to the size of the system, portability may be an issue. However, after some thought there are many uses for the shield, such as:
Event-driven recording playback. For example, you could standardise PA announcements by playing back pre-recorded messages at the press of a button instead of attempting to train staff to articulate themselves in an understandable manner (e.g. railway annoucements);Modification of devices for the vision-impaired – a recording could be played after a particular event has occurred with the device;Adding voice or music output to an art installation;Etcetera
You get the idea. From a hardware perspective, you will need the Arduino Nano, the MP3 add-on board, and a microSD card. It is recommended that you not use a microSDHC card as they can be somewhat unreliable in this situation. Furthermore, please format the card with the FAT16 or FAT32 file system. Finally, to prepare for our first example – please copy the MP3 files downloadable from here onto your microSD card.
Now some preliminary software work needs to be done. Please download and install the SdFat library. The VLSI 1053B decoder chip uses the SPI bus (SPI? See my tutorials, parts one and two) – and so does the microSD card. Generally the CS (chip select) line is connected to digital 10 on Arduino – but our MP3 board uses 4. So we need to slightly modify the SdFat library to take this into account. Let’s do this now. First of all, locate and open in a text editor the file Sd2PinMap.h. It will be located in the library folder as shown below:
Now, scroll down to line number 279 in the file, and change the parameter uint8_t const SS_PIN from 10 to 4 – as such:
Finally, save and close the file. If you are working with other products that use the SPI bus and an SD card reader, you may want to run two separate Arduino IDE/library installations. At this point ensure your microSD card is formatted, contains the initial demonstration MP3 files, and inserted into the card socket underneath the board. Finally – insert your Nano into the MP3 board, plug in some headphones (or move the volume knob to mid-postion) and the USB lead. Then download and install this demonstration sketch. You can ignore the message in the sketch about changing the SS pin as we have done this in the library. You will hear some bells (track001.mp3) and drums (track002.mp3).
A brief look at that sketch reveals much code that to the beginner or intermediate user could be somewhat confusing. But don’t let this worry you, we can rearrange a few things to make using the MP3 shield very easy. For our next example, we will learn how to alter the headphone output volume, and select which track to play. Download and open this sketch, and also download and copy these example sound files to your microSD card.
You can ignore everything except for the void loop() section of the sketch – there are two functions of note. The first being:
Mp3SetVolume(0,0);
This sets the output volume for the left and right audio channel. 0 is maximum volume, and the minimum is over 250. You should call this function every time if you need a default volume lower than 100% after every system reset/power cycle. The other function to note is:
playMP3("news.mp3");
This function is the goal of the exercise – just insert the file name of the MP3 you want to play. Note that file names must be in the old 8.3 character format (e.g. “evie123.mp3″ and not “Evie – Parts 1, 2 and 3.mp3″). Now you can have your sketch fire up the MP3 player on request – you can insert your code into this sketch and modify as required.
At this point you may be considering the output options of the MP3 board apart from a pair of earphones. Things are not entirely as they seem, and some thought does need to go into the hardware connections. Do not connect anything else apart from normal stereo “walkman”-style earphones to the socket on the board. Doing so will risk damaging the decoder IC. Furthermore, if you wish to connect the output from the board to an external amplifier, some extra circuitry is required. Some of this is included on the board, and some is not. First, please download and view the VS1053 output guide (.pdf). Turn to page eight to find the following schematic:
In order to connect to a line-out input of an amplifier via the earphone socket, you will need to recreate the circuit above. Some of this has been done on the board – resistors R7~R9 and C3~C5 are preinstalled. You can see this in the MP3 shield schematic. So do the right thing and reap the rewards!
Now you can go forth and musify your creations with MP3 music and other recordings. Please note that this article would not have been possible without the example Arduino sketches provided by Nathan Seidle, the founder and CEO of Sparkfun. If you meet him, buy him a beer.
If you have any further hardware questions or enquiries relating to the Arduino Nano or MP3 board, please direct them to Gravitech via their contact page. The Gravitech Arduino Nano and MP3 board used in this article were promotional considerations provided by Gravitech, whose products including the Arduino Nano family are available directly from their website or these distributors.
As always, thank you for reading and I look forward to your comments and so on. Furthermore, don’t be shy in pointing out errors or places that could use improvement. Please subscribe using one of the methods at the top-right of this web page to receive updates on new posts, follow on twitter, facebook, or join our Google Group.
Otherwise, have fun, be good to each other – and make something!
July 2011 Competition Results
Hello readers
[Oops - this was originally published as August instead of July]
The month of July is now over and therefore another competition. There were six questions hidden within the posts for July, and for the curious the questions and answers were:
- Which software was used to create the picture above? (Image of an Arduino and breadboard in this post) – Fritzing;
- What large products are famously made in Toulouse, France and exported around the world? – Aircraft from EADS/Airbus Industries – such as the amazing A380;
- Which movie did the quote printed in the video above come from? (“All work and no play makes Jack a dull boy“) – “The Shining“;
- What is larger, 1000 nanofarads or 1 microfarad? – Neither, they are the same;
- What is the frequency of the crystal in this kit? – 32.768 kHz;
- Where are the headquarters for NXP located? – Eindhoven, The Netherlands.

With the Scanalogic2, you can capture and analyse all sorts of signals, including I2C, CAN bus, SPI, UART, and more. The firmware is user-upgradable and allows the design team to add more features when they are developed. You can even capture data and play it back to recreate situations in the future, or transfer the data to other users for their analysis. For more information please visit the Ikalogic website, or read my quick review of the Scanalogic. Thanks to Little Bird Electronics for the Scanalogic2
The second winner drawn was Kevin from New Jersey, USA who will receive one brand new Gravitech Arduino Nano:

Made in the USA, the Gravitech Arduino Nano is a very, very small version of our Arduino Duemilanove boards. It contains the same microcontroller (ATmega328) but in SMD form; has all the I/O pins (plus two extra analogue inputs); and still has a USB interface via the FT232 chip. The prize version will have the pins soldered as shown above. Thanks to Gravitech for the Arduino Nano.
Congratulations to the lucky winners, and thank you to all those who took the time to enter the competition. I hope you enjoyed reading the posts, and look forward to running another competition in August. The prizes are two new products that will be very desirable, and will be reviewed in the next week or two. So stay tuned!
So have fun and keep checking into tronixstuff.com. Why not follow things on twitter, subscribe for email updates or RSS using the links on the right-hand column, or join our Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other – and we can all learn something.
July 2011 Competition
Hello Readers
The July competition has now closed and the winners have been announced. Thank you to all those who entered and stay tuned for the next competition in August!
Time for another competition! To enter is very easy. There will be six questions hidden within articles published in the month of July (but not this one!). Once you have answers to all six, email them to competition at tronixstuff dot com with “July 2011″ in the subject line before 05/08. On the 5th of August, I will compile a list of people with the correct answers, and randomly select two winners. Please note competition rules at the end of this article.
The first winner drawn will receive an ex-review Ikalogic “Scanalogic2” PC-based logic analyser and signal generator:

With the Scanalogic2, you can capture and analyse all sorts of signals, including I2C, CAN bus, SPI, UART, and more. The firmware is user-upgradable and allows the design team to add more features when they are developed. You can even capture data and play it back to recreate situations in the future, or transfer the data to other users for their analysis. For more information please visit the Ikalogic website, or read my quick review of the Scanalogic.
The second winner drawn will receive one brand new Gravitech Arduino Nano:

Made in the USA, the Gravitech Arduino Nano is a very, very small version of our Arduino Duemilanove boards. It contains the same microcontroller (ATmega328) but in SMD form; has all the I/O pins (plus two extra analogue inputs); and still has a USB interface via the FT232 chip. The prize version will have the pins soldered as shown above.
As with any other competition, there needs to be some rules:
- Prizes will be delivered via Australia Post domestic or regular international air mail. Winners may elect for other methods upon payment of real cost;
- Winners outside of Australia will be responsible for any taxes, fees or levies imposed by your local Governments (such as import levies, excise, VAT, etc.) upon importation of purchased goods;
- Prizes may take up to 45 days to be received;
- If you have won a previous competition you cannot enter;
- The Judge’s decision is final with regards to any dispute;
- Entries will be accepted until 2359h GMT on 4th August 2011.
So have fun and keep checking into tronixstuff.com. Why not follow things on twitter, subscribe for email updates or RSS using the links on the right-hand column, or join our Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other – and we can all learn something.
Review: The Gravitech Arduino Nano family
Hello Readers
In this article we will examine a variety of products received for review from Gravitech in the United States – the company that designed and build the Arduino Nano. We have a Nano and some very interesting additional modules to have a look at.
So let’s start out review with the Arduino Nano. What is a Nano? A very, very small version of our Arduino Duemilanove boards. It contains the same microcontroller (ATmega328) but in SMD form; has all the I/O pins (plus two extra analogue inputs); and still has a USB interface via the FT232 chip. But more on that later. Nanos arrive in reusable ESD packaging which is useful for storage when not in use:
Patriotic Americans should note that the Nano line is made in the USA. Furthermore, here is a video clip of Nanos being made:
For those who were unsure about the size of the Nano, consider the following images:
You can easily see all the pin labels and compare them to your Duemilanove or Uno board. There is also a tiny reset button, the usual LEDs, and the in circuit software programmer pins. So you don’t miss out on anything by going to a Nano. When you flip the board over, the rest of the circuitry is revealed, including the FTDI USB>serial converter IC:
Those of you familiar with Arduino systems should immediately recognise the benefit of the Nano – especially for short-run prototype production. The reduction in size really is quite large. In the following image, I have traced the outline of an Arduino Uno and placed the Nano inside for comparison:
So tiny… the board measures 43.1mm (1.7″) by 17.8mm (0.7″). The pins on this example were pre-soldered – and are spaced at standard 2.54mm (0.1″) intervals – perfect for breadboarding or designing into your own PCB - however you can purchase a Nano without the pins to suit your own mounting purposes. The Nano meets all the specifications of the standard Arduino Duemilanove-style boards, except naturally the physical dimensions.
Power can be supplied to the Nano via the USB cable; feeding 5V directly into the 5V pin, or 7~12 (20 max, not recommended) into the Vin pin. You can only draw 3.3V at up to 50 mA when the Nano is running on USB power, as the 3.3V is sourced from the FTDI USB>serial IC. And the digital I/O pins still allow a current draw up to 40 mA each. From a software perspective you will not have any problems, as the Nano falls under the same board classification as the (for example) Arduino Duemilanove:
Therefore one could take advantage of all the Arduino fun and games – except for the full-size shields. But as you will read soon, Gravitech have got us covered on that front. If the Arduino system is new to you, why not consider following my series of tutorials? They can be found here. In the meanwhile, to put the size into perspective – here is a short video of a Nano blinking some LEDs!
Now back to business. As the Nano does not use standard Arduino shields, the team at Gravitech have got us covered with a range of equivalent shields to enable all sorts of activities. The first of this is their Ethernet and microSD card add-on module:
and the underside:
Again this is designed for breadboarding, or you could most likely remove the pins if necessary. The microSD socket is connected as expected via the SPI bus, and is fully compatible with the default Arduino SD library. As shown in the following image the Nano can slot directly into the ethernet add-in module:
The Ethernet board requires an external power supply, from 7 to 12 volts DC. The controller chip is the usual Wiznet 5100 model, and therefore the Ethernet board is fully compatible with the default Ethernet Arduino library. We tested it with the example web server sketch provided with the Arduino IDE and it all just worked.
The next add-on module to examine is the 2MOTOR board:
Using this module allows control of two DC motors with up to two amps of current each via pulse-width modulation. Furthermore, there is a current feedback circuit for each motor so you measure the motor load and adjust power output – interesting. So a motorised device could sense when it was working too hard and ease back a little (like me on a Saturday). All this is made possible by the use of the common L298 dual full-bridge motor driver IC. This is quite a common motor driver IC and is easy to implement in your sketches. The use of this module and the Nano will help reduce the size of any robotics or motorised project. Stay tuned for use of this board in future articles.
Next in this veritable cornucopia of add-on modules is the USBHOST board:
turning it over …
Using the Maxim MAX3421E host controller IC you can interface with all sorts of devices via USB, as well as work with the new Android ADK. The module will require an external power supply of between 7 and 12 volts DC, with enough current to deal with the board, a Nano and the USB device under control – one amp should be more than sufficient. I will be honest and note that USB and Arduino is completely new to me, however it is somewhat fascinating and I intend to write more about using this module in the near future. In the meanwhile, many examples can be found here.
For a change of scene there is also a group of Xbee wireless communication modules, starting with the Xbee add-on module:
The Xbee itself is not included, only shown for a size comparison. Turning the module over:
It is nice to see a clearly-labelled silk screen on the PCB. If you are unfamiliar with using the Xbee wireless modules for data communication, you may find my introductory tutorial of interest. Furthermore, all of the Gravitech Nano modules are fully software compatible with my tutorial examples, so getting started will be a breeze. Naturally Gravitech also produce an Xbee USB interface board, to enable PC communication over your wireless modules:
Again, note that the Xbee itself is not included, however they can be supplied by Gravitech. Turning the board over reveals another highly-detailed silk screen:
All of the Gravitech Xbee modules support both series 1.0 and 2.5 Xbees, in both standard and professional variants. The USB module also supports the X-CTU configuration software from Digi.
Finally – leaving possibly the most interesting part until last, we have the MP3 Player add-on board:
and on the B-side:
The MP3 board is designed around the VS1053B MP3 decoder IC. It can also decode Ogg Vorbis, AAC, WMA and MID files. There is a 3.5mm stereo output socket to connect headphones and so on. As expected, the microSD card runs from the SPI pins, however SS is pin 4. Although it may be tempting to use this to make a home-brew MP3 player, other uses could include: recorded voice messages for PA systems such as fire alarm notices, adding sound effects to various projects or amusement machines, or whatever else you can come up with.
Update – We have examined the MP3 board in more detail with a beginner’s tutorial.
The Arduino Nano and related boards really are tiny, fully compatible with their larger brethren, and will prove very useful. Although this article was an introductory review, stay tuned for further projects and articles that will make use of the Nano and other boards. If you have any questions or enquiries please direct them to Gravitech via their contact page. Gravitech products including the Arduino Nano family are available directly from their website or these distributors.
As always, thank you for reading and I look forward to your comments and so on. Furthermore, don’t be shy in pointing out errors or places that could use improvement. Please subscribe using one of the methods at the top-right of this web page to receive updates on new posts, follow on twitter, facebook, or join our Google Group.
[Disclaimer - the products reviewed in this article are promotional considerations made available by Gravitech]
High resolution photos are available on flickr.
Otherwise, have fun, be good to each other – and make something!






























