Silicon ChipMicrocontrollers Can Be A Snap - March 2009 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Carbon trading may not be needed in Australia after all
  4. Feature: Reviving Old Laptops With Puppy Linux by Warrick Smith
  5. Feature: Digital Radio Is Coming, Pt.2 by Alan Hughes
  6. Project: A GPS-Synchronised Clock by Geoff Graham
  7. Project: New, Improved Theremin Mk.2 by John Clarke
  8. Project: Build A Digital Audio Millivoltmeter by Jim Rowe
  9. Project: Microcontrollers Can Be A Snap by Stan Swan
  10. Vintage Radio: The deadly and the difficult: when to say "no" by Rodney Champness
  11. Book Store
  12. Advertising Index
  13. Outer Back Cover

This is only a preview of the March 2009 issue of Silicon Chip.

You can view 32 of the 96 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Articles in this series:
  • Digital Radio Is Coming, Pt.1 (February 2009)
  • Digital Radio Is Coming, Pt.2 (March 2009)
  • Digital Radio Is Coming, Pt.3 (April 2009)
  • Digital Radio Is Coming, Pt.4 (June 2009)
  • Digital Radio Is Coming, Pt.5 (August 2009)
Items relevant to "A GPS-Synchronised Clock":
  • VK2828U7G5LF TTL GPS/GLONASS/GALILEO module with antenna and cable (Component, AUD $25.00)
  • GPS-Synchronised Clock PCB pattern (PDF download) [04203091] (Free)
  • PIC16LF88-I/P programmed for the GPS Synchronised Clock for stepping hands [0420309A.HEX] (Programmed Microcontroller, AUD $15.00)
  • VK2828U7G5LF TTL GPS/GLONASS/GALILEO module with antenna and cable (Component, AUD $25.00)
  • PIC18LF88 firmware and C source code for the GPS-Synchronised Clock with stepping hands [0420309A.HEX] (Software, Free)
Articles in this series:
  • A GPS-Synchronised Clock (March 2009)
  • GPS Synchronisation For Clocks With Sweep Hands (November 2009)
Items relevant to "New, Improved Theremin Mk.2":
  • Theremin Mk.2 PCB [01203091] (AUD $15.00)
  • Improved Theremin Mk.2 PCB pattern (PDF download) [01203091] (Free)
  • Improved Theremin Mk.2 front panel artwork (PDF download) (Free)
Items relevant to "Build A Digital Audio Millivoltmeter":
  • Digital Audio Millivoltmeter Input Attenuator front panel artwork (PDF download) (Free)
  • Input Attenuator PCB for Digital Audio Millivoltmeter [04205091] (AUD $7.50)
  • Digital Audio Millivoltmeter PCB [04103091] (AUD $20.00)
  • PIC16F88-I/P programmed for the Digital Audio Millivoltmeter [0410309A.HEX] (Programmed Microcontroller, AUD $15.00)
  • PIC16F88 firmware and source code for the Digital Audio Millivoltmeter [0410309A.HEX] (Software, Free)
  • Digital Audio Millivoltmeter PCB pattern (PDF download) [04103091] (Free)
  • Digital Audio Millivoltmeter front panel artwork (PDF download) (Free)
Articles in this series:
  • Build A Digital Audio Millivoltmeter (March 2009)
  • Input Attenuator For The Digital Audio Millivoltmeter (May 2009)

Purchase a printed copy of this issue for $10.00.

