Welcome to t r o n i x s t u f f
Hello, and welcome to the t r o n i x s t u f f website. Regular articles are published about many things, including analogue and digital electronics, electronic kits, part reviews – and you can also follow our popular series of Arduino tutorials. The latest posts are below, and at your top-right are indexes to previous articles. On the right are ways to subscribe for new post notifications, author contact details, as well as links to our Google Group for discussion. Finally, there is also a monthly prize giveaway! Please have a look around, learn something, and don’t be afraid to make a comment or offer your feedback. And remember – there is so much more than just Arduino! (“Arduino” is a trademark of Arduino Team)
Before following any tutorials, please read and understand the boring stuff.
So have fun, stay safe, be good to each other – and make something!
Initial review: Hakko FX-888 Soldering Station
Introduction
During many years of orbiting around the world of electronics and related fields, soldering was not really one of my strong points. After moving more seriously into this field it occurred to me that my choice of soldering weapons played a part in the end results. So a few days ago I pulled the trigger and ordered my first “real” station – the Hakko FX-888.
Opening…
After waving goodbye to the courier and opening the delivery carton, the following was presented:
Frankly it’s only a box and shouldn’t matter, but you can appreciate the effort involved from a retail perspective. Opening up we find a neatly and safely packaged station with the multilingual instructions on top:
Everything is included to get going without any surprises. The station itself:
This is quite solid and weighty – at 1.3kg, so will not be moved by accident. The colours are quite snazzy and in some markets you can choose different colour schemes. According to Hakko – this is a “High-performance soldering iron that, in the pursuit both “usability” and “appearance”, has evolved beyond being a mere working tool”…
As you can see the temperature can be adjusted between 200 and 480 degrees Celsius. There is a calibration adjustment below the temperature knob, and the tool for calibration (“thermal correction”) is hidden away underneath the station:
You can also see the power switch on the right-hand side of the unit (when positioned normally). A tiny Allen key is included which is used to lock the temperature control to a desired position, however there isn’t a spot to keep it – so for now I have used (once again) some blu-tac to stick it under the base (not shown in photograph). Finally there is one red LED above the Hakko logo which lights when the heater is on – however it turns off once at the required temperature.
Next we have the soldering iron with fixed lead to the station:
This is a very light iron – for me the lightest so far, with a weight of 44 grams excluding the cord. The iron ships with a 0.5mm conical tip (type T18-B) that is fine for normal through-hole work, however there are sixteen different tips available from Hakko. What took me by surprise is the flexibility of the cord bushing, no matter which direction you turned the iron in your hand – there was hardly if any at all resistance from the cord. When changing tips be careful when unscrewing the nut, it is easy to unscrew the handle instead.
Finally we have the iron holder and parts:
The holder is made from metal, although it may not look so in the image. There is space for the included sponge and brass cleaning wire. You can also use the rubber cleaner (the grey/green lip) for cleaning as well. You can fit a large cleaning wire in the holder, however only small amount is presented at any one time, so you will need to rotate it now and again by opening the bottom of the holder which reveals the wire space.
Specifications
For those who like the numbers, here they are:
- Station power consumption - 70W
- Temperature range – 200~480 degrees Celsius
- Temperature stability – +/- 1 degree Celsius at idle temperature
- Iron power consumption – 65W at 26V AC
- Cord length – 1.2m
- Tip to ground resistance – 2Ω
The system is designed to protect against anti-static discharge, and the handle and other parts are conductors – not insulators. For more details please see the Hakko website.
Question - What nationality is the Hakko company?
Australian pricing – WTF?!
There is one thing that I am not too happy about – the price. In Australia the FX-888 can be found for between $160 and $175+GST – and delivery should be free. However the exact same product in the US market works out to be around … Au$89+sales tax. Ugh. I don’t mind paying an extra 25% due to the distances between sunny Melbourne and the rest of the world – but the local price is just too high. Sure, I could import one – but then there isn’t any warranty. Not that I expect the Hakko to break anytime soon, but who knows? So one pays more and deals with it.
Other observations
The reheating speed is excellent, the iron can reach any selected temperature in less than sixty seconds. This also helps avoid cold joints by recovering from temperature loss at a rapid rate. Furthermore having such a light iron without the burden of an AC lead at the back allows much more tip control and reduces wrist and muscle fatigue over long sessions.
Finally, the user manual includes exploded diagrams for all parts and the matching part numbers, which tells me Hakko want this station to last and are happy for you to maintain it yourself. Unlike using my older iron, I am sure with extended use the FX-888 will be less of a physical drain and also help improve my confidence in soldering.
Dave Jones from eevblog.com has described a modification to the FX-888 that allows an LED to show when the iron is on, not just heating:
Conclusion
Although the FX-888 is not inexpensive, it is very easy to use and light-years ahead of using a normal hand-held soldering iron. If you are finding yourself doing more soldering than the occasional hobbyist or are looking to work with a wide variety or components and soldering joints then you could do a lot worse than considering the FX-888. At this juncture it was not the cheapest, however I feel it was a solid investment and will last me a long time. And here it is, ready for work:
The Hakko FX-888 Soldering Station is available worldwide. Residing in Australia I purchased mine from element14.
Disclaimer – The items in this review were purchased by myself and reviewed without notifying the manufacturer or retailer.
Have fun and keep checking into tronixstuff.com. Why not follow things on twitter, Google+, 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.
Project: Clock Two – Single digit clock
Introduction
Time for another instalment in my irregular series of clock projects. (Or should that be “Time for another instalment in the series of irregular clock projects”?) In contrast with the extreme “blinkiness” of Clock One, in this article we describe how to build this single-digit digital clock:
Once again the electronics of the clock will be based from an Arduino-compatible board with a DS1307 real-time clock IC added to the board. On top of this we add a shield with some extra circuitry and two buttons – but more on this later.
The inspiration for this clock came from a product that was recently acquired at Ikea – the “Kvart” work lamp, for example:
If you are shopping for one, here are the Ikea stock details:
The goal is to place the electronics of the clock in the base, and have one single-digit LED display at the top of the neck which will blink out the digits. There will be two buttons under the base that are used to set the time. It will be powered by a 9V battery or an AC adaptor which is suitable for a typical Arduino board.
Construction
This article is a diary of my construction, and you can always use your own knowledge and initiative. It is assumed that you have a solid knowledge of the basics of the Arduino system. If not, review my series of tutorials available from here. Furthermore, feel free to modify the design to work with what you have available – I hope this article can be of some inspiration to you.
Software
It is much easier to prototype the clock and get the Arduino sketch working how you like it before breaking down the lamp and building up the clock. To do this involves some jumper wires and a solderless breadboard, for example:
Although there are four buttons on the board we only use two. They are connected to digital pins eight and nine (with 10k pull-down resistors). The LED display segments a~g are connected to Arduino digital pins 0~6 respectively. The decimal point is connected to the pulse output pin of the DS1307 – which will be set to a 1Hz output to have a nice constant blinking to show the clock is alive and well.
If you are unfamiliar with operating the DS1307 real-time clock IC please review this tutorial. Operation of the clock has been made as simple for the user as possible. To set the time, they press button A (on digital eight) while the current time is being displayed, after which point the user can select the first digit (0~2) of the time by pressing button A. Then they press button B (on digital nine) to lock it in and move to the second digit (0~9) which is again chosen with button A and selected with button B. Then they move onto the digits in the same manner.
After this process the new time is checked for validity (so the user cannot enter invalid times such as 2534h) – and is ok, the clock will blink the hyphen twice and then carry on with the new time. If the entered time is invalid, the clock reverts back to the current time. This process is demonstrated in the following video clip:
You can download the Arduino sketch from here. Note that it is written for Arduino v23 – not v1.0.
Question - In what year was Ikea founded?
Hardware
The parts required to replicate the Clock Two in this article are:
- One Arduino-compatible board with DS1307 real-time clock IC as described in this article
- One Arduino protoshield and header pins
- One common-cathode 7-segment LED display of your choosing
- Seven current-limiting resistors to reduce the output current from Arduino digital outputs going to the LED segments. In our example we use a 560 ohm resistor network to save time
- Two buttons and two 10k ohm pull-down resistors
- One meter of nine-core wire that will fit inside the neck and stand of the Kvart lamp – an external diameter of less than 6mm will be fine
- And of course – the lamp
The protoshield is used to hold the buttons, resistor network and the terminus for the wires between the LED display and the Arduino digital outputs, for example:
At this stage you will need to do some heavy deconstruction on the lamp. Cut off the mains lead at the base and remove the plastic grommet from the stand that surrounded the AC lead. Next, with some elbow grease you can twist off the lamp-shade unit from the end of the flexible neck. You could always reuse the lamp head and AC lead if wired by a licensed electrician.
Now you need to feed the multicore wire through the neck and down to the base of the lamp. You can pull it through the hole near the base, and then will need to drill a hole in the base to feed it through to the electronics as such:
Take care when feeding the cable though so you don’t nick the insulation as shown above. Leave yourself a fair bit of slack at the top which will make life easier when soldering on the LED display, for example:
The next step is to solder the wires at the top to the LED display. Make notes to help recall which wires are soldered to the pins of the display. If your soldering skills (like mine) aren’t so good, use heatshrink to cover the soldering:
Most displays will have two GND pins, so bridge them so you only need to use one wire in the multicore back to base:
At this point use the continuity function of a multimeter or a low-voltage power source to test each LED segment using the other end of the cable protruding from the base. Once you are satisfied the segments have been soldered correctly, carefully draw the cable back through the neck and base in order to reduce the slack between the display and the top of the lamp neck. Then solder the individual LED segment wires to the protoshield.
Now if you have not already done so, upload the sketch into the Arduino board – especially if you are going to permanently mount the circuitry into the base. A simple method of mounting would be using a hot glue gun, but for the purpose of demonstration we have just used blu-tac:
Although this does look a little rough, we are using existing stock which kept the cost down. If you are going to power the clock with an AC adaptor, you will also need to cut out small opening to allow the lead to protrude from the side of the base. And now for the resulting clock – our Clock Two:
So there you have it, the second of many clocks we plan to describe in the future. If you have any comments or suggestions, please leave them below or in our Google Group.
Have fun and keep checking into tronixstuff.com. Why not follow things on twitter, Google+, 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.
Is this the world’s smallest Arduino-compatible board?
Introducing the Freetronics LeoStick – one very small Arduino Leonardo-compatible** board, in the format of a typical USB memory stick – the board for integration into smaller projects, on-the-go fun when travelling, or minimalism-enthusiasts:
Whether or not the LeoStick is the world’s smallest Arduino-compatible board – it’s pretty darn tiny – for example:
Note that the length includes the USB plug extrusion on the PCB. A lot of small boards on the market may consider themselves to be fully Arduino-compatible, but with a few minor or major caveats – such as not having full USB interface, or using a cut-down MCU such as an ATtiny, or offer less current handling ability. After comparing their specifications with the LeoStick, you can see how much has gone into such a small board:
- Native USB port built-in, no need for any USB or FTDI cables
- Two Full Color RGB LEDs on-board! Drive different colored outputs and fun feedback from your sketch right away. One RGB LED is completely programmable, the other does Power, USB RX and TX indication, the RX and TX LEDs can also be controlled.
- On-board Piezo speaker element, play sounds, tunes and beeps. Can also be used as a knock/vibration sensor
- Same I/O pins. The LeoStick provides all the same header connections as larger boards, you can connect all the same sensors, actuators, and other inputs and outputs as typical Arduino models.
- Breadboard compatible, has 0.1″ pitch pads and header pins can be fitted underneath
- 500mA polyfuse and protection on the USB port
- ATmega32U4 microcontroller, Arduino compatible with on-board USB, 32K Flash, 2.5K RAM, 1K EEPROM at 16MHz
- ISP 6-pin connector for advanced programming of the ATmega32U4 MCU
Here is the underside of the LeoStick , showing the piezo speaker:
And here is a quick video of the LeoStick in action:
** Although this is a newly-released product, it does rely on a modified beta version of the upcoming Arduino Leonardo bootloader. There are some known issues with Windows 7 64-bit drivers and some library functions don’t work perfectly yet. Any firmware or Arduino Leonardo compatible support should not be considered to be final release firmware or in any way an official Arduino. At Freetronics’ request, please don’t hassle the Arduino team with support or requests related to this board – they’re solely the responsibility of Freetronics.
Nevertheless there is a growing and vibrant support forum where you can see examples of the LeoStick in action and discuss other subjects and issues. The LeoStick is also a very complete ATmega32U4 breakout and USB board by itself and the LeoStick can be programmed directly from the supplied standard ISP header by AVR Studio, Mac OSX-AVR, avrdude, WinAVR etc.
The LeoStick is also new to us here as well, and we look forward to integrating it into projects in the near future, as well as having a board to experiment with when travelling. As we always say – if it meets your needs or you want to try something new, you could do a lot worse than getting yourself a LeoStick. If you are interested in learning how to use Arduino in general – check out our tutorial here. For more discussion and support information for the LeoStick consult the forum or product web page.
Have fun and keep checking into tronixstuff.com. Why not follow things on twitter, Google+, 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.
Experimenting with Surface-Mount Component Prototyping
Now and again I have looked at SMT (surface-mount technology) components and thought to myself “I should try that one day”. But not wanting to fork out for a toaster oven and a bunch of special tools I did it on the cheap – so in this article you can follow along and see the results. Recently I ordered some ElecFreaks SOIC Arduino Mega-style protoshields which apart from being a normal double-sided protoshield, also have a SOIC SMT pad as shown below:
First up I soldered in two SOIC format ICs – a 555 and a 4017:
These were not that difficult – you need a steady hand, a clean soldering iron tip and some blu-tac. To start, stick down the IC as such:
… then you can … very carefully … hand-solder in a few legs, remove the blu tac and take care of the rest …
The 4017 went in easily as well…
…however it can be easier to flood the pins with solder, then use solder-wick to soak up the excess – which in theory will remove the bridges between pins caused by the excess solder. And some PCB cleaner to get rid of the excess flux is a good idea as well.
Now to some smaller components – some LEDs and a resistor. These were 0805 package types, which measure 2.0 × 1.3 mm – for example a resistor:
The LEDs were also the same size. Unlike normal LEDs, determining the anode and cathode can be difficult – however my examples had a small arrow determining current flow (anode to cathode) on the bottom:
Another way is to use the continuity function of a multimeter – if their output voltage is less than the rating of the LED, you can probe it to determine the pins. When it glows, the positive lead is the anode. Handling such small components requires the use of anti-magnetic tweezers – highly recommended…
… and make holding down the components with one hand whilst soldering with the other much, much easier.
Unlike normal veroboard, protoshield or other prototyping PCBs the protoshield’s holes are surrounded with a “clover” style of solder pad, for example:
These solder pads can make hand-soldering SMT parts a little easier. After some experimenting, I found the easiest way was to first flood the hold with solder:
… then hold down the component with the tweezers with one hand while heating the solder with the other – then moving and holding one end of the component into the molten solder:
Question - What are the dimensions (length x width) of an 0805 SMT component in mm?
The first time (above) was a little messy, but one improves with practice. The clover-style of the solder pads makes it easy to connect two components, for example:
With some practice the procedure can become quite manageable:
As the protoshields are double-sided you can make connections between components on the other side to keep things neat for observers. To complete the experiment the six LEDs were wired underneath (except for one) to matching Arduino Mega digital output pins, and a simple demonstration sketch used to illuminate the LEDs, as shown below:
For one-off or very low-volume SMD work these shields from elecfreaks are quite useful. You will need a steady hand and quite a lot of patience, but if the need calls it would be handy to have some of these boards around just in case. For a more involved and professional method of working with SMT, check out this guide by Jon Oxer.
In the meanwhile, have fun and keep checking into tronixstuff.com. Why not follow things on twitter, Google+, 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.
February 2012 Competition
It’s that time of the month again so we are running another competition. This month we have two prizes. Let’s check those out then follow up with the rules of entry.
Prize One is a brand new Freetronics EtherMega board – the mother of all Arduino-compatible boards. As reviewed recently, the EtherMega combines the power and versatility of the Arduino Mega2560, a microSD card shield, a full Ethernet shield and power over Ethernet support:

