Silicon ChipPICAXE-Based 433MHz Wireless Thermometer - January 2006 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Australia should build nuclear power stations
  4. Feature: Holden’s EFIJY Show Car by Jeff Brown
  5. Review: Tektronix Arbitrary/Function Generators by Peter Smith
  6. Project: Pocket TENS Unit For Pain Relief by John Clarke
  7. Feature: Excellence In Education Technology Awards by Silicon Chip
  8. Project: “Little Jim” AM Radio Transmitter by Jim Rowe
  9. Book Store
  10. Project: Universal High-Energy Ignition System; Pt.2 by John Clarke
  11. Project: Building The Ultimate Jukebox; Pt.2 by Ross Tester
  12. Project: Build A MIDI Drum Kit; Pt.3 by John Clarke
  13. Project: PICAXE-Based 433MHz Wireless Thermometer by Stan Swan
  14. Vintage Radio: The AWA B25/6 stereogram by Rodney Champness
  15. Salvage It: A human-powered LED torch for next to nothing by Julian Edgar
  16. Advertising Index

This is only a preview of the January 2006 issue of Silicon Chip.

You can view 41 of the 120 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.

Items relevant to "Pocket TENS Unit For Pain Relief":
  • Pocket TENS Unit PCB [11101061] (AUD $10.00)
  • PCB pattern for the Pocket TENS Unit (PDF download) [11101061] (Free)
  • Pocket TENS Unit front panel artwork (PDF download) (Free)
Items relevant to "“Little Jim” AM Radio Transmitter":
  • "Little Jim" AM Transmitter PCB [06101062] (AUD $15.00)
  • MC1496BDG or MC1496DR2G Balanced Modulator/Demodulator IC (SOIC-14) (Component, AUD $3.00)
  • PCB patterns for the "Little Jim" AM Radio Transmitter (PDF download) [06101061/2] (Free)
  • "Little Jim" AM Radio Transmitter front panel artwork (PDF download) (Free)
Items relevant to "Universal High-Energy Ignition System; Pt.2":
  • (2005 Version) PIC16F88-E/P programmed for the Universal High Energy Electronic Ignition System [ignition.hex] (Programmed Microcontroller, AUD $15.00)
  • PCB pattern for the Universal High-Energy Ignition System (PDF download) [05112051] (Free)
  • Universal High-Energy Ignition System front panel artwork (PDF download) (Free)
Articles in this series:
  • Universal High-Energy Ignition System; Pt.1 (December 2005)
  • Universal High-Energy Ignition System; Pt.2 (January 2006)
Items relevant to "Building The Ultimate Jukebox; Pt.2":
  • Ultimate Jukebox front panel artwork (PDF download) (Free)
Articles in this series:
  • Building The Ultimate Jukebox; Pt.1 (December 2005)
  • Building The Ultimate Jukebox; Pt.2 (January 2006)
  • Building The Ultimate Jukebox; Pt.3 (February 2006)
Items relevant to "Build A MIDI Drum Kit; Pt.3":
  • PIC16F88-I/P programmed for the MIDI Drum Kit [drumkit16.hex] (Programmed Microcontroller, AUD $15.00)
  • PIC16F88 firmware and source code for the MIDI Drum Kit [drumkit16.hex] (Software, Free)
  • PCB patterns for the MIDI Drum Kit (PDF download) [01211051/2/3] (Free)
  • MIDI Drum Kit front panel artwork (PDF download) (Free)
Articles in this series:
  • Build A MIDI Drum Kit (November 2005)
  • Build A MIDI Drum Kit; Pt.2 (December 2005)
  • Build A MIDI Drum Kit; Pt.3 (January 2006)
  • Build A MIDI Drum Kit; Pt.4 (February 2006)