Microcontrollers can be a SNAP! Thanks in no small part to the SILICON CHIP promotion over the last five years, popular and cheap PICAXE micros are widely now considered the best value educational microcontroller. However, motivated pre-teens and fuzzy-eyed seniors who are “keen to learn about micros” may find PICAXE PC board soldering or breadboard circuit assembly too fiddly. So here’s a nifty approach that fits a PICAXE-08M micro-controller into the gutted sound module from a colourful “Snap Connector” electronic kitset. by The Mad Scientist (aka Stan Swan) 78  Silicon Chip siliconchip.com.au S nap Connector kits are globally sold under a variety of names but here in New Zealand they’re known as “Electronic Brain Boxes”. The simplest “80 Experiments” kit costs around $20 from Dick Smith Electronics (NZ). They’re also available from the NSW CSIRO shop (www.csiroshop.com). Pre-teen kids thrive on them and classroom management is easy, since no tools are needed. That’s right teachers – no tools needed! Although this PICAXE conversion is designed around the most basic kit, the approach shows great promise for easing the electronics learner’s transition from toys to tools. The modification still allows full PICAXE programming (~80 lines of high level code) but only three of the normal five I/Os are now available. That’s normally quite enough for intro work. Some PICAXE-08M channels are limited normally anyway, with channel 0 output only and channel 3 input only. Even with just three I/Os applications abound, with sounds, LED flashing, sensor reading, timers, data loggers, simple reaction games, code sending, traffic light simulations and much more – even two-wire serial data communications to other units/PCs are possible. Thousands of PICAXE programs have been written over the last five years and many will readily adapt to use here. Aside from youngsters, even sprightly seniors can now handle the setup – you’re never too old to learn about micros! Basic electrical circuits included with the snap kits themselves of course can still be used, although (hooray!) those relating to the mindless, noise-making sound module can be now (thankfully) ignored. Most electronics old timers can well recall the frustrations that blighted their early circuitry and many of today’s electronics newcomers sadly experience the agony of defeat with wire stripping, tool use, soldering and component handling. Sure – just like laying bricks – it’s easy when you know how! The confidence boost gained from assembling circuits that work is immense. I’ve used a swag of 30 “Snap Kits” as part of my educational “mad scientist” work and have had Components in the supplied kits quickly snap together to assemble colourful circuits. Lamps, LEDs, switches, series and parallel connections, motors and even sound and alarm circuitry can be quickly and reliably made by the simplest versions. siliconchip.com.au March 2009  79 ON 10k CON1 DB9 6 7 8 9 1 2 B 3.5mm STEREO PLUG B I/O PINS (CHANNELS) 3– 5.5V tions, suitable for mid-level secondary school and innovative Science Fair projects based around these have been noted. PICAXE persuasion! But instead of such zeal with simple components, here’s a low-cost end-userR T=TIP 3.5mm T oriented approach based around – gasp 1 IC1 10k R=RING STEREO 3 6 B=BODY TO PC SOCKET PICAXE-08M – a microcontroller. Read on! SERIAL 10 F LED 2 Although the basic kit circuits are PORT 5 4 8  highly educational, both kids and (es33 pecially!) adults may soon tire of siren and machine gun noises from the sound 330 KIT SPEAKER WITH ADDED module. Compared with the rest of the 4 8 CAPACITOR 1 kit, the five connections to this C-O-B AND RESISTOR (Chip On Board) sound device are not lucid anyway – it’s little more than a SC 2009 mindless “red box”. The schematic shows conversion parts and other minor kit modifications Hence, removing this module from its inside dashed red lines. A normal Rev.Ed PICAXE serial D9 programming housing and replacing it with a far more cable, terminating in a grounded tip 3.5mm stereo plug, neatly matches the versatile PICAXE-08M micro tempts insocket now fitted to the modified sound module. stead. An alternative would be to make your own add-on module from a plastic thousands of kids tinker with them in the past 18 months. project box but it naturally wouldn’t Even the simplest “80” kit keeps a “Friday afternoon on a look as professional, and suitable snap connectors have also hot day” class focused for ~45 minutes, with the small motor been elusive, at least here in NZ. driven fan especially popular. Amazingly, however, most are Initial case cutting with a Dremel readily exposes the still intact and almost none of the parts have been lost! innards but a larger trapezoidal cutout, as far back as the The design of the kits in fact cultivates compulsive tidying solder tag contacts, is preferred since the existing wires are up – complete sets have been re-boxed in as little as three rather too flimsy. A small piece of Veroboard (perhaps 4 hole minutes! Youngsters (some even preschool) absolutely love x 6 hole) makes for the neatest assembly, although a “rats them. As the colourful instructions are very graphical, usnest” ugly layout can be used. ers don’t even have to be able to read – this could perhaps It’s recommended that colour-coded wires (Brown=1, further appeal for those with poor English skills. Red=2, Yellow=4 etc) are used to identify the connections, Even the larger kit versions may however only provide with a DIP-8 socket for the PICAXE. Ensure the Veroboard a few hours of out-of-the-box fun for most kids and an encopper tracks under the socket are completely cut, perhaps hanced challenge is really needed to stimulate curiosity. using a sharp drill bit. For those who’ve just come in, the Motivated teachers and parents could of course make up PICAXE I/O “PIN” channels are NOT the same as the usual their own experiments and task worksheets – eg, Ohms law, IC pins and an unusual supply pinout also exists. The IC series/parallel loads, switches etc. pin 1 is positive, with pin 8 0V (ground). The larger kits in fact even have radio and metering opThe retrofitting modification is a tad fiddly but the wiring 3 4 5 R T 22k 2 1 7 0 “Picaxed” ELECTRONIC BRAIN BOX Here’s an assembled conversion, with the 9-pin DIL socket wired to a piece of Veroboard for convenience. It’s ready for soldering to the five now-vacated contact tags in the Snap Connector kit. If significant numbers of these kits are being converted, as in a classroom, simple wiring templates and jigs will speed assembly . 80  Silicon Chip Voila! Ready for programming. Tightening the ring on the 3.5mm programming socket nicely secures the circuitrya clear plastic trapezoidal panel could be perhaps also fitted to suit display of the conversion while preventing tampering. Ensure the PICAXE is correctly inserted into the DIP-8 socket, with the positive supply on pin 1. siliconchip.com.au Here’s the innards of the kit’s supplied sound module. The noisy output arises from the (unknown) IC under the black blob – cut the five linking wires and remove the module from the holder. is not really critical. Aside from the five links to the gutted module’s connectors, two resistors (10kΩ and 25kΩ) and a 3.5mm 3-terminal socket are also fitted to allow PICAXE programming. The pain of tight clearance soldering can be eased with a “helping hands” support. Use every trick in the book for such fiddly work! If quite a few conversions are being done, set up a simple spacing template to streamline assembly and wire lengths etc. Subsequent programming, using the usual PICAXE 3-wire serial lead connected to an editing PC, can be readily done via the fitted (three terminal) socket. Download the free editor from the Revolution Education site => www.picaxe.com. The editing PC doesn’t have to be the latest (or networked), as even an old Win 95/98 standalone laptop – preferably one with serial ports – can still handle the task. Extra circuitry (LEDs, 10kohm pullup resistors etc) can be made simply made by modifying spare two-contact “snap” strips. The speaker should now have a 10µF electrolytic and 33Ω resistor fitted too. Extra LEDs will need a dropping The completed “PICAXEd” circuitry, laid out to suit diverse PICAXE program applications. Parts in the simplest “80 Circuit” Snap Connector kit exactly cover this arrangement, and a 10kΩ resistor fitted to a spare 2-connector strip allows a useful READADC voltage divider. siliconchip.com.au Parts needed for the PICAXE modification can be readily mounted on both the 3.5mm stereo programming socket and a small Vero off cut. Use a Dremel to neatly enlarge the cutout for better access to the five snap contact tags. resistor (~330Ω). The PICAXE-08M itself runs on any supply from 3-5.5V, so the use of a dummy cell allows either 3 x fresh AA cells or 4 x 1.2 V NiCd/NiMH to be used in a 4xAA holder. This dummy cell, shown here as a shorting screw for effect, can be more elegantly made using a nail inserted inside a suitable length and width of bamboo or plastic tube offcut. As the PICAXE itself only draws a few milliamps, the batteries may last months under light loads. When they’re nearly flat, the dummy can be replaced with another near-flat AA, squeezing a few more useful Joules out of the batteries in an environmentally (and tight budget!) friendly manner. Just make sure you don’t exceed that 5.5V PICAXE limit! Applications Layout trials lead to the suggested version that suits a versatile 3 I/O channel use. The “PICAXEd” sound module looks right at home amongst the colourful parts, although a simple neat label showing the I/Os and supply positions could be fitted (see the sample below). Aside from easy LEDWINK: HIGH 1: WAIT 1: LOW 1: WAIT 1: SOUND 2,(100,10):GOTO LEDWINK style programs, this suggested setup in fact perfectly suits a simple PICAXE response timer game (REACTIONBB.BAS) originally devised in 2003. Competitive kids who’ve tried this game have declared it “pretty cool” – you can’t ask for better praise than that! SC It’s essential to suitably re-label the original sound module. Here is a suggested 30mm x 20mm label, with punch-out for the 3.5mm socket, can be covered with clear contact or laminated and then suitably glued on top. 1 2 4 PICAXE-08M MICRO 0V 3-5V + Further ideas, including an Instructable, PICAXE links and downloadable programs are hosted at => www.picaxe. orconhosting.net.nz/snap.htm March 2009  81