## Project: Clock One

Let‘s make a huge analogue and digital clock using a dot-matrix display.

Updated 18/03/2013

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:

• 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.

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:

In the meanwhile have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column? And join our friendly 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

Updated 05/11/2014

Time once more to have some fun, and this time by examining the Freetronics DMD “Dot Matrix Display” available from Tronixlabs. 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 ~4 A per DMD. This is connected to a separate 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 4A  for each DMD used – so for two DMDs, you will need 8A, 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. 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

to turn off all the pixels, or

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.

Next some text. First you need to choose the font, at the time of writing there were two to choose from. Use

for a smaller font or

for a larger font. To position a single character on the DMD, use:

which will display the character ‘x’ at location x,y (in pixels – starting from zero). For example, using

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):

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

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

To draw a line from x1, y2 to x2, y2, use:

To draw a rectangle from x1, y2 to x2, y, use:

And to draw a filled rectangle use:

Now let’s put those functions to work. You can download the demonstration sketch from here, and watch the following results:

Update – the DMD is also 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, check out the entire DMD range at Tronixlabs. And if you enjoyed this article, or want to introduce someone else to the interesting world of Arduino – check out my book (now in a fourth printing!) “Arduino Workshop”.

Have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column, or join our forum – dedicated to the projects and related items on this website.

## Review – Tenma 72-7222 Digital Clamp Multimeter

The purpose of this article is to examine the Tenma 72-7222 Digital Clamp Multimeter supplied for review by element-14/Farnell/Newark. The Tenma is a strongly featured yet inexpensive piece of test equipment – and considerably good value when you consider there is a current clamp for measuring high AC currents. So let’s have a look and see what we have.

Initial Impression

The Tenma arrives in a retail box, and generally nicely packaged. Naturally this has nothing to do with the performance of the meter at all, but at least they made an effort:

Opening up we find a nicely rounded group of items: the meter itself, some no-name AAA cells, test leads, a thermocouple for temperature measurement, a surprisingly articulate and well-written user manual, and the unit itself – all within a nice pouch. Wow – a pouch. Agilent? Fluke? All that money for a DMM and you don’t include a pouch?

Recent test equipment reviewers have made pulling apart the unit part of the review – so here goes… the back comes off easily:

No user-replaceable fuses… instead a PTC. A closer look at the PCB:

A very neat and organised PCB layout. There are plastic tabs that hold the PCB in along with a screw, however the case flexed too much for me to warrant removing the PCB completely. The spring for the clamp meter is locked in nicely and very strong, it won’t give up for a long time. Pulling the clamp base out reveals the rest of the PCB:

Installation of the battery is two stage procedure, first you need to remove a screw and then slide out the rear door:

… then insert the AAA cells into a frame, which is then inserted inside the unit:

The physical feel of the unit is relative to the purchase price, the plastic is simple and could be quite brittle if the unit was dropped from a height. The user manual claims the unit can be dropped from up to a height of one metre. Onto carpet? Yes. Concrete? Perhaps not. However like all test equipment one would hope the user would take care of it whenever possible. The clamp meter is very strong due to the large spring inside the handle, which can be opened up to around 28mm. The included leads are just on one meter long including the length of the probe:

The leads are rated to Category I 1000V (overkill – the meter can’t go that high) and 600 V Category II – “This category refers to local-level electrical distribution, such as that provided by a standard wall outlet or plug in loads (for example, 115 AC voltage for U.S. or 200 AC voltage for Europe). Examples of Measurement Category II are measurements performed on household appliances, portable tools, and similar modules” – definition from from National Instruments.  Unlike discount DMMs from unknown suppliers you can trust the rating to be true – otherwise element-14 wouldn’t be selling it.

Unit Specifications

• Voltage Measuring Range DC:200mV, 2V, 20V, 200V, 600V
• Voltage Measuring Range AC:2V, 20V, 200V, 600V
• Current Measuring Range AC:2A, 20A, 200A, 400A
• Resistance Measuring Range:200ohm, 2kohm, 20kohm, 200kohm, 2Mohm, 20Mohm
• Temperature Measuring Range:-40°C to +1000°C
• DMM Response Type:True RMS
• DMM Functions:AC Current, AC/DC Voltage, Resistance, Temperature
• Ranging:Auto
• Display Count:1999
• AC Current Range Accuracy:± (1.5% + 5d)
• AC Voltage Range Accuracy:± (1.2% + 5d)
• Accuracy:± (1.0% + 3d)
• Current AC Max:400A
• Current Range AC:2A, 20A, 200A, 400A
• DC Voltage Range Accuracy1:± (0.8% + 1d)
• Resistance Range Accuracy:± (1.0% + 2d)
• Temperature Measuring Range:-40°C to +1000°C

The only measurement missed out on is DC current, however there is the Tenma 72-7224 which has DC current and frequency ranges. Finally, all the modes and buttons can be selected while holding the meter with one hand – for both left- and right-handed folk.

Measurement experience

Normally I would compare the measurements against my Agilent U1272A, however it’s out to lunch. Instead, a Fluke 233. First, AC voltage from the mains:

Next, a few DC voltage measurements:

Now for some resistance measurements. Higher values near the maximum of 20M Ohm can take around four seconds to measure:

Forward voltage of a 1N4004 diode:

Now off to the kitchen for some more measurements – first with the thermocouple:

The boiling water test – 100 degrees Celsius (you can also select Fahrenheit if so inclined):

And now to test out the AC current clamp meter function with a 10A kettle at boiling point. First, using the 20A current range:

And then again on the 400A current range:

As always, it’s best to use the multimeter range that more closely corresponds with the current under test. The meter also has a continuity test with a beeper, however it was somewhat slow and would often take around one second to register – so nothing too impressive on that front. The meter can record the maximum value with the grey button, or hold a reading using the yellow button.