433MHz + Picaxe = Magic! You’ve no doubt heard of Murphy’s, Ohm’s and Moore’s Laws . . . but how about Swan’s Law – “You can never have too many thermometers”? by Stan Swan* H ere’s a Picaxe-controlled wireless version that should suit many needs and YES! – it’s legal, as the only Australian/NZ 433.92MHz LIPD ISM regulatory restriction is that the transmitter should not exceed 25mW EIRP (Effective Isotropic Radiated Power). Since Picaxe-08M microcontrollers work so well with 433MHz UHF data modules (see last month), it’s tempting to further link the pair to industrystandard DS18B20 Dallas Semiconductor (Maxim) digital temperature ICs and make a simple Picaxe-08M driven wireless thermometer. Direct Celsius temperature data can be then transmitted some 50 metres and shown on a PC attached to the 433MHz receiver (with perhaps further treatment under Excel). A simple antenna extends this range to more like 300m, while a Picaxecontrolled data repeater can even push ranges to perhaps 500m and may allow coverage when obstacles otherwise block weak signals. What’s involved As initially mentioned in the December 2005 SILICON CHIP article, we’ve now migrated to the Mk.2 PICNIK box layout approach (see the The first of Stan’s breadboard circuits for this month: both use the wireless techniques explained last month but now they’ve taken on Picaxe control. Aaaaah – Stan’s two loves in one circuit? He’s in rapture . . . 98  Silicon Chip siliconchip.com.au The DS18B20 digital temperature IC is, confusingly, a look-alike to cheap BC547 transistors and mixups may arise unless it’s boldly marked – here whiteout and a red felt tip dot has been used to avoid any possible circuit confusion. As outlined last month, the various LIPD modules are usually pin-for-pin compatible, so most of the common 433.92MHz transmitters can be used, although the antenna position may vary on some. One I found even had its antenna pre-wound and bonded to the module. The receiver assembly may need more consideration, since the Jaycar version needs a nominal 5V supply and may be less tolerant of three 1.5V AAs (ie, 4.5V) for the supply unless the cells are fresh. Consider perhaps four NiCd/NiMHs (4 x 1.2 = 4.8V) instead, or even 4 x 1.5V cells (thus 6V) and a series silicon diode to drop that back to around 5.4V (as outlined later). The Mk.2 PICNIK box has room for either a three or four AA-cell switched battery box anyway Once the Tx and Rx boards are assembled and powered up, simply port over the correct code (www.picaxe. orcon.net.nz/434tx.bas and www. picaxe.orcon.net.nz/434rx.bas) from the Picaxe Editor PC to the matching setup. Following the energy saving SLEEP command (initially set to about one minute – modify to suit), the DS18B20 Here’s the Picaxecontrolled wireless thermometer – the circuit at top and the breadboard layout at right. There are subtle differences between this layout and the photo at left – neither is “wrong” but the one at right is a little easier to follow in printed form. www.picaxe.orcon.net.nz/picnik2.gif “slide show”), which conveniently has room enough for a Picaxe-08M and the 434MHz Tx/Rx units. It’s again strongly recommended that you first lay out the circuit on such solderless breadboards (as we’ve shown here), allowing things to be better understood and tweaked. The final soldered versions should be the last stage in your design– not the first! However, for eager constructors “more confident in their abilities” and wanting to build just the final version, it’s suggested that Dick Smith Prototype Board (DSE H-5605) be used. Its 0.1-inch-spaced solder pads siliconchip.com.au are laid out exactly the same as the breadboards, allowing almost a “paint by number” approach to board stuffing. Rather than soldering the Picaxe and 433 units directly onto this board, use 8-pin IC sockets. The same can be said for the transmitter and receiver modules – cut the IC sockets in half lengthways. The DS18B20 can of course be extended away from the board with three wires but ensure their solder joints are waterproofed with epoxy or neutral silicone sealant for measurements in damp areas. See a possible approach at www.picaxe.orcon.net. nz/pvdemo.jpg The alternative construction methods: our familiar breadboard and above it, a DSE Prototype Board. It’s easy to transfer circuits from one to another because both use the grid system. January 2006  99 Want cheap, really bright LEDs? We have the best value, brightest LEDs available in Australia! Check these out: Luxeon 1, 3 and 5 watt All colours available, with or without attached optics, as low as $10 each Low-cost 1 watt Like the Luxeons, but much lower cost. •Red, amber, green, blue and white: Just $6 each! Lumileds Superflux These are 7.6mm square and can be driven at up to 50mA continuously. •Red and amber: $2 each •Blue, green and cyan: $3 each Asian Superflux Same as above, but much lower cost. •Red and amber: Just 50 cents each! •Blue, green, aqua and white: $1 each. Go to www.ata.org.au or call us on (03)9419 2440. Select your microcontroller kit and get started... From $295* Fax a copy of this ad and receive a 5% discount on your order! Feature rich, compiler, editor & debugger with royalty free TCP/IP stack RCM3400 • Prices exclude GST and delivery charges. Tel: + 61 2 9906 6988 Fax: + 61 2 9906 7145 www.dominion.net.au 100  Silicon Chip 4007 Here’s the matching receiver module – again, there are differences between this and the photos. Virtually any of the commonly available (and cheap!) 433MHz wireless modules can be used in this circuit as most are pin-for-pin interchangeable. will power up to read the temperature, which is then transmitted as a variable (b1) before shut down again. A red LED winks to indicate outgoing data, which has been reduced in speed to just 300 bps for reliability. There’s little point in sending faster when the unit will spend considerable time idling between readings and the Picaxes could even be under-clocked to further slow data rates if superior reception is needed – this may also prolong battery life. At the receiver (if in range) the unit first has to be given a preamble to ensure it’s listening carefully – experimentation showed that a good burst of ASCII 85s (“U” being 01010101) ensured it was suitably responsive. A further “ABC” qualifier is then added to the transmitted serial string, with a similar sequence at the receiver, to ensure that data will only be re- sponded to if this preceding ABC is present. Naturally, with numerous wireless garage door openers, door bells and the like now abounding, you don’t want false triggering every time the place next door has visitors – or vice versa. There’s a parallel here with WW2 coded BBC messages of course – only if a pre-determined phrase such “My hovercraft is full of eels” was broadcast would the listening partisan group blow up the rail bridge, etc. Being 2006 rather than 1945, instead of bridges the alerted SERIN command takes the b1 temperature variable and directs it via the Picaxe programming cable to the PC for editor “F8” 4800bps terminal window display. Other readouts, perhaps an LCD module or old organiser suitably driven by SEROUT, could easily be used instead. siliconchip.com.au idle capacity to “store and forward” the temperature data. The technique is akin to LEO (Low Earth Orbital) “flying mailbox” satellites which take in weak ground signals, when over a remote area, for resending as they pass over a base station perhaps 20 minutes later. When placed in an elevated RF sweet spot (and perhaps solar-powered), enhanced signal broadcasting results, allowing data gathering from areas that may otherwise be UHF black holes – a cave or well perhaps. The small 230 hole (+ 40 supply Put a receiver and transmitter module together and what do you get? A repeater, of course! The code for the Picaxe control can be found on Stan’s website (address at end of this article). With the use of the Picaxe WRITE and READ commands, quite a stack of these variables could be stashed in EEPROM for later retrieval as well of course, effectively making a wireless temperature data logger. Every school should make one to explore and experiment ! A simple quarter-wave antenna (~165mm at 433-4MHz), perhaps spiraled somewhat for compactness, should give a range through wooden walls of about 50m. For coverage beyond this, consider antennas such as the Yagi “cotanga” or magnetic pickup version described last month (www.picaxe.orcon.net.nz/ yagi433.jpg) and if used at both ends siliconchip.com.au perhaps 300m range may result. In situations where the transmitter signal is well shielded from the receiver behind metalwork, buildings, hills or extensive vegetation you’ll need a bit more ingenuity. A repeater! Taraaaa! You saw it here first – a dead simple but effective Picaxe controlled 433MHz data repeater. The Picaxe driving code is a breeze, but keep in mind it’s only set up to “store and forward “ a single variable, so don’t expect WiFi bandwidth! Since the baby 08M has spare I/O channels and memory, it was tempting (and indeed proved feasible) to use its And here’s the breadboard layout of the repeater. The long black object is also an antenna – just a different type than our curly wire version. January 2006  101 rail) breadboards we used nicely fit both a 433 Rx and Tx module alongside the Picaxe, and following simple hookup wiring the repeater can be programmed with www.picaxe.orcon. net.nz/434rpt.bas To show its action, green and red LEDs (for awaiting receiving then retransmitting) connect via 1kW dropping resistors – much larger than really needed but reducing battery drain to just a few milliamps. 433MHz transmitters only come on when data is fed to them but naturally the sensitive receiver must be switched off before the transmitter comes on, otherwise it will be overloaded. Such needs can again be easily handled via our Picaxe, since each output has the ability to provide (“source”) ~ 20mA current when high. Somewhat annoyingly, the Picaxe SERIN command can’t be interrupted or timed out but completely stops processing until a suitable signal arrives, meaning the receiver can only be switched off (and the program able to continue) after such prescribed data is received. There’s a parallel here with fishing and the discard of any less worthy catches, as you’ll only go home when a desirable barramundi (?) is in the bag. Note: the temperature data handling here is a simplex in nature, and similar to a radio station sending out programs. Extensive data massaging, using CRC error detection or even half duplex confirmation is rather beyond this initial article so has not been considered, although is mentioned in the references. If the receiver is close to both the sender and the repeater, a double set of data will show up on the screen as the two signals are received. Although you’ll obviously not need the resending in such a strong signal arrangement, normally position the repeater where it can just reliably hear the sender and the receiver can further hear the repeater’s outgoing signal. Perhaps initially reduce the SLEEP to just a few seconds to speed up the process, as the informative switching LED patterns will greatly help positioning. Solar power? With hardware and gift/bargain stores now displaying racks of solar powered garden lamps at near throw102  Silicon Chip Just to prove the point, here’s a version of the circuits on the DSE prototype board. Ignore the 2 extra LEDs in the repeater circuit. Note the IC sockets supporting the Rx module – they can also be trimmed for the programming lead. away prices (often under A$5 each), it’s tempting to power our modules from the sun via parts salvaged from such lamps. Since each lamp usually has an epoxy-covered four-wafer PC cell (delivering ~2V at 30mA) and a 600mAh NiCd, a 3-PV array will be sufficient to drive a module (probably the repeater) and charge four NiCds. Average current demands of the Picaxe controlled units are around 10mA (much less when sleeping), meaning ~eight hours of daylight will be sufficient to run a setup and keep the batteries at full charge. To avoid oversupplying the Picaxe08M (which normally needs under 6V) and prevent battery discharge via the panel at night, a blocking diode should also be fitted. Although cheap, silicon diodes waste 0.6V but conveniently the solar garden lamps again come to the party and provide a superior Schottky version (1N5817 etc) which drops only 0.2V. Amazingly for the lamp price, further useful parts like an ultra-bright white LED lurk in the device for later projects – how can these things be made so cheaply? Footnote for sunbelt regions: just as the photovoltaic (PV) panels need sunlight, you need to ensure that the repeater electronics aren’t cooked by strong sun. It can happen! Don’t mount the repeater in too inconvenient a place either, as you’ll no doubt need to access it for software upgrades and occasional dirt removal from the panels. Birds naturally appreciate elevated roosts but their droppings (especially from seagulls) may be the weak point in a pico PV-powered system like this! References: For convenience these are hosted, along with mentioned URLs and project software, at www.picaxe.orcon. SC net.nz/434rpt.htm * s.t.swan<at>massey.ac.nz siliconchip.com.au