From the Freetronics website:
The EtherMega is a 100% Arduino Mega 2560 compatible board that can talk to the world. Do Twitter updates automatically, serve web pages, connect to web services, display sensor data online, and control devices using a web browser. The Freetronics EtherMega uses the same ATmega2560 as the Arduino Mega 2560 so it has masses of RAM, flash memory, and I/O pins, and also includes the same Wiznet W5100 chip used by the official Arduino Ethernet Shield, so it’s 100% compatible with the Ethernet library and sketches.
Any project you would previously have built with an Arduino Mega 2560 and an Ethernet shield stacked together, you can now do all in a single, integrated board. We’ve even added a micro SD card slot so you can store web content on the card, or log data to it. But it gets even better: we found space to squeeze in a small prototyping area, so now it’s possible to build a complete, Internet-enabled Arduino device including your own custom parts all on a single board! You don’t even need to use a prototyping shield for many projects.
Prize Two is awesome – and a mystery no more. It is the new Freetronics LeoStick:
From the Freetronics website:
The LeoStick is just like the upcoming Arduino Leonardo, but given the “honey, I shrunk the kids” treatment!
Just pop it into your USB port (no cable required!) and upload straight from the Arduino IDE. We’ve even included on-board RGB LED lights and a speaker in this handy sized board. All the usual Arduino pins are present and each LeoStick comes with low profile header sockets for plugging in modules, shields and wires.Features of the LeoStick include:
- Native USB port built-in, no need for any USB or FTDI cables
- Two Full Color RGB LEDs on-board! Drive different colored outputs and fun feedback from your sketch right away. One RGB LED is completely programmable, the other does Power, USB RX and TX indication, the RX and TX LEDs can also be controlled.
- On-board Piezo speaker element, play sounds, tunes and beeps. Can also be used as a knock/vibration sensor
- Same I/O pins. The LeoStick provides all the same header connections as larger boards, you can connect all the same sensors, actuators, and other inputs and outputs as typical Arduino models.
- Breadboard compatible, has 0.1″ pitch pads and header pins can be fitted underneath
- 500mA polyfuse and protection on the USB port
- ATmega32U4 microcontroller, Arduino compatible with on-board USB, 32K Flash, 2.5K RAM, 1K EEPROM at 16MHz
- ISP 6-pin connector for advanced programming of the ATmega32U4 MCU
Please note: The LeoStick currently uses a modified beta version of the upcoming Arduino Leonardo bootloader. There are some known issues with Windows 7 64-bit drivers and some library functions don’t work perfectly yet. Any firmware or Arduino Leonardo compatible support should not be considered to be final release firmware or in any way an official Arduino. Don’t hassle the Arduino team with support or requests related to this board: they’re solely our responsibility. The LeoStick is also a very complete ATmega32U4 breakout and USB board by itself and the LeoStick can be programmed directly from the supplied standard ISP header by AVR Studio, Mac OSX-AVR, avrdude, WinAVR etc.
How to enter!
There will be six questions for you to answer spread across articles published between the 1st and 29th of February. So you will need to review older posts. At the end of February and once you have answers to all six questions, email the answers along with your full name, email address and postal address to competition at tronixstuff dot com with the subject heading February.
During the second week of March, all the correct entries will be collated and two randomly chosen. The first correct entry drawn will win first prize, and the second entry the second prize. Entries will be accepted until 03/03/2012 0005h GMT.
As with any other competition, there needs to be some rules:
- Incomplete entries will be rejected, so follow the instructions!
- The winners’ first name and country will be announced publicly;
- The winners’ name and mailing address will be passed to the prize supplier only for the purpose of prize delivery and not for any form of marketing.
- Entries that contain text not suitable for minors or insulting to the competition will be rejected (seriously – it happens);
- Prizes will be delivered via Australia Post domestic or regular international air mail. We take absolutely no responsibility for packages that go missing or do not arrive. If you live in an area with a “less than reliable” domestic postage system, you can pay for registered mail or other delivery service at your expense.
- 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;
- No disputes will be entered in to;
- Prizes carry no warranty nor guarantee – and are to be used or abused at entirely your own risk;
- Entries will be accepted until 03/03/2012 0005h GMT.
Thanks to Freetronics for the EtherMega and LeoStick prizes!
So have fun and keep an eye out for the four competition questions spread through the February posts… In the meanwhile, follow things on twitter, Google+, 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 – Freetronics EtherMega
In this review we take a look at what is possibly the most fully-featured Arduino compatible board on the market today – the Freetronics EtherMega. This board combines the functionality of an Arduino Mega2560, a microSD card shield, and an Ethernet shield that supports power over Ethernet with optional 802.3af standard. So instead of having these three mashed together at a great expense:
… you can have this:
Which saves space, time and money. Firstly, the specifications:
- 100% compatible with the Arduino Mega2560. So you have the ATmega2560 microcontroller, 54 digital I/O pins with 14 PWM-capable, 256KB of flash memory, 8KB of SRAM and 4KB of EEPROM to play with, the Atmel 8u2 micrcontroller taking care of the USB interface;
- However unlike the original, the EtherMega contains a switchmode power supply that allows operation from a DC power supply of between 7 and 28VDC without overheating;
- Complete c0mpatibility with the Arduino Ethernet shield, using the Wiznet W5100 controller just like the original;
- Network status LEDs on both the socket and the PCB;
- Fixed SPI behaviour on Ethernet chipset;
- Complete microSD card compatibility with SD library, and chip-select is on digital pin 4 so Ethernet and microSD can work together on the same sketch;
- optional 802.3af power over Ethernet support at up to 48V using the optional regulator board which mounts on the EtherMega;
- mini USB connector instead of the larger standard USB socket which can interfere with shields – and a USB cable is included
Furthermore there are a few modifications to make using the EtherMega easier or simpler. The first of these is the onboard prototyping area allowing you to add your own circuitry, or perhaps a module:
Also notice that the I2C pins have been brought out alongside the 5V and GND pins on the right. The only difference to take note of are the jumpers that are used to select either USB or DC socket power:
However that is a small price to pay compared to the convenience of the wide voltage-handling capability. Finally, unlike the original Arduino Mega2560 the designers have placed the TX/RX indicators at the top-left of the EtherMega so they are still visible when extra shields have been mounted:
The overall design and quality of the EtherMega is top notch, with a thick PCB, rounded corners, descriptive silk-screening, and packaging that can be reused as Mega or other part storage.
Question – How many LEDs in total are on an EtherMega?
If you are looking for an Arduino Mega2560 and could use Ethernet, power-over-Ethernet, a microSD card interface and full, 100% Arduino compatibility you could do a lot worse than getting yourself an EtherMega. If you are interested in learning how to use Arduino and Ethernet – check out our tutorial here. Or to get your Arduino tweeting, visit here. For more discussion and support information for the EtherMega consult the forum or product web page.
Have fun and keep checking into tronixstuff.com. Why not follow things on twitter, Google+, 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.
Results – January 2012 Competition
Hello Readers
The January 2012 competition has now closed. For the curious, the questions and answers were:
Q – What does the acronym PWM mean?
A – Pulse-width modulation
Q – How many LEDs are contained in the Freetronics DMD?
A – 512
Q – How many digital I/O pins on an Arduino Mega2560?
A – 54
Q – What type of processor core does the PIC32 (from the Uno32 review) use?
A – MIPS (or to be more precise, 32-bit MIPS M4K Core)
Congratulations to Jack M. from the interesting state of South Australia! Jack has won the following prizes:
One v1.0 Akafugu Akafuino-X board as reviewed recently:

Jack’s Akafuino-X will have a companion on its journey which will be the Mayhew Labs “Go Between” Shield, as reviewed recently:

Thanks to Akafugu for offering the Akafuino-X prize!
The February 2012 competition will be announced soon, so in the meanwhile have fun and follow things on twitter, Google+, 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.
Project: Clock One
Introduction
For some strange reason I have a fascination with various types of electronic clocks (which explains this article). Therefore this project will be the start of an irregular series of clock projects whose goal will be easy to follow and produce interesting results. Our “Clock One” will use a Freetronics Dot Matrix Display board as reviewed previously. Here is an example of an operating Clock One:
As you can see, on the left half of the board we have a representation of an analogue clock. Considering we only have sixteen rows of sixteen LEDs, it isn’t too bad at all. The seconds are illuminated by sixty pixels that circumnavigate the square clock throughout the minute. On the right we display the first two letters of the day of the week, and below this the date. In the example image above, the time is 6:08. We omitted the month – if you don’t know what month it is you have larger problems.
Hardware
To make this happen you will need:
- A Freetronics Dot Matrix Display board;
- If you want the run the display at full brightness (ouch!) you will need a 5V 2.8A power supply – however our example is running without the external supply and is pretty strong
- An Arduino board of some sort, an Uno or Eleven is a good start
- A Maxim DS1307 real-time clock IC circuit. How to build this is explained here. If you have a Freetronics board, you can add this circuit directly onto the board!
Software
Planning the clock was quite simple. As we can only draw lines, individual pixels, and strings of text or individual characters, some planning was required in order to control the display board. A simple method is to use some graph paper and note down where you want things and the coordinates for each pixel of interest, for example:
Using the plan you can determine where you want things to go, and then the coordinates for pixels, positions of lines and so on. The operation for this clock is as follows:
- display the day of week
- display the date
- draw the hour hand
- draw the minute hand
- then turn on each pixel representing the seconds
- after the 59th second, turn off the pixels on the left-hand side of the display (to wipe the clock face)
There isn’t a need to wipe the right hand side of the display, as the characters have a ‘clear’ background which takes care of this when updated. At this point you can download the Arduino sketch from here. Note that the sketch was written to get the job done and ease of reading and therefore not what some people would call efficient. Some assumed knowledge is required – to catch up on the use of the display, see here; and for DS1307 real-time clock ICs, see here.
The sketch uses the popular method of reading and writing time data to the DS1307 using functions setDateDs1307 and getDateDs1307. You can initally set the time within void setup() – after uploading the sketch, comment out the setDateDs1307 line and upload the sketch again, otherwise every time the board resets or has a power outage the time will revert to the originally-set point.
Question – What frequency crystal would you use with the DS1307 RTC?
Each display function is individual and uses many switch…case statements to determine which line or pixel to draw. This was done again to draw the characters on the right due to function limitations with the display library. But again it works, so I’m satisfied with it. You are always free to download and modify the code yourself. Moving forward, here is a short video clip of the Clock One in action:
So there you have it, the first of many clocks I plan to describe in the future. For more information about the display used, please visit the Freetronics product page. Otherwise if you have any comments or suggestions, please leave them below or in our Google Group.
Disclaimer – The display module used in this article is a promotional consideration made available by Freetronics.
Have fun and keep checking into tronixstuff.com. Why not follow things on twitter, Google+, 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 – Digilent chipKIT Uno32
In this review we consider a Digilent chipKIT Uno32 development board made available by element14.
Introduction
This is a development board that is based on the Arduino Uno, however uses a Microchip PIC32MX320F128 microcontroller instead of the Atmel ATmega328 we are used to:
Digilent’s decision to use the PIC32 introduces some interesting changes to the Uno format, and the largest change to take note of is the clock speed – 80 MHz instead of the Uno’s 16 MHz. That certainly took my attention, and we can see this demonstrated shortly.
When shipped the board arrives alone in a cardboard box, without a USB cable:
All documentation is found on the Digilent website. There is also a support forum to discuss libraries, IDE updates and so on. The board itself is quite familiar upon initial inspection:
You can see that Arduino shield will physically fit onto the board, and the extra I/O pins are accessed through the second rows of jumpers inside the board. With some crafty PCB creation skills you could make your own Uno32 shields, or consider one of the boards available from element14 or Digilent.
As for the other specifications of the Uno32:
- Clock speed – 80 MHz
- 128K flash program memory
- 16K SRAM data memory
- I/O pins – 42 (12 used as analogue inputs or digital I/O)
- Five PWM pins
- FTDI chip for USB interface
- Two user LEDs
- Same form factor as Arduino Uno boards, which allows physical shield compatibility
- Five interrupt pins
- On board real-time clock (external crystal required)
You will need a new IDE, and you can download Uno32-modified versions of the Arduino v22 and v23 IDE from here for Windows, MacOS and 32-bit Linux (no 64-bit…). The bootloader is preinstalled on the Uno32 and after installing the special IDE it works just as our normal Arduinos do in terms of editing and uploading sketches. The board also is compatible with the Microchip MPLAB IDE and PICkit3 in-circuit debugger if you want to use the Uno32 as a normal PIC32 development board. There is a row of holes between the USB socket and the DC socket that will need header pins soldered in for PICkit3 use.
Naturally you want to see the speed test. The following sketch was run on an Arduino Uno and the Uno32 boards using IDE v1.0 for the Uno and the MPIDE v23 for the Uno32:
void setup()
{
Serial.begin(9600);
}
unsigned long a,b,c,d,e;
void loop()
{
a=millis();
for (c=1; c<1000000; c++)
{
d=sq(c);
}
b=millis();
e=b-a;
Serial.print("Duration: ");
Serial.print(e);
Serial.println("ms");
do {} while (1>0);
}
And here are the results of running the sketch four times on each board (click image to enlarge):
Well that’s pretty impressive – over sixty times faster than the Arduino Uno. Therein lies the major reason to use this board over the Uno. The eagle-eyed among you may have also noticed the difference in the compiled binary sketch size – 6432 bytes for the Uno32 vs. 2540 bytes for the Arduino Uno. That’s interesting.
Nevertheless there are many things to take note of when moving from Arduino to Uno32, or in other words – you can’t just swap out an Arduino Uno for an Uno32, recompile and run your sketch at the faster speed. The Microchip PIC32 is very much a different beast to the Atmel AVRs we’re used to, so it is important that you understand the differences in hardware and software to take advantage of the Uno32. So let’s run through those now.
Power Differences
The Uno32 is a 3.3V board due to the PIC32. You can still power it via USB, or connect between 7~15 VDC to the power socket on the board. You can change a jumper and feed 5V directly into the board bypassing the 5V regulator. External power is regulated to 5V then to 3.3V. From a total of 1A current, the PIC32 uses 75mA, so you can draw up to 925mA from the 5V bus or 425mA from the 3.3V bus (or a mixture from both). It would pay to determine your current load before testing to avoid damaging the board, however the manual notes that the regulators will become hot at high current loads but do have thermal protection. Finally there is also a jumper that chooses between a 5V or 3.3V voltage feed to the shields. As always, consult the manual first.
I/O Differences
Although the PIC32 being a 3.3V part, the manual states that the digital I/O pins are 5V tolerant, so applying 5V to a digital input won’t damage the PIC32. Logic on the other hand is a different kettle of fish. According to the manual a digital ‘high’ when sourcing 12mA of current will only reach close to 3.3V. This may be too low in some situations so check your threshold voltages when choosing external parts. Furthermore, the analogue reference voltage (AREF) is restricted to 3.3V.
One stand-out difference is that you can only source 18mA from a digital pin, which is OK if you’re blinking some LEDs. However for logic output to keep the voltage range below 0.4V for ‘low’ and above 2.4V for ‘high’ the current must be restricted to -12~+7mA – another different limitaion. Finally, the maximum current you can source over all the I/O pins at once is 200mA.
There are two UARTs, number one where we expect it (D0/D1) and another on pins 39 and 40. I2C is on A4/A5 but needs to be activated with a jumper. Note that unlike an Arduino there aren’t any inbuilt pull-up resistors for the I2C bus, so add your own. There is also an SPI bus at the usual position (D10~13) and interestingly you can change the board between SPI master and slave via another set of jumpers. There are five pulse-width modulation outputs, however one is on D10 which is also part of the SPI bus. Finally there are five hardware interrupt pins.
Shield Compatibility
Arduino shields will physically fit onto the Uno32 – but you need to be aware of the I/O differences listed above, the voltage and current specification and also the software side of things. Again – do your research before making the commitment to the hardware.
Software Compatibility
The Uno32 is compatible with a variety of Arduino sketches, but not all. This in a large part is due to the libraries which will need to be sourced from the community or rewritten yourself if not provided with the MPIDE software. There is a community on the support forum which is contributing their own, such as the real-time clock library – but again, research needs to be done before use. When trying to use an existing Arduino sketch and hardware, you will need to spend some time checking for compatibility. Again – it’s much easier to design a new project around the Uno32 than rejig an existing one.
Open Source?
One of the things many people love about the Arduino ecosystem is that the entire system is open source hardware and software. Without causing a pro/con argument about software licensing you should note that not all of the software toolchain for the Uno32 is open, nor the USB or TCP/IP stack. There is some interesting discourse about this here.
Conclusion
A lot of work needs to be done to ensure compatibility with existing Arduino applications. The Uno32 is tempting due to the raw clock-speed increase, however the sketch/library and hardware differences may introduce a few road blocks. However, when designing a project from scratch and understand the licensing limitations, the Uno32 would be great as you know what you have to work with – a much faster board with much more I/O. And it is very inexpensive, less than ~$35. You can order your new Uno32 from element14.
Finally, if you’re looking for a very inexpensive PIC32 development board to use with Microchip MPLAB, the Uno32 is a great deal that can possibly interface with a wide variety of shields from the Arduino world.
Disclaimer – The Chipkit Uno32 board reviewed in this article was a promotional consideration made available by element14.
Have fun and keep checking into tronixstuff.com. Why not follow things on twitter, Google+, 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.
Arduino meets Las Vegas with the Freetronics DMD
Hello Readers
Time once more to have some fun, and this time by examining the new Freetronics DMD “Dot Matrix Display”. We will look at the setup and operation of the display. In a nutshell the DMD comprises of a board measuring approximately 320mm across by 160mm which contains 16 rows of 32 high-intensity red LEDs. For example, in the off state:
Connection of the DMD to your Arduino-compatible board is quite simple. Included with each DMD is a 2×8 IDC cable of around 220mm in length, and a PCB to allow direct connection to the Arduino digital pins D6~13:
Finally the cable connects to the left-hand socket on the rear of the DMD:
You can also daisy-chain more than one display, so a matching output socket is also provided. Finally, an external power supply is recommended in order to drive the LEDs as maximum brightness – 5V at ~2.8 A per DMD. This is connected to a seperate terminal on the rear of the board:
Do not connect these terminals to the 5V/GND of your Arduino board!
A power cable with lugs is also included so you can daisy chain the high-intensity power feeds as well. When using this method, ensure your power supply can deliver 5V at 2.8A for each DMD used – so for two DMDs, you will need 5A, etc. For testing (and our demonstration) purposes you can simply connect the DMD to your Arduino via the IDC cable, however the LEDs will not light at their full potential.
Using the display with your Arduino sketches is quite simple. There is an enthusiastic group of people working on the library which you will need, and you can download it from and follow the progress at the DMD Github page and forks. Furthermore, there is always the Freetronics forum for help, advice and conversation. Finally you will also need the TimerOne library – available from here.
However for now let’s run through the use of the DMD and get things moving. We will be using Arduino IDE v23. Starting with scrolling text – download the demonstration sketch from here. All the code in the sketch outside of void loop() is necessary. Replace the text within the quotes with what you would like to scroll across the display, and enter the number of characters (including spaces) in the next parameter. Finally, if you have more than one display change the 1 to your number of displays in #define DISPLAYS_ACROSS 1.
Here is a quick video of our example sketch:
Now for some more static display functions – starting with clearing the display. You can use
dmd.clearScreen( true );
to turn off all the pixels, or
dmd.clearScreen( false );
to turn on all the pixels.
Note: turning on more pixels at once increases the current draw. Always keep this in mind and measure with an ammeter if unsure.
dmd.selectFont(System5x7);
for a smaller font or
dmd.selectFont(Arial_Black_16);
for a larger font. To position a single character on the DMD, use:
dmd.drawChar( x, y, 'x', GRAPHICS_NORMAL );
which will display the character ‘x’ at location x,y (in pixels – starting from zero). For example, using
dmd.drawChar( 10, 5, 'A', GRAPHICS_NORMAL );
results with:
Note if you have the pixels on ‘behind’ the character, the unused pixels in the character are not ‘transparent’. For example:
However if you change the last parameter to GRAPHICS_NOR, the unused pixels will become ‘transparent’. For example:
You can also use the parameter GRAPHICS_OR to overlay a character on the display. This is done with the blinking colon in the example sketch provided with the library.
Next, to draw a string (group of characters). This is simple, just select your font type and then use (for example):
dmd.drawString( 0,0, "Hello,", 5, GRAPHICS_NORMAL ); dmd.drawString( 2,9, "world,", 5, GRAPHICS_NORMAL );
Again, the 5 is a parameter for the length of the string to display. This results in the following:
Next up we look at the graphic commands. To control an individual pixel, use
dmd.writePixel( x,y, GRAPHICS_NORMAL,1); // turn on a pixel at location x,y
And changing the 1 to a 0 turns off the pixel. To draw a circle with the centre at x,y and a radius r, use
dmd.drawCircle( x, y, r, GRAPHICS_NORMAL );
To draw a line from x1, y2 to x2, y2, use:
dmd.drawLine( x1, y1, x2, y2, GRAPHICS_NORMAL );
To draw a rectangle from x1, y2 to x2, y, use:
dmd.drawBox(x1, y1, x2, y2, GRAPHICS_NORMAL );
And to draw a filled rectangle use:
dmd.drawFilledBox(x1, y1, x2, y2, GRAPHICS_NORMAL );
Now let’s put those functions to work. You can download the demonstration sketch from here, and watch the following results:
Update – the DMD will also be available in other colours, such as white:
So there you have it, an inexpensive and easy to use display board with all sorts of applications. Although the demonstrations contained within this article were rather simple, you now have the knowledge to apply your imagination to the DMD and display what you like. For more information, support and conversation visit the Freetronics product page and support forum.
Disclaimer – The parts reviewed in this article are a promotional consideration made available by Freetronics.
Have fun and keep checking into tronixstuff.com. Why not follow things on twitter, Google+, 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.

























