Conclusion

The Tenma 72-7222 works as advertised, and as expected. It is a solid little unit that if looked after should last a few years at a minimum. It certainly has a few limitations, such as the 1999 count display, lack of backlight, and the average continuity function. But don’t let that put you off. For the price – under Au\$30 – it is a certified deal. If you need a clamp current meter for odd jobs or a casual-use multimeter and you are on a limited budget, the Tenma will certainly prove a worthwhile purchase. Full-size images are available on Flickr.

You can purchase a Tenma 72-7222 from element-14Farnell and Newark.

[Note – The Tenma 72-7222 Digital Clamp Multimeter was a promotional consideration from element-14/Farnell/Newark]

## Kit review – High Accuracy LC Meter

Time for another kit review. Lately one of my goals has been to make life easier and in doing so having some decent test equipment. One challenge of meeting that goal is (naturally) keeping the cost of things down to a reasonable level. Unfortunately my eyesight is not the best so I cannot read small capacitor markings – which makes a capacitance meter necessary. Although I have that function within my multimeter, it is often required to read resistors in the same work session.

Thus the reason for this kit review – the High Precision LC Meter kit. The details were originally published in the May 2008 issue of Australia’s Silicon Chip magazine. The meter specifications are:

• Capacitance – 0.1pF to over 800 nF with four-digit resolution;
• Inductance – 10 nH to over 70 mH with four-digit resolution;
• Accuracy of better than +/- 1% of the reading;
• Automatic range selection, however only non-polarised capacitors can be measured.

The power drain is quite low,  between 8 (measurement) and 17 milliamps (calibration). Using a fresh 9V alkaline battery you should realise around fifty to sixty hours of continuous use. At this point some of you may be wondering if it is cheaper to purchase an LC meter or make your own. A quick search found the BK Precision 875B LCR meter with the same C range and a worse L range for over twice the price of the kit. Although we don’t have resistance measurement in our kit, if you are building this you already have a multimeter. So not bad value at all. And you can say you built it 🙂

Speaking of building, assembly time was just under two hours, and the kit itself is very well produced. The packaging was the typical retail bag:

The first thing that grabs your attention is the housing. It is a genuine, made in the US Hammond enclosure – and has all the required holes and LCD area punched out, so you don’t need to do any drilling at all:

The enclosure has nice non-slip rubberised edging (the grey area) and also allows for a 9V battery to be housed securely. The team at Altronics have done a great job in redesigning the kit for this enclosure, much more attractive than the magazine version. The PCB is solder-masked and silk-screened to fine standard:

There are two small boards to cut and file off from the main PCB. We will examine them later in the article. All required parts for completion were included, and it is good to see 1% resistors and an IC socket for the microcontroller:

At first I was a little disappointed to not have a backlit LCD module, however considering the meter is to be battery operated (however there is a DC socket for a plugpack) and you wouldn’t really be using this in the dark, a backlight wouldn’t be necessary. Construction was easy enough, the layout on the PCB is well labelled, and plenty of space between pins. Lately I have started using a lead-former, and can highly recommend the use of one:

… then mount the LCD and the larger components:

… the switches and others – and we’re done:

The only problem at this point was the PCB holes for the selector switch, one hole was around 1mm from where it needed to be. Instead of drilling out the hole, it was easier to just bend up the legs of the switch and keep going:

At this stage one has to cut out two supports from the enclosure, which can be done easily. Then insert the PCB and solder to the sockets and power (9V battery snap). Initial testing was successful (after adjusting the LCD contrast…

If you look at the area of PCB between the battery and the left-hand screw there are eight pins – these are four pairs of inputs used to help calibrate and check operation of the meter. For example, by placing a jumper over a pair you can display the oscillator frequency at various stages:

Furthermore, those links can also be used to fine-tune the meter. For example one can increase or decrease the scaling factor and the settings are then stored in the EEPROM within the microcontroller. However my example seemed ok from the start, so it was time to seal up the enclosure and get testing. Starting with a ceramic capacitor, the lowest value in stock:

Spot-on. That was a good start, however trying to bend the leads to match the binding posts was somewhat inconvenient, so I cut up some leads and fitted crocodile clips on the end. The meter’s zero button allows you to reset the measurement back to zero after attaching the leads, so stray capacitance can be taken into account.

Next, time to check the measurement with something more accurate, a 1% tolerance silvered-mica 100 picofarad capacitor:

Again, the meter came through right on specification. My apologies to those looking for inductor tests – I don’t have any in stock to try out. If you are really curious I could be persuaded to order some in, however as the capacitance measurement has been successful I am confident the inductance measurement would also fall within the meter’s specifications.

As shown earlier, there were two smaller PCBs included:

The top PCB is a shorting bar used to help zero the inductance reading, and the lower PCB is used to help measure smaller capacitors and also SMD units. A nice finishing touch that adds value to the meter. The only optional extra to consider would be a set of short leads with clips or probes to make measurement physically easier.

When reading this kit review it may appear to be somewhat positive and not critical at all. However it really is a  good instrument, considering the accuracy, price, and enjoyment from doing it yourself. It was interesting, easy to build, and will be very useful now and in the future. So if you are in the market for an LC meter, and don’t mind some work – you should add this kit to your checklist for consideration. It is available from our store – Tronixlabs.com

… which along with being Australia’s #1 Adafruit distributor, also offers a growing range and Australia’s best value for supported hobbyist electronics from DFRobot, Freetronics, Seeedstudio and much much more.

As always, have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column, or join our forum – dedicated to the projects and related items on this website.

### Australian Electronics!

Buy and support Silicon Chip - Australia's only Electronics Magazine.