Silicon ChipOctober 2018 - Silicon Chip Online SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Seemingly helpful technology may not be that helpful
  4. Feature: Reusable Rockets by Dr David Maddison
  5. Project: GPS-synched Frequency Reference Pt.1 by Tim Blythman
  6. Project: Arduino-based programmer for DCC Decoders by Tim Blythman
  7. Project: Low-voltage, high-current DC Motor Speed Controller by Nicholas Vinen
  8. Serviceman's Log: I'm on holidays, but not from servicing! by Dave Thompson
  9. Feature: Developing CleverScope's high-performance CS448 by Bart Schroeder
  10. Project: Opto-Isolated Mains Relay by Tim Blythman
  11. Feature: Intro to programming: Cypress' System on a Chip (SoC) by Dennis Smith
  12. PartShop
  13. Product Showcase
  14. Vintage Radio: Emerson 838 hybrid valve/transistor radio by Ian Batty
  15. Subscriptions
  16. Market Centre
  17. Advertising Index
  18. Notes & Errata: Steam Train Whistle/Diesel Horn / Arduino Data Logger
  19. Outer Back Cover

This is only a preview of the October 2018 issue of Silicon Chip.

You can view 40 of the 112 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 "GPS-synched Frequency Reference Pt.1":
  • GPS-synched Frequency Reference PCB [04107181] (AUD $7.50)
  • PIC32MX170F256B-50I/SP programmed for the GPS-Synched Frequency Reference [0410718A.hex] (Programmed Microcontroller, AUD $15.00)
  • VK2828U7G5LF TTL GPS/GLONASS/GALILEO module with antenna and cable (Component, AUD $25.00)
  • Micromite LCD BackPack V2 complete kit (Component, AUD $70.00)
  • SMD parts for the GPS-Synched Frequency Reference (Component, AUD $80.00)
  • Firmware (HEX) files and BASIC/C source code for the GPS-Synched Frequency Reference [0410718A.hex] (Software, Free)
  • GPS-Synched Frequency Reference PCB pattern (PDF download) [04107181] (Free)
  • GPS-synched Frequency Reference drilling and cutting diagrams (PDF download) (Panel Artwork, Free)
Articles in this series:
  • GPS-synched Frequency Reference Pt.1 (October 2018)
  • GPS-synched, lab-quality frequency reference (Part 2) (November 2018)
Items relevant to "Arduino-based programmer for DCC Decoders":
  • DCC Decoder Programmer PCB [09107181] (AUD $5.00)
  • DCC Decoder Programmer PCB plus stackable headers [09107181] (AUD $7.50)
  • Small 2A boost step-up regulator module (MT3608) (Component, AUD $3.00)
  • DCC Decoder Programmer sketches (Software, Free)
  • DCC Decoder Programmer PCB pattern (PDF download) [09107181] (Free)
Items relevant to "Low-voltage, high-current DC Motor Speed Controller":
  • Four-channel High-current DC Fan and Pump Controller PCB [05108181] (AUD $5.00)
  • PIC16F1459-I/SO programmed for the Four-channel High-current DC Fan & Pump Controller (0510818A.HEX) (Programmed Microcontroller, AUD $10.00)
  • Firmware for the Four-channel High-current DC Fan & Pump Controller (0510818A.HEX) (Software, Free)
  • Four-channel High-current DC Fan and Pump Controller PCB pattern (PDF download) [05108181] (Free)
Articles in this series:
  • Low-voltage, high-current DC Motor Speed Controller (October 2018)
  • Low voltage DC Motor and Pump Controller (Part 2) (December 2018)
Items relevant to "Opto-Isolated Mains Relay":
  • Opto-Isolated Relay PCB plus two extension boards [10107181] (AUD $7.50)
  • Opto-Isolated Relay PCB pattern (PDF download) [10107181] (Free)
Items relevant to "Intro to programming: Cypress' System on a Chip (SoC)":
  • Cypress PSoC4 CY8CKIT demonstration project files (Thermistor/LCD) (Software, Free)
Articles in this series:
  • Intro to programming: Cypress' System on a Chip (SoC) (October 2018)
  • Cypress “system on a chip” part 2 (September 2019)

Purchase a printed copy of this issue for $10.00.

siliconchip.com.au Australia’s electronics magazine October 2018  1 Project of the Month: Our very own specialists are developing fun and challenging Arduino®-compatible projects for you to build every month, with special prices exclusive to Nerd Perks Club Members. Sure, you can buy off the shelves but where's the FUN in that! Wireless Silent Notifier: STEP-BY-STEP INSTRUCTIONS AT: jaycar.com.au/wireless-silent-notifier This is a perfect project for new mums and dads or anyone that needs to be alerted in silence. Included is a simple base station that picks up wireless signals, a sensor (in this case a sound level sensor) and a strobe light. As soon as the sensor is triggered (say a baby crying) the strobe light will go off. One detector is included in this project but you can use any number of different types, depending on what you want to measure and be alerted for (temperature, moisture, door entry, ph levels etc.). VALUED AT $119.80 NERD PERKS CLUB OFFER BUNDLE DEAL $ 89 SAVE OVER $30 Batteries not included. SKILL LEVEL: INTERMEDIATE TOOLS REQUIRED: SOLDERING IRON, MOUNTING SCREW WHAT YOU WILL NEED: LEONARDO BOARD 12VAC 1.67A PLUGPACK LED STROBE - AMBER WIRELESS MODULES (RECEIVER)- 433MHZ WIRELESS MODULES (TRANSMITTER) - 433MHZ MICROPHONE SOUND SENSOR MODULE 2AA BATTERY ENCLOSURE 2N7000 N-CHANNEL FET XC-4430 MP-3058 LA-5328 ZW-3102 ZW-3100 XC-4438 PH-9280 ZT-2400 $29.95 $29.95 $19.95 $13.95 $13.95 $7.95 $3.35 75¢ SEE OTHER PROJECTS AT: www.jaycar.com.au/arduino Improve Your Project: 7 19 95 $ 95 $ DETECT IT IR OBSTACLE AVOIDANCE SENSOR MODULE XC-4524 Use an infrared detection unit to trip the detection signal. Just one of the many type of detectors that you can build. $ 39 95 $ 69 95 LOG IT DATA LOG MODULE XC-4536 CONNECT IT ESP-13 WI-FI SHIELD XC-4614 EXTEND IT LONG RANGE LORA™ SHIELD Use the Datalogging Shield with RTC to record dates and times of when detectors go off. Connect this module for some Internet of Things (IoT) capabilities (i.e notified online, buzz you on your phone etc.) XC-4392 Use this shield to communicate with detectors a couple of kilometres away! NERD PERKS CLUB MEMBERS RECEIVE: 20% OFF TV BRACKETS* *Applies to Jaycar 503A Home Theatre Hardware: Plasma TV Brackets Catalogue Sale 24 September - 23 October, 2018 EARN A POINT FOR EVERY DOLLAR SPENT AT ANY JAYCAR COMPANY STORE* & BE REWARDED WITH A $25 JAYCOINS GIFT CARD ONCE YOU REACH 500 POINTS! Conditions apply. See website for T&Cs * REGISTER ONLINE TODAY BY VISITING: www.jaycar.com.au/nerdperks To order: phone 1800 022 888 or visit www.jaycar.com.au Contents Vol.31, No.10; October 2018 SILICON CHIP www.siliconchip.com.au Features & Reviews 14 Want to go into space? It’s not too far off! You’d have heard of Elon Musk’s SpaceX but there are others waiting to put tourists into space with reusable rockets: Richard Branson’s Virgin Galactic and Jeff Bezos’ Blue Origin are almost ready to take off! – by Dr David Maddison 68 Developing CleverScope’s high-performance CS448 It wasn’t always plain sailing for Bart Schroeder as he took his concept ’scope from a thought bubble to market. What he ended up with is one of the highest regarded scopes on the market: the CS448. He tells us the story himself. 82 Intro to programming: Cypress’ System-on-a-chip It’s much more than just a microcontroller. The CY8CKIT-049-42XX Prototyping Kit is one of the best development platforms available at the moment. And you can buy a kit – complete with the chip – for about six bucks! – by Dennis Smith Constructional Projects Reusable spacecraft are now available (or being developed) to reduce the cost of sending anything into space (even humans!) – Page 14 It’s one Clever ’Scope, this CleverScope! Four isolated inputs with 1kV rating – Page 68 28 GPS-synched Frequency Reference (Part 1) With an accuracy of 100 parts per billion and synched to the GPS time standard this beauty also has a Micromite BackPack touch screen interface and rock-solid output between ~1MHz to 100MHz – by Tim Blythman 38 Arduino-based programmer for DCC decoders If you’re into model trains on a BIG layout, you’d know that you absolutely need DCC (Digital Command Control) to individually control locos on the same track. This programmer makes it all so easy - and it’s cheap! – by Tim Blythman 46 Low voltage, high current DC motor speed controller We originally designed it for car fans and pumps - which of course it does really well. But it suits virtually any low voltage (ie, 5-25V) motor with pulse-width modulation giving virtually any speed from 0% to 100% – by Nicholas Vinen 74 Opto-isolated Mains Relay: switches up to 10A <at> 250V Switching from a micro? Or any other low voltage source? Here’s the safe way to do it. It keeps dangerous voltages away from low voltage circuitry, where it could do components – or you – some serious harm! by Tim Blythman Touch screen control, extremely accurate, stable . . . what more could you ask for in a Frequency Reference? – Page 28. Want to run multiple locos at the same time in your model layout? You need DCC – and this DCC decoder programmer – Page 38. Your Favourite Columns 61 Serviceman’s Log I’m on holidays – but not from servicing! – by Dave Thompson 90 Circuit Notebook (1) Arduino talking clock (2) Micromite Plus Explore data logger (3) Eight-button quizmaster (4) Switch-mode solar battery charger with sunset switch 98 Vintage Radio Emerson 838 hybrid valve/transistor radio – by Ian Batty Everything Else! 2 Editorial Viewpoint   104 Ask SILICON CHIP 4 Mailbag – Your Feedback    111 Market Centre siliconchip.com.au Australia’s electronicsIndex magazine 88 SILICON CHIP Online Shop   112 Advertising 96 Product Showcase    112 Notes and Errata Run your DC pumps and fans at the speed YOU want with this low voltage, high current motor speed controller. Ideal for auto use – plus more. – Page 46. Switching mains voltages can be dangerous – but not if you use this Opto-isolated Mains Relay – handles 10A <at> 250V – Page 74 October 2018  1 www.facebook.com/siliconchipmagazine SILICON SILIC CHIP www.siliconchip.com.au Editor Emeritus Leo Simpson, B.Bus., FAICD Publisher/Editor Nicholas Vinen Technical Editor John Clarke, B.E.(Elec.) Technical Staff Jim Rowe, B.A., B.Sc Bao Smith, B.Sc Tim Blythman, B.E., B.Sc Technical Contributor Duraid Madina, B.Sc, M.Sc, PhD Art Director & Production Manager Ross Tester Reader Services Ann Morris Advertising Enquiries Glyn Smith Phone (02) 9939 3295 Mobile 0431 792 293 glyn<at>siliconchip.com.au Regular Contributors Dave Thompson David Maddison B.App.Sc. (Hons 1), PhD, Grad.Dip.Entr.Innov. Geoff Graham Associate Professor Graham Parslow Ian Batty Cartoonist Brendan Akhurst Silicon Chip is published 12 times a year by Silicon Chip Publications Pty Ltd. ACN 626 922 870. ABN 20 880 526 923. All material is copyright ©. No part of this publication may be reproduced without the written consent of the publisher. Subscription rates: $105.00 per year, post paid, in Australia. For overseas rates, see our website or email silicon<at>siliconchip.com.au Editorial office: Unit 1 (up ramp), 234 Harbord Rd, Brookvale, NSW 2100. Postal address: PO Box 139, Collaroy Beach, NSW 2097. Phone (02) 9939 3295. E-mail: silicon<at>siliconchip.com.au ISSN 1030-2662 * Recommended & maximum price only. Editorial Viewpoint Seemingly helpful technology may be not that helpful For some years, I have had my Android phone set to automatically upload any photos that I have taken, to Google’s servers. This is very handy because it makes my photos easy to share. And it also means that I won’t lose any photos if my phone suddenly becomes kaput, which has happened to me twice already. Besides concerns over third parties getting access to data stored in “the cloud” (which is not paranoia, as we found out through the iCloud hacks), there is another aspect of this which I find very disconcerting. One day, I took a photo of my baby daughter and Google Photos asked me “who is this?” I (perhaps foolishly) entered her name and since then, Google’s facial recognition technology automatically tags photos that I take which include her. I can search for her name in Google Photos and it finds the images which include her, which is handy. But it’s also a bit creepy. She isn’t even a year old and already a computer somewhere has her biometric data and is able to recognise her. That information is not public but it’s stored on a server somewhere in “the cloud”. How do we know that it will stay private? Presumably Google would not purposely make it public (would they?) but maybe it could be hacked, or accidentally leaked, or otherwise compromised. There are potentially serious implications should anyone with nefarious intentions get a hold of that data. For example, someone with access to a network of street and traffic cameras and a large set of biometric data could track people’s movements, to stalk them. Consider that if you have ever shared a photo of yourself or your family members on social media, along with any identifying information, just about anyone with internet access could use those photos to build their own biometric database. They could then automatically scan other images from social media and other sources, to keep track of where you have been and what you have done. Big Brother is certainly watching you! In the case of young children, they may grow up to find out that others have already made their photos and other private data public, without their knowledge or consent. I’m not sure that’s morally right. This affects adults, too. You may have kept your information private but could an acquaintance have shared photos of you, and identifying information, without asking you first? I’m not really that concerned about government abuse of data like this because they already know so much about us. If you have a driver’s license or passport then they have your biometric data on file. But what about “social media mobs” and/or others with bad intentions? Having your photos and biometric data available on social networks could help deranged people harass you. Such events are becoming more commonplace, and not just for public figures. So while technology like Google’s facial recognition is convenient, you should think carefully about the ramifications before you give away private information to third parties, or make it public via social media. And when you do give away such information to a third party, you have to consider how securely it will be kept. Printing and Distribution: Nicholas Vinen Derby Street, Silverwater, NSW 2148. 2 Silicon Chip Australia’s electronics magazine siliconchip.com.au siliconchip.com.au Australia’s electronics magazine October 2018  3 MAILBAG – your feedback Letters and emails should contain complete name, address and daytime phone number. Letters to the Editor are submitted on the condition that Silicon Chip Publications Pty Ltd may edit and has the right to reproduce in electronic form and communicate these letters. This also applies to submissions to “Ask Silicon Chip”, “Circuit Notebook” and “Serviceman”. Streaming versus Broadcast TV I have some comments regarding your editorial in the September 2018 issue, “Streaming will make Broadcast Television Obsolete”. By far the cheapest way to reach large audiences is to broadcast it. Optus found this out when they bought the rights to the World Cup Soccer. Their system crashed due to the enormous demand. They had to sublet the contract to SBS for broadcasting. This is because each viewer has to be served separately. It is not financially worthwhile to have the server capacity for a huge audience once every four years! An Ultra High Definition signal requires 25Mbit/s per viewer, according to Netflix. There are 10 million dwellings in Australia. If each dwelling were to switch on their TVs at the same time, it would require a total of 250Tbit/s (250 million Mbit/s) to be supplied from the servers, through the Internet Service Providers and to the users. By contrast, broadcast TV can do this now with 23Mbit/s! The data capacity of the telco networks relies on the fact that only a small proportion of the users are downloading simultaneously. Streaming is continuous downloading, and as audiences increases, the data demand between the ISP and the telephone exchange feeding users also increases. This results in the need for more inter-exchange fibre optic links and associated equipment. As for Netflix and the like, they have to install sea containers full of computers at telephone exchanges to store their range of programs and then enough servers for that area’s subscribers to reduce the data rate required back to the ISP. In conclusion, isn’t streaming vs broadcast TV like radio vs records/ CD? We have our favourite stored programs/movies but we only wish to watch a few times, the rest of the time we want others to make program selections for us. 4 Silicon Chip Remember that telcos and streaming companies have a vested interest in promoting their services. Alan Hughes, Hamersley, WA. Nicholas responds: I did specifically mention in my editorial that sport is likely to continue to be broadcast due to its broad appeal (along with news). It’s the other content which I believe will end up being 100% streamed. You suggest that 25Mbit bandwidth per user is required for 4K streaming but I stream 1080p video with a 4Mbit ADSL connection and still have bandwidth to spare; that is not even using the latest video codecs. I have also streamed 4K video in the past with an 8Mbit connection and I found the video quality more than acceptable. I would suggest that using the latest compression such as VP9 or H.265 (HEVC), around 8-10Mbit may be required for 4K streaming, possibly less. Most Australian broadband users (and anyone on the NBN) already have more than enough bandwidth. Of course, broadcast TV is more “efficient” but why would you want others to choose what you can watch if you can make your own choice? Your analogy of records/CDs does not describe how I use streaming services. The vast range of programs available, which is continually growing, means I can watch something different every day and never run out of new programs to view. Electronics/engineering video recommendation I read your Editorial Viewpoint in the September 2018 issue. Thanks for recommending the EEVblog YouTube channel. It’s hard to find guys that are entertaining and technical. Here is another one, called AvE: siliconchip. com.au/link/aalc It isn’t just about electronics; quite a few of the videos also relate to machining and mechanical engineering. But like David L. Jones, they “tear down” quite a few pieces of equipment Australia’s electronics magazine to show you what’s inside, including the electronics. They did an interesting teardown of the Dyson V9 Motor. I love the waveform used to drive that motor. Colin Reeve, Karrinyup, WA. More support for expanded Sound Effects module When I saw the Super Sound Effects Module project in the August 2018 issue (siliconchip.com.au/Series/325), I was excited by the prospect of adding a voice output to my projects. But like George from Holland Park (Mailbag – September issue), I quickly realised the limitations in terms of the number of sounds, words or phrases that could be used with only seven trigger inputs. The serial interface suggested by George is a good idea (UART/SPI), however, another alternative that would require a fairly simple software change would be to use six of the existing status inputs as a parallel bus and the seventh status input as a strobe, edge triggered, to clock in the selection on the bus. This would give the ability to select 64 sounds, words or part messages. I would like to be able to use this project to “speak” a number of alarm messages with the value of analog variables spoken. For those that remember, something like the old GPO “talking clock”, ie, “on the third stroke, it will be ten forty-five and ten seconds” etc. Thanks for a great magazine. Silicon Chip and its forebears have given me a lot of pleasure over the years. As a teenager, I used to read my Electronics Australia magazines from cover to cover each month. This month’s Editorial Viewpoint reminded me of the earlier variants of the magazine. I bought my first copy of Radio, TV & Hobbies in 1965 and siliconchip.com.au still have it and the rest, much to my wife’s dismay. Peter McConnell, Northbridge, NSW. Memories from the early days of Silicon Chip Many, many years ago myself and a mister Branko Justic of Oatley Electronics watched Leo Simpson and Greg Swain put together the second issue of Silicon Chip Magazine on Leo’s table tennis table. At the time, many questioned whether Australia could support another electronics magazine. Electronics Today International (ETI) and Electronics Australia (EA) were both running strongly at the time Silicon Chip started. The journey from those humble beginnings to the magazine we see today is truly remarkable and one to be proud of. If you look at other technical magazines currently in print around the world, I think readers will agree that Silicon Chip can hold its head up with the best. Take a look at the technical magazine section of any large newsagent. One of the first things you will notice is the number of projects published in other magazines that were designed by the Silicon Chip staff or readers of Silicon Chip. Compare these with the projects appearing in Silicon Chip that originated in other magazines. Here the number is almost zero. Also, notice the project quality and sophistication. Silicon Chip, in my opinion, leads the world. Not only is this true for projects but technical articles as well. In short, Silicon Chip is a world-class technical publication that in many respects leads the world. At the helm of this magazine has been Leo Simpson and until several years ago, Greg Swain. 31 years is a long time to sit in the same chair. His monthly editorial has at times rubbed several people the wrong way but if you know Leo, you will know that he looks you square in the eye and tells it as it is. There’s no dissembling. He ran the magazine the same way. Both myself and Branko Justic had many projects published in the magazine and the one thing that I quickly learned about Leo and Greg was that if your project was not technically sound or was not innovative, it would quickly be rejected. siliconchip.com.au DID YOU MSS OUT? Is there a particular project in S ILICON C HIP that you wanted to read – but missed that issue? Or perhaps a feature that really interests you? Grab a back issue . . . while they last! The SILICON CHIP Online Shop carries back issues for all months (with some exceptions!) from 1997 to date. Some popular issues are sold out, and some months are getting quite low. But if you want a particular issue, you can order it for just $12.00 INCLUDING P&P* – while stocks last! The following issues are still available (at time of going to press): 1997 – all except August and September 1998 – all except March 1999 – all except February 2000 – all except April 2001 – all except October & December 2002 – all except June & July 2003 – all still available 2004 – all still available 2005 – all still available 2006 – all except January & October 2007 – all still available 2008 – all still available 2009 – all still available 2010 – all still available 2011 – all still available 2012 – all except December 2013 – all except February 2014 – all except January 2015 – all still available 2016 – all still available 2017 – all still available 2018 – all still available HOW TO ORDER WITH YOUR CREDIT/DEBIT CARD#: Don’t forget to let us know which issues you require! Via email: silchip<at>siliconchip.com.au (24 hours a day) Via the net: siliconchip.com.au/shop/ (24 hours a day) By mail: Silicon Chip, PO Box 139, Collaroy NSW 2097 By phone: (02) 9939 3295; Mon-Fri 9am to 4.30pm * Australia only. O’seas? email for a quote # Visa/Mastercard only. OH NO! THE back issue YOU WANT IS SOLD OUT! DON’T PANIC AND STAY CALM! We can still help you! The SILICON CHIP website (siliconchip.com.au) houses complete issues from mid 1997 on. You can browse a preview version – and if it’s what you want, you can purchase a digital edition (complete magazine) . Full details are given where you browse the issue. And if you’re a current digital edition subscriber, there are even more attractive rates! SPEAKING OF SUBSCRIBING . . . That’s the one way to guarantee you’ll never miss an issue! Not only that, you’ll $AVE money on the over-the-counter price. Full details are at siliconchip.com.au/shop/subscriptions Australia’s electronics magazine October 2018  5 I once submitted a project for an electronic dashboard for cars that used a constant current source to charge a capacitor. In the final prototype, I had placed a resistor on the emitter of a transistor instead of the collector. I thought Leo was being very difficult until I looked carefully at the circuit and discovered the mistake. The project still worked but not exactly as described. Leo insisted that I re-lay the PCB. So now we find ourselves at a point in time that had to happen. The magazine is being left in a position of great strength. All this will add to the pressure now on Nicholas. Mate, you have some mighty big shoes to fill. I wish you all the best. I want to say thank you to Leo for all the support he showed to CTOAN Electronics and to me over the years. I wish you well in your future endeavours. I guess it’s time to finally dust off that boat that I did not get to see when I was in Sydney last. Thanks for the past 31 years. You have certainly earned your relaxation time. Jeff Monegal, North Maclean, Qld. NASA explorer robot concept and BASIC programming Once again, thank you for a most readable edition of Silicon Chip (July 2018). Your article on Agricultural Robots in that issue reminded me of a NASA robot that I recently stumbled upon USB/serial converter design flaw I noticed a design flaw in the CP2102 USB-to-serial converters available online and also available from the Silicon Chip Online Shop (Cat SC3543). I bought five from you and they all have the same flaw. When you measure the 3V3 output, you’ll find it’s closer to 4.2V. Apparently, it’s a known fault in the design but the information hasn’t been passed onto buyers. Jim Rowe described the modules in the January 2017 issue of Silicon Chip (siliconchip.com.au/Article/10510), on pages 72-74. Fig.1 on page 73 shows the /RST line connected to 5V but the datasheet indicates that it should be connected to the 3.3V rail, either via a 6 Silicon Chip and I haven’t seen any references to it anywhere else, the All-Terrain HexLimbed Extra-Terrestrial Explorer (ATHLETE). NASA scientists produced these fantastic robots over 10 years ago. I wonder what became of them? See: en.wikipedia.org/wiki/ATHLETE and videos of the robot at: siliconchip.com. au/link/aala Also, I read Keith Anderson’s letter in the July issue concerning BASIC and C programming and I agree with your response regarding Visual Basic. While working at the university, I bought an academic copy of Visual Basic and it ended up being a waste of money. But PicBasic Pro is a superb compiled BASIC for Microchip’s 8-bit microprocessors and PowerBasic Console Compiler is excellent for testing algorithms and writing hack programs on PCs running Microsoft Windows. George Ramsay, Holland Park. Qld. Radio can flatten caravan battery when switched off Regarding caravan power/charging systems as mentioned by David Sills in the September issue, I have discovered a severe shortcoming which I suspect is a problem with many caravans. I recently checked the 12V feeds from my caravan house battery and found that with everything switched off, there was a 90mA continuous load. This current was going into the radio. pull-up resistor, directly or left open. Having it connected to 5V causes current to flow through the internal clamp diode on that pin, into the 3.3V line, pulling its voltage high. That effect is discussed here: siliconchip.com.au/link/aal9 The solution from the above site is to cut the track, which I did, and it solves the problem. Note that it’s a little fiddly because the track is quite fine so you need to use a scalpel or something with a very fine tip. I suggest that you include a note with the converters you sell so buyers are aware of this flaw. Hopefully, the manufacturer(s) will hear about the flaw and modify their design. Peter Ihnat Wollongong, NSW. Australia’s electronics magazine Modern car radios have Bluetooth capability and the installer had wired the +12V permanently to the radio and paralleled the IGN wire (into the radio) with this. This is necessary as you cannot use the radio without the IGN wire being pulled high and caravans don’t have an ignition switch! But this activates the radio’s Bluetooth function and as a result, it draws significant current from the battery continuously. At this rate (90mA), a fully charged 100Ah battery would be completely discharged in around 46 days. I fixed this problem by installing a switch next to the radio, to switch the IGN wire and thus turn on the radio. I was initially going to completely de-power the whole radio via the switch, but this causes the loss of any frequency presets. Why don’t car radio manufacturers use non-volatile storage (EEPROM) for channel presets nowadays? This would save a lot of hassle for mechanics wanting to disconnect the car battery during maintenance. Bruce Boardman, Highfields, QLD. MEN system requires multiple Earth connections I am writing in response to the letter in the September issue of Silicon Chip titled “Separate Earth bar with Neutral link is required”. Trevor Krause wrote: “Every sub-board should have an Earth stake to the ground which is A handy website helps with electronics calculations Lately, I was re-visiting op amp theory and designing low-pass and bandpass active filters. I had difficulty figuring out how to match input impedance with the resistors and capacitors in my scraps box. I found the following website very helpful: www.electronicstutorials.ws It contains dozens of in-depth tutorials on many different aspects of electronics and provides all the relevant formulas. It is well worth the visit and I hope that readers find it useful. Michael Harvey, Albury, NSW. siliconchip.com.au https://www.facebook.com/mi.battery.experts https://www.facebook.com/mi.battery.experts https://www.facebook.com/mi.battery.experts https://www.facebook.com/mi.battery.experts https://www.facebook.com/mi.battery.experts https://www.facebook.com/mi.battery.experts https://www.facebook.com/mi.battery.experts www.master-instruments.com.au sales<at>master-instruments.com.au https://plus.google.com/+MasterInstrumentsMarrickville https://plus.google.com/+MasterInstrumentsMarrickville https://plus.google.com/+MasterInstrumentsMarrickville https://plus.google.com/+MasterInstrumentsMarrickville https://plus.google.com/+MasterInstrumentsMarrickville https://plus.google.com/+MasterInstrumentsMarrickville https://plus.google.com/+MasterInstrumentsMarrickville bonded via an Earth wire to the Earth terminal. This Earth stake references or ties the Neutral and thus the whole sub-board circuit to ground potential at that point.” I would like to point out that the Earth connection at the sub-board must also be connected back to the Earth at the main board. A critical aspect of the Multiple Earth/Neutral (MEN) system that we use is that the Neutral is multiply Earthed and connected to the “Earth” (safety) conductor at the first connection point of the supply to the premises concerned. Neutral is Earthed by the supply authority. Any local Earth stake would be quite unlikely to get a connection with true Earth at less than about 25W. Hence, the maximum current that would flow through it if a fault occurred would only be about 9A. That isn’t enough to trip a circuit breaker. With a properly implemented MEN system, the resistance to Earth (and to the Neutrals which also connect to this ”Earth” point) is almost zero because there are many such “Earth” connections – not just in your premises but also in the distribution network, neighbouring premises etc. The real reason for having a local Earth stake at both the main premises and any other out-building is to reduce the Earth impedance at high frequencies, by keeping the Earth wiring as short and straight as possible. This improves the ability for the Earth conductor to handle sudden high-current pulses such as may be induced by nearby lightning strikes. I have seen Earth stakes connected with a wire wound in a coil, like an old-fashioned telephone cord. That is a terrible idea because the wire forms an air-cored inductor which will cause that Earth connection to be nearly useless in the event of a lightning strike! While high-frequency, high-voltage pulses are not commonly induced into the electrical system, they do happen and having a distributed network of Earths, and local Earths, helps to conduct away the energy associated with these events. While there is really nothing that can safeguard any electrical equipment from a direct lightning strike, those living in a suburban environment are much less likely to be affected by this since there are usually 8 Silicon Chip Australia’s electronics magazine so many overhead power lines that lightning tends to strike outside the premises anyway. Over-voltage protection devices at the “switchboard” may help too but these can still be overwhelmed by the huge voltages and currents from a lightning strike. Peter Taylor, Box Hill, Vic. More on electrical safety and correct Earth wiring I wish to thank D. R. Haddock and Trevor Krause, both of Qld, for their informative responses to my letter, published in the August 2018 issue. These responses are on pages 10 and 12 of the September 2018 issue. Perhaps it was not 100% clear from my original letter that there are two different properties involved. I had no intention of purposefully touching the bared Neutral in my friend’s workshop/shed. I was satisfied that the Neutral to Earth potential was not at a dangerous level. It was definitely not anywhere near 230VAC; a few volts, perhaps. Maybe another Earth should have been utilised but the workshop appeared to have been wired in a professional manner. At a tertiary education campus where I worked as a Technical Officer in the 1970s, I once noted a higherthan-expected voltage on the Neutral wire relative to the Earth wire of the project I was working on. I called the licensed electrician for advice and he considered the voltage acceptable. But, Trevor’s response did make me wonder where the outgoing circuit Earth wires are terminated in my switchboard. I had only noticed the one directly connected to the bar, as shown in the photo. Upon further investigation, I can see that these Earth wires appear to be terminated in a bundle insulated by green/yellow electrical tape. There is a rather age-worn SEC (Victoria) approval label affixed to the hinged door. It includes a plan showing the underground cable’s path to the then-SEC in-ground supply pit. Unfortunately, none of the documents are dated or signed. All services in this estate are underground. Of the bundle, one of the heaviest gauge wires goes to the brass Neutral bar. One bonds the metal cabinet to the bundle. One presumably exits the cabinet (at siliconchip.com.au the top) and goes via the wall cavity to be attached to the Earth stake below the cabinet, after it exits the wall cavity via a weep hole. I am not sure about the others as I consider it inadvisable to trace the wires other than by visual means. I do wonder if the outgoing circuit Earth wires should have been connected to the unused brass bar and this bar bonded to the bar with the wire going to the Earth stake. Both bars have suitable unused terminals available fitted with two screws. It certainly would have made visual inspections easier. Perhaps the Earth stake wire should have been connected to the unused bar and the Neutral bar linked to the Earth bar as Trevor suggests. It seems sensible but the presently unused bar would require another bonded terminal with two screws. The one home building company built many of the houses in this estate so they could all be wired similarly. My house wiring does not appear to have been tampered with at the switchboard and certainly not since August 2003, when I took possession of the property. Having now seen that the Earth returns do exist, the wiring appears reasonably safe. I hope that the bundled Earth wires are properly connected by being twisted together and soldered. There does not appear to be any form of connector beneath the insulation tape. Uncertain about the safety of my meter box, I decided to check the integrity of the Earth stake. To check the Neutral potential, I needed a knowngood Earth reference, so I cleaned up the outside of the copper pipe from the water main to my water meter. It is buried in moist clay, to a depth of around 600-700mm. I connected a DMM set to measure millivolts between the Earth connection in my meter box and this Earth reference, and I also fitted a clamp meter around the Neutral connection to measure the total residence current, then I switched on a 1000W two bar radiator, the clothes dryer and a Vulcan Tangi room heater. With around 22A flowing, I measured 20mV potential between my main Neutral connection and the Earth reference point. I conclude therefore that the Earth connections are making good contact (despite the unorthodox connecsiliconchip.com.au tion method) and there is no dangerous voltage on the Neutral line of my property. While not directly related, this letter reminds me of the close call I had some time ago, in the early 1980s. I was working in a laboratory and connected a piece of equipment to a GPO via an extension lead that I had retrieved from a nearby storeroom. The equipment had been working when plugged directly into the GPO but it no longer worked after adding the extension cable. In those days, there was no mandatory test and tagging required, and no RCDs installed at the circuit breaker/ switchboard. We lived life in the fast lane. Eventually, I determined by close inspection that some “bright spark” had connected the plug end of the extension lead correctly but the socket end had Active connected to Earth, Neutral to Active and Earth to Neutral. It was a wonder I didn’t receive a nasty shock! All that had apparently saved me was the heavy-duty painted finish of the metal instrument case, my safety boots and the industrial vinyl floor surface. Not long after that incident, I found that Swann Electronics produced a plug-in device that showed if a lead/ GPO was terminated correctly using three neon lights. I purchased one and use it often. Unfortunately, the device does not indicate the quality of the wiring, just whether the connections have been made correctly. I have demonstrated that a test-and-tag “black box” would pass a flexible 10A extension lead if only one strand of the multi-stranded earth conductor was intact! Ray Smith, Hoppers Crossing, Vic. CDs sound better than vinyl It’s not very often when I have a “laugh out loud” moment reading an electronics magazine. However, reading David Barwick’s letter on page 15 of the July 2018 issue and the response by Silicon Chip had me in that very situation. Sadly though, it seems that the CDversus-vinyl debate is destined to continue for some time. Why do so many people suffer from the delusion that vinyl sounds better? I watched an interview with Elton John on an English chat shows and he was Australia’s electronics magazine Helping to put you in Control LogBox Connect 3G The LogBox 3G is an IoT device with integrated data logger and 3G / 2G connectivity. Free access to Novus Cloud for storage and access to data SKU: NOD-011 Price: $699.95 ea + GST LIDAR-Lite v3HP This is a compact, high-performance optical distance measurement sensor from Garmin. It is the ideal solution for drone, robot or unmanned vehicle applications. SKU: SFC-082 Price: $245.00 ea + GST Room CO2 Traffic Light Alarm Unit CDR-AL sensors and alarm units are designed to detect carbon dioxide concentration, temperature in the room spaces and provide alarm indication on high level of CO2 (green, amber and red LED). SKU: SXS-312 Price: $297.95 ea + GST Isolated Serial Converter The Yotta Control A-1521 is an isolated RS232 to RS232/422/485 serial converter. Features baudrate to 115.2kbps, 3000VDC isolation and 10-30VDC powered. SKU: YTC-201 Price: $99.95 ea + GST Isolated Analog Signal Converter Slim isolated signal converter with dual output converts a single, 4 to 20 mA analog input signal to dual 4 to 20 mA analog outputs. SKU: DBB-030 Price: $179.95 ea + GST U6 Data Acquisition OEM Card The -OEM variant does not include the screw terminals or enclosure. It has 14 Analogue Inputs. Expandable to 80 single ended or 40 differential with the Mux80 Card. SKU: LAJ-041O Price: $425.00 ea + GST Temperature Data Logger IP65 sealed temperature logger for monitoring temperatures of products during transportation. NFC wireless interface and Windows software for configuration, download and charting. SKU: NOD-052 Price: $59.95 ea + GST For Wholesale prices Contact Ocean Controls Ph: (03) 9708 2390 oceancontrols.com.au Prices are subjected to change without notice. October 2018  9 asked about the resurgence in vinyl sales. His response was: “It sounds better”. Come on Elton, really? As an incredibly talented composer, musician and vocalist, surely your ears tell you differently. James Carlon, Point Cook, Vic. Response: the added harmonics and background noise certainly can make vinyl records sound “warmer” but this is really just extra sound that’s being layered on top of the actual recording made by the musicians. If they wanted their recording to sound “warm” then they could add harmonics in the mixing or mastering processes and our digital playback systems would faithfully reproduce them. Simple solution for vehicles with varying alternator output The letter on page 4 of the September 2018 issue on vehicles having difficulty charging caravan batteries is spot on. I first came across this problem in our 1990s Honda Accord. It regularly scaled the battery charging voltage to suit a range of circumstances. I wasn’t surprised to find that our VW does the same thing. There is a simple and cheap solution and that is to use a pre-built boost DC/DC converter module (switchmode power supply). Use the vehicle’s 12V switched ignition line to power the coil of a relay which connects the boost converter’s input to the vehicle power supply when the ignition is on and set its output to an appropriate voltage to charge the caravan battery, eg, 13.8V DC. They usually have an internal diode which prevents the battery from being charged from discharging back into the vehicle battery but the relay should prevent this when the ignition is off, anyway. The relay’s real purpose is to prevent the vehicle battery from being flattened as the boost converter draws current to maintain the caravan battery. The best part is that a 15A boost converter costs less than $10 from AliExpress or eBay! They’re much cheaper than a voltage sensitive relay and more reliable too, given the varying DC voltages involved. We have a setup like this installed on our VW, so the car fridge is entirely independent of the vehicle battery. It does produce a fair bit of interference 10 Silicon Chip at around 120kHz but it doesn’t seem to interfere with FM reception. Gilbert Hughes, Weetangera, ACT. Other methods of taming mains voltage I see that from the correspondence that others are having trouble with high mains voltages, as am I. My hometown is 15km from the main grid and the mains is usually in the vicinity of 253VAC, sometimes higher. We also suffer from severe switching spikes. Over the years, I have lost several pieces of equipment (including a refrigerator and a grid-tied inverter), due, I believe, to the high voltage. I have been using Leo Simpson’s Mains Moderator (revised in March 2011; siliconchip.com.au/Article/937) for more than 20 years, and while it works well, it is difficult to find a suitable transformer with a rating above 3A, limiting its use to a single appliance. I think that if the sinewave peaks were clipped, the problem would be reduced. I have thought about using a Triac-based motor speed controller, but these do not necessarily reduce the peak voltages. I wonder whether it would be possible to “cut a slot” in the waveform, centred on the peak voltage, resulting in two pulses per half cycle with a lower peak and average voltage. At 253VAC, the peak is around 358V DC but at 230VAC, the peak is around 325V DC. So if the mains waveform to the appliance(s) were cut off once the instantaneous voltage exceeded 325V and switched back on when it fell below that figure, the mains voltage would be effectively lowered. This would require a gate cut-off device rather than a Triac but, with computer control, it should be achievable. All the standard suppressors such as MOVs, snubbers and filter networks would be desirable of course. This system would work on universal motors and resistive loads but may have frequency doubling effects on induction motors or other devices. David Tuck, Yallourn North, Vic. Response: while you are right that interrupting the mains waveform around the peak would reduce both the peak and average voltage, as you point out, certain types of equipment would not take kindly to receiving such Australia’s electronics magazine a waveform. The switching would introduce some nasty high-frequency harmonics. This scheme might actually cause equipment with switchmode power supplies to fail prematurely since it would effectively expose them to a high inrush current at 100Hz, each time the mains waveform was re-applied to the load. We think the old-fashioned method of a motor-driven Variac is a much more appropriate way of regulating the mains voltage to an acceptable level. 2.4kVA (10A) Variacs are not prohibitively expensive and could potentially power several loads (whatever you could plug into a single GPO). For example: https://au.rs-online.com/ web/p/products/8902783/ It should not be terribly difficult to come up with a method for attaching a servo or stepper motor to provide feedback for automated control. We will look into the viability of doing this in a future project. Very happy with Ultra-LD Mk.4 stereo amplifier I just finished building a complete stereo amplifier using your Ultra-LD Mk.4 modules (August-October 2015; siliconchip.com.au/Series/289). Wow, what a very special amp! I built my stereo Mk.4 into the lovely Altronics Ultra-LD Mk.3 case, with the preamp & input selector boards. I love the remote control features! I also used your Universal Speaker Protector Mk.3 (November 2015; siliconchip. com.au/Article/9398). I built a separate power supply PCB for each amplifier module. They share a bridge rectifier and a custom 500VA toroidal power transformer. This allows both modules to deliver 135W continuously. I got the custom power transformer from Tortech and it only just fits in the case. It has an earthed electrostatic shield as well as a copper magnetic shield, to minimise interference and noise. While I was moving the rectifier bridge, I swapped it out for a 50A unit from Rockby, which was the same size. There was just enough room in the centre of the case to mount the two power supply PCBs vertically, with the bottom sides facing each other and some “elephant hide” inbetween. Throughout the unit, I used highgrade electrolytic capacitors purchased from Digi-Key, along with the specified siliconchip.com.au thin film resistors (from Stackpole), low noise transistors and so on. Altronics supplied high-grade capacitors for the preamp and input selector boards too, which was pleasing. I fitted an extra pair of 3mm yellow LEDs on the amplifier front panel and wired these up to the clipping indicator outputs on the Mk.4 power amplifier boards. While building the amplifier, I had a bit of a mishap. A metal washer found its way between one of the big transistor legs and the heatsink on the righthand channel amp module, blowing all four Thermaltrak output transistors and some other components. Luckily, I had spares for most of these components and after replacing them all, it works fine. I was relieved to find that Jaycar stocks the output transistors, in case I manage to blow them again. Luckily, all the other semiconductors survived. It has taken more over a year to finish it but I’m pretty patient and it’s the best amplifier I have ever built, so it was worth the time and the cost. I still haven’t quite finished; I’m going to add fan cooling which switches on automatically if the heatsink gets above a specific temperature, using the circuitry built into the speaker protector. When I had the amp running last summer during those scorching 45°C days, it got very hot, even with its lid off, so extra cooling is required. I plan on using a 70mm low-noise fan. It won’t have a very high airflow but is quite quiet at 21dbA. I also want to add a pair of stereo line out dual RCA sockets adjacent the others on the rear of the case. I think that I could connect these outputs across the volume pot. I would solder a figure-8 shielded cable to the left and right volume control pot terminals under the preamp board, each with its own 100W series resistor and ferrite bead. I assume this could drive a load impedance of 22kW without any problems. I’d like to drive your 80-LED stereo bargraph using these outputs. By the way, I was looking at the circuit of the universal loudspeaker protector and noticed there is no backEMF protection diode for the main relay coil. I haven’t had any problems as a result of this, though. Neville Goddard, Blue Haven, NSW. Response: thanks for your letter. Your proposed method for adding line output sockets should work fine. It should drive a 22kW load without any problems. It should work well down to 10kW or possibly even a bit lower. The lack of a back-EMF protection diode on the Speaker Protector module was an accidental omission but driving transistor Q15 (BC556) has a -65V Vceo rating and the relay is a 24V DC coil type, so Q15 is unlikely to see a collector-emitter voltage in excess of Neville Goddard’s finished Ultra-LD Mk.4 Stereo Amplifier. 12 Silicon Chip Australia’s electronics magazine 48V from back-EMF, therefore, Q15 should not be damaged. Finding replacement conductive rubber buttons I am repairing a Kenwood TK-780 VHF FM commercial transceiver (programmed for Amateur radio frequencies) but one of its “conductive rubber” buttons has disintegrated and others are giving intermittent operation. Can anyone suggest a source for replacement buttons? They are approximately circular, a bit under 5mm in diameter and somewhat thin. I’m sorry that I can’t be more accurate than that but they are somewhat squishy and hard to measure. Also, it would be great if someone could point me to the programming manual for this type of transceiver. Dave Horsfall, dave<at>horsfall.org Gosford, NSW. Prizes offered for two electronic designs I have an idea for a couple of projects that I would find very helpful on a day-to-day basis but I’m afraid that they are beyond my capabilities to design. I sent an e-mail to Silicon Chip a few months ago with both suggestions but you rejected them as ideas for projects to publish in the magazine because you thought they were too specialised to have a broad appeal. But I would still like to build them and I saw that Jaycar gives prizes to people who come up with interesting electronics designs. That gave me an idea; perhaps a Silicon Chip reader would be interested in designing some electronics to my specifications in exchange for a cash prize. My first idea is for a card shuffler. I have looked at the commercial offerings and except for the machines used by casinos, which cost as much as a small car, they generally seem to be pretty unreliable and jam often. I think the easiest way to do it would be to build a machine which takes a stack of playing cards and then randomly pushes them, one at a time, into one of two piles on either side of the original pile. The two piles can then be stacked and then put back into the machine to be reshuffled. I think about five passes should be sufficient to shuffle one deck of cards, and seven passes to shuffle three. siliconchip.com.au I presume this could be done with some motors controlled by a micro but it is beyond my design capabilities. It may need some sort of vacuum air pressure system to help it move the cards. My second idea is for a “meeting manager” which consists of a number of small battery-powered boxes with wireless communication and some LEDs and buttons. The idea is that each person would have a box in front of them with coloured LEDs and I would have the master box. I could then control their LEDs to indicate whose turn it was to talk, when someone’s request to speak has been noted and so on. They could press down on their box (activating a button underneath) if they have something to say. They would need to contact me for the full details. If they can then come up with a design (including any necessary software) that entirely solves my problems, they will have earned that prize money. Keith Anderson, Kingston, Tas. Editor’s note: we cannot vouch for Mr Anderson but any readers interested in finding out more about his offer can contact him at keith.anderson.645<at> gmail.com Android-based projects wanted It would be good if you could create some projects utilising Android smartphones communicating with Arduinos via some form of wireless communication. While there are abundant resources for learning how to programs Arduinos, the Android component is still rare and quite complex at this moment. Thanks and keep up the good work. Chung Liauw, Ulverstone, Tas. Response: that is a good suggestion and one that we have investigated in the past. We passed the idea onto at least one contributor but nothing ever came of it. But we did publish a Circuit Notebook item in December 2016 (“WiFi Christmas light controller”) which describes how to interface an Android device or iPhone to an ESP8266 module via WiFi. Uses for obsolete phones and tablets As tablet computers move into their second and third generation, many old siliconchip.com.au tablets are discarded as people trade up, often due to poor (and non-replaceable) battery life in older tablets, requiring constant charging. I have just replaced my wife’s six-year-old tablet, for that reason. Often the processor, screen and drivers are still OK and the screens can be quite large, at 7, 8 or 10 inches diagonal. Would you consider developing an article suggesting ways to reuse old tablets, perhaps as a dumb terminal or semi-smart touch terminal, or simply as a screen for viewing, attached to another device providing the smarts? For example, a Raspberry Pi. Ken McCallum, Rankin Park, NSW. Response: you are right that older tablets and phones can still be useful and they can be mounted on the wall or a desk and powered from the mains via a charging cable. We will consider an article on this topic but we think that you could come up with many ideas simply by looking at what apps are available. For example, with Android tablets, you might consider: 1. a digital picture frame using a Google Photos slideshow; 2. reading books stored as PDF or EPUB files; 3. a video or music player using VLC, RocketPlayer, Clean Music etc; 4. displaying weather forecasts, weather radar or tide data via a web browser, the BOM weather app etc; 5. a news feed via a web browser, or a twitter feed etc; 6. a webcam using DroidCam or IP Webcam; 7. a fixed videophone using Skype, WeChat, Google Duo etc; 8. using it like an atlas, with Google Maps, Google Earth etc; 9. to control a Raspberry Pi or PC via Remote Desktop or VNC; 10. a Secure Shell (SSH) terminal using Termius, ConnectBot or JuiceSSH; 11. loading it with data sheet PDFs and keeping it on your workbench as a quick reference... etc That’s just off the top of our heads! NBN is NYP (not yet perfect) In the chaos of moving house, I picked up a May 2009 issue of Silicon Chip magazine and started reading it. I mistakenly thought it was the May 2018 issue and upon seeing the editoAustralia’s electronics magazine rial, thought that Leo must be filling in for Nicholas. The title of his editorial was “Highspeed broadband network (NBN) could be a white elephant”. It’s worth a re-read if you have time. How prophetic it turned out to be. His suggestion that the money may be better spent on a Very Fast Train between capital cities is worth a comment. With all the NBN speed issues it may well have been quicker to post a letter or document that used the VFT than sending it via the NBN! On settling into Townsville, we are starting to experience first hand the things we former Brisbanites thought the people in the north were whinging about. Despite what our state and federal politicians say about shopping around for a better power deal, the reality is we only have one provider here. I suspect that this may be the case elsewhere in Australia. When we buy petrol, do we get charged a pumping fee? No, these costs are factored into the price and most likely a percentage. So to get power bills down maybe the fixed supply charges should be dropped and made a percentage of use instead. This would be much fairer for lowincome earners and pensioners who often have bills where the fixed charges are far more than the cost of the energy they used. Finally, I really enjoy reading Silicon Chip magazine. It is truly on the way to being a national treasure. Neil Bruce, Townsville, Qld. Response: we’re just now transitioning to the NBN and while the performance of the network can be pretty good at times, it varies a lot and the transition experience leaves a lot to be desired. We thought that by now, the process would be quite streamlined but we were cut over essentially by surprise and had to scramble to get everything back up and running again. Electricity retailers would not want to get rid of service fees; while you are right that these fees could be rolled into the actual tariff, their most profitable customers are likely to be those who use very little electricity but still pay the service fees. The only way that’s likely to change is via government action and we would expect significant pushback from the retailers if that were mooted. SC October 2018  13 Reusable Rockets Rockets and spacecraft have always been either relatively cheap and disposable . . . or expensive and reusable, meaning that getting to space was out of the reach of all but the richest individuals. That is now changing with SpaceX, Virgin Galactic and Blue Origin leading the charge to develop safe, affordable reusable space vehicles. SpaceX, in particular, has had spectacular success of late. This article describes how they manage to get rockets to land all by themselves – a feat which, until recently, seemed almost impossible. by Dr David Maddison Artist’s concept of the Skylon spaceplane in orbit, with its cargo bay doors open. 14   14   S Silicon Chip Australia’selectronics electronicsmagazine magazine Australia’s siliconchip.com.au O ne of the biggest dreams in space flight is to make it as cheap and accessible to as many people as possible. However, that is only possible if the launch vehicles are reusable, like an airliner. Unfortunately, making a reusable launch vehicle is easier said than done; hence the fact that most space vehicles in use today are still expendable. The Space Shuttle is the most famous reusable space launch vehicle but as we describe below, it was actually more expensive to operate than expendable rockets! But that may have all changed recently, with SpaceX’s multiple successful vertical landings of rocket boosters. They have already reused some rockets more than once. For a video of a “second-hand” rocket launch, see: https://youtu. be/GS8CBmeZ0FY In this article, we look at past, current and future attempts to develop reusable launch vehicles, with particular emphasis on SpaceX. They are currently humanity’s best hope for making space travel affordable and practical. SpaceX SpaceX Falcon 9 SpaceX was founded in 2002 by Elon Musk, with the objectives of lowering the cost of delivering payloads to orbit (Musk believes that US$1100/kg is achievable) and enabling the colonisation of Mars. Musk subsequently co-founded Tesla, Inc – another high-profile manufacturing company. Despite being a relatively young company, SpaceX has achieved a number of “firsts”, such as: • the first private company to deliver a payload to orbit using a liquid fuelled rocket (2008), • the first landing of a commercial rocket under its own power (2015), • the first reuse of a rocket intended for orbital use (2017), • the first private company to launch a payload into orbit around the sun (2018). You may have seen the latter in the news; it was notable in that the payload was Elon Musk’s personal Tesla Roadster. Importantly, SpaceX has also flown 14 resupply missions to the International Space Station (ISS) – something which NASA is no longer capable of doing since the US Space Shuttle was The SpaceX Dragon spacecraft configured as a cargo carrier. siliconchip.com.au retired (more on that later). SpaceX produces both rockets (Falcon) and rocket engines (Merlin and Draco). The Merlin liquid fuel rocket engines are powered by liquid oxygen and kerosene and are the main engines on the Falcon rockets. The Draco engines use monomethyl hydrazine with nitrogen tetroxide as the oxidiser; they are primarily used as thrusters. SpaceX currently offers two launch vehicles, the Falcon 9 and the Falcon Heavy, as well as the Dragon spacecraft. The Falcon 9 is a two-stage rocket which is designed to deliver a payload to space either within a fairing or within the Dragon spacecraft itself. It can also carry humans into space. Payloads can be placed into low earth orbit (up to 22,800kg) or into geosynchronous transfer orbit (8,300kg), or a payload of 4,020kg can be sent to Mars. The vehicle is 70m high, has a diameter of 3.7m and when fuelled has a mass of just over 549 tonnes. Falcon 9 uses nine Merlin engines and a mission can be still completed if up to two engines fail during flight. The thrust developed by Stage 1 at sea level is 7,607kN (equivalent to five 747s at full power) and the first stage burn time is 162 seconds. Stage 2 uses one Merlin engine, optimised for use in the vacuum of space and it develops 934kN with a burn time of 397 seconds. The launch cost for a Falcon 9 with a maximum payload to low earth orbit is US$62 million, which works out to an economical US$2,719 per kilogram. Falcon Heavy The Falcon Heavy consists of a central core and two side-mounted boosters. It is basically a Falcon 9 with two Falcon 9 Stage 1 cores mounted at its sides. Standing 70m tall and 12.2m wide, it is currently the most pow- SpaceX Falcon Heavy The SpaceX Dragon spacecraft in crew-carrying configuration. Australia’s electronics magazine October 2018  15 Like something out of an old science fiction movie, the two side boosters from the Falcon Heavy landed almost simultaneously at Kennedy Space Center on February 6th, 2018. The central core was also supposed to land (on a drone ship at sea) but it did not have enough ignition fluid to re-ignite the motors for landing. This test flight launched Elon Musk’s personal Tesla Roadster into orbit around the sun. See videos: https://youtu.be/u0-pfzKbh2k and https://youtu.be/ A0FZIwabctw You can track its position at www.whereisroadster.com erful rocket in production in the world. It can lift 63,800kg into low earth orbit, 26,700kg into a geosynchronous transfer orbit, 16,800kg to Mars or 3,500kg to Pluto. Compare its lifting capability into low earth orbit to the retired Space Shuttle (24,000kg), Delta IV Heavy (22,560kg), Ariane 5ES (20,000kg) and the Atlas V 551 (18,510kg) and you will see that it is a monster. See a video of a Falcon Heavy launch at: https://youtu.be/BBA7su98v3Y The cost of a Falcon Heavy launch is US$90 million which for a 63,800kg payload into low earth orbit amounts to US$1,410 per kilogram. The Falcon Heavy was first launched on February 6th, 2018. While this is an amazing rocket, what is perhaps even more astounding is that its two booster rockets came back to Earth on their own, landing gently on their tails and they both went on to power other rockets! (See photo above.) But before we get onto the technology which allowed this incredible feat, we should mention Dragon – SpaceX’s spacecraft, designed to deliver payload and crew into orbit. It can be configured in three different ways: for carrying crew to the ISS, for carrying cargo to the ISS or as an orbiting lab, independent of the ISS. It can also be fitted with a non-pressurised “trunk” to hold extra equipment or cargo. By the way, the Draco thruster engines we mentioned earlier also form part of the launch escape system for the Dragon crew module; for this role, they are upgraded to SuperDraco configuration. The challenges of rocket reuse Readers would be aware of the fact that the now-retired US Space Shuttle was assisted in its launch by two solid rocket boosters, which fell away from the vehicle after they 16 Silicon Chip burned out, deployed parachutes and landed in the ocean. They were then picked up by ships, refurbished and reused for later launches. But liquid-fuelled rockets are preferred for most tasks because of their greater efficiency (higher specific impulse), lower fuel cost and simplicity of fabrication in the outer casing. Liquid-fuelled rockets are not suitable for recovery by the means described above. For a start, their complex engines will not take kindly to being immersed in salt water. You can’t always predict where a spacecraft using a parachute system will land; hence, they are typically brought back over the ocean. The water also cushions the impact. Trying to bring a rocket back safely onto land using parachutes would be much more difficult. Also, when a solid rocket burns out, it is little more than a (very strong) shell, whereas a liquid-fuelled rocket still has the heavy motor(s) attached and its structure exists mainly to support the fuel and oxidiser tanks and subsequent stages, so it may not survive such a re-entry. And due to the weight of the motor(s), even if it does survive re-entry, it will tend to land motor-first, which is not ideal. So that explains why SpaceX chose to use the rocket motor itself to perform a controlled re-entry. However, this is a much trickier task than merely deploying a parachute and requires some clever technology, as we shall see. The pitfalls of reusability Even if the technology to recover rockets is feasible (and clearly it is), that doesn’t necessarily mean it’s a good idea. Disposable rockets can potentially be cheaper, even though you have to build a new one for each launch. Rocket engines have to handle extreme pressures and Australia’s electronics magazine siliconchip.com.au temperatures and they can only withstand these conditions for a limited time before they wear out. In the case of a disposable rocket, the engine only has to survive one launch – typically around two and a half minutes of burn time. That means they can be made lighter and less expensively. In rockets, lightness is essential. The same is true of the rocket itself. A rocket which can survive the stress of re-entry and can then be relaunched is likely to be more expensive to build and heavier, too. And costs tend to go up exponentially with weight. Then there is the fact that a rocket which uses its engine(s) to assist in landing – as the Falcon boosters do – also need to carry extra fuel for this job. That adds to the weight, meaning they have to carry even more extra fuel so that they can bring that fuel with them! There is also the cost of refurbishing a rocket after it has been used once – checking it over to make sure it’s safe to launch again, cleaning, refuelling and so on. That can add up to a significant portion of the cost of a new rocket. So there are hurdles to be overcome before a reusable rocket makes sense. For an in-depth analysis of the pros and cons of launcher reuse, primarily focused on SpaceX’s technology, see: https://youtu.be/NY2ZVCA2Sno SpaceX’s reusable rocket technology As explained above, parachutes are not a practical way to recover a liquid-fuelled rocket. So it makes sense to use the motor itself to control the re-entry and cushion the impact. But this means the rocket needs extra fuel to complete recovery. A Falcon rocket carrying its maximum payload could not be recovered as it cannot carry that extra fuel. The payload capacity is reduced by around 30% if the boosters are to be recovered, to allow for the extra fuel needed for manoeuvering and landing. Carrying that extra fuel means that the launch is more expensive but this is offset by the savings from not having to build new boosters for the next launch. It isn’t just fuel either; on the Falcon 9, the landing legs alone weigh 2.1 tonnes. That’s 2.1 tonnes extra weight that must be carried until the second stage separates and 2.1 tonnes less payload capacity, just to allow the rocket to land. However, the high payload capability and high efficiency of the Falcon rockets means that they can still carry a significant payload to orbit while also retaining enough fuel for controlled landings. It is also necessary to have the ability to vary the engine thrust over a wide range, to allow for precisely controlled acceleration both to provide stabilisation upon re-entry and also cushioning for the touchdown. And the engines must be able to be restarted multiple times. This is not that easy to achieve; early rockets had difficulty restarting due to fuel and oxidiser moving around in the (almost-empty) tanks. Small thrusters are needed to orientate the rocket correctly and to provide a small acceleration to force the liquids into the lower end of the tanks (accomplished by gravity at launch) to keep the fuel pumps fed. Reliable, multi-use igniters are required to provide a controlled re-start; ignition has to be carefully sequenced with activation of the turbo-pumps which feed in fuel and oxidiser to prevent the engines from exploding. The engines must be carefully designed to avoid instability and possisiliconchip.com.au Reusable or Refurbishable? The ideal reusable launch system is much like a passenger aircraft, in that the only work required between flights is some basic maintenance and refuelling. No reusable launch system has achieved that yet but the situation has improved dramatically between the now-retired US Space Shuttle and the SpaceX Falcon 9. The Space Shuttle took 650,000 hours of labour to refurbish between flights – this figure increased after the Challenger accident in 1986, due to more rigorous NASA policies which involved thoroughly checking everything between every flight. Figures are hard to come by for SpaceX but it is thought that for the Falcon 9 Block 3 and 4 boosters require about 1000 to 10,000 labour hours to be refurbished, ready for reuse. You can see the “used” nature of some of the Falcon 9 boosters because they still have soot marks on them from their landing when the rocket is flying through its own exhaust plume. That suggests that the boosters are not entirely remanufactured, as was required for the Space Shuttle main engines. Falcon 9 rockets also need much less refurbishment and checking because they see less heat than the Shuttle did during re-entry and therefore they don’t have an extensive thermal protection system to check and maintain. SpaceX has a stated goal that the boosters should be able to be turned around between flights in 24-48 hours with inspections only, and the plan is to reuse Block 5 boosters ten times before major refurbishment is required. ble failure at lower thrust levels. Digital engine control can be used to avoid unstable thrust levels; it is tough to design a rocket engine that is efficient at 100% thrust while still being stable at much lower thrust levels but if there are particular combinations of conditions that lead to instability, the engine controller can be programmed to avoid those conditions. Attitude control After the successful separation of the second stage, the first stage is still on an upwards trajectory. A disposable rocket follows a parabolic path, re-entering the atmosphere (likely tumbling) and partially burning up before falling into the ocean or on an unoccupied area of land (launch sites are chosen to avoid burnt out rockets falling on people). So the first part of recovering a reusable rocket is to use thrusters to rotate and stabilise the rocket and to push the fuel to the bottom of the tanks. The main engine(s) are then restarted and run for a time to ensure that the rocket re-enters the atmosphere cleanly and that it is heading to the planned recovery location. For the Falcon rocket, this is the pad where it is to land. The engines are then shut off and the rocket allowed to continue under gravity’s influence until it is within the atmosphere. It must then be stabilised using the thrusters and/or controlled aerodynamic surfaces (fins/wings) when the engine is fired again, to slow it down. Stability is vital at this point, not just to prevent the rocket burning up but also because if the fuel is sloshing around in the tank(s) too much, the main engines may not be able to be restarted. Too much spin can cause the fuel to stick to the outside of the tanks, like a centrifuge; this was the reason for at least one failure to recover a Falcon 9 rocket. Australia’s electronics magazine October 2018  17 The SpaceX Dragon spaceship delivering 3175kg of cargo to the ISS on April 10th, 2016. On the same trip, it returned cargo to earth. While it is capable of carrying astronauts, it has not been used for that purpose yet. The final part of the descent requires careful computer control of the engine thrust and the various manoeuvring devices, to bring the rocket gently down onto its landing pad. Legs deploy just before landing, so it does not tip over when it touches down. Thrusters are not normally used during the final descent, partly because they would not have enough fuel but also because aerodynamic surfaces provide much more authority (ie, provide a wider range of control) once the rocket is within the lower part of the atmosphere, where the air is thicker. All this control requires numerous thrusters and control surfaces, motors and valves to drive them, a computer to control those motors and valves, accelerometer and gyroscopes for feedback and positioning feedback – either from an aerospace grade GPS receiver (or several), and/or from ground radar stations tracking the rocket(s) and relaying their position and velocity information via radio links. Position and velocity information for the final stages of landing is likely to come from a source very close to the landing pads to ensure the rockets slow down just before reaching the ground and then touch down in precisely the right spot. Augmented GPS could be used to provide accurate position data; see our article in the September 2018 issue (siliconchip.com.au/Article/11222) for more details on that. The software required to perform all these tasks, especially the final stages of landing, needs to be written very carefully and the control systems must all be well-characterised to prevent instability in the algorithms. Because of the possibility that the rockets may crash when attempting landing (which has happened a few times), SpaceX decided initially to land their rockets on a floating platform at sea. Once they had successfully landed a few 18 Silicon Chip rockets on that platform, they got government approval for bringing the rockets back to land-based pads. Rapid development SpaceX announced the reusable rocket program in 2011 and testing with purpose-built prototypes took place from 2012 through to 2014, with four landings over water. Six landing tests were carried out with Falcon 9 rockets in 2014 and 2015, with the first landing on a ground pad in December 2015. The first commercial SpaceX launch to successfully recover a booster was on April 8, 2016 and since then, there have been 20 successful booster recoveries. Of these, 14 have already been reused. The plan is to also recover the Falcon 9 Heavy core; however because it would be much further downrange than the boosters (which can return to their launch site) it could land at sea, on a drone ship. The fact that this program progressed from initial testing to full commercial use in just five years is quite astounding. Space programs have progressed quickly in the past; for example, the Apollo program which landed men on the moon took around eight years from President John F Kennedy’s famous exhortation to Congress (May 25, 1961), to Neil Armstrong’s equally famous “Tranquility base here: The Eagle has landed” on 20 July, 1969. But these days, major aerospace programs can take decades, even when they are using proven technology. This suggests that the move from government-managed space programs to private industry had resulted in muchimproved efficiency, as predicted by many proponents of the aerospace industry. For more details on SpaceX’s reusable rocket development program, see: https://en.wikipedia.org/wiki/ Australia’s electronics magazine siliconchip.com.au The Blue Origin “New Shepard” (named after Alan Shepard, the first US Astronaut in space), just after blast-off. It is a race between Jeff Bezos’ Blue Origin and Sir Richard Branson’s Virgin Galactic as to who will be the first to put tourists into space! SpaceX_reusable_launch_system_development_program The journey to Mars Elon Musk’s greatest vision for SpaceX is to establish a colony on Mars (and beyond). The proposed SpaceX Mars transportation infrastructure consists of reusable launch vehicles, passenger spacecraft, orbital refuelling tankers and the production of propellants on Mars for return journeys: methane and oxygen, to be made from atmospheric CO2 and underground ice. The goal is to have the first humans on Mars by 2024. This involves the BFR or Big Falcon Rocket, which is currently in development. The BFR is intended to replace the Falcon 9, the Falcon Heavy and the Dragon with a single vehicle that is suitable for insertion into Earth orbit, lunar orbit and interplanetary missions. They even want to use it for suborbital flights to allow Size comparison of various rocket systems, including several currently in use and some still in development. Note particularly the difference in size between the SpaceX Falcons, the Blue Origin New Glenn and the Saturn V, the latter of which sent men to the moon. The three-stage New Glenn will be the third-tallest rocket ever built after the Saturn V and the Soviet N1 (not Antares Soyuz Ariane pictured), at 99m tall 5 and 7m in diameter. siliconchip.com.au passengers to go from one place on Earth to any other in one hour or less. The BFR will be nine metres in diameter, 106m tall, with a total mass of 4400 tonnes. It will have a payload capacity to low Earth orbit of 150 tonnes, to Mars of 150 tonnes (with in-orbit refuelling) and a return payload from Mars of 50 tonnes. It will be powered by liquid methane and liquid oxygen and have two reusable stages. The second stage will have three configurations: cargo, passenger or tanker. Because the cargo version will have such a high payload, it will be used to deliver a large number of satellites at once to reduce costs. For Moon and Mars missions, the BFR would be refuelled in Earth orbit by the tanker version of the BFR, sent up on a separate flight. The following videos are relevant to the BFR: https://youtu.be/XcVpMJp9Th4 and https://youtu.be/0qo78R_yYFA Atlas V Vulcan Falcon V 9 Falcon Heavy Delta IV Heavy Australia’s electronics magazine New Glenn 2-stage New Glenn 3-stage New Glenn landed booster Saturn V October 2018  19 A history of reusable space vehicles Apart from early experimental rocket designs which were recovered and rebuilt by their designers, the first vehicle that could fly to the edge of space in suborbital flights (considered to be 80km for the purpose of qualifying as an astronaut) and was reusable was the North American Aviation X-15 rocket-powered hypersonic plane, which first flew in 1959 until its retirement in 1968. An X-15 spaceplane at the moment of launch from its B-52 mothership. The X-15 was designed as an experimental platform to investigate: spacecraft control in a near vacuum; the hypersonic flight regime (speeds above Mach 5); aircraft construction using advanced materials such as titanium, nickel steel alloys and ablative materials; the space environment; human factors; atmospheric re-entry and spacecraft systems. But the X-15 was suborbital and needed to be carried aloft by a B-52 bomber. It also had a short flight time and no real payload – just the pilot. However, the X-15 deserves its place in history as to this day it continues to hold the title for the fastest manned “aircraft” ever flown, at 7274km/h; (2021m/s), set in October 1967. The US Space Shuttle The first reusable system to reach orbital flight (and capable of carrying a payload) was NASA’s Space Shuttle which flew from 1981 to 2011. It was designed to be cheaper than expendable launch systems but it turned out to be far more expensive, primarily due to substantial costs for refurbishment between flights. It took around 25,000 people (costing US$1 billion per year) nine months to refurbish each Shuttle after a flight. Also, it was not completely reusable. The components reused were the two solid rocket boosters and the orbiter itself; the giant external fuel tank was jettisoned to burn up during re-entry over the ocean. The Space Shuttle program cost over its lifetime around US$210 billion (2010 dollars) for 135 flights or an average of over $1.5 billion per flight, although different costs are claimed according to the accounting methodology used. The original estimated cost for the Space Shuttle delivering a payload to orbit was US$54 per kilogram (about US$300 in today’s money). In 2011, the estimated actual cost per kilogram of payload delivered to orbit was about $18,000 per kilogram. It was also initially estimated to be capable of being launched every week but after the first flights, it soon became apparent that this was unrealistic and there was only one launch every three months on average for the entire fleet; individual orbiters took nine months to The Space Shuttle main engines were “reusable” – but had to be rebuilt after each flight at great expense. An expendable engine may have been much cheaper over the life of the program. 20 Silicon Chip An F-1 Rocket engine, one of five used on the first stage of the Saturn V used to send men to the moon. These could have been adapted to be used on the Space Shuttle, as an expendable alternative to the reusable main engines. refurbish, as mentioned above. Part of the reason it was so expensive was due to the cost of rebuilding for the main liquid fuel engines (attached to the orbiter) after each launch. The cost was so high that it would likely have been cheaper to build expendable engines for each launch. For example, the Saturn V main engines were proven technology before the first shuttle launch and could have been used instead. The total thrust developed by the three main engines and the two solid rocket boosters on the Shuttle was 28,900kN while the Saturn V F-1 engines developed 6,676kN, so the Shuttle could have been launched with four F-1 engines alone with no solid boosters. Note that the F-1 engines would have to have been modified for Shuttle operation since they were designed to operate for around two minutes, before the next stage took over, versus the Shuttle engines which had to operate for around 8.5 minutes until orbital insertion. Soviet Buran shuttle The Soviet Union also developed a competing reusable launch system from 1980, similar to the Space Shuttle. It was called the Buran but it made only one unmanned flight, in 1988 and then the program was effectively cancelled, with the collapse of the Soviet Union, in 1991. Australia’s electronics magazine siliconchip.com.au Aborted attempts Rockwell X-30 Apart from the Shuttle, there have been many other programs to develop reusable launch systems which have either been unsuccessful or cancelled for one reason or another. These include: • Sea Dragon, a sea-launched reusable booster which was the biggest rocket ever proposed and would have been able to carry 550 tonnes into low earth orbit. It would have used a single enormous motor with fuel fed by pressurised gas (1962; see video: https://youtu.be/6e5B7EKVg48) • Douglas DC-X, a single-stage-toorbit rocket which was part of the US Strategic Defense Initiative “Star Wars” program (1991-1996). • Sea Dragon Douglas DC-X • BAC MUSTARD or Multi-Unit Space Transport And Recovery Device (1964-1970); see video: https://vimeo.com/66870958 BAC MUSTARD • Lockheed Martin X-33 (1996-2001) – a one third scale prototype for the • Lockheed Martin VenturStar, a proposed single-stage-to-orbit (SSTO) replacement for the Space Shuttle Lockheed Martin X-33/ .VentureStar • • XCOR Lynx, which was to fly suborbitally with a pilot and single paying passenger or payload (2003-2017). XCOR Lynx • BAE HOTOL or Horizontal Take-Off and Landing (1982-1989) BAE HOTOL • Airbus Adeline, a reusable rocket first stage (2010-18) These unsuccessful or cancelled examples all contributed to scientific and engineering knowledge. But it is clear that a major problem with developing reusable launch systems is that they are significantly more complex and expensive to build initially than expendable launch systems and are not necessarily cheaper in the long run either. Shockingly, since the demise of the Shuttle, NASA has no ability to put astronauts in space and they contract rides at great expense on the Russian Soyuz spacecraft, to get crew to the International Space Station (ISS). In 2017, Russia charged the USA US$490 million for six seats on Soyuz. This deficiency will hopefully be solved by SpaceX and Boeing, who are both working on space capsules and associated launch systems. Unmanned tests for both are scheduled late this year (but more likely will happen in 2019). The two designs are quite different; the Boeing CST-100 capsule is more traditional with physical switches while the SpaceX capsule is more “Tesla style” with touchscreens. The Ansari X Prize In 1996, to stimulate development in reusable launch systems, a prize of US$10 million was offered by a private foundation for the first non-governmental organisation that could develop a reusable manned spacecraft, capable of being launched into space twice within two weeks. In 2004, the prize was renamed the Ansari X Prize in recognition of a major donation from an entrepreneur of that name. On 4th October 2004, the prize was awarded to the Tier One team led by Burt Rutan with funding from Microsoft’s Paul Allen, for their SpaceShipOne craft. The date corresponded to the launch anniversary of Sputnik 1 in 1957. Of course, the prize money was not the real incentive, as US$100 million had been invested in the technology to win the prize. Bezos’ Feather • Rockwell X-30, a single-stage-to-orbit passenger spaceplane that was intended to fly between Washington and Tokyo in 2 hours (1986-93) siliconchip.com.au In case you were wondering about the significance of the feather painted on all Blue Origin spacecraft, it’s “a symbol of flight with grace and power.” Australia’s electronics magazine October 2018  21 Current/future reusable spacecraft development Blue Origin Jeff Bezos, of Amazon fame, founded Blue Origin (www. blueorigin.com) in 2000. Blue Origin’s design philosophy is to incrementally improve systems (corporate motto “step by step, ferociously”) and not to move on to the next phase of design until the existing design is perfected. Engineers from the McDonnell Douglas DC-X project were hired to work on the New Shepard spacecraft, which incorporates ideas from that concept. New Shepard, named after Alan Shepard, the first American in space, is intended for space tourism use, with suborbital flights. The first passenger-carrying flight is expected late this year with paying passengers in 2019. It flies at an altitude in excess of 100km. New Shepard has a single booster which detaches from the crew capsule and returns to earth, landing vertically under rocket power with drag brakes to slow it down before the engine fires. The crew capsule continues to coast and then later descends via a parachute. The crew capsule (seen above) seats six and has large windows for viewing. Each flight gives a few minutes of weightlessness. The New Glenn, named after John Glenn, the first American to orbit the earth, is designed to deliver payloads into earth orbit and will be available in either two- or three-stage versions. The three-stage version will be the third-tallest rocket ever built. The two-stage version will be able to lift 45 tonnes to low earth orbit or 13 tonnes to geostationary transfer orbit. It uses the Blue Original developed BE-4 engine which is fuelled by liquid oxygen and liquid methane. Payload figures have not been released for the three-stage version. The New Glenn is not just “vapourware”; as of April 2018, it has seven satellite launches booked and the first launches are expected in 2020. See the video “Introducing New Glenn” at: https://youtu.be/ BTEhohh6eYk The New Armstrong is still being designed and few details have been released but the speculation is that this will take payloads to the moon. That would be consistent with their naming convention and Blue Origin have also published a picture of a lunar lander. You can view a video of the latest New Shepard launch, testing emergency capsule separation on July 18th, 2018. It includes highlights of previous tests and a single “passenger”, Mannequin Skywalker. See: https:// 22 Silicon Chip youtu.be/kgfTDkU0Z-g Another video at https://youtu.be/6ZJghIk7_VA shows the view (and sound) from the crew capsule during the launch. Another video of the same launch, called “Apogee 351,000 Feet”, is at: https:// youtu.be/h6_RvniifL8 You can also watch a space tourism promotional videos for Blue Origin at https://youtu.be/K9GoLD49sQ0 and https://youtu.be/YJhymiZjqc Boeing CST-100 Starliner The Boeing CST-100 Starliner is a reusable spacecraft rather than a launch system and is designed to take astronauts to the ISS and possibly other orbital missions. It is slightly larger than the Apollo command module and will carry up to seven astronauts or fewer astronauts and more cargo. It is designed to be reused up to ten times. It can be launched by various rockets such as the Atlas V, Delta IV, Falcon 9 and the Vulcan. It can endure missions of 60 hours of orbital flight and can remain docked for up to 210 days. The first crewed flight is expected to take place in mid-2019. Reaction Engines Skylon Australia’s electronics magazine siliconchip.com.au Skylon (www.reactionengines.co.uk) is a single-stage-to-orbit space plane which starts its journey with air-breathing liquid hydrogen engines in the lower atmosphere and then switches to liquid hydrogen and liquid oxygen when there is insufficient atmospheric oxygen. It is being designed to carry 17,000kg of payload to equatorial low earth orbit, 11,000kg to the ISS or 7300kg to geosynchronous transfer orbit. It is expected to have a two day turn around time between flights. Skylon was developed from HOTOL, mentioned earlier. ShipTwo has two pilots; the rocket motor uses a polyamide fuel (a nylon-like material) and nitrous oxide as the oxidiser. The total flight time will be around 2.5 hours but only a few minutes will be in space. It is a race between Sir Richard Branson’s Virgin Galactic or Jeff Bezos’ Blue Origin as to who will be the first to put tourists into space! The following video is of a test flight on 29th May 2018. The aircraft reached an altitude of nearly 35km and a speed of Mach 1.9. See: https://youtu.be/YQPyZB-cjO4 United Launch Alliance Vulcan A key feature of the Skylon is the SABRE or Synergetic Air-Breathing Rocket Engine which operates much like a conventional jet engine and ramjet up to an altitude of 26km and up to speeds of Mach 5.5, at which point the air intake closes and the engine acts like a rocket. Skylon has the potential to seat up to 30 passengers in a special module instead of cargo. The empty weight of the space plane is expected to be 53,500kg with a fully loaded weight of 325,000kg. SABRE engine testing is expected to start in 2020. However, no date has been provided for construction or testing of the space plane. See the video at: https://youtu.be/2m-oiO_ZwZI SpaceShipTwo SpaceShipTwo is a suborbital spaceplane manufactured by The Spaceship Company which is owned by Virgin Galactic (www.virgingalactic.com). It launches at an altitude of 15000m from a “mother ship” plane, White Knight Two. SpaceShipTwo will be used to carry six fee-paying passengers to suborbital altitudes (around 110km) at a cost of around US$250,000 per ride. Sir Richard Branson, founder of Virgin Galactic said on 29th May this year that they are only two or three flights away from sending passengers into space and he plans to be one of the first. Space- siliconchip.com.au The United Launch Alliance (www.ulalaunch.com) between Boeing Defense, Space & Security and Lockheed Martin Space Systems is intended to provide space launch services to the US Government. They currently use four expendable rockets: the Atlas V, Delta II, Delta IV and Delta IV Heavy. In 2014, they began developing a new launch system with several configuration options to replace both the Delta and Atlas launch systems; the Vulcan. The new first-stage booster will have two Blue Origin BE-4 2400kN thrust engines running on liquid methane and liquid oxygen, to replace the Russian RD-180 engines currently used on the Atlas V. This decision was made due to the perceived supply risks with Russia due to the Ukrainian crisis at the time, and the desire to use US-built engines. The first stage can also accommodate up to six additional strap-on solid rocket boosters to increase thrust (eg, for heavier payloads). The second stage will be the Centaur as used in the Atlas V but they are planning to develop a new second stage later, called the Advanced Cryogenic Evolved Stage. All the above is relatively conventional but the possibility of reusability has not been ignored. They plan to eventually recover the first-stage motors, which will separate from the fuel tank after they burn out. An inflatable heat shield will then be deployed for hypersonic re-entry, followed by a guided descent with a parafoil, to be captured in mid-air by a helicopter. The engines are 24% of the booster weight but 65% of the booster cost and these Blue Origin engines are reusable by design. One advantage of recovering the motors by this method is that fuel does not need to be kept for the landing process, as is the case with SpaceX and Blue Origin; therefore, a larger payload can be put into space. See videos: https://youtu.be/SqCTK7BmLHA and https:// youtu.be/lftGq6QVFFI SC Australia’s electronics magazine October 2018  23 DEAL OF THE MONTH! Build It Yourself Electronics Centre® October 99 49.50 $ Li-Ion Soldering Irons Protect Your Battery With ANBI® Switch 12W ANBI is an Australian designed battery isolator which prevents your battery from draining when not in use by isolating the negative terminal. Also a great anti-theft device! Ideal for cars, boats, caravans, even mowers! Installs in a few minutes. NOW OPEN! SAVE $30 Get started in electronics with this handy 20pc kit. 139 84.95 $ M 8198 SAVE 20% 90 minute run time 2500mAh - 540°C max. Ideal for occasional soldering jobs or light duty repairs and field servicing. Recharge by USB power adaptor in your car or at home - also recharges from a battery bank. Includes air compressor & ultra compact lithium jump starter! $ T 2690 59 $ High efficiency. Compact. Easy to use! T 2163 29 169 $ SAVE 24% 30 Inflate a tyre. Start a flat battery. $ A complete auto rescue kit for the car boot. Features a 16800mAh battery bank plus emergency compressor to top up tyres (max 8 mins run time). Provides 600A peak cranking output for cars with flat batteries. 12/16/19V & USB output provided for powering devices. SAVE $10 101 Pc Ratchet Driver Kit T 2186A A tool for every occasion! Features 95 security, philips, pozi and slotted bits made from tough S2 alloy. Includes two way ratchet handle with comfy rubber grip. See web for full contents list. A price breakthrough for accurate True RMS AC measurement! Packed with features for under $40. Includes carry bag and test leads. Q 1130B X 0432 NEW! 79.95 $ No more eye strain! This jumbo 5x loupe with LED lighting provides a crisp clear view of fine print, circuit boards, small parts etc. USB rechargeable. Includes carry case. 42 $ True RMS Autoranging Meter 39.95 NEW! N 2090 5 Dromana Ave. (opposite Officeworks & Westfield). SAVE $40 T 2417 NEW! AIRPORT WEST $ An excellent multi purpose soldering iron for service technicians, schools, engineers, R&D, production work etc. Japanese long life ceramic element. 150°-480°C. 0.8mm tip. 2 year warranty. $ NEW VIC STORE! A jam packed starter kit including soldering iron, multimeter, solder sucker, wire stripper, cutters, pliers and more! Ideal for beginners & enthusiasts. Micron® 60W Digital Soldering Station T 3133 NEW! Bare Conductive Paint Jar ® Paint real circuits on almost any surface! Great for repairs or experimenting. 50ml jar. A 3195 Boost Your Audio Output Handy mini DAC and headphone amplifier in one. With optical and coaxial inputs and 3.5mm/RCA outputs, its ideal for converting digital formats into analog signals. Supports PCM audio <at> 192KHz (24-bit). Powered by any USB charger (M 8861 $9.95). 11.95 $ NEW! $ T 2694 30W 45 minute run time 2500mAh - 600°C max. Kit includes 3 tips & carry case. The perfect iron for field techs or working with automotive cabling etc. Easy to stay recharged on the job recharge from flat in 3.5hrs. USB Power Accessories For Your Iroda Lithium Iron... 9 $ .95 D 2210 D 2203 Mini Phone Holder Universal design suits any phone under 85mm wide. Spring mount provides a strong grip on your device, whilst the clip holds onto your vehicle aircon vent. NEW! 9 $ .95 Stick almost anything to almost anything! Amazing reusable nano-gel sticky pads! Secure your phone to any surface. Residue free washable design. 2pcs per pack. See back page for store locations or visit: www.altronics.com.au/storelocations M 8861 USB Mains Charger 24.50 $ 17 $ .95 D 0505A 4000mAh Mobile Battery Bank. M 8623B USB Car Charger Sale pricing ends October 31st 2018. Do-It-All Multimeter Super-Tough DMM. Built like a tank! With in-built AC mains detection. This is one of the best DMMs we have evaluated when it comes to build quality and feature set. Its perfect for the serious electronics enthusiast, electrical tradesperson or service tech. 3.75 digit display features a LCD bargraph and helpful mode indicators. Includes carry case, temp probe, insulated test leads and 9V battery. 99 $ 169 $ This new multimeter is built tough with water and dust resistance, plus a impact resistant case for the rough and tumble of every day use in the field. Auto ranging design offers a feature list as long as your arm with a clear large digit backlit display. Includes carry case & test leads. See web for full spec list. SAVE $26 149 $ Q 1068 T 2444A SAVE $66 away those soldering fumes! SAVE Whisk #1 choice for schools! This 60W soldering station has a powerful in-built $50 fume exhaust fan which sucks away the smoke when soldering. The active filter helps to reduce airborne pollutants in your workshop. Durable metal construction. Q 1069 100MHz Dual Channel Digital Storage Oscilloscope Get a close up view with a desktop microscope Perfect for those in R&D, product development or servicing. 2 channels with real-time 1GSa/s sampling. Colour 7” TFT screen simultaneously displays waveform plus the measured wave voltage, peak to peak plus RMS, frequency, duty cycle etc. Realtime adjustments can be made using included PC software. Stored data can be saved to a USB stick. SAVE $180! 20 only at this price. 2 year warranty. 719 This high resolution 12 megapixel 200x USB micrscope allows close up inspection of just about anything! USB PC interface, plus HDMI output for monitor connection. 220x magnification with 10-50mm focal length. In-built 2.4” LCD. $ Q 0203A 230 $ SAVE $59 X 4306 TOP WORKBENCH DEALS FOR DIAgNOSIS & REPAIR. 139 $ Q 2120 40 $ Q 1289 SAVE $90 SAVE $60 109 49 $ Battery Health Analyser Detects and analyses voltage, cold cranking amperes, resistance and cell condition in 12V lead acid cells. Easy connection and on screen menu driven operation. Ideal for vehicle servicing or checking 12V SLA cells in battery backup systems. Measures cable length, traces cable location, finds cable breakages & provides PoE/ping testing. Provides a suite of test functions for comms/CCTV installers with easy on-screen adjustments. It even logs readings to Micro SD card (16GB D 0328 $13.95). Q 1250 Compact Wind Speed Tester A compact thermometer & anemometer with max speed of 108km/h. Great for ventilation monitoring, experiments etc. Includes battery. Easy data cable testing. Digital Vernier Calipers $ SAVE $20 Twin laser beams for precise measurement between -50°C and 1050°C with 30:1 optical resolution. Adjustable emmisivity to cater for different surfaces. It even connects to an external probe. 2% accuracy. 315 Fixed 13.8V 20A Bench Power Supply 150 $ A fixed voltage output power supply designed for powering automotive, marine and comms equipment. Low noise and ripple design (<100mV) offers excellent efficiency and performance. SAVE $35 NEW! Q 1346 D 3009 49.95 $ PoE Network Tester SAVE $34 T 2247A Precision measuring with ease! 150mm length, suitable for measuring internal, external and depth dimensions. 0.01mm, 0.0005” and 1/128th” display. Measure temperature without touching. $ SAVE 27% Test live ethernet cabling for data and power. Works with any 802.3af/at ports/cabling. Ideal for data/comms installers. Shop online 24/7 <at> www.altronics.com.au M 8254 Network Cable Tracer A must have for IT technicians! Combines a cable tracer & tester in one unit. Injects an audible signal down the line, making it easy to find specific lead. Requires 3 x AA and 1 x 9V batteries. 89 $ Q 1341 1300 797 007 SAVE $20 POWER SAVERS... PROTECT YOUR HOME OR BUSINESS. Why settle for just HD? This system features 2K detail and clarity. SAVE $119 SAVE $300 599 Affordable 4 Megapixel CCTV Surveillance System. S 9900G 4 Domes Simple to install with instructions supplied. Cameras can be remote viewed on iOS/Android. Each pack includes: • HD digital video recorder • Pro grade 4MP resolution weatherproof cameras • 20m connection leads • Power supply • HARD DRIVES TO SUIT: 1TB $119 (D 5514), 2TB $189 (D 5516). SAVE $220 899 Vari-Focal 1080p/960H Camera .95 S 9006 NEW! 69 .95 $ 360+ Home Monitoring Wi-Fi Cameras This new pair of cameras are ideal for remote monitoring around your home or business. Streaming directly to the cloud you can view live streams anywhere in the world. S 9006 is a low cost 720p model, ideal for baby/pet monitoring. S 9007 is 1080p with pan/tilt and 2 way audio (and object tracking). Battery Free Kinetic Door Bell A 0326 NEW! SAVE $60 SB9123F Remote Motion Activated Camera Records 720p video or 8MP still shot photos to internal SD card when motion is detected. Runs off batteries, so its quick & easy to set up anywhere you need to keep an eye on things. Weatherproof case with LCD screen. Requires 8xAA S 4955B 4pk, $3.95 & DA0322 16GB SD card $16.95. 159 S 9444 M 8536 12V 10A 10 Stage M 8194 HALF PRICE! 64.50 A must have for any road trip! Starts most 4 & 6 cylinder cars from dead flat. • 300 cranking amps • Fits in your glovebox • High power LED flood light • USB phone charging • Suits 12V vehicles only. • Includes carry case, battery clips, mains charger & USB lead. $ SAVE $20 63 43 $ $ X 2381 20 LED 39 30 $ $ N 0704 X 2380 8 LED Dusk or motion activated Solar powered with in-built rechargeable batteries. These stylish motion activated LED lights are fantastic for lighting up outdoor areas such as entryways, paths etc. Three operating modes - see web for full details. SAVE $40 $ 89 $ SAVE 20% Instant Outdoor Lights. No Electrician Required. 34.95 your battery is maintained in tip-top condition whenever you need it. Helps to extend battery service life. Suitable for permanent connection. Great for caravans & seldom used vehicles. USB Car Jumpstarter & 2-in-1 Floodlight A high performance 1080p AHD camera with adjustable focal length (3-12mm). Switchable between 1080p and 960H modes depending on DVR capability. X 2382 54 LED $ 99 $195 $ Each model utilises a microprocessor to ensure M 8534 6/12V 4.5A 7 Stage S 9941 99 Never have to change the batteries on your door bell again! Kinetic action of the button press powers the signal to a wireless chime unit inside your home. 25 ring tones. 100m range. BIG & BEEFY 3000W SURGE RATING! Delivers pure sine wave AC power to difficult loads, such as laptops & game consoles. 12V input, 1000W continuous rated. 274 x 131 x 83mm. Multi-Stage Weatherproof Vehicle Battery Chargers $ NEW! Get Pure AC Mains Power In Your Car Nothing else to buy! Pre-installed with 1TB hard drive. S 9007 $ S 9901G 4 Bullets 440 $ SAVE 22% 4 Channel Wireless CCTV System Add security to your home or business with our high resolution 4 megapixel (1080p) CCTV pack. Wireless cameras cut down installation time and effort! Pack includes power supplies for each camera, a network video recorder (expands to 9 channels!) and four compact bullet cameras. M 8017A 12V M 8018A 24V $ Wireless Shop Door Alert 5W Solar Charger Module Produces up to 400mA charge current. Ideal for maintaining a 12V lead acid battery. 465W x 320H. 33 $ A handy motion activated chime unit for shops to notify staff when customers arrive. 120m range. Requires 3xAAA batteries (S 4949B 4pk $3.95) & 3xC batteries (S 4960B 4pk SAVE 22% $7.90). 5 Way Intelligent USB Charger ‘Charge IQ’ feature charges a connected device at the fastest speed. 7.8A max current. 110-240V - great for travel. Includes mains lead. 73x73x34mm. SAVE 30% 35 $ M 8880 S 5322 Shop online 24/7 <at> www.altronics.com.au OPEN UP A WORLD OF ELECTRONICS LEARNINg WITH BBC MICRO:BIT! 84.95 $ K 5157 NEW KIT! 26 $ 18.95 $ Z 6462 Z 6460 4 Relay Control Board Breakout T-Adaptor Shield Features 4 x 3A 120V AC/24V DC rated relays for building in device control, and trigger other systems in your design. Allows you to breakout all pins on the BBC micro:bit and plug it directly into a breadboard for designing. Z 6440 .95 31 16.95 $ BBC micro:bit GO Kit The BBC micro:bit is a pocket sized codeable computer with motion detection, compass, LED display and Bluetooth on board. Designed to be fun and easy to use for students in coding class rooms. It even connects to Arduino and Raspberry Pi! Includes USB lead and battery pack. Z 6466 Simple Breakout Motor Drive Breakout Board Features two motor channels capable of 1.2A continuous load. Breaks out all micro:bit pins, plus a handy serial comms header for connection to bluetooth module. Plug in your micro:bit & breakout every pin to a standard header. 21.95 20.95 (SC Mar ‘18) Smooth triac speed control for appliances rated up to 10A. Suits brush-type universal motors such as those in lathes, electric drills, circular saws, routers, nibblers & jigsaws. K 9810 13.95 Z 6463 Sensor Connection Shield Power Breakout Board Breakous all digital and analog interfaces plus adds I2C serial port and SPI comms interfaces. Breaks out all the micro:bit pins, plus provides power via 2 x AA batteries. Includes short power lead adaptor. 23.50 Z 6461 170 tie Features an adhesive breadboard, plus matching solder masked PCB holes underneath for when you want to solder down your design. All micro:bit pins broken out to headers. Super Smooth Motor Speed Controller Kit Z 6464 $ Breadboard Shield NEW KIT! K 6037 NEW KIT! 19.95 $ $ 69.95 23.95 $ 23.95 H 0536 $25.95. $ Z 6469 Z 6468 310 tie $ (SC Jan-May ‘17) This completely new amp design incorporates most of the features of Silicon Chip Ultra-LD Mk4 200W amp but uses easy-to-solder through-hole components no SMD! 200W into 4Ω load. Heatsink for illustration purposes, $ .95 $ ‘SC200’ 200W Amplifier Module Kit Joystick Control Pad Shield $ ‘Choppy’ PWM Control Kit (DIYODE Mar ‘18) A simple kit providing PWM output for 12V systems up to 5A. Great for motor speed control, light dimming adjustment and other level control applications. Z 6465 Turn your micro:bit into a handheld game pad or use it as a controller for other projects. Build It Yourself Electronics Centres MAKER BITS ‘N’ PIECES... VIC » Springvale: 891 Princes Hwy 03 9549 2188 » Airport West: 5 Dromana Ave NEW! 03 9549 2121 NEW! NSW » Auburn: 15 Short St 29.50 $ Z 6467 59 .95 $ Ethernet IoT Arduino Development Board Connect your Arduino design to the internet-of-things with this handy W5500 ethernet board with atmega328p on board. Fully compatible with UNO with integrated USB download & micro SD card slot. Mini OLED Display NEW! Z 6525 Z 6425 44.95 $ Raspberry Pi POE Hat Monochrome 128x64 0.96” module with very low power consumption. I2C interface. 3.3-5V input. Allows you to power the Raspberry Pi 3 Model B+ over ethernet. Great for remote IoT applications or any project where getting power to the location is difficult. SAVE 25% SAVE 20% 69.95 $ » Virginia: 1870 Sandgate Rd » Perth: 174 Roe St » Balcatta: 7/58 Erindale Rd » Cannington: 5/1326 Albany Hwy » Midland: 1/212 Gt Eastern Hwy » Myaree: 5A/116 N Lake Rd www.altronics.com.au/resellers 26 Please Note: Resellers have to pay the cost of freight & insurance. Therefore the range of stocked products & prices charged by individual resellers may vary from our catalogue. MP3 Audio Arduino Shield 29 2.8” Touchscreen Shield A 240x320px touchscreen shield for Arduino utilising the ILI9325 chipset. 3.3V input. With on-board MicroSD slot for media playback. 3.5mm mic input and output sockets. 5V input. 3 Axis Digital Compass Converts magnetic field to a differential voltage for heading information. 3-5V input. 08 9428 2188 08 9428 2167 08 9428 2168 08 9428 2169 08 9428 2170 Or find a local reseller at: $ $ 07 3441 2810 WA Z 6332 Z 6335A Z 6510 02 8748 5388 QLD Z 6391 SAVE 33% 10 $ NEW! U-Blox Neo-6M GPS Shield With SD Slot Add GPS positioning to a Arduino project. 3.3/5V logic level. Includes 28dB active antenna. 3.3/5V input, standard shield dimensions/pin outs. Sale Ends October 31st 2018 Phone: 1300 797 007 Fax: 1300 789 777 Mail Orders: mailorder<at>altronics.com.au B 0091 © Altronics 2018. E&OE. Prices stated herein are only valid until date shown or until stocks run out. Prices include GST and exclude freight and insurance. See latest catalogue for freight rates. Accuracy better than 100 parts per BILLION! Lab Quality Programmable GPS-synched FREQUENCY REFERENCE ... ... ... Part 1 – by Tim Blythman Whether in design, service & repair, calibration or any other critical task in electronics there are times when a really accurate and stable frequency reference is needed. The chances are, whatever frequency you require, this Micromite BackPack-based project can provide it. Exactly! O ur new GPS-based Frequency Reference provides three high accuracy, customisable outputs which are set up using a touchscreen and synchronised to the 1PPS signal from a GPS module. Two of these can be set to a wide range of frequencies over the range of about 1-100MHz. The onboard temperature-compensated oscillator is within a temperature-controlled oven for maximum stability. Not only is its GPS-synchronised oscillator very stable but you can choose from a huge range of possible output frequencies – in fact, it has three separate outputs, so you can even produce more than one signal at a time. It’s especially useful in combination with frequency counters, oscilloscopes and spectrum analysers with external reference inputs, especially if their inbuilt oscillator is not terribly accurate. For example, many devices need a 10MHz reference and this unit can produce that exact frequency. But it’s also quite common to see test equipment needing some oddball frequencies, so you can set up one of the outputs to cater to those too. We’ve gone to quite some length to make this design not only very accurate and flexible but also com28 Silicon Chip pact, easy to build, easy to use and relatively inexpensive. And we have also addressed most of the criticism levelled at our previous design, mainly to do with its ability to reject jitter from the satellite signals. We satisfied the compactness and ease of construction requirements by making this unit considerably simpler than our previous design (March-May 2007 & September 2011; siliconchip.com.au/Series/57). This is possible because we are using a substantially more powerful micro (a PIC32) so we’ve been able to replace a substantial portion of the hardware with software routines. So this unit is not only better than the earlier models, it’s cheaper! Since this project is based on the Micromite LCD BackPack V2 (May 2017; siliconchip.com.au/Article/10652), the touchscreen eliminates the need for all the extra display and button sensing circuitry and the need for many cutouts in the front panel. Australia’s electronics magazine siliconchip.com.au We can supply a kit to build the BackPack module; see the parts list for details. The simplification of the circuitry has also meant that we can fit the extra circuitry on a much smaller board. In fact, it’s now a similar size to the BackPack and simply stacks behind it, so the whole lot will easily fit into a small UB3 Jiffy box. And the touchscreen means we can make the user interface much easier to understand and simpler to use, with a lot of extra features. But it’s the triple PLL IC which provides the pièce de résistance, that is, the three configurable outputs. One of the outputs is limited to a small range of frequencies (including that all-important 10MHz option) but for the other two, you can type in just about any frequency and chances are, it will produce that exact frequency, or something very close. And if it isn’t exact, it will tell you the difference. Excellent long-term precision The jitter reduction mentioned earlier is possible because we are no longer using a phase-locked-loop (PLL) IC to lock the voltage controlled oscillator (VCO) onto the GPS 1PPS signals. A PLL will adjust the VCO frequency immediately upon detection of a phase difference but that could just be due to jitter. Instead, we’re using a software algorithm which averages the VCO frequency over a range of time periods and makes small, calculated adjustments to the frequency. We’ll have more on that algorithm in the next article in this series. Also, for it to be as effective as possible, we need an extremely stable oscillator. This has been achieved by putting a temperature-compensated oscillator in a temperature-controlled oven, along with a very stable reference regulator which is used to derive the VCO’s control input voltage, Features & Specifications • Main 40MHz oscillator is disciplined from GPS signals • Accuracy of around ±100ppb after 30 minutes • Three BNC outputs with programmable frequencies: ~ 1-100MHz • Main oscillator is temperature compensated and oven regulated • MicroMite BackPack-based 320 x 240 pixel LCD touchscreen for configuration and status • Compact unit, 160 x 68 x 44mm overall (in UB3 Jiffy box) • Powered from 5V USB supply <at> 400mA (500mA at start-up) • Optional disciplined 1PPS output • Works with a wide range of GPS units, with external or internal antenna • Low parts count • Modest parts cost • Most parts are easy-to-solder SMDs along with a DAC that can produce very small voltage steps. The end result is that with a satellite-derived 1PPS signal with sufficient long-term accuracy, we can trim the VCO’s output so that its error is measured not just in parts-permillion . . . but in parts-per-billion! Since the new unit is simpler, we’ve also managed to make it use much less power. Rather than needing a 12V supply, it runs off 5V instead. That simplifies the power supply and the unit simply runs from any USB (5V) power source such as a phone charger or even directly from a computer. Principle of operation The block diagram, Fig.1, shows the basic principle of the Fig.1: block diagram of the Programmable GPS-Synched Frequency Reference. The VCO is located in the oven section, with transistor Q1 and a DS18B20 thermometer used to maintain it at a fixed temperature. This feeds the PLL, which then routes the signal to the Micromite and to the three outputs. The Micromite chip can then send commands to DAC IC1 to shift the VCO frequency via buffer IC3, to discipline the 40MHz VCO frequency using 1Hz pulses from the GPS module. siliconchip.com.au Australia’s electronics magazine October 2018  29 Frequency Reference. The oven section is shown at upper left, and inside it, there is a voltage-controlled oscillator (VCO1), a DS18B20 temperature sensor and transistor Q1. The Micromite controls the output voltage of the DAC (digital-to-analog converter – IC6) using an SPI (serial pe- 30 Silicon Chip ripheral interface) bus. This voltage affects the dissipation in transistor Q1 and it heats up the components inside the oven, including the digital temperature sensor. The temperature reading is fed back to the Micromite over a Dallas 1-wire serial bus and this information is used to Australia’s electronics magazine siliconchip.com.au adjust the voltage fed to Q1, regulating the oven temperature. A second SPI DAC, IC1, produces a voltage which is buffered by IC3 and then fed to the VCO, to shift its output frequency slightly, over the range of 39,999,800-40,000,200Hz. The initial tolerance of the VCO is ±2ppm which equates to ±80Hz, with a drift of up to ±1ppm (±40Hz) per year, and some small additional variation with temperature or supply voltage changes. By shifting the VCO frequency, we can compensate for these errors, getting its output very close to exactly 40,000,000Hz. Once the oven reaches the target temperature, it varies over a range of less than 1ºC, improving the stability of the VCO into the parts-per-billion range. The trimmed frequency from the VCO is fed to a multi-PLL chip, IC2, and from there back to a high-frequency counter within the Micromite. The Micromite can then count the number of pulses received between each 1pps pulse from the GPS module to determine whether the VCO’s frequency is spot on. If it is not, the Micromite adjusts the drive to the VCO to bring it back in line with the GPS pulses. Note that it can also average its readings over a longer period to reduce the influence of jitter in the GPS 1pps pulses on the output of the VCO. The 40MHz frequency from the VCO is also fed to three programmable PLLs within IC2 which can be configured to produce a wide range of different frequencies. The outputs of the three PLLs are then buffered by IC4 and IC5, to provide a low impedance for BNC-socket output connectors CON2-CON4. If LK2 is fitted instead of LK1, CON2 will instead be fed with a disciplined (ie, more accurate) 1pps signal from the Micromite instead of the third PLL output. Circuit description Fig.2: complete circuit diagram for the Frequency Reference, showing the Micromite BackPack as a “black box” (the May 2017 article has the details). The 40MHz signal from VCO1 is fed to PLL IC2 which then produces the three programmable frequency output signals fed to CON2-CON4 as well as the signal fed back to RX/T1CK on the BackPack. This is divided down and compared to the 1PPS signal from the GPS module at pin 21 and the difference is used to change the voltage at the outputs of dual DAC IC1, which are combined and buffered by IC3 and then fed to the VCO’s control input. siliconchip.com.au Turning now to the full circuit diagram, Fig.2, you can see that there is a little more to it than described above. While oscillator VCO1 (TXEAACSANF-40) is in the oven, we have decided to use a temperature-compensated oscillator, for extra stability. IC1, the DAC controlling the VCO frequency, is an MCP4922 dual 12-bit type. We need fine control over the voltage fed to the VCO, so we can shift its frequency by very small amounts. Rather than use an expensive 24-bit DAC, we are instead averaging the two outputs of the dual 12-bit DAC using different resistor values, so that the pin 10 output gives fine control and the pin 14 output adjusts the frequency in larger steps. With this arrangement, we can vary the frequency of the VCO over its full range, in steps of around 60ppb. So that the VCO output is stable, the control voltage also must be very stable, so both the averaging resistors and the 2.5V reference for the DAC (REG2) are inside the oven, indicated by the shaded area on the circuit diagram. The combined DAC output is fed to an LMV641 op-amp (IC3) so that the VCO’s control input doesn’t load up the averaging resistors and cause the voltage to shift, and so that the VCO control input is driven from a low-impedance source to ensure it operates correctly. This is a high-precision, low noise, low power op amp. A 22pF capacitor at its input reduces unwanted noise. While IC3 has no gain, there is a 2kΩ resistor in its feedback path, so that the impedance seen by both inputs (pins 2 and 3) is the same. This is important since mismatched input impedances cause increased thermal drift in op amps and that is something we definitely do not want. DAC IC1’s reference inputs (pin 11 and 13) are fed with Australia’s electronics magazine October 2018  31 The Main Page provides buttons to access all the features of the Frequency Reference, as well as displaying the current state of the three outputs. The settings are organised into three main groups: Presets, Temperature (for tuning the oven’s operation) and VCO Trim (for manual adjustment of the VCO). The Presets page allows frequency settings to be copied and pasted. All the presets are saved to non-volatile storage, so are preserved during power cycles. 2.5V from REG2, a MAX6166A precision regulator with 5ppm/°C temperature coefficient. Since its temperature variation is within 1°C and that the VCO “pulling range” is ±5ppm, that means the influence of variations in REG2’s output should be no more than (2 x 5ppm) x 5ppm x 1°C which is a fraction of a part per billion. Also, REG2 is fed from a 2.7V regulated rail provided by REG1, itself a very stable 2.7V low-dropout (LDO) regulator, so its line regulation should be excellent. It should be apparent that we have gone to a lot of effort to ensure that the VCO’s output is extremely stable and only shifts when the micro wants it to! NPN transistor Q1, which provides heat for the oven, is connected directly across the 3.3V supply and so its dissipation is directly proportional to collector current, which in turn is related to its base current. The base current is determined by the voltage at output pin 10 of IC6, another MCP4922 dual SPI DAC, which uses a 2.7V reference from REG2, to avoid loading up REG1 unnecessarily. Q1’s 2.7kΩ base current-limiting resistor was chosen to keep the maximum dissipation in Q1 to a safe level. The Micromite sets the DAC output to control the temperature as measured by TS1, forming a closed control loop. The second DAC in IC6 is not needed for any function related to the oven so its output at pin 14 is connected to LED1 to vary its brightness as well as CON7, which is used for diagnostic purposes. The DS18B20 oven temperature sensor (TS1) sends its data to the Micromite pin 16 and its output is fitted with a 4.7kΩ pull-up resistor, as required for the Dallas 1-wire protocol. Phase-locked loop IC pins 12 (Y1) and 15 (Y2) are terminated to ground with 510Ω resistors, while the other four outputs are fed to their destinations via 510 /1.1kΩ dividers. Unfortunately, the CDCE906 data sheet was not specific about the output loading requirements and we found these resistor values necessary to provide reliable operation. The dividers only reduce the output signal swing by about 33% and since the chip runs off a 3.3V supply, that still gives a useful swing of around 2.2V peak-to-peak. Output Y4 is fed back to the RX pin (pin 12) on the Micromite via jumper LK1 as this is the only pin which can measure frequencies this high (as described below). Since this prevents the serial console from operating, LK1 has been provided; simply remove the jumper to access the serial console and re-insert it to allow normal operation. The other three remaining outputs at pins 16, 19 and 20 (outputs Y3-Y5) are fed to paralleled pairs of gates in hex inverter chips IC4 and IC5. These are 74ALVC14 devices, which are a modern equivalent to the 74HC14 hex schmitt trigger inverter. The difference is that these chips can operate at lower voltages (1.653.6V) and much higher frequencies (up to about 100MHz). They can also source or sink up to 50mA per output. So each pair can supply up to 100mA and they feed the outputs via 39Ω impedance-matching/currentlimiting resistors. A dedicated pair of inverters (IC5e/f) is also provided to buffer the disciplined 1pps output from pin 22 of the Micromite. Four of the twelve inverter stages are unused (IC4a/b/e/f), so their in- 32 Silicon Chip The PLL, IC2, is what allows us to have three customisable frequency outputs which are not simply integral fractions of the VCO’s 40MHz frequency. It is a Texas Instruments CDCE906 triple-PLL clock synthesiser IC, the only chip that is in a TSSOP (finepitch) SMD package as it is not available in a larger package. It has six programmable outputs but since it only has three internal PLLs, some settings are shared between them (we are using four of the six). It is controlled over an I2C bus at pins 9 and 10, which are connected to pins 17 & 18 of the Micromite and 4.7kΩ pullup resistors are fitted, as required by the I2C standard. If you are not familiar with PLLs, briefly, they consist of a voltage-controlled oscillator followed by a programmable divider. A phase comparator compares the frequency and phase of the divided output to the input frequency and provides negative feedback, to adjust the oscillator frequency until the output of the divider matches the input, thus providing a fixed ratio between the input and output frequencies. The 40MHz signal from VCO1 is fed into the three PLLs within IC2, via a 51Ω resistor, to provide IC2 with the expected 50Ω source impedance. Each PLL has a multiplier and a divider, which allows a vast number of ratios to be chosen, and in turn, a wide range of frequencies to be derived from the input clock. Each output can be programmed to take its input from any of the PLLs and the PLL frequency can be further divided down to give an even wider range of output frequencies. The two unused outputs of IC2, at Australia’s electronics magazine siliconchip.com.au Tuning the temperature settings can be done on this page, although we found the initial values we tried were quite good. You may need to raise the setpoint if your workspace consistently gets above 35°. The VCO settings are basic, but very useful. Changing the C Value (control value) allows the VCO to be manually tuned, perfect if you have an atomic clock source for calibration. A Status page is provided to give information about how the Frequency Reference is performing. In this case, no GPS module is connected, and the unit has fallen back to PLL-only mode. puts are tied to ground to prevent oscillation. The link arrangement to select the signal source for CON2 is a little more complex than was shown on the block diagram. A 5-pin header is used, which allows a jumper shunt to be placed over either pins 2 & 3 or 3 & 4 to feed either signal through to the central pin of the BNC socket. But since pins 1 and 5 are wired to ground, this gives you the option of feeding either or both signals to offboard connectors by placing a 2-wire plug over pin pairs 1 & 2 and 4 & 5. between a 3.3V or 5V power supply for the GPS module. We used the trusty old VK2828U7G5LF GPS module with onboard ceramic antenna, which can operate from either 3.3V or 5V. But we have provided the option since some constructors will prefer to use a module with an external antenna and in this case, you may need to choose a particular voltage to suit the module. Whichever module you use, make sure it has a TTL serial interface along with a 1PPS output pin. The NMEA output from the GPS module is a stream of serial text data which contains satellite information, including the time, date and location. The module also produces a 1PPS pulse, which is fed directly to pin 21 on the Micromite. Once the Micromite confirms from the NMEA data that a valid satellite fix has been achieved, it starts timing the 1PPS pulses in order to discipline the VCO. GPS module interface The GPS module’s serial TX and RX pins are wired directly to pins 9 and 10 on the Micromite so that the latter can receive NMEA serial data. A jumper is placed on LK1 to select Power supply You can fit either a mini USB (CON5) or micro USB (CON6) socket and power then comes from a 5V USB charger or similar. The 5V supply is fed directly to the Micromite BackPack, where it powers the LCD touchscreen and is regulated to 3.3V to power the Micromite chip. The 3.3V supply is then fed back to the Frequency Reference board, to power the remaining circuitry. The only component on the Frequency Reference which may draw directly from the 5V supply is the GPS module, and that’s only if you have selected the 5V option. Everything else runs from 3.3V, with Parts list – Precision Frequency Reference 1 double-sided PCB, code 04107181, 120mm x 55mm 1 Micromite BackPack V2 kit (described in May 2017) [SILICON CHIP Cat SC4237] 1 VK2828U7G5LF or equivalent GPS module [SILICON CHIP Cat 3362] 3 PCB-mount BNC sockets (CON2-CON4) [Jaycar PS0661] 1 UB3 Jiffy Box 1 40-way snappable pin header (GPS1,JP1,JP2,LK1) [Altronics P5430, Jaycar HM3212] 1 4-pin and 18-pin female socket 3 jumper shunts (shorting blocks) (JP1,JP2,LK1) 1 SMD USB mini-B (CON5) or micro-B (CON6) socket 3 M3 tapped 12mm long Nylon spacers 3 M3 x 20mm pan head machine screws 1 USB charger or similar power supply with cable to suit CON5/CON6 Parts for oven enclosure 2 100mm cable ties 2 bottle caps, film canisters, small foam cups or similar siliconchip.com.au Semiconductors 2 MCP4922 dual 12-bit SPI DAC ICs, SOIC-14 (IC1,IC6) 1 CDCE906 programmable PLL/clock synthesizer, TSSOP-20 (IC2) 1 LMV641 low-power op amp, SOIC-8 (IC3) 2 SN74ALVC14 hex schmitt trigger inverter, SOIC-14 (IC4,IC5) 1 DS18B20 temperature sensor IC, TO-92 (TS1) 1 MCP1700-2.7V voltage regulator, TO-92 or SOT-23 (REG1) 1 MAX6166AESA 2.5V voltage regulator, SOIC-8 (REG2) 1 3mm LED (LED1) 1 BC337 NPN transistor, TO-92 (Q1) 1 TXEAACSANF-40 VCTCXO IC, 4-SMD (VCO1) Capacitors (all SMD X7R, 3216/1206 size) 5 10mF 7 100nF 1 22pF Resistors (all SMD 1%, 3216/1206 size) 1 8.2M 1 10k 3 4.7k 1 2.7k 3 1.1k 6 510 1 220 1 51 Australia’s electronics magazine 2 2k 4 39 October 2018  33 Each output (CON2, CON3 and CON4) has its own control screen and allows setting of the output frequency by automatic seeking, manual adjustment of PLL parameters and from stored presets. The advanced screen gives direct control of the N, M and P dividers which are used by each PLL, as well as reporting whether the resulting PLL frequency is within the correct range. CON4’s advanced PLL control is restricted to modifying the P value, as N and M are locked to provide the 40MHz reference that is fed back into the Micromite. the 2.7V (REG1) and 2.5V (REG2) regulators being used only to provide the DAC reference voltages. Micromite pin 4 is wired to the LDAC-bar input of IC1 (pin 8), which is driven to ensure that the output voltages of both DACs within IC1 change at the same time. This prevents glitches from changes in the DAC output voltage being propagated to the input of VCO1. Communications with the DACs is simple since the micro only needs to send the new digital value over the SPI bus and the output voltages then change in response. The PLL IC has a more complex interface and is controlled by programming an array of internal registers which have various functions. Note that we have had to use the Micromite’s pin 26 since there are no free pins on the I/O header (pin 14 is a shared SPI pin so cannot be used). But the BackPack V2 uses pin 26 for the optional software LCD backlight control, so and the BackPack must be built with hardware (trimpot) backlight brightness control instead. Also, because the Micromite must use its internal TIMER1 feature to keep track of the frequency, as none of the other timers are fast enough to manage the 40MHz signal. Unfortunately, the TIMER1 pin is attached in hardware to the Micromite’s console RX on pin 12, so we have to shut down IC2 until it is needed. Using the console RX pin to capture the 40MHz signal from the VCO means that we can not use the console during normal operation, as this will cause the 40MHz signal to be swamped by signals from the console. To get around this, the two USB sockets on the board (CON5 and CON6) are used for power only. Link LK1 is provided so that you can still program the Micromite via the serial console and it is then shorted with a jumper for normal operation. Remaining components By default pin 1 of IC2 (S0/A0/CLK_ SEL) is configured to disable the six outputs when low. So we have fitted a 10kΩ resistor to ground, to make the outputs disabled by default. This pin is wired back to Micromite pin 24 so it can enable the PLL outputs by making that pin a digital output and setting it high. All ICs have 100nF bypass capacitors between their main supply pins and ground, for reliable operation, and all regulators have 10mF ceramic input bypass and output filter capacitors, except for REG2 which has internal compensation, so does not require a capacitor on its output. To minimise the noise from DACs IC1 and IC6 and jitter from PLL IC2, these three devices also have 10mF ceramic bypass capacitors near their supply pins, in parallel with the 100nF capacitors. Micromite BackPack The Micromite is responsible for coordinating the functions of all the components on the GPS Frequency Reference board. As mentioned earlier, the two DACs IC1 and IC6 use the SPI bus, which is on pins 3 (SPI OUT) and 25 (SPI CLK) of the Micromite. This same bus is also used on the BackPack for communications with the touchscreen but at different times, so the functions do not interfere. The Micromite’s digital output pin 5 is pulled low when the software sends an SPI command to IC1 and this is wired to its chip select (CS-bar) input. Similarly, Micromite pin 26 drives the CS-bar input of DAC IC6. 34 Silicon Chip Australia’s electronics magazine Controlling the PLL IC2’s software registers allow us to provide a comprehensive range of output frequencies, as we can set up internal multipliers and dividers to determine a wide range of internal PLL frequencies. We have the capability to read and write these internal registers; the read function is used only to verify that the writes have occurred correctly. Each PLL inside IC2 has a 12-bit ‘N’ divider and a 9-bit ‘M’ divider. But since the ‘N’ divider is in the feedback loop of the PLL, it actually has the effect of multiplying the frequency. It is the N/M fraction which determines the ratio between the PLL and input frequencies. Each of the six outputs also has a separate 7-bit ‘P’ divider. The N, M and P values are all integers (ie, whole numbers). In more detail, the incoming (nominally 40MHz) frequency is multiplied by N and then divided by M to give the PLL frequency, and the PLL frequency is divided by P to arrive at the output frequency. The PLL frequency must be in the range of 80-300MHz and the output frequency is limited to a range from 1-167MHz. Our output buffers limit the maximum usable frequency to around 100MHz. We configure the registers in IC2 so that PLL1 feeds into CON2, PLL3 feeds into CON3 and PLL2 feeds into both CON4 and back to the Micromite’s pin 12 frequency counter input. While PLL1 and PLL3 can be set to a wide range of frequencies, PLL2 is fixed to run at 160MHz, so that a ‘P’ divider of four gives us our 40MHz signal to feedback to the Micromite. That means, however, that CON4 cannot be set to produce just any frequency. But it can still be set to siliconchip.com.au The Seek page allows the frequency to be entered by a numeric keypad and provides MHz and kHz shortcuts to speed up entry of custom frequencies. If an entered frequency is too low for the Seek algorithm, a message box advises the fact and returns to the previous screen, preventing invalid results. When a valid Seek frequency is entered, the Micromite finds the nearest frequency which can be generated by the PLL and displays it so that it can be checked before being output. a number of different frequencies, ie, 160MHz divided by an integer between two and 127 (80MHz, 53.3MHz, 40MHz, 32MHz, 26.7MHz, …, 1.26MHz). While CON2 and CON3 can provide a much more flexible range of frequencies, the software actually has to do quite a bit of work to calculate the N, M and P values required to produce a specific frequency. After all, there are 268 million possible combinations [2(12+9+7)]. While it’s possible that there is no combination of values which will give a particular frequency that you want, chances are, if it is in the range of 10100MHz then the unit will be able to produce something very close (and you will be able to see on the screen what that frequency actually is). Since there are so many combinations of values, we had to carefully design an algorithm to find the best combination. It starts by determining what values of P are valid given the desired frequency. Because the PLL frequency must fall between 80MHz and 300MHz, this gives a fairly small range. For example, to produce a 40MHz frequency, P must be between two (80MHz PLL) and seven (280MHz PLL). Since the value of P is limited to seven bits, the highest valid value for P is 127. This is also what determines the lowest possible frequency that the PLL output can produce, which is 630kHz (80MHz÷127). Since the N and M registers have 12 and nine bits respectively, that puts an upper limit on their values at 4095 and 511 respectively. There is also a restriction that N must be greater than or equal to M, but given that the minimum PLL frequency is 80MHz, N must be greater than M to achieve this from a 40MHz source anyway. Since M has a smaller range of values, the algorithm iterates over the valid values of P and M, works out what the exact (decimal) value of N would need to be to produce the desired frequency, and then tests the next highest and lowest integer values to see how close they would be to our target frequency. As the iteration occurs, if a better match is found, it is stored. If an exact match is found, then no further searching need be done. Otherwise, it continues until all viable PLL setting combinations have been tested. Developmental Trials and Tribulations This project took some time to finish and like many of our more ambitious projects, we encountered a few stumbling blocks along the way. The final design is pretty close to the initial concept but we had to make a few refinements for it to work properly. As is typical, we are using all of the Micromite BackPack’s free I/O pins. The only way to get more I/Os would have been to use a board with an SMD micro but they are trickier to solder. In the end, the only real compromise we had to make was to use one of the console pins for I/O, making our debugging more difficult. This was necessary because the PIC32 only provides one input pin for each timer clock and only one of the timers is fast enough to neasure the 40MHz signal from the VCO. That pin just happens to coincide with the serial console transmit function. So we had to use the touchscreen to display debugging messages. That meant that we couldn’t see BASIC error messages. While the V2 BackPack has a USB console connector, unlike the one on Plus BackPack, this shares the same TX and RX pins, so that doesn’t help. The other major problems we had were with the PLL/Clock Synthesizer chip, IC2. It would randomly freeze up the I2C bus, sometimes locking up the Micromite and often just failing to respond at all. The I2C signals from the Micromite looked fine on an oscilloscope. siliconchip.com.au After many hours of probing, it became apparent that the I2C signals were OK but the chip couldn’t decode them because its ground was so noisy. We then noticed that the ground trace to the PLL/Clock Synthesizer chip had disappeared. This chip is closest to the Micromite header on the PCB and we had laid a short ground trace between them. But Altium Designer thinks it’s smarter than us; it saw that there were two different ground paths between those pins and decided to remove one of them as it considered it redundant. So the chip’s ground connection was via a long, circuitous path, hence the noise. We also found that IC2 operated much more reliably when the outputs were loaded up with around 1.5kΩ to ground and with a 50Ω series resistor to set the source impedance for the clock input; this was not mentioned in the CDCE906 data sheet, so we had to figure it out ourselves. Finally, we managed to simplify the design during development. We originally had two extra logic ICs, a divider to produce 20MHz and 10MHz signals from the 40MHz VCO output and another to select which of these three signals was fed to CON4. We later realised that all these functions could be done inside IC2, which would also allow for more frequency options for CON4. Since we had to revise the board to get IC2 to work properly, we eliminated the two extra ICs at the same time. Australia’s electronics magazine October 2018  35 Unfortunately, when this algorithm was implemented in BASIC, it took over a minute to complete, which is far too long. Thus, we had to write a CFUNCTION to speed up the process. Once the C code has been compiled, it generates PIC32 machine code which is inserted into and can be called from the BASIC program and this runs much faster. Our CFUNCTION version of the code takes less than one second to complete. As well as the N, M and P values, there are a number of registers which need to be set up for the PLL to operate as required. Most of these are initially set by “dumping” an array of data into the registers during the initialisation phase. After this, the N, M and P registers are about all that is changed by the program in the Micromite. Each PLL also has a one-bit flag which can be used to select either a high-speed mode (above 180MHz) or low-speed mode (below 200MHz). As each group of registers are updated, this is set to the appropriate value. As well as being able to enter a desired frequency and having the register values calculated for you, we decided to give users the option to enter the values of N, M and P manually. We found during testing that the restrictions stated in the data sheet on the PLL frequency are not hard-and-fast rules and that the chip is able to operate at frequencies outside the specified range. So our software does not enforce these rules for manually-entered values, although it does give a warning for combinations that would result in a PLL frequency outside the normal range. Other software considerations The remainder of the software is relatively straightforward. Updating the DAC outputs only requires selecting the chip, writing 16 bits, then deselecting the chip, so this only takes a few lines of code. Processing and parsing the NMEA data from the GPS module is a bit more involved, as we have to check that the GPS module has a proper fix before trying to discipline the VCO from the 1PPS signal (otherwise the 1PPS signal may not be accurate). This involves checking that we have received the “$GPRMC” sentence and that it has the value “A” at a certain point, and not “V”. Because it is not much more effort, 36 Silicon Chip we also decipher the GPS latitude, longitude, UTC time and date and display these values on the status page as confirmation that the GPS module is working correctly. Apart from the software algorithm for setting frequencies, we also had to create a second CFUNCTION to count the incoming 40MHz pulses from the VCO. This requires setting up the TIMER1 interrupt and an interrupt service routine to keep track of when the 16bit hardware counter overflows (the 32-bit timers are not able to operate at this high a frequency). The same routine also provides the disciplined 1PPS output by toggling pin 22 every twenty million received pulses. Thus, the accuracy of the output 1PPS signal is matched to the accuracy of the 40MHz oscillator, as they work in lockstep. We came up with an easy way to do this accurately. Rather than letting the 16-bit timer roll over at 65,536 as it would normally (ie, after 216 pulses), we set it to roll over after 62,500 pulses. Then, each time it rolls over, we increment another counter and once it reaches 320, that means that 20 million pulses (62,500 x 320) have occurred. So we only need to determine whether to toggle the state of pin 22 right at the start of the interrupt handler routine and since the delay will be the same each time, the duty cycle will be exactly 50% and the frequency will be exactly locked to the VCO. The TIMER1 interrupt handler also increments a 64-bit counter by 62,500 each time it is called. Then, when a 1PPS pulse from the GPS module is detected on pin 21, the TIMER1 value is added to this counter and that forms the timestamp which is stored in a circular buffer. The intervals between these timestamps are then fed into an algorithm to determine whether to adjust the VCO frequency and if so, in which direction and by how much, to keep it running at exactly 40MHz, or as close as is possible. User interface As is usually the case with projects using a complex touch interface, the code to display information and process user input is quite involved and, including font data, takes up about half of the BASIC source code. There are nine distinct interface screens, each quite different. The main Australia’s electronics magazine overview page has five buttons, one to access the “Settings” page, one for the “Status” page and one each to set up the three outputs. The current frequencies at CON2, CON3 and CON4 are also displayed on this screen. The output settings screen allows one of four preset frequencies to be loaded, or custom frequencies to be programmed, either using the automatic search algorithm or by manually setting the N, M and P divider values. A long press on one of the preset buttons allows the current output frequency value to be stored in a preset, while a short press loads that frequency immediately. The settings page allows the presets to be copied between the various outputs. The characteristics and response of the temperature controller and VCO adjustment algorithm can also be changed. The VCO’s control voltage can be changed manually, so you can directly adjust the VCO frequency if you have access to a high-precision frequency reference for calibration. The adjustment interval can be changed too. Longer adjustment periods mean more data is available to perform a more accurate adjustment, but it will take longer to settle. Physical construction Like many of our Micromite projects that use the LCD BackPack board, the Programmable GPS Frequency Reference is designed to fit into a UB3 jiffy box, making for a very compact piece of test equipment.The BNC connectors project out the side of the box, with the front panel dedicated to the touchscreen. Building this project is not particularly difficult, although there are a number of SMD parts. This is because IC2 is only available in an SMD (TSSOP) package, and we would have had to use a significantly larger box if we had used mostly through-hole parts. Except in the case of IC2, where we had no choice, we have selected mostly easyto-solder (larger) SMDs. The oven is made from just a few commonly available parts and does not take long. A few holes need to be drilled and cut into the plastic case but once you have built the PCBs, the rest is pretty easy. We’ll get into the construction and operating details in part two, next month. SC siliconchip.com.au Here’s one for all the model railway enthusiasts . . . DIGITAL D IGITAL COMMAND C OMMAND CONTROL C ONTROL PROGRAMMER for DECODERS DCC – Digital Command Control – is a widely-used method for controlling model railways, especially when running multiple locos/ trains on the same track(s). This DCC programmer is simple, cheap and easy to build – and operates from a computer’s USB port. by Tim Blythman DCC is a great innovation, allowing many model locomotives to be addressed and operated independently on the same track at the same time It has been embraced as a standard by the NMRA (National Model Railroad Association, based in the USA), so equipment from different manufacturers can inter-operate without issue. And since the standards are public, anybody can create DCC-compatible devices. But the big downside to DCC (especially for beginners) is the cost of a base station. Even the cheapest base stations cost several hundred dollars and each locomotive also needs a decoder. Usually, even the simplest base 38 Silicon Chip stations include the option to program decoders but this can be a bit fiddly to use and can interfere with the operation of other trains on the “main line”. In this article, we describe how to build a standalone programmer based using an Arduino microcontroller module with a custom shield. It connects to a computer USB port to provide a convenient interface for programming. It allows you to read and write the Configuration Variables (CVs) on DCC rolling stock, customising their operation and performance. We have also designed the shield to be compatible with the DCC++ Arduino software. DCC++ is an open-source hardware and software system for the operation of DCC-equipped model Australia’s electronics magazine railroads; see https://github.com/DccPlusPlus/ When programmed with the DCC++ software, the programmer can be used with the Java Model Railroad Interface (JMRI), which provides a way to control DCC-based model trains from a computer. Its most relevant functions for this project are the ability to load and save locomotive (decoder) configurations. There is also another graphical user interface (GUI) which is compatible with DCC++, written in the “Processing” language. See the DCC++ web page for details. As well as being able to use the DCC++ software, we have written a small Arduino program which allows siliconchip.com.au CVs to be read and written via commands on the Arduino Serial Monitor. You don’t need JMRI or DCC++ to use it in this mode. By the way, we have previously published two other DCC system related designs: a 10A DCC Booster in the July 2012 issue (siliconchip.com.au/Article/614) and a Reverse Loop Controller in the October 2012 issue (siliconchip. com.au/Article/494). DCC hardware interface A typical DCC system requires 1215V to operate (see the panel below for an explanation of how DCC works). You can power the Arduino from a voltage in this range but it isn’t necessary; we’re using a small boost regulator module so that you can also run it off a 5V USB supply. In this case, the boost regulator provides the 1215V DC to power the tracks and DCC decoder(s). The DCC signal is a square wave at several kilohertz and the locomotive/ decoder could draw a few hundred milliamps, so our programmer needs to be capable of rapidly switching the track voltage and supplying sufficient current. Luckily, this can be achieved using a low-cost, bog-standard 556 dual timer IC. This IC is basically two 555 timers glued together in a 14-pin package. The outputs on the 556 can deliver up to 200mA at 500kHz, so it is perfectly suitable for this project. The Arduino module generates the DCC signals with the correct timing, which the 556 converts into the correct voltage levels. We’re also using a current sense (shunt) resistor so that the Arduino can detect how much current the attached locomotive is drawing. The DCC decoder can send data back to the programmer by varying its current draw. It sends a response by briefly drawing at least 60mA from the tracks. This is important as it is the only way to read data back from the decoder. Circuit description Fig.1 shows the circuit of the DCC Programmer. It’s based around dual Why DCC? If you’re running more than one loco/ train on a layout, the only logical way to do it is with DCC, which gives control to each one without affecting any other(s). And because the power and control signals are separate, the locos are still powered even when not moving, so their lights and any sound effects can still be operated. The downsides of DCC are mostly to do with cost and there is the added complexity of adding decoders to your locomotive. DCC allows manual control over each train, just as you normally have with a normal controller – but DCC has the big advantage of being able to take its operating commands from a computer, allowing completely automated model layouts, if you wish. This is especially useful in larger layouts; DCC also allows automatic point switching, level crossing boom gates and so on, obviously with suitable motors. The JMRI software mentioned in the text allows control over all these functions. Fig.1: besides the Arduino itself, the other components are mounted on a plug-in shield. It’s based around dual timer IC1, which acts as two power inverters with some built-in logic circuitry, forming a basic low-power full-bridge driver under the control of the Arduino. DC/ DC boost converter MOD1 provides the ~13V DC supply for IC1 when the Arduino is running from a 5V USB supply. siliconchip.com.au Australia’s electronics magazine October 2018  39 556 timer IC1 and boost converter MOD1. Pins 4 and 10 of IC1 are the reset inputs of the two timers and the timer outputs are disabled if these pins are low. They are held low initially by the 1kΩ resistor from pin 10 to ground, so output pins 5 and 9 are low. These pins connect to either side of the track, either via CON6 (a header socket) or CON7 (terminal block), depending on which suits you best. So when both timers are in reset and both outputs are low, there is no voltage across the track. The enable signal from the Arduino is fed to CON3 so when this goes high, the reset input at pin 10 is pulled high via the 100Ω series resistor. Schottky diode D1 is then reversebiased, so the other reset input at pin 4 can also be driven high by the Arduino, via CON2 and its 10kΩ series resistor. The trigger input of the first timer (pin 6) is pulled to ground while the threshold input of that same timer (pin 2) is tied to VCC (pin 14), so its output at pin 5 is high by default. However, if the pin 4 reset input is held low by the Arduino (via CON2), then this timer is in its reset state, so output pin 5 is low. Therefore, during operation, the output at pin 5 follows the signal at pin 4. Output pin 5 is also connected to the trigger input of the second timer, at pin 8, while that timer’s threshold input (pin 12) is also tied to VCC. So output pin 9 is low when output pin 5 is high and vice versa, and thus the second timer operates as an inverter once it is enabled. Thus, when IC1 is enabled, there is always a voltage across the track, with the magnitude being close to VCC and the polarity depending on the signal from CON2. A 2.2Ω resistor between IC1’s ground pin and the main circuit ground is used to sense the current flowing between the track connections. Regardless of the direction of current flow through the track connections, that current must ultimately flow back through IC1 and to the power supply ground. The result is a voltage across that 2.2Ω resistor. That voltage is fed to CON5 via a 1kΩ series resistor and on to one of the Arduino’s analog pins where it feeds the internal 10-bit analog-to-digital converter (ADC) and is converted into a digital value in the range of 0-1023 by the software. The combination of the 10-bit ADC and the 2.2Ω current sense resistor means the resolution of this reading is around 2mA. JP1 is a three-pin header which allows you to choose whether the voltage fed to the 556 IC is from the Arduino’s DC input socket (via the VIN pin) or from MOD1, an MT3608 2A boost DC/DC converter module. If you are powering the Arduino from a 12V plugpack, then you can put JP1 in the VIN position, so the plugpack provides the track voltage. But if you are powering the Arduino from a computer or a 5V USB charger, this voltage is not sufficient to power the tracks. In this case, you can place JP1 in the VOUT+ position and adjust the trimpot on the MT3608 module to provide 13V to IC1. The stand-alone Arduino program has a very simple interface, and allows direct reading and writing of CVs. This is sufficient to fully manipulate any parameters, but may not be as intuitive as the advanced roster settings available with DecoderPro. 40 Silicon Chip While not vital, as MOD1 has onboard bypass capacitors, the shield has provision for 100µF input bypass and output filter capacitors. We recommend that you fit the input bypass capacitor but leave the output filter capacitor off (as described in the Construction section). There is also an onboard 6.8Ω resistor between the 5V supply and the module’s VIN+ terminal, to reduce the inrush current from the 5V supply when it is first connected and to limit the maximum current drawn during operation (eg, if the tracks are accidentally shorted). The shield is driven using two of the Arduino’s digital pins and feeds the current sense voltage back to one of the analog pins. Rather than make these fixed, and risk interfering with the function of any other shields plugged into the Arduino, all three pins can be selected using jumper shunts for maximum flexibility. The digital pins are selected by placing one jumper between CON1 and CON2 (for the polarity signal) and another between CON1 and CON3 (for the enable signal). By default, our software is set up to use digital output D5 for the polarity signal and D11 for the enable signal but you can change the software if you place the jumpers in other locations. Similarly, the analog pin is selected by connecting a pin on CON4 to the associated pin on CON5 and by default, we’re using analog input A1. The software The primary job of the software is This is the Simple CV Programmer interface in DecoderPro, and it allows CVs to be directly written and read. Using the Roster feature allows the locomotive to be given a name, and CVs to be saved to a configuration file, as well as grouping the CVs into logical groups. Australia’s electronics magazine siliconchip.com.au Fig.2: use this PCB overlay diagram and the photo at right as a guide when building the shield. Make sure that MOD1 is orientated correctly, with its VIN pins towards the electrolytic capacitor. IC1, D1 and the electrolytic capacitor are also polarised. The jumper locations shown here suit our sketch as well as the DCC++ code, when being used as a DCC programmer. to produce a signal across the tracks which carries the required DCC packets. It does this using an interrupt software routine (ISR) which is triggered every 58µs by a timer. 58µs is the halfperiod of a ‘1’ bit. To send a ‘1’ bit, we toggle the DIR pin each time the interrupt fires. To send a ‘0’, we should ideally have a half-period of 100µs but 116µs (2 x 58µs) is within the limits that are recognised by the decoder. So we merely wait for two timer interrupts to occur before toggling the DIR pin to transmit a zero bit. The interrupt handler steps through the DCC data array as each bit is transmitted, then sets a flag to indicate that the complete packet has been sent and moves onto the next packet. Thus, most of the real work is done inside the interrupt routine. During most programming sequences, the programmer sends several reset packets to the loco, followed by multiple ‘write’ packets and this is accomplished by placing the appropriate commands in the array to be transmitted. The detection of acknowledgement pulses from the loco is done by continually sampling the voltage across the current sense resistor, at the selected Arduino analog input. The quiescent sample value is used as a baseline value. If an acknowledgement is expected, the current sample is compared with the baseline and if the threshold is reached, a flag is set indicating an acknowledgement has been received. As well as being able to use the DCC++ software, we provide a basic serial terminal interface. This allows you to send DCC commands straight to the locomotive, assuming that you know what is required. These are inserted into the array of packets to be sent, but they are not transmitted until siliconchip.com.au you indicate that they are ready. The software then sets a flag to start the transmission. MOD1 is optional We are using boost regulator MOD1 for convenience, so that you can run the programmer off a 5V USB supply. However, if you plan to power the Arduino from a 12-15V DC supply, you could omit MOD1. In this case, you would need to place JP1 in the “VIN” position. Keep that in mind as you assemble the shield. Construction The DCC Programmer Shield is built on a PCB measuring 68.5 x 53.5mm (the size and shape of a standard Arduino shield) and coded 09107181. Use the overlay diagram, Fig.2, as a guide during construction. Fit the smaller resistors first, confirming the values with a DMM before soldering each in place. Follow with diode D1, taking care to orientate it as shown in Fig.2. Then install the two larger 1W resistors. You can now fit the 100µF input bypass capacitor for MOD1. This should be laid over on the PCB so that you can later stack another shield on top if you need to. Make sure its positive (longer) lead goes in the pad nearest the adjacent edge of the PCB. Next, solder in pin headers CON1CON6 and JP1 where shown. You can then fit MOD1, by first soldering four component lead off-cuts to the pads so that they stick out the top of the board, then lowering MOD1 over those leads and soldering them to the pads on the top of the module. You can then trim off the excess lead length on top of MOD1 and on the underside of the PCB. Now solder CON7 to the board, making sure it has been pushed down so it is sitting correctly on top of the Parts list – Arduino DCC Decoder Programmer 1 double-sided PCB, code 09107181, 68.5 x 53.5m 1 set of Arduino stackable headers (1 x 6-pin, 2 x 8-pin, 1 x 10-pin) 1 Arduino Uno or equivalent 1 MT3608 2A boost module [SILICON CHIP Online Shop Cat SC4437] 3 14-pin headers (CON1-CON3) 2 6-pin headers (CON4,CON5) 1 2-pin female header socket (CON6) 1 2-way terminal block, 5/5.08mm pin spacing (CON7) 1 3-way pin header (JP1) 4 jumper shunts/shorting blocks Semiconductors 1 556 dual timer IC (IC1) 1 1N5819 1A schottky diode (D1) Capacitors 1 100µF 25V electrolytic Resistors (all 0.25W, 1% unless otherwise stated) 1 10kΩ 3 1kΩ 1 100Ω 1 6.8Ω 1W 5% Australia’s electronics magazine 1 2.2Ω 1W 5% October 2018  41 PCB and its wire entry holes are facing towards the outside edge of the board. Fit the Arduino headers next. We’ve specified stackable headers but you could potentially use standard headers if you don’t plan to attach any shields on top of this board. Either way, make sure the long pins project out the bottom of the board. You need to solder the stackable headers carefully to avoid getting solder on the pins except near where they connect to the pads. Note that the stackable headers give more clearance for the components on the board underneath (eg, the Arduino). If you use standard headers, you may find that CON7’s pads short to the shield of the USB connector below, which is connected to ground. Adjusting MOD1’s output voltage Before installing IC1, you must adjust MOD1’s output voltage. Plug the shield into your Arduino board and then apply power. Use a DMM set to measure DC volts to probe the VOUT+ and VOUT- pads on MOD1. Adjust its onboard trimpot screw to get a reading just below 15V; counter-intuitively, the voltage is decreased by turning the adjustment screw clockwise. We set our track voltage to 13V and it works well. You can then remove power, unplug the shield and fit IC1, ensuring that its pin 1 notch faces into the middle of the board, as shown in Fig.2. You could potentially use a socket but given that the IC is supplying significant current to the tracks, it’s better to avoid that. Now fit the jumpers to select your desired track voltage source and to configure which Arduino pins are used for control. If you are unsure, insert the jumpers in the positions shown in Fig.2. The shield assembly is then complete. Software setup and testing Now you need to upload the Arduino sketch code to the board. This is done using the free Arduino IDE (integrated development environment). It is available for Windows, macOS and Linux and you can download it from www.arduino.cc/en/Main/Software The IDE is used to compile and 42 Silicon Chip Monitor indicating the locomotive’s short address (CV 1). Other CVs can be written to and read from with simple commands like this. To write a CV, use the format “w1:3” That command writes the value 3 to CV 1. Using it with DCC++ and JMRI DecoderPro If you want to run DCC trains from a computer, you can use the open-source JMRI The DCC software. It comes with Deprogrammer shield coderPro, which has a commounts on top of the Arduino prehensive “Roster” feature UNO board, as seen here. which that be used to save and restore locomotive programming upload the software to the Arduino. Now download the software pack- parameters. If you have a fleet of similar locomoage from the SILICON CHIP website. This contains a “standalone” Ardui- tives, this is a convenient way of manno sketch called “DCC_Programmer_ aging their various performance CVs. So that our Programmer can operShield_V2”, which is the easiest way to test your shield. Before you can ate with JMRI, we can use the openuse this sketch, you need to install a source DCC++ Arduino sketch. This was designed to work with other hardlibrary called TimerOne. TimerOne can be installed from the ware but our shield has been designed IDE’s Library Manager (Sketch menu to be compatible with that hardware, → Include Library → Manage Librar- so you can run DCC++ on it without ies…). Open the Library Manager and any modifications. Our software download package for search for “TimerOne” and then when you find it, select it and click the “In- this project includes the DCC++ software. To use it, extract and open the stall” button. In case you have trouble with that DCCpp_uno sketch. Then check the method, we also include a zipped “Config.h” tab and make sure that this copy of the library in the sketch down- line is set correctly: load package. This can be installed us#define MOTOR_SHIELD_TYPE 0 ing the Sketch → Include Library → You need to set up the jumpers on Add .ZIP Library menu option. Now extract and open the DCC_Pro- CON1-CON5 for your shield to match grammer_Shield_V2 sketch from the those shown in the overlay diagram, download package, eg, using the IDE’s Fig.2. This configuration is required File → Open menu option. Connect to emulate this motor shield type. Upthe Uno to your computer and select load the sketch to the Uno board, as the “Uno/Genuino” option from the described above. The DCC++ software also uses a seTools → Board menu. Also, check that the correct COM rial interface, so you can use the serial port listed under the Tools → Port monitor to examine its output. The DecoderPro program has the menu matches the one assigned to option to use a DCC++ programmed your Uno board. Select the Upload option under Uno, so our reprogrammed board can the Sketch menu and then open the now be used with DecoderPro. JMRI serial monitor (Tools → Serial Moni- is available for Windows, Mac and tor) at 115,200 baud. You should get Linux (including a Raspberry Pi vera message describing how to use the sion). However, note that you need to sketch. If you have a DCC locomotive, have Java installed to use it. Get JMRI from http://jmri.sourceplace it on a length of track wired to either CON6 or CON7 and type “r1” forge.net/download/index.shtml and in the Serial Monitor, followed by the open the DecoderPro program. Go to the Edit → Preferences menu and Enter key. If everything is working, you should under Connections, choose DCC++ see some text appear on the Serial as System Manufacturer and DCC++ Australia’s electronics magazine siliconchip.com.au Serial Port as System connection. Ensure the Serial port matches that of the Uno. Save the configuration and close DecoderPro so that it can re-load the new settings. Open DecoderPro again and under Edit → Preferences choose defaults, and ensure that DCC++ is selected for Service Programmer. Unless you have other hardware, you should select DCC++ for all options. Save, close and re-open DecoderPro again. Click the red power button and ensure that it turns green. You should see “Service Mode Programmer DCC++ Is Online” in the bottom left corner of the screen. Now use the Actions → Single CV Programmer menu option to open the Simple Programmer window. This window allows you to read and write single CVs via a basic interface. If you find you are getting the “No acknowledge from locomotive” error then the threshold that DCC++ uses for detecting acknowledge pulses from the track may need to be adjusted. This is a parameter in the DCCpp_ uno sketch. Close DecoderPro (so that it no longer has control over the Arduino) and navigate to the “PacketRegister.h” tab in the DCCpp_uno sketch. Near line 20, there is a value called ACK_SAMPLE_THRESHOLD which is 30 by default. We found that reducing this to 12 gave consistent results with three different decoders. Save the sketch with the changes, then upload it to the Arduino board again. Ensure that the Serial Monitor is closed before reopening DecoderPro and try the Single CV Programmer option again. siliconchip.com.au While the default value of 30 corresponds to the specified value of 60mA for the acknowledge pulse, the DCC++ sketch also applies some smoothing to the sensed current, so this may change the actual detected current threshold. To use the Roster feature, click the “New Loco” button in the top left corner of the main DecoderPro window. Click “Read type from decoder” and DecoderPro will read a number of the CVs to identify parameters such as the manufacturer. If this does not work, you can also choose Roster → Create entry to enter this manually. Once a Roster entry has been created, double-click it to open the Comprehensive Programmer, allowing more detailed and complex programming to occur. JMRI is a vast program with many features and we can’t pretend that we’ve covered a fraction of them here. There is comprehensive documentation online. The article at siliconchip.com.au/ link/aal3 introduces DecoderPro and is a good place to start. JMRI also has a layout editor (PanelPro) so that you can create track diagrams and these can be animated with information from the layout if you have the correct sensors installed. Other uses for this project You may not think that having a DCC Programmer is all that useful but this device can also be used as a minimal DCC base station. With the DCC++ software, the Programmer can act as a low-power booster. If you set the board jumpers for EN on pin D3, DIR on pin D10 and Current Australia’s electronics magazine Sense on A0 then the DCC++ sketch can use the Programmer as its “main line” output. This means that the output can be connected to some track and DecoderPro’s throttle window can be used to control a DCC decoder-equipped locomotive. Because its current capacity is limited, you’re not going to be running a fleet of trains but it could be handy for testing and experimentation. In our trials, we found a small H0 scale locomotive was able to be driven at low speed, including operating the lights. What about driving a small motor? Another possible use for this shield is as a small 12V motor driver board. If you need to drive a small 6-15V DC motor using USB power or some other source of 5V then this shield can be used as a reversible motor driver, without the need for an external power source. It’s suitable for motors drawing up to about 2W. Note that your 5V supply must be able to deliver enough current. Useful links Setting up DCC++ with JMRI DecoderPro: https://github.com/DccPlusPlus/BaseStation DCC Standards Page: www.nmra.org/ index-nmra-standards-and-recommended-practices OVERLEAF: I I I I I I I I I I I I I I I HOW DCC WORKS October 2018  43 How DCC works We published an article in the February 2012 issue explaining how DCC works and showed some typical DCC decoders (see siliconchip.com.au/Article/769). But that article didn’t go into much detail regarding the DCC protocol, so read on for a more detailed explanation. If you aren’t into model railways then the advantages of DCC may not be obvious. To understand why it is so useful, we’ll explain how model railway systems worked before DCC. For a standard DC model railway, a single locomotive is fed power through the tracks, with one rail being negative and the other positive. Varying the average voltage between the rails changes the loco’s speed while swapping the rail polarities reverses its direction of travel. A typical H0 scale locomotive (1:87 scale) runs from 12V DC, drawing from a few hundred milliamps up to an amp or so. Such a system only allows a single locomotive to be controlled as multiple locomotives would receive the same track voltage. And direct control of accessories such as headlights, steam or sound effects is not possible. With clever use of diodes, it’s possible to have directional headlights, but a battery is still needed for lights if the locomotive is stopped as there is no voltage on the track. The most common way to allow multiple locomotives to operate is to divide the track into individual “blocks” or sub-circuits which can be switched between controllers. As you can imagine, the switching rapidly becomes very complicated as the track layout expands or more controllers are added. DCC transmits both power and control signals using the tracks. The locomotive’s onboard decoder interprets the control signals and commands the motors, lights and other accessories. Power is supplied continuously, allowing accessories to operate even while the locomotive is stationary. Beyond lights, features such as smoke generators and sound effects modules are quite common (if not especially cheap). The DCC signal is a square wave with a 50% duty cycle and varying pulse width. The data is encoded in the pulse widths while the square wave, once rectified, provides DC power for the decoder, motor, lights etc. The track voltage is typically 30V peak-to-peak, with cycle times of around 100µs. A typical DCC base station consists of a microcontroller feeding an H-bridge of some sort, usually with some form of current detection to shut it down in the event of a short circuit. With exposed conductors in the form of rails, it’s bound to happen sooner or later. A simplified circuit diagram of a typical DCC decoder is shown in Fig.3. This shows some of the circuitry to drive two lamps (eg, headlight and marker LEDs) as well as the motor. The DCC protocol encodes a binary 1 as a pulse that is nominally 58µs high and 58µs low, with a binary 0 having high and low periods that are 100µs or longer (see Fig.4). Because the locomotive can be placed on the track either forwards or backwards, the absolute polarity cannot be determined, so the high pulse may come before or after the low pulse. Fig.5 shows what these ‘0’ and ‘1’ bit pulses look like when they are arranged back-to-back, forming a continuous AC waveform. While the standards are specific as to what should and should not be accepted as valid data, merely sampling the “high” period of adjacent bits is sufficient to decode the bitstream and in any case, each command has a checksum byte, so errors caused by timing inaccuracies can be detected and the corrupt command ignored. The peak frequency of this signal is around 8kHz, which is higher than the 5kHz that the widely-used L293 fullbridge motor driver IC can deliver. So DCC base stations designed around the L293 IC probably won’t work reliably. ®: Registered DCC trademark of the National Model Railroad Association (USA). Fig.3: a simplified version of a typical DCC decoder circuit, showing the bridge rectifier and filter capacitor used to convert the AC voltage on the tracks to a DC voltage, with the raw track signal also being fed to the micro so it can be decoded. The micro then controls the H-bridge motor driver transistors, lamps, sound effects module etc. 44 Silicon Chip Australia’s electronics magazine siliconchip.com.au Fig.4: in a DCC system, the voltage across the tracks has a more-or-less constant magnitude but its polarity is continuously reversing, creating a 5-8kHz square wave. This is rectified by the DCC decoder(s) and is used as a power source for their logic circuitry as well as driving motors, lights, audio amplifiers etc. But the frequency modulation also encodes digital commands, addressed to individual locos. DCC protocol The bitstream is broken up into packets, with each packet containing one command, for tasks such as setting the motor to a particular speed or turning a light on and off. The loco’s state is stored by the decoder and kept consistent until it is updated by a future packet. There are also dedicated programming commands, which set configuration values (CVs) in non-volatile EEPROM. These values are used to determine which address the locomotive responds to, how the speed changes with throttle position, how lights and other accessories react to inputs etc. It’s these CVs that our programmer is designed to read and modify. Each valid packet starts with at least 14 sequential ‘1’ bits. This is referred to as the preamble and allows the decoder to synchronise itself with the start of the data packet, which is indicated by the first following ‘0’ bit. The data for the first byte of the command (which is an address) follows this, with all bytes sent most-significant-bit (MSB) first (see Fig.6). Subsequent bytes are prefixed with a zero bit so each byte transfer requires nine bits to be sent. The last byte to be transmitted is the aforementioned checksum byte. After this, a ‘1’ bit is sent, indicating that the packet is complete. The final ‘1’ can also count as the start of the next preamble if packets are sent back-to-back. Since each byte in the packet is separated by a ‘0’ bit, the only place that more than eight ‘1’ bits can appear in a row in a valid DCC sequence in is the preamble, so decoders can’t be fooled into thinking a new packet is starting in the middle of a valid packet. Each packet is a minimum of three bytes so the minimum packet transmission length is 40 bits, giving a minimum packet time of just over 5ms. So it’s possible to send close to 200 commands per second using DCC. Once the decoder has received a packet and the checksum is correct, it checks the address byte. If it matches the address stored in the decoder’s EEPROM, it can act on the command and if necessary, send a response. That is generally only necessary for programming commands as the programmer needs a way to read the configuration from the decoder. In this case, the packet sent by the base station is equivalent to asking “is this bit of this configuration variable set?”, to which the decoder replies either with an acknowledgement or not. The acknowledgement is performed by the decoder by placing a load of 60mA or more across the tracks for 6ms. In practice, this is usually done by the decoder briefly powering the motor, often resulting in the locomotive inching forwards during programming. The acknowledgement is one of two reasons why programming usually occurs on a dedicated programming track. Firstly, it would be difficult to accurately detect the acknowledgement pulse in the presence of other loads (such as other locomotives) on the rails. Secondly, many programming packets are broadcast to all decoders on the track. So the only way to guarantee that only the correct locomotive receives the programming packets is to have a dedicated section of track for programming. The DCC standards are very detailed and make for interesting reading. It could potentially be used in situations other than model railways, where power and commands SC need to be sent and received over two wires. Fig.6 (right): the structure of the shortest possible valid DCC command, containing one address and one data (command) byte. The preamble always consists of at least fourteen sequential ‘1’ bits and each byte is separated by a ‘0’ bit, with the command being terminated by a checksum byte (to detect errors) and then a final ‘1’ bit to indicate that there is no further data in this command. siliconchip.com.au Australia’s electronics magazine Fig.5 (left):the sequences of ‘0’ and ‘1’ bit pulses are strung together to create a continuous AC waveform across the tracks, effectively forming a frequencymodulated square wave. The RMS voltage is very close to the peak voltage, providing a similar voltage and current to the motors in the locos, while the average voltage is effectively zero since the waveform is symmetrical. October 2018  45 Four-channel High-current DC Fan and Pump Controller by Nicholas Vinen We originally designed this multi-channel pump and fan speed controller for automotive (or other vehicle) tasks – but now realise it has a myriad of other applications. It can be used anywhere you need to adjust the speed of low-voltage DC fans or other PWM-controlled devices. It has many options and is easy to set up using an onboard USB interface. J form 20A output channels. ust one look at the specs panel opposite will show just The design also incorporates a comprehensive supply how flexible this project is! If you need to control the voltage monitoring and timer scheme which allows it to speed of a low-voltage DC motor – a fan or pump for consume a tiny amount of power (microamps) when the example – in response to changes in temperature, this is battery voltage is low but quickly comes into operawhat you need. tion once the battery starts charging. The The speed is controlled by varying the duty cycle of timers allow the unit to run for a specithe DC voltage applied to the device (ie, Pulse-Width fied time after the supply voltage drops, Modulation or PWM control) and is calculated eg, to cool down a turbo-charged enbased on either the absolute temperagine after driving for some time. ture of one or two sensors, or During this “cooldown” period, the difference in temperature the fan(s) and pump(s) can be run at between two sensors. a reduced duty cycle, to avoid disUp to four temperature sencharging the battery too quickly. sors can be connected and these And the unit can be programmed can either be analog (NTC thermisto ignore periods of lower battery tors) or digital (Dallas DS18B20)     voltage, as would be the case in devices. Shown here vehicles where the battery is not There are four independent 10A close to life size, the charging while ever the engine output channels which can be used motor/pump controller fits is running. to control four separate fans/pumps, on a single PCB. While it has all SMD The relationship between senor they can be combined in pairs to components, construction is not difficult. 46 Silicon Chip Australia’s electronics magazine siliconchip.com.au Features & specifications • • • • • • • • • • • Supply voltage: .............................. 5-15V DC Outputs:............................................ 4 x 10A or 2 x 20A or 2 x 10A + 1 x 20A Supply protection:......................... can handle typical load dumps and other automotive spikes Quiescent current: ........................ typically <1mA Temperature sensors:................... up to four, each a 10k NTC thermistor or DS18B20 digital sensor Temperature sensor range:......... -55°C to +125°C (DS18B20), -30°C to +105°C (NTC) Temperature sensor accuracy: .. (-10°C to +85°C): ±0.5°C (DS18B20), typically ±1°C (NTC) PWM frequency: ............................ 0.1Hz to 160kHz (configurable; output capabilities vary) PWM duty cycle: ........................... 0% to 100% in 1% steps Configuration interface:............... USB port (serial console) Per-output configuration:........... which temperature sensors control duty cycle, minimum/maximum duty cycle, duty cycle hysteresis, duty cycle ramp speed, supply voltage compensation, motor characteristic compensation • Power supply configuration:....... switch-on voltage, switch-off voltage, switch-off delay, cooldown voltage threshold, cooldown delay and maximum time, cooldown mode duty cycle adjustment • Software features: ........................ status feedback, debugging • Other features:............................... configurable indicator LED on/off-board, shut-down/enable input sor temperature and fan/pump speed is controlled using numerous parameters which make the unit’s set-up very flexible. For example, you can specify both a minimum and maximum duty cycle for each output, along with the corresponding sensor temperature(s). You can also compensate for the fact that the load speed varies with supply voltage and that speed may not be proportional to voltage. For example, fan speed is roughly proportional to the cube root of the voltage applied (see siliconchip.com.au/link/aal6). The unit can linearise this control so that the fan speed doubles when the temperature (difference) doubles. All these various parameters are programmed over a USB interface so that you can avoid fiddling with trimpots or jumpers; depending on how you wire it, you can change its configuration without having to open the case – or possibly even the vehicle bonnet! This same interface can provide real-time feedback on the status of all the temperature sensors and output duty cycles. You can also temporarily override temperature sensor readings and the supply voltage to see whether the unit responds as expected. Circuit description Fig.1 shows the full circuit, which is based on PIC16F1459 microcontroller IC1. We chose this controller for the following properties: a USB interface, a very low sleep current (so it can be powered from a fixed battery supply), multiple hardware PWM outputs, multiple analog inputs plus a number of free digital inputs and outputs and sufficient flash memory and processing speed for a reasonably complex firmware program. This chip has two hardware PWM outputs at pins 5 (RC5/PWM1) and 8 (RC8/AN8/PWM2). These feed two halves of a dual low-side Mosfet driver, IC2 (TC4427A). IC2 is effectively just two high-current buffers; its output pins 7 and 5 follow the state of input pins 2 and 4 but the inputs draw minimal current (ie, have a high impedance) while the outputs can source and sink several amps peak. This high current charges and discharges the gate capacitances of Mosfets Q1a and Q1b quickly, giving rapid on and off transitions. Fast switching avoids the high dissipation which occurs when the Mosfets are in a partial siliconchip.com.au conduction state. These Mosfets are connected between the negative terminal of the fan/pump outputs at CON8 and CON9 and power ground. The positive terminal of each fan/pump output connects directly to the positive terminal of the high-current supply header, CON15. The power ground connection is also made at this connector. So essentially, the positive supply to each fan/pump comes directly from CON15 while the negative supply at CON15 connects to the fan/pump via the Mosfet channel. Hence, the Mosfets switch on power to each fan or pump when their gate is high and off when it is low. Mosfets Q1a and Q1b are in a single 8-pin SMD package and are each rated to handle up to 30V and 40A with a typical on-resistance of 4.34mΩ. This gives a continuous dissipation when conducting 10A of 434mW (10A2 x 4.34mΩ). Thus, the dual package could dissipate up to 868mW. The junction-to-ambient thermal resistance for this device is 95K/W, giving a maximum temperature rise of 82.5K (868mW x 95K), so with an ambient temperature of 55°C, we would expect a junction temperature of up to 137.5°C, which is well below the maximum rating of 175°C. In practice, the heatsinking effect of the PCB results in a lower temperature rise and so these Mosfets should each comfortably handle 10A continuously even, in the hostile environment of an engine bay. (A good rule of thumb is that a single 8-pin SOIC package can handle around 2W without becoming too hot, as long as it is connected to a reasonably-sized copper plane.) The same arrangement is used for driving fan outputs 3 and 4 at CON10 and CON11, using dual Mosfet driver IC3 and dual Mosfet Q2. These are controlled by digital output pins RC3 (pin 7) and RC4 (pin 6) of IC1. Since IC1 only has two hardware PWM pins, these must be software-controlled; they are updated from a timer-controlled interrupt handler routine which means that we can provide reasonably accurate PWM signals up to a moderate frequency (around 2kHz). Note that each output Mosfet (Q1a-Q2b) also has an associated diode to the +12VF supply rail (D1-D4). These are rated at 5A continuous, 200A peak (non-repetitive for 8.3ms) and 400V, and are included to absorb any back-EMF Australia’s electronics magazine October 2018  47 Fig.1: the Fan Controller is built around PIC microcontroller IC1, which provides PWM signals to Mosfet drivers IC2 and IC3. These then control Mosfets Q1a-Q2b to switch on and off and vary the speed of up to four fans or pumps. Up to four digital (DS18B20) or analog (10k NTC thermistor) temperature sensors can be connected via CON4-CON7. Configuration and monitoring are done via the USB interface at CON1 or CON3. from switched inductive loads such as fan motors. The back-EMF current could exceed 10A but would typically average much lower than this, well within the 5A rating. Temperature sensors Between one and four temperature sensors can be wired up to pin headers CON4-CON7. Each of these headers has a 4.7kΩ pull-up resistor from pin 1 to the 3.3V supply while pin 2 connects to ground. Pin 1 also connects to one of the following input pins on IC1: RC1/AN5, RC2/AN6, RB4/ AN10 or RB5/AN11 (pins 15, 14, 13 and 12 respectively). If a 10kΩ NTC thermistor is connected to one of these pin headers, it forms a voltage divider with the 4.7kΩ resistor to the 3.3V rail, so a voltage appears at the micro pin which drops with increasing temperature. In this case, the micro pin is configured as an analog input. The 3.3V rail is fed directly into pin 16 (VREF+) and is 48 Silicon Chip used as the ADC reference voltage. This allows for accurate ratiometric measurements of these voltages so that the temperature readings can be as accurate as the resistor and NTC tolerances allow. If a DS18B20 digital temperature sensor is used, it is configured in 2-wire mode, with its ground pin to pin 2 (ie, circuit ground) and its other two pins tied to pin 1. In this case, the sensor gets its supply voltage from the 3.3V supply via the 4.7kΩ resistor and the sensor and micro also communicate by briefly pulsing this pin low. Thus, the sensor pin is used as a digital I/O for digital sensors. During ADC conversions, the DS18B20 sensor draws more power, so the micro drives the relevant pin high to 5V, to ensure it is supplied with sufficient current. The fact that this is above the normal 3.3V level for this pin is not a problem because the DS18B20 can operate with a varying supply voltage as long as it is in the range of 3.0-5.5V. Australia’s electronics magazine siliconchip.com.au approximate range of -10°C to +105°C. The temperature sensor inputs could also be used as digital inputs under some circumstances, to either inhibit the operation of a fan or pump or to force it on. We’ll explain how to do this later. Essentially, if you leave an input open, you get a very low temperature reading while if you short it out, you get a very high temperature reading. Supply voltage sensing ERRATA PWM frequencies above 1kHz require a 30V+ schottky diode to be connected across the fan/pump, cathode to positive, with a current rating at least half the load’s maximum. Solder it across the unit’s outputs or the fan/pump terminals. We also suggest that you solder 10µF 25V X5R capacitors on top of the 100nF bypass capacitors for IC2 and IC3 and add a 2200µF 25V lowESR electrolytic between the +12VF and 0V (fan power input) terminals on the board. Note that the loads may run briefly when power is first applied; disconnect all loads before making a connection to CON2 (ICSP). Hence, no circuit changes are needed to use either an NTC thermistor or digital temperature sensor. You just have to tell the software which type of sensor you are using on which input, so it knows how to configure the corresponding pin. The measurement range for the DS18B20 is -55°C to +125°C and it has a specified accuracy of ±0.5°C from -10°C to +85°C. There is a precision/update rate trade-off with this type of sensor; at 1.25Hz, you get readings in 0.0625°C steps; at 2.5Hz, the steps are 0.125°C; at 5Hz, 0.25°C and at 10Hz, 0.5°C. The rate is software configurable. For an NTC thermistor, the software calculates readings from -50°C up to around +120°C but a typical thermistor is only be specified to operate from -30°C to +105°C (it may work outside these bounds but accuracy may suffer). We recommend the use of 1% tolerance thermistors which should give readings accurate to within about ±1°C in the siliconchip.com.au The unfiltered supply connection (nominally 12V) is applied to the emitter of high-voltage PNP transistor Q3. When IC1 brings its RB7 digital output (pin 10) high, this switches on small signal Mosfet Q4, as its gate voltage is then 5V above its source, which is connected to ground (0V). Q4 then sinks current from the base of Q3, via the 100kΩ series resistor, switching on Q3. The supply voltage is then applied to the 22kΩ/10kΩ resistive divider, resulting in a voltage at pin 9 of IC1 (analog input AN9) which is approximately one-third of that of the supply voltage. IC1 uses its 5V supply as the ADC reference voltage for this measurement, allowing it to measure a supply voltage of up to 16V (5V x 3.2). This is then used to decide whether IC1 should be active or go into low-power sleep mode and is also used to compensate the PWM output duty cycles for supply variations if that option is enabled. When IC1 is in sleep mode, pin 10 is driven low, switching off Q4 and Q3 and thus minimising the quiescent current. Dual diode D7 (with the two diodes connected in parallel) prevents damage to Q4, should there be a spike in the 12V supply, which could couple through the base-emitter junction of Q3 and across to the collector of Q4. Since the cathodes of D7 connect to the filtered and clamped 12V supply, any excessive voltage is conducted to TVS1 and dissipated within. When IC1 is active and pin 10 is high, this also supplies current to the input of reference regulator REG2, via a low-pass RC filter comprising a 220Ω resistor and 100nF ceramic capacitor. REG2 supplies minimal current – just the current through the four 4.7kΩ temperature sensor pull-up resistors (a maximum of 2.8mA) plus a few microamps to supply the VREF+ analog reference of IC1’s internal ADC (via pin 16). So its input is driven directly by digital output RB7 (pin 10) on IC1. This is the same pin used to control the gate of Q4, so when the supply voltage sensing is active, REG2 is also active, to provide the reference voltage to pin 16, allowing the ADC to make accurate supply and temperature sensor voltage measurements. The 220Ω series resistor from pin 10 to REG2 also limits the initial current spike from charging/discharging REG2’s 100nF input bypass capacitor to 15mA. Its low-pass filter action minimises any supply noise feeding through to the output of REG2. Power supply There are two separate power connectors; CON15 is used to feed power solely to the fans via Mosfets Q1 & Q2 while CON14 powers the rest of the circuitry. The two grounds are connected via a 1kΩ resistor for testing purposes but usually, they will both connect back to the negative terminal of the battery, effectively shorting that resistor out. The reason for the separate connectors is so when the Australia’s electronics magazine October 2018  49 fans/pumps are powered, the voltage automotive systems, so are longer drop along the wires does not affect the spikes at lower voltages. To avoid battery voltage measurement. the 220Ω resistor and TVS1 burning That could cause the unit to continuout in such a case (eg, during jump ally switch on and off if the battery voltstarting), PTC1 has been included. age is close to the cut-out threshold. That If it is conducting more than a few was a problem with our previous design, hundred milliamps, its resistance indespite it having significant built-in hyscreases after a short time. This limits teresis for the cut-out voltage. the long-term current and thus disPower for the board flows through resipation in itself and the other comverse polarity protection diode D6, two ponents. Once the supply voltage resmall schottky diodes within the same turns to normal, its resistance drops package that are connected in parallel to and it no longer has much effect on minimise the voltage drop. The supply We show the blank PCBs mainly circuit operation. current then flows through a small PTC because construction is a little unusual: REG1 is the primary regulator prothermistor and a 220Ω 3W SMD resistor using SMDs, all the components are viding power to the rest of the cirbefore reaching transient voltage sup- mounted on what would normally be cuit and it has a very low quiescent regarded as the “underside” of the pressor TVS1. current of just a few microamps. These components protect the cir- double-sided board. The large holes This means that when IC1 is in sleep along the edge allow large terminals for cuitry from the voltage spikes which are mode, the whole circuit normally connecting heavy-current motors, etc. common in automotive supplies. TVS1 draws less than 1mA and so has virclamps the voltage at input pin 8 of REG1 to a maximum tually no effect on battery life. of about +18V and -1V while conducting around 1A; this We’re using the high-voltage version of this regulator, value is based on an expected maximum spike voltage of rated to survive with an input in the range of -50V to +60V, around ±200V with current limiting due to the 220Ω se- for maximum robustness, even though the input protecries resistor. tion circuitry should prevent its supply voltage from ever While brief (~1ms), high-voltage spikes are common in coming close to those extremes. Fig.2: this web-based software (which can be run on the local PC if necessary) provides a simple interface for setting all the configuration parameters for the DC Fan Speed Controller. The text at the bottom is automatically updated and if sent to the unit’s USB serial console, will set the new configuration automatically. You can also read the configuration back out of the unit using the reverse procedure. 50 Silicon Chip Australia’s electronics magazine siliconchip.com.au This regulator requires an output filter capacitor with an ESR in a specific range for stability, so we have carefully chosen a 22µF 16V tantalum capacitor with a suitable ESR over a wide temperature range, to ensure it works well in the hostile environment of an engine bay. There is no onboard fuse for the fan supplies but a fuse is required. If you don’t have a suitable spare fuse in your fuse box, you need to add an inline fuse between the battery positive terminal and pin 1 of CON15 with a sufficiently high rating to handle the full load current. Shut down/enable input CON12 provides a method to shut down the unit’s outputs when they are not needed. For example, it could be wired to a switch in the cabin to enable or disable the extra fans or to an ECU or another computer which may decide to shut them down for some reason. By default, pulling the RA4 digital input (pin 3) on IC1 low shuts down all the outputs and this pin is held high using a software-enabled internal pull-up current. Pin 3 can be pulled low by making a connection between the pins of CON12. But the software settings can also be changed to invert the operation of this pin so that it must be pulled low to enable the outputs. USB interface The signal pins on USB socket CON1 (D- and D+) connect directly to the USB pins on microcontroller IC1 (pins 18 and 19). The micro has all the internal circuitry required for USB communication. The USB 5V pin is wired to IC1’s digital input RB6 (pin 11) via a 100kΩ resistor, so that pin is pulled high when a USB host is connected. Dual schottky diode D5 (again paralleled) allows current to flow to the micro’s 5V supply from the USB socket, so the unit can be programmed without needing an external power supply wired up to CON14. If there is already power at CON14, D5 does not conduct unless the USB 5V rail is significantly higher than 5V. D5 also prevents current from being fed back into the USB port if the USB 5V rail is a bit low. When powered from the USB supply, Mosfet drivers IC2 and IC3 have no supply voltage, so we avoid driving their inputs. Microcontroller IC1 detects this condition and disable all the PWM outputs unless the supply rail which feeds these chips is above 5V, to avoid current flowing through their input clamp diodes. IC1 needs to know when a USB connection is made so it can initiate communications with the host. If power is coming from the USB connector, then this happens immediately at power-up but if power has already been applied externally, then the only way to know when to initiate communication is by monitoring the state of pin 11. But this is a little tricky since we haven’t provided any pull-down resistor on that pin to ensure its level is low when the USB cable is not connected (this was done to save space). The trick is that we briefly set pin 11 as a digital output and pull it actively low, then set it as an input again and check the voltage. The small pin capacitance ensures that the voltage is still close to 0V when we read its state unless the USB supply is present and pulling it up to 5V. So this allows us to avoid needing the extra component; the 100kΩ series resistor is necessary to ensure that excessive current does not flow siliconchip.com.au Parts list – DC Fan/Pump Controller (main board) 1 double-sided PCB, code 05108181, 68 x 34.5mm 1 MINIASMDC014F PTC thermistor, 4832/1812 SMD package (PTC1) 1 SMD mini type B USB connector (CON1) 1 5-pin header (CON2) 1 4-pin header (CON3) 6 2-pin polarised headers with matching plugs (CON4-CON7,CON12,CON13) Semiconductors 1 PIC16F1459-I/SO microcontroller programmed with 0510818A.HEX (IC1) 2 TC4427AEOA dual low-side Mosfet drivers, SOIC-8 (IC2,IC3) 1 LM2936HVMAX-5.0 LDO regulator, SOIC-8 (REG1) 1 MCP1700-3.3 3.LDO regulator, SOT-23 (REG2) 2 BUK7K5R1-30E dual N-channel Mosfets (Q1,Q2) 1 MMBTA92 high-voltage PNP transistor, SOT-23 (Q3) 1 2N7002 N-channel Mosfet, SOT-23 (Q4) 1 blue high-brightness SMD LED, SMA package (LED1) 1 TPSMD14A transient voltage suppressor, SMC case (TVS1) 4 SD2114S040S8 5A 400V schottky diodes, SMB case (D1-D4) 3 BAT54C dual schottky diodes, SOT-23 (D5-D7) Capacitors (all SMD 3216/1206 size, 50V X7R unless otherwise stated) 1 22µF 16V SMB case tantalum [Vishay/Sprague 293D226X0016B2T] 1 10µF 16V X7R 1 1µF 25V X7R 1 470nF 50V X7R 4 100nF 50V X7R 1 1nF 50V X7R Resistors (all SMD 3216/1206 size, 1% unless otherwise stated) 2 100kΩ 1 39kΩ 2 10kΩ 4 4.7kΩ 3 1kΩ 2 220Ω 1 220Ω 5% 3W SMD 6331/2512 Other parts (case, wiring, sensors etc) 1 IP65-rated case large enough for the PCB 1-4 waterproof 10kΩ NTC thermistors with cables (TS1-TS4) and/or 1-4 waterproof DS18B20 temperature sensors (TS1-TS4) 1 USB cable with Type-A connector or chassis-mount Type-B USB socket (optional) 1 inline blade fuse holder rated at 40A or higher 1 40A blade fuse various lengths of heavy duty automotive wire (10A and 40A, red and black) through the clamp diode on that pin while the 5V bypass capacitors are charging immediately upon power-up. The unit automatically comes out of sleep mode if a USB cable is connected, so that you can communicate with it, and stays out of sleep mode as long as the USB cable is attached. But it still shuts down the outputs based on the supply voltage, so the fan/pump behaviour is not affected by using the connection state of the USB interface. In addition to the onboard micro USB connector, the USB connections are broken out to a 4-pin header, so that a USB cable or waterproof socket can be soldered directly Australia’s electronics magazine October 2018  51 to the board and either fed through a grommet in the case or mounted on the case respectively. LED feedback and programming LED1 is provided as a means to determine what the unit is doing. It can be programmed to light up when the unit has power, or light up when the unit is active (ie, not in sleep mode). Or it can be set to change brightness depending on the maximum output duty cycle. It is driven from digital output RA5 (pin 2), using software PWM to control brightness, as all the hardware PWM pins are used for the fan/pump outputs. Five-pin header CON2 allows microcontroller IC1 to be programmed once it has been soldered to the board. We expect most constructors would purchase a pre-programmed micro but if there is a software update, or if you want to program it yourself, this is possible using a PICkit 3 or PICkit 4 plugged into CON2. CON2 is designed so that it does not need to be soldered to the board; the pin header is a friction fit so it can be inserted when needed and then removed when programming is complete. High-current connections Note that while CON8-CON11, CON14 and CON15 are labelled as connectors, in each case, they are actually a pair of pads on the PCB. This is because, to save space and because of the high currents involved, and for reliability reasons, we decided it was best to make these connections by soldering wires directly onto the PCB. As you can see from the photo, the pads are large enough for thick copper wire, to ensure it can handle the high currents without excessive voltage drops or wire heating. The wires are clamped or glued to holes in the case so that the solder joints do not fatigue and fail from vibration. Set-up and software Initially, the plan was for the unit to be completely configured and controlled using the USB port, via a serial (text) interface. You would send it commands and it would display a response. This would let you set and view all the parameters, see the status and send testing commands to check that it’s operating as expected. Unfortunately, although we are using the version of this chip with the maximum amout of flash memory (16384 bytes), it was simply impossible to fit all these functions into the space available. So what we have done instead is created a separate piece of software that you run on a computer, which allows you to set all the various configuration parameters. This then produces a code which you “copy and paste” into the serial terminal to update the configuration programmed into the chip. To simplify the software, this code is a text representation of the bytes to write into the chip’s configuration memory. This interface is shown in Fig.2. The various parameters have been chosen at the top and the long configuration string is shown at the bottom. This updates as soon as you make any changes to a parameter and there’s a convenient button to copy it, ready for pasting. The USB interface provides a method to dump the unit’s configuration in the same format, and if you copy and paste this back into the setup software shown in Fig.2, all the configuration data at the top of the page is updated with the values you chose last time. So the process of making small changes to the unit’s configuration is quick and easy. You just dump the configuration in the text console, copy it, paste it into the app, make the changes, then copy the new string and paste it back into the text console. You can skip the first few steps when making subsequent changes since you will already have the app open. Status monitoring and debugging The monitoring/debugging interface lets you easily “peer inside the black box” of the Fan Controller to see what it is doing. This is done by issuing commands over the USB text console. For example, if you type “show status” then you get a listing of the current supply voltage, the temperature readings of all the connected sensors and the PWM duty cycle and frequency of each output (see Fig.3). Once you have set the unit up, so that you don’t have to manipulate the battery voltage and sensor temperatures to verify that it’s doing its job correctly, you can also issue commands to override the battery voltage and/or the temperature readings. For example, if you issue the command “override TS2 57C”, the unit behaves as if temperature sensor TS2 is giving a reading of 57°C. You can verify that the fans/pumps respond as expected, then issue another command so that the reading goes back to normal. Overriding the supply voltage works similarly. The operation of the USB interface does not interfere with the unit’s other functions, so if you can route the USB cable to allow it, it would be possible to drive around and have someone in the passenger seat monitor the temperatures, fan speeds etc, to see how they respond. Coming next month Next month we will have the full construction and wiring details of the new DC Fan Speed Controller as well as more details on how the software works, the various settings, the SC control commands and other helpful instructions. Fig.3: the text-based USB serial console interface allows you to monitor the unit’s status in real time, read and update its configuration dynamically and also perform debugging/testing actions which allow you to see how the unit responds to changes in sensor temperatures and/or supply voltage variations. 52 Silicon Chip Australia’s electronics magazine siliconchip.com.au DIY Home Entertainment. UPGRADE YOUR AUDIO VISUAL SYSTEM $ 139 $ NOW 3995 $ AC-1782 8995 AC-1781 SAVE $5 BLUETOOTH® AUDIO RECEIVER WITH MUSIC CONTROL AA-2087 WAS $44.95 A clever and convenient way to listen to your music or take calls on the go without having to be tethered to your phone or Tablet. Built-in NFC for quick sync. • Rechargeable battery • Up to 8hrs usage CS-2400 FROM $ 6995 pr SAVE $20 HDR HDMI Splitters Conveniently split your HDMI source components to drive up to four HDMI equipped displays. Transmit up to 18Gbps with no data loss. Built-in equaliser, retiming & driver. Includes audio support for up to 7.1 surround sound and 4K resolution. 2 OUTPUT SINGLE INPUT AC-1781 4 OUTPUT SINGLE INPUT AC-1782 129 KEVLAR COAXIAL CAR SPEAKERS Provides clean, crisp, natural and smooth balance sound. All models are paired with soft dome tweeters. Sold as a pair. 4" 40WRMS CS-2400 WAS $89.95 NOW $69.95 SAVE $20 5" 50WRMS CS-2401 WAS $119 NOW $99 SAVE $20 6.5" 75WRMS CS-2402 WAS $139 NOW $119 SAVE $20 PORTABLE WIRELESS UHF PA SYSTEM AM-4095 WAS $199 Streams music or backing tracks via Bluetooth® or audio cable. Includes wireless microphone and built-in amplifier/controller. 30WRMS. Rechargeable. • USB/microSD slot for recording NOW 149 Learn About... $ HDR HDMI SWITCHER AC-1780 Connect up to 4 HDMI sources to one display (or another receiver). Support up to 4K × 2K resolution. Infrared remote control and mains power adaptor included. • HDMI & 3.5mm audio outputs HIGH DYNAMIC RANGE (HDR) High Dynamic Range (HD R) video is a giant leap in true to life 4K video image quality. It pro duces deeper and more vivid col our with more detail shown bet s, ween the bright and dark colour s on your screen. With HDR, sha dows no longer appear as void blacks, but show greater detail wit h more shades. READ THE FULL ARTICLE: jaycar.com.au/4khdr $ SAVE $50 NOW $ 279 149 $ MORE ON PAGE 4 2.4GHZ WIRELESS 1080P HDMI AV SENDER AR-1905 Full HD 1080p HDMI support makes this AV sender plug and play with most digital pay TV or home theatre systems, providing an amazing clarity at up to 15m line of sight. Includes infrared emitter, infrared receiver and two mains power adaptors. MORE ON PAGE 4 50M 1080P HDMI CAT5E/CAT6 EXTENDER WITH INFRARED AC-1783 Extends HDMI connections over a single Cat5e/6 cable. Ideal for running HDMI signals to new locations or connecting through existing building cables. Includes HDMI loop output. • Range: Up to 50m (CAT6), 40m (CAT5E) 199 $ SAVE $50 INTRO PRICE $ 49 $ 95 ANALOGUE AUDIO TO DIGITAL MP3 CONVERTER 240WRMS STEREO AMPLIFIER AA-0520 WAS $249 Provides crisp audio power with two channels at 120WRMS each. Ideal for powering a second set of speakers elsewhere in your home or office. Dual line audio input. Remote control included. • RCA input • 6.5mm output 99 SAVE $30 GE-4103 Easily convert your older vinyl records, cassette tapes, or any other audio source to digital MP3! Includes infrared remote control, 3.5mm audio cable, USB power cable and USB mains power adaptor. • Inputs: RCA & 3.5mm • Outputs: 3.5mm, USB & SD USB STREAMING MICROPHONE AM-4133 RRP $129 Improve your podcasting or audio recording. Solid triple-layered grille for durability. Wide frequency response (20Hz to 20kHz). High sampling rate for quality sound. Plug and play operation. • 200mm long Buy Online, Click & Collect In Store. Catalogue Sale 24 September - 23 October, 2018 To order: phone 1800 022 888 or visit www.jaycar.com.au Maker Hardware We love making things as much as you do. Get started, or add to your collection of Arduino and Raspberry Pi compatible hardware, and build something new! AS-3000 WAS $169 159 $ FROM 3 $ 95 SAVE $10 Arduino Compatible ADD SOUND TO YOUR PROJECT All purpose replacement speakers for your next project. 8 ohm. 57MM 0.25W AS-3000 $3.95 76MM 1W AS-3006 $4.25 100MM 2W AS-3008 $4.75 50 × 90MM 5W AS-3025 $6.95 125MM 6W AS-3007 $7.95 Raspberry Pi Media Player Kit XC-9012 Includes everything you need to turn your HDMI TV into a customisable media centre. Includes: Raspberry Pi 3B, ABS case, HDMI cable, power supply and USB cable, mini wireless keyboard/trackpad with media functions, microSD card installed with Media software. 3 4 $ 95 7 $ 95 AMPLIFIER MODULE XC-4448 The easy way to add sound to your project. For more volume than XC-4424, connect this Hook up a digital pin and ground, and use the module to drive a small speaker (up to 3W). ® tone() function to get your Arduino beeping. The high efficiency Class D amplifier runs between 2.5V - 5.5VDC. 19 95 $ $ MP3 RECORDING MODULE XC-4516 A full featured MP3 module that supports both playback and recording. An onboard microphone is used for audio input, and a 3.5mm jack provides the output. 44 95 49 95 ARDUINO® ROBOT BONANZA BOOK BM-7136 This book guides you through the construction of 7 robots that roll, walk, talk, slither and even sling insults at you. • 370 pages, 230 × 185mm softcover ARDUINO® WORKSHOP BOOK BM-7137 Learn to make projects that add-on to your Arduino® microcontroller platform. 65 projects. • 370 pages, 180 × 235mm softcover 54 39 95 RECORD AND PLAYBACK MODULE XC-4605 Includes a small built-in amplifier capable of directly driving an 8 ohm speaker. Ideal if you need to playback a specific sound. Records up to 10 seconds. $ MIDI SHIELD XC-4545 Add music by giving your project a powerful MIDI communication protocol. Provides both MIDI-IN and MIDI-OUT connections, as well as a MIDI-THRU port. 49 95 MUSIC SHIELD XC-4544 Combines all the components you need to build an MP3 player in one shield. Includes MP3 decoder IC (which also does WAV and MIDI), micro SD card slot and control buttons. Theremin Synthesiser Kit MkIII KC-5537 REF: SILICON CHIP MAGAZINE JANUARY 2018 $ $ Great for your project that needs to detect sounds. Includes both analogue (for waveform) and digital output with adjustable threshold for simple sound detection. $ XC-4595 Based around one of the IC’s commonly used to add FM radio reception to mobile phones and other gadgets. Provides a stereo 3.5mm socket for output and capable of driving headphones directly. $ 95 MICROPHONE SOUND SENSOR MODULE XC-4438 24 95 SI4703 FM TUNER BREAKOUT BOARD $ 9 $ 95 ACTIVE BUZZER MODULE XC-4424 Raspberry Pi Compatible 9995 Produces that truly retro sound that you hear in movies such as the soundtrack for the 1951 film “The Day the Earth Stood Still”. This new design is easier to build than ever before with the volume plate incorporated into the circuit board. Also, most components are mounted on the circuit board to eliminate messy wiring, and the on-board voltage regulation to suit a 9VAC power supply helps eliminate noise that usually comes from modern switch mode power supplies. It can also be powered by an external 12V battery. 9 $ 95 “THE CHAMP” AUDIO AMPLIFIER KIT KC-5152 REF: SILICON CHIP MAGAZINE FEBRUARY 1994 This tiny module uses the LM386 audio IC and will deliver 0.5W into 8 ohms from a 9V supply making it ideal for all those basic audio projects. • PCB and electronic components included. CAN'T FIND THE KIT YOU ARE LOOKING FOR? CHECK OUT OUR KIT BACK CATALOGUE: jaycar.com.au/kitbackcatalogue Follow us at facebook.com/jaycarelectronics Catalogue Sale 24 September - 23 October, 2018 Arduino® Project Of The Month Guess That Song Game: Turn your living room into a real life game show and have fun playing it with your family and friends. Prepare some MP3 files (songs/tunes) on an SD card, and try to be the first to guess that song. Arcade buttons are included to provide that quiz show feel, with a small LCD screen providing the name of the file just played. See who has the most musical knowledge between songs of today and yesteryear. SD card not included. STEP-BY-STEP INSTRUCTIONS AT: jaycar.com.au/guess-that-song-game VALUED AT $184.32 Finished project contains 4 × controllers. NERD PERKS CLUB OFFER BUY ALL FOR 129 $ SKILL LEVEL: INTERMEDIATE TOOLS: SOLDERING IRON, HOLE SAW SAVE OVER $55 WHAT YOU NEED: RASPBERRY PI 3B ENCLOSURE FOR RASPBERRY PI 8 × 3.5MM STEREO SOCKET 4 × JIFFY BOX RED ARCADE BUTTON SWITCH YELLOW ARCADE BUTTON SWITCH BLUE ARCADE BUTTON SWITCH GREEN ARCADE BUTTON SWITCH 4 × 3.5MM STEREO PLUG TO 3.5MM STEREO PLUG 4 × BC327 PNP TRANSISTOR 10K OHM 0.5W METAL FILM RESISTORS PK8 2.7K OHM 0.5WATT METAL FILM RESISTORS PK8 XC-9000 $74.95 XC-9002 $9.95 PS-0132 $1.35 EA HB-6015 $2.95 EA SP-0662 $9.95 SP-0664 $9.95 SP-0666 $9.95 SP-0665 $9.95 WA-7009 $8.50 EA ZT-2110 48¢ EA RR-0596 55¢ RR-0582 55¢ SEE OTHER PROJECTS AT: www.jaycar.com.au/arduino Cabling For Audio Professionals: 2 /m $ 95 FROM FROM 052 PP-1 7 $ 95 PROFESSIONAL MICROPHONE CABLE XLR AMPHENOL CONNECTORS WB-1540 4 core screened. Sold by the metre or by the roll. Solder type. Diecast metal shell. 3 PIN MALE PP-1052 $7.95 3 PIN FEMALE PS-1062 $8.95 2 $ 95 4 $ 95 Cabling For Audio Visual Installations: BREADBOARD LAYOUT PROTOTYPING BOARDS 28 PIN SOIC/SOP TO DIP BREADBOARD ADAPTOR PI-6530 A fantastic way to transfer your breadboard design to PCB without having to rework it. SMALL 25 ROWS/400 HOLES HP-9570 $4.95 LARGE 59 ROWS/862 HOLES HP-9572 $9.95 Allows SMD IC’s and other smaller pitch components to be used with standard 0.1” prototyping equipment. 30 PP-02 3 /m $ 50 3 ea $ 95 7 $ 95 32 PP-02 $ 34 95 TRIPLE AUDIO/VIDEO CABLE PREMIUM GOLD PLATED RCA PLUGS SMD IC BK1198 RADIO RECEIVER LIGHT DUTY HOOK-UP WIRE PACK WB-1554 2 × audio & 1 × video. Sold by the metre or by the roll. Best quality. Red, yellow and black colours available. ZK-8829 All-in-one radio receiver chip that will do AM, FM and shortwave from 2.7-22MHz. • Comes in 16 pin SOIC package WH-3009 Quality 13 × 0.12mm tinned hook-up wire on plastic spools. 8 rolls of different colour included. • 25m on each roll Cabling For Your Hi-Fi Speakers: 4 ea $ 95 $ 32 95 /roll 30M SPEAKER CABLE WB-1709 Heavy duty. 24/0.20mm Figure 8 with trace. 26 4 PP-0 GOLD PLATED BANANA PLUGS Designed for heavy duty speaker cable. RED PP-0426 BLACK PP-0427 To order: phone 1800 022 888 or visit www.jaycar.com.au FREE Jumper Leads Prototyping Board Shield XC-4482 427 PP-0 (WC-6024) WORTH $5.95 With every purchase of XC-4482. This stackable shield makes semipermanent prototyping simple. $ Provides solder-pad access to all the Arduino's pins and a large area of isolated pads. • Includes reset button • SOIC-14 breakout, for surface mount ICs • 68(L) × 53(W) × 12(H)mm 1595 See terms & conditions on page 8. 55 High Definition Home TECH TALK: HDMI AV Senders AV Senders allow you to share audio visual content with multiple display devices around your home, office, meeting room etc. It incorporates HDMI for higher resolution video. Excellent, lower cost alternative to professional AV installation. Come in and ask us about which one is best for you! LEARN MORE AT: jaycar.com.au/avsender $ 369 $ 399 $ MINI 5.8GHZ WIRELESS 1080P HDMI AV SENDER AR-1909 5.8GHZ WIRELESS 1080P HDMI AV SENDER AR-1908 Perfect for travelling, presentations, lecturing, or even home streaming from your laptop. Plugs straight into the HDMI socket on your laptop or PC. • 5.8GHz digital transmission • HDMI 1.3 & HDCP1.2 compliant • Up to 20m transmission range Ideal for home theatre systems, gaming, meeting rooms, and much more. • 5.8GHz digital transmission • HDMI 1.3 & HDCP1.4 compliant • Infrared Extender • Up to 30m transmission range HDMI Extenders: 1080P – TCP/IP CAT6 100M 179 AR-1828 WAS $59.95 Suitable for controlling devices hidden behind cabinets e.g. for use with Hi-Fi, DVD etc • 2 × dual IR emitter cables and mains power adaptor included 249 4K – CAT6 50M AC-1737 Allows you to use your infrared remote control from the receiving point, so you can control the device you are sending video from. Compatible with all standard HDMI audio including Dolby Digital and surround sound. • Range: Up to 50m (CAT6) • HDMI 1.4 & HDCP 2.2 compliant • Power: 12VDC (mains adaptor included) • 88(L) × 61(W) × 17(H)mm 66 $ SAVE $20 FROM 49 A NOW 59 95 SAVE $20 2-INPUT IR EXTENDER KIT AR-1812 WAS $79.95 Suitable for controlling devices hidden behind cabinets and to extend the range of your IR remote control to another room. • Up to 6 × IR emitter output connections NOW 69 95 SAVE $15 95 BIDIRECTIONAL IR EXTENDER OVER CAT5E - 100M AR-1809 WAS $84.95 Splits a single HDMI input to multiple HDMI outputs without losing audio or video quality. • HDMI 2.0 & HDCP 2.2 compliant 2 OUTPUT SINGLE INPUT AC-1766 $49.95 AC-1714 WAS $129 Distribute up to four HDMI sources to 2 displays simultaneously. Up to 4K UHD resolution. Remote control included. • 4 × HDMI inputs, 2 × HDMI outputs • Audio & video EDID support • Supports 12 bit per channel deep colour $ $ 7 C-1 HDMI UHD SPLITTERS 4 × 2 HDMI MATRIX SWITCHER SPLITTER NOW 49 95 4 CHANNEL IR EXTENDER KIT NOW 109 $ $ SAVE $10 $ 1080P – CAT6 150M AC-1746 Uses bi-directional Power-Over-Cable (PoC) technology to run the power over the CAT5E/CAT6 Ethernet cable and connect the power supply to either the transmitter or receiver. • Range: Up to 130m (CAT5E), 150m (CAT6) • HDMI 1.4 compliant • Power: 24VDC (mains adaptor included) • 65(L) × 115(W) × 25(H)mm IR Emitter and Extender Kits enable you to interface all your IR remote controlled devices together and control them from a single point. $ AC-1734 Uses TCP/IP protocol to be able to split a HDMI signal to multiple displays through a common home router or switch (requires extra receivers AC-1735 available separately). Built-in IR repeater. • Range: Up to 20m (CAT5E), 100m (CAT6) • HDMI 1.3 compliant • Power: 5VDC (mains adaptor included) • 100(L) × 65(W) × 25(H)mm 229 HDMI OVER POWERLINE KIT AR-1903 Ideal for locations with concrete walls or complex structures where RF transmission isn't suitable. Signal is sent over the building's existing power lines. • HDMI 1.3 & HDCP 1.4 compliant • 3D Support • Infrared Extender • Up to 300m transmission range Infrared Extenders: Easily extends your HDMI source to a display using CAT5E/6 cable. $ Limited Stock. 8 OUTPUT SINGLE INPUT AC-1769 $149 Suitable for controlling devices up to 100m away including behind cabinets or walls in different rooms. Ideal for domestic and commercial applications including digital signage, demo stations or video conferencing etc. • 2 × IR emitter output connections $ 19 95 $ $ 29 95 USB TYPE-C TO 3.5MM AUDIO ADAPTOR WC-7930 DISPLAY PORT PLUG TO HDMI SOCKET WQ-7422 Quick and easy headphone connection for your USB Type-C enabled device such as Smartphone, tablet, laptop or PC. Plug and play. 80mm long. Connects from a display port plug to a HDMI socket for connecting to a high definition TV or monitor. 150mm long. 56 449 $ 29 95 HDMI TO TYPE C LEAD WQ-7412 Type A plug to Type C or 'Mini' plug cable for connection to portable HDMI devices. 3m long. Follow us at facebook.com/jaycarelectronics FROM 79 95 AMPLIFIED HDMI LEADS Ideal for long runs. Designed to compensate for any loss over the length of the run. Suitable for Full HD, 4K, 3D, and UHD signals. 10M WQ-7437 $79.95 15M WQ-7438 $99.95 20M WQ-7435 $119 30M WQ-7439 $139 Catalogue Sale 24 September - 23 October, 2018 More Than Just Sound! Bluetooth® Audio Speakers: Bluetooth® technology offers a quick and easy way to stream just about anything from your phone, tablet or laptop to devices such as car radios, portable speakers, Hi-Fi stereos and more. The technology is most popular in speakers allowing people to play their tunes direct from their Smartphones and Tablets to a speaker without the need of an amplifier. Speakers come in all shapes and sizes with some even incorporating smart functionality (such as Google Assistant etc.) others waterproof to take your tunes outside. Bluetooth® speakers are becoming extremely popular as they are: • Easy to use with simple set up • Portable - can connect to a variety of devices anytime, anywhere! NOW 19 95 $ SAVE $5 LED LAMP SPEAKER XC-5228 WAS $24.95 Easy to use with great sound. LED illumination. Changes colour. Adjustable brightness. Up to 10m range. • Speaker: 3W • Rechargeable Li-Po battery • 3.5mm AUX, microSD Card • Up to: 5hrs playback /3hrs charge time • 121mm long NOW $ 39 95 $ 69 $ 95 4W 360° SURROUND SOUND SPEAKER 2 X 4W 360° STEREO SURROUND SOUND SPEAKER XC-5240 XC-5236 Mini size perfect for the outdoors. Up to 10m range. • Waterproof IPX7 • Speaker: 4W • Rechargeable Lithium-ion battery • Hands-free calls • 3.5mm AUX • Up to: 8hrs playback /4hrs charge time • 117mm long 89 SAVE $40 Features True Wireless Stereo (TWS) technology which allows you to play true left and right channel audio with the purchase of an additional speaker. NFC™ connectivity for quick sync. Up to 10m range. • Waterproof IPX7 • Speaker: 2 × 4.3W • Rechargeable Lithium-ion battery • Hands-free call • 3.5mm AUX • Up to: 12hrs playback /5hrs charge time • 168mm long Due Mid October. STEREO VIBRATION SPEAKER XC-5229 WAS $129 Integrates a resonator for massive sound with richer bass and higher overall volume. Up to 10m range. • 2 × 5W (Speaker) / 26W (Resonator) • Rechargeable Li-Po battery • 3.5mm AUX • Up to: 4hrs playback /3hrs charge time • 140mm long Smart Speaker with Google Assistant Smart, wireless, take anywhere speaker. Experience a life of new possibilities with Google Assistant by your side. Built-in rechargeable battery (via USB) up to 6 hours use, Wi-Fi & Bluetooth®, splashproof and available in 2 stylish colours. BLACK XC-6000 WHITE XC-6001  IPX6 SPLASHPROOF  DYNAMIC FULL RANGE 360° SURROND SOUND  TAPCONNECT TECHNOLOGY ONLY $ MINI IN SIZE, 99ea HUGE ON SOUND Wait, There's More... ONLY 14 95 $ SAVE $5 ONLY 19 95 $ SAVE $5 $ ONLY 29 95 SAVE $10 $ ONLY 39 95 SAVE $20 MINI SPLASHPROOF SPEAKER SHOWER SPEAKER SPEAKER WITH NFC TECHNOLOGY RUGGED & WATERPROOF SPEAKER XC-5227 ORRP $19.95 • Accept/reject incoming call • USB recharge • Up to: 6hrs playback / 3hrs charge time • 70mm (dia.) XC-5630 WAS $24.95 • Comes with suction cup • Waterproof • Up to: 5hrs playback / 3hrs charge time • 93mm long XC-5209 WAS $39.95 • 2 × 3WRMS • Microphone and hands free support • Up to: 7hrs playback / 3hrs charge time • 165mm long XC-5213 WAS $59.95 • 2 × 4WRMS • IP66 rated splashproof • Impact resistant • Up to: 8hrs playback / 2hrs charge time • 195mm long To order: phone 1800 022 888 or visit www.jaycar.com.au See terms & conditions on page 8. 57 Workbench Essentials: There has been an obvious resurgence in people getting back to the workbench and reviving skills involving manual dexterity. As you will see across the following pages, Jaycar has all the DIY tools you'll need to equip your workbench so you can create projects from the power of your brain and your hands. 199 $ 3 FREE Keychain Measuring Tape (TH-2500) Valid with purchase on any of the workbench essential products, TD-2000, QP-5040,QC-1929, AA-0414, AA-0405 & TH-1846 4 19 95 $ $ NOW 24 95 SAVE $5 5 2 $ NOW 64 95 SAVE $15 6 $ NOW 1 39 95 7 $ 45 HALF PRICE! SAVE $7.50 1. F-TYPE REMOVAL TOOL TD-2000 WAS $14.95 • Insert or unscrew F-Type or BNC connector • Comfortable grip • Carbon steel • 255mm long 2. 0-15V ANALOGUE BENCH VOLTMETER QP-5040 NEW • 3V and 15V scales • Zero offset adjustment • Quick and easy to read display 3. 20MHZ USB OSCILLOSCOPE QC-1929 • Ultra portable • USB interface plug & play • Automatic setup • Waveforms can be exported as Excel/ Word files • Spectrum analyser (FFT) • Includes 2 probes 4. SPEAKER POLARITY TESTER WITH TONE GENERATOR AA-0414 WAS $29.95 • Sinewave tone generator, speaker polarity and RCA cable tester • Output Range: 0V-8V • RCA or alligator clips • 9V battery required 5. ROADIES CABLE TESTER AA-0405 WAS $79.95 • Test cables: Speakon, RCA, USB, RJ45 etc. • LED indicators • Bullet-proof all-metal construction • Requires 1 × 9V battery (SB-2423 $3.95) 6. RATCHET CRIMPING TOOL TH-1846 • Heavy duty • Crimps BNC/TNC connectors onto RG58/59/62 coax cable • Ratchet mechanism for accurate and reliable crimps Sound Level Meters: $ 39 95 SAVE $10 13 $ 95 119 $ SAVE $10 1ea QM-1592 Ideal for vehicle, traffic, race or any evidencebased noise testing. • Dynamic Range: 50dB • Accuracy: ±1.4dB • Calibration: 94, 114dB • A & C weighted • Fast and slow response • Compliant with Type 2 (Class 2) standards BRUSH CABLE ENTRY WALL PLATE PS-0291 Flush type. Accept standard keystone 110 jacks. Single to 6 port available. Single gang brush plate for cable entry through walls etc. Suitable for pre-terminated cables going to LCD or plasma screens. FROM 2 AUDIO & VIDEO KEYSTONE INSERTS $ 349 SAVE $30 58 For audio and video applications. Fits standard 110 keystone wall plates above. S-VIDEO - S-VIDEO PS-0769 $2.95 HDMI - HDMI PS-0771 $8.95 RCA - RCA WHITE PS-0764 $2.95 RCA - RCA RED PS-0765 $2.95 RCA - RCA YELLOW PS-0767 $2.95 SAVE $20 SOUND RING - SPEAKER SINGLE DOOR KIT AX-3667 WAS $39.95 Optimise sound waves and prevent losses. Foam. 3M adhesive backing. Outer ring and inner circle. • 195mm dia. $ HDMI WALL PLATE WITH FLYLEAD PS-0281 Standard Australian/NZ GPO mount with HDMI sockets for AV installations. Comes with a single or dual HDMI port with flexible 150mm flylead for better inner wall clearance. 3 12 95 $ 95 $ 75 OHM TV FLOOR SOCKET LT-3063 Designed to mount on the skirting board or floor. • F59 connection at rear • PAL socket output • Mounting screws included Follow us at facebook.com/jaycarelectronics NOW 19 95 $ 14 95 $ 95 YN-8050 WAS $379 Self-adhesive and easily moulded. Provides acoustic isolation and insulation for roof, firewall, floor, doors, etc. 330mm wide. FOAM ABSORBER AX-3662 $14.95 BUTYL DEADENER AX-3687 $29.95 BUTYL/FOAM COMBO AX-3689 $29.95 KEYSTONE WALL PLATES $ 95 A 9 $ 75 PROFESSIONAL WITH CALIBRATOR 62 6 X-3 SOUND DEADENERS Ideal for any surface that needs to be deadened e.g. car door or floor panels. It completely damps (ie prevents) any panel resonating from high power speakers. • 675(L) × 330(W) × 2.3(D)mm WAS $129 FROM 14 95 $ HEAVY DUTY SOUND BARRIER DAMPING MATERIAL AX-3680 COMPACT QM-1589 Great for car audio installers, clubs and PA. • Range: 30 - 130dB • A & C weighted • Data hold & min/ max function, backlight • Fast and slow response HALF PRICE! WAS $49.95 PS-0769 MICRO QM-1591 Ideal for environmental, safety and sound system testing. • Range: 40 - 130dB • A weighted • Pocket size, min/max hold, backlit COAX SEAL TAPE NM-2828 A handy sealing system that fuses together to form a removeable, waterproof seal once applied. • 12mm wide × 1.5m long Catalogue Sale 24 September - 23 October, 2018 EXCLUSIVE CLUB OFFERS: FOR NERD PERKS CLUB MEMBERS 20% OFF WE HAVE SPECIAL OFFERS EVERY MONTH. LOOK OUT FOR THESE TICKETS IN-STORE! NOT A MEMBER? Visit www.jaycar.com.au/nerdperks NERD PERKS CLUB OFFER FREE Shortwave Antenna TV BRACKETS* EXCLUS E CLUB OFIV FER NERD PERKS CLUB OFFER NERD PERKS CLUB OFFER 2 FOR $148 ONLY $129 E EXCLUSIV CLUB OFFER NOT A MEM Sign up NOW BER? ! It’s free to join. Valid 24/7/17 to BER? NOT A MEM! It’s free to join. 23/8/17 Sign up NOW (AR-1947) WORTH $19.95 Valid 24/7/17 to With every purchase of AR-1945 WORLD BAND WITH PLL & SSB AR-1945 23/8/17 STEREO AMPLIFIER WALLPLATE Ideal for a novice ham radio licensor, keen fisherman or even just the outdoors type. $ TV BRACKETS* 20% OFF IN-CAR ENTERTAINMENT BUNDLE AA-0519 REG $99 Replace that bulky amplifier powering your ceiling speakers and stream music from your Smartphone or connect audio to the AUX input. ONLY WIRELESS INFRARED HEADPHONES AA-2047 $39.95 7" TFT COLOUR MONITOR QM-3752 $119 VALUED AT $158.95 SAVE 219 $ 50 $ NERD PERKS NERD PERKS NERD PERKS SAVE HALF PRICE SAVE 20% 5M HIGH QUALITY HDMI LEAD WQ-7228 REG $24.95 CLUB $19.95 2 × RCA Plugs to 2 × RCA Plugs. ELECTRONIC CIRCUIT BOARD LACQUER 175G NA-1002 REG $11.50 CLUB $5.75 Non CFC ozone propellant. NERD PERKS NERD PERKS SAVE SAVE 4-CHANNEL UNIVERSAL BATTERY CHARGER MB-3701 REG $39.95 CLUB $29.95 Charges Li-Ion, Ni-MH and Ni-Cd batteries. 1A USB outlet. ABS INSTRUMENT ROLLING CASE HB-6387 REG $189 CLUB $149 Retractable handle. 530(W) × 225(H) × 335(D)mm NERD PERKS SAVE 20% M205 FUSE PACK SF-2242 REG $12.95 CLUB $9.95 40 fuses. 5x500mA, 10x1A, 10x2A, 5x3A, 5x5A, 5x10A. 120MM BALL BEARING FAN YX-2517 REG $36.95 CLUB $24.95 240VAC. Solder lug connection. SAVE 20% 29 95 30% NERD PERKS 25% SAVE NERD PERKS SAVE 25% 20% DUINOTECH NANO BOARD XC-4414 REG $29.95 CLUB $23.95 ATMega328P microcontroller. DC POWER CABLE - 10M ROLLS WH-3056 REG $11.95 CLUB $8.95 Flexible. 15A rated current. 3 colours available. NERD PERKS NERD PERKS NERD PERKS NERD PERKS SAVE SAVE SAVE SAVE 25% 25% CRO PROBE CABLE QC-1902 REG $39.95 CLUB $29.95 1.2m cord length. Stainless steal BNC connector. 15% 25% UNIVERSAL DRILL PRESS STAND TD-2463 REG $39.95 CLUB $29.95 Heavy duty cast metal base and frame. Up to 60mm drilling depth. ALPHANUMERIC DOT MATRIX LCD MODULE CCD EXTENSION CABLE QP-5516 REG $19.95 CLUB $14.95 WQ-7278 REG $59.95 CLUB $49.95 2 line screen displays up to 16 characters at 20m long. Carries video, audio and power. a time. Backlight. NERD PERKS CLUB MEMBERS RECEIVE: YOUR CLUB, YOUR PERKS: 20% OFF TV BRACKETS * *Applies to Jaycar 503A Home Theatre Hardware: Plasma TV Brackets To order: phone 1800 022 888 or visit www.jaycar.com.au CHECK YOUR POINTS & UPDATE DETAILS ONLINE. LOGIN & CLICK "MY ACCOUNT" Conditions apply. See website for T&Cs See terms & conditions on page 8. 59 What's New: We've hand picked just some of our latest new products. Enjoy! Wi-Fi Universal Smart Remote 3995 $ FROM 29 95 SZ-2031 BLADE FUSE BLOCK WITH BUS BAR Accepts up to 30A per output with handy fuse-blown indication. Negative bus bar. 6 WAY SZ-2031 $29.95 12 WAY SZ-2032 $39.95 $ $ $ 79 95 $ WIRELESS UHF HEADSET MICROPHONE KIT AM-4051 Provides great quality audio reproduction without any messy wiring. 3.5mm AUX connection. Rechargeable battery. Easily detach microphone from the head bracket. FROM 24 95 AR-1930 LED CLOCK WITH AM/FM RADIO Dual alarm. Time & alarm battery back-up. Dual display brightness. Snooze function. Mains powered. Due Early October. LARGE DISPLAY AR-1930 $24.95 X-LARGE DISPLAY AR-1932 $39.95 SZ-1923 AR-1974 Connects via Wi-Fi and allows you to control infrared appliances using Smartphones or tablets via free app. You can even pair with Google Home or Amazon Echo for voice control. FROM 39 95 ILLUMINATED ROCKER SWITCH PANELS Switches are rated at 20A for a 12V system (10A for 24V) up to a maximum 45A per panel. High quality. Blue LED illumination. 2 WAY SZ-1923 $39.95 4 WAY SZ-1924 $59.95 6 WAY SZ-1925 $79.95 59 95 $ FROM 29 95 SL-3512 $ SOLAR RECHARGEABLE LIGHT WITH PIR Easy and quick installation. Motion sensor. IP65 Waterproof. 6m detection range. 220 LUMEN SL-3512 $29.95 400 LUMEN SL-3514 $49.95 $ 49 95 UNDERWATER LED LIGHT SL-3945 8 single-colour and 2 colour-changing modes. Magnetic base. IP68 rated. 3 × AA batteries required. 4 Channel 1080p AHD DVR QV-3163 AUTOMOTIVE DMM QM-1446 Perfect for the workshop as an engine analyser as well as basic DMM. Full dwell angle measurement and tacho, with max / data hold and bright backlit LCD. 19 $ 95 BATTERY OPERATED WIRELESS DOORBELL LA-5048 Simple and easy to install. Up to 50m wireless transmission range. 16 selectable melodies. Requires 3 × AAA batteries. Versatile 4 channel surveillance digital video recorder. Plug and play (P2P) remote viewing. Easy QR code network set-up. Dropbox photo backup. 1TB HDD included. • Supports multiple input formats including AHD • Full 1080p recording on all 4 channels • Additional 2 channel IP camera support $ 349 Due Early October. TERMS AND CONDITIONS: REWARDS / NERD PERKS CARD HOLDERS FREE GIFT, % SAVING DEALS, DOUBLE POINTS & MEMBERS OFFERS requires ACTIVE Jaycar Rewards / Nerd Perks Card membership at time of purchase. Refer to website for Rewards/ Nerd Perks Card T&Cs. PAGE 3: Nerd Perks Card Holders receive a special price of $129 for Guess That Song Game when purchased as bundle. PAGE 3: FREE Jumper Leads (WC-6024) valid with every purchase of Prototyping Board Shield (XC-4482). PAGE 6: FREE Keychain Measuring Tape (TH-2500) valid with every purchase of Workbench Essentials applies to TD-2000, QP-5040, QC-1929, AA-0414, AA-0405 & TH-1846. PAGE 7: Nerd Perks Card holders receives FREE Shortwave Antenna (AR-1947) valid with every purchase of AR-1945 World Band Antenna. Nerd Perks Card Holder Offer: Buy 2 x Stereo Amplifier Wallplate (AA-0519) for $148. Nerd Perks Card Holder Offer: In-Car Entertainment Bundle (1 x AA2047 + 1 x QM-3752) for $129. Nerd Perks Card Holders receives 20% OFF TV Brackets: Applies to Jaycar 503A: Home Theatre Hardware: Plasma TV Brackets. FOR YOUR NEAREST STORE & OPENING HOURS: 1800 022 888 www.jaycar.com.au 99 STORES & OVER 140 STOCKISTS NATIONWIDE NEW STORE: BEENLEIGH 137 George Street, QLD 4207 PH: (07) 3386 1647 Head Office 320 Victoria Road, Rydalmere NSW 2116 Ph: (02) 8832 3100 Fax: (02) 8832 3169 Online Orders www.jaycar.com.au techstore<at>jaycar.com.au Arrival dates of new products in this flyer were confirmed at the time of print but delays sometimes occur. Please ring your local store to check stock details. Occasionally there are discontinued items advertised on a special / lower price in this promotional flyer that has limited to nil stock in certain stores, including Jaycar Authorised Stockist. These stores may not have stock of these items and can not order or transfer stock. Savings off Original RRP. Prices and special offers are valid from Catalogue Sale 24 September - 23 October, 2018. SERVICEMAN'S LOG I'm on holiday, but not from servicing! Dave Thompson* It’s been 11 years since we’ve visited my wife’s hometown in Croatia and a lot has happened in the meantime. At home, we’ve suffered through a global financial meltdown and something of a physical meltdown in the form of 14,000-odd earthquakes, both of which were devastating to almost everyone in Christchurch. On the other hand, Croatia (and the Dalmatian coast in particular) has seen a huge boom in the number of people visiting and is enjoying the economic benefits this has produced. However, all these tourist dollars come at some expense. My wife’s hometown has an off-season population of around 25,000. At the height of the season, around half a million live here with another million or so passing through during the summer months. In order to house all these extra people, what started as a (literally) cottageindustry of folks renting out an empty room or two to the passing tourist is now a global business, with hundreds of new, multi-story apartment buildings dotting the coast, courtesy of wealthy European investors looking to cash in. Many locals who once enjoyed pristine, panoramic Adriatic views now look out upon some cinder-block wall literally a few metres away. I suppose you could consider that progress but the locals might disagree! One thing that hasn’t progressed at the same pace is the Internet infrastructure. In Christchurch, we have enjoyed three significant broadband speed upgrades over those 11 years. The last time we visited Croatia, my wife’s family were enjoying then-revolutionary 2Mb/s (megabit per second) copper-wire based broadband pipe they’d just had installed. It certainly beat the pants off the dial-up they’d been using previous to that, and that faster internet revolutionised almost everything here. But nothing has really changed since then. Economic growth spurts Countries emerging from conflict often benefit from rapid progress and development and Croatia was no exception. While they weren't exactly behind the iron curtain, it certainly had an effect on them; the Socialist ethic of the day shunned outside influences. Once that veil lifted, things changed rapidly. German über-telco T-Mobil stepped in and offered to rebuild the telecommunications infrastructure. This saw Croatia at the bleeding edge of telecommunications technology in Europe. Their Internet services were equal to or better than those we enjoyed at home. We had a similar telecommunications boom in New Zealand. Before that, we were regarded as being 20 years behind everyone else in just about everything. But then several overseas companies came along with massive investments in hardware and infrastructure, which kicked our creaky old analog systems into the 21st century. Without them, we’d still be in the dark ages, so to speak. Sadly, in Croatia, the lustre of those new investments has now well and truly faded; my relatives use exactly Items Covered This Month • • • • • The Kiwi takes flight Solar-related failures Swarfed up stepper motor Honda SUV failure to spark Palsonic TFTV3920MV TV repair *Dave Thompson runs PC Anytime in Christchurch, NZ. Website: www.pcanytime.co.nz Email: dave<at>pcanytime.co.nz siliconchip.com.au Australia’s electronics magazine October 2018  61 the same modem they’d been supplied with back then and the speeds they get from the now way-oversold system are often deplorable. Given the state of the ancient copper lines and the sheer difficulty of installing a fibre network into an ancient city, where the 2,000-year-old Roman ruins down the road look like a new subdivision, it seems their Internet isn’t going to get faster any time soon. The serviceman's curse returns Homes here are built with very thick walls, using concrete, bricks and steel reinforcing, all of which creates a rudimentary Faraday cage. WiFi signals reach from the router to about as far as the next wall. The last time we were here, my brother-in-law and I spent a few gruelling hours under the intense Dalmatian sun installing a temporary, 25 metre long local area network (LAN) cable, running it up and over the roof through eaves, always-open windows and shutters and through wherever it would fit to link us to that router. Sadly, with the installation of airconditioning and other renovations, that cable had long gone and the route was no longer viable. And so the first thing asked of me when I arrived (after the usual family stuff) was if there was any way to speed things up. In an effort to see what I was dealing with, I tried to wirelessly connect my laptop to their router, which is situated about eight metres away as the crow flies, in an office on the other side of the house. Despite the short distance, the connection was very poor; virtually useless. Since we had a lot of catching up to do with various people, it was a while 62 Silicon Chip before we got around to visiting the over-worked local computer guy at his shop. His workshop is about the size of my bedroom and is stacked from floor to ceiling with old laptops, desktops and printers. It appeared that every tourist visiting the city was in there complaining (in 10 different languages) that something was wrong with their mobile device. From what I could gather, most of them were simply unaware of the requirements for WiFi passwords. The poor tech was trying to explain in his best pidgin Euro that all they needed to do was enter a WiFi password and they’d be able to connect in their hotel, apartment, camper-van, Ražnjići stand etc. I felt his pain, but to be honest I was somewhat relieved that I wasn't him! Once I got a chance to talk to him, I asked for his best WiFi access point and paid about half what I would have shelled out in Christchurch for an Asus Router/Wireless Access Point. This gave me a few options and just to be safe, I also purchased another 25 metre Cat5 network cable. Repeaters don't work that well I’d used routers in wireless repeater mode before and while that would have been an easy solution, I’ve had little real success using them in this way. The idea is that the router picks up whatever WiFi signal is available and then relays it, to provide better coverage. But the problem is that the weaker a WiFi signal gets, the more packets get dropped and the slower the connection goes. So even if we had a good connection to this new, stronger and faster WiFi network, the router still has to relay the packets back to the original network, which is as slow as a wet week. Also, when a router is used in repeater mode, its bandwidth is halved because it has to deal with double the amount of network packet requests and receipts. So while this configuration means no pesky cabling, it is clearly not ideal. The best option is to use the router as a network access point but then the access point must be hard-wired into the original router and placed close to where we will connect to it. That means running a cable at least part way; a challenging prospect but one I’d have to overcome. Australia’s electronics magazine I started by walking the proposed cable route with an eye to boring holes in either the timber door frames or the masonry itself. I’d talk over the options with the homeowner later; right now, I had to see how viable it would be to run a cable this way. I had three doors to circumvent and while it seemed I’d be able to run a cable through the gap under two of the doors, things came unstuck on the last door which separated the two halves of the house. On this older part of the house, while the upper door frames were timber, they were actually very thin, merely decorative strips, so drilling anything through them was going to be impossible. There was also a bottom strip, like a small step about 25mm high that the door closes against, and this is made of a marble-like polished stone that is bonded to the floor and fits perfectly into the wooden door frame; so running a cable under the door was not an option. Drilling a large enough hole to take a Cat5 cable and plug through a 500mmthick concrete wall wasn’t something I was prepared to do and besides, the owners didn't like the idea. If I pushed the point I might have swayed them but, as non-technical types, they regarded the work as non-essential. So I’d have to go another way. Just before that inaccessible access door is a spare bedroom and it has the newer type of door with no marble step, so I came up with the idea to run the cable into that room instead and sit the access point high on top of the dresser, on the opposite side of the wall to where we’d be using the laptop. I rolled the cable out and temporarily positioned and set up the AP to check the signal, and it was good; I’d put it there. Back to work after a nap After 5pm, I wandered back down to the computer shop. Like many European stores during the summer, he opens at 8am, closes at 1pm and re-opens at 5pm, trading until 9 or 10pm. This is simple practicality; it is so hot during the early afternoon that nobody ventures out anyway. Most locals have their main meal at around 2pm, then have a kip before going back to the office. It is all very civilised, though a little alien to us Antipodeans. The Spanish siliconchip.com.au “Setting the standard for Quality & Value” Established 1930 ’ CHOICE! THE INDUSTRY S CNC Machinery Metal Working Sheet Metal Fabrication Wood Working Workshop & Automotive Lifting Handling Cutting Tools Measuring Equipment Machine Tool Accessories HSS Industrial Centre Drill Set Metric Precision HSS Jobber Drill Set Imperial Precision HSS Jobber Drill Set Metric Precision HSS Jobber Drill Set • • • • • • • • • • • • • • • • • • 5 piece set No. 1, 2, 3, 4, 5 HSS M2 grade Industrial quality 40 $ 47.30 (D508) $ HSS Sheet Metal Step Drill Set • • • • • • 3 piece set For drilling thin material HSS M2 grade 4-12mm x 1mm steps 6-20mm x 2mm steps 6-30mm x 2mm steps 75 $ $ 82.50 (D1071) 25 piece set Precision ground flutes HSS M2 bright finish Range: 1~13mm 0.5mm increments 89 $ 95 $ 99 (D1272) $ HSS Countersink Set • • • • • • • 4 piece set HSS M2 grade 45° angle Ø2 ~ Ø5mm Ø5 ~ Ø10mm Ø10 ~ Ø15mm Ø15 ~ Ø20mm 65 $ $ 29 piece set Precision ground flutes HSS M2 bright finish Range: 1/16 ~ 1/2" 1/64" increments 115 $ 104.50 (D1282) • • • • • • • • • 6 piece set HSS M2 grade 45° angle Ø1.5 ~ Ø6.3mm Ø6.3 ~ Ø8.3mm Ø8.3 ~ Ø10.4mm Ø10.4 ~ Ø12.4mm Ø12.4 ~ Ø16.5mm Ø16.5 ~ Ø20.5mm 75 126.50 (D1285) $ Metric HSS Combination Tap & Drill Set HSS Countersink Set $ 71.50 (D1051) $ 51 piece set Precision ground flutes 1-6mm in 0.1mm increments HSS M2 grade • 7 piece set • Designed for up to 3.2mm sheet metal • HSS M2 grade • M3, M4, M5, M6, M8, M10 • Includes hex snap-on drive 60 $ 82.50 (D1061) $ $ 66.55 (T0191) Digital Caliper Digital Caliper EF-5S - Engineers File Set Metric HSS Hole Saw Set • • • • • • • • • 200mm hardened and tempered files • Second cut: Flat, 1/2 Round, Round, Square, Triangular • Includes carry case • 11 piece set • M42 Bi-Metal high speed steel • 19, 22, 25, 32, 35, 38, 44, 51, 57, 64, 76mm • Includes 3/8" & 1/2" arbor shank & pilot drill 150mm / 6" Metric, inch & fraction 4-way measuring Includes battery 33 $ $ 38.50 (M738) 200mm / 8" Metric, inch & fraction 4-way measuring Includes battery 49 $ $ 35 $ 59.40 (M739) 99 $ 42.35 (F100) $ $ 110 (D102) RSP-500 Pneumatic Roller Seat GSP-795 Pneumatic Stool TCS-3 Mobile Tool Cabinet Seat WCH-6D Workshop Series Tool Chest • • • • • • • • • • • • • • 600 x 260 x 340mm • 6 drawers with protective liner • Ball bearing slides • Key lockable drawers & lid 380-500 seat height Ø300mm padded seat 360º swivel wheels Moulded tool tray 39 $ $ 44 (A360) ALL & THIS E MOR & 675-795mm seat height Ø360mm padded seat 360º seat rotation 135kg capacity 99 $ $ 99 $ 110 (A359) Staff Member $ 110 (A001) 89 $ $ 99 (T690) ATBG280/6 Industrial Bench Grinder BD-325 Bench Drill PD-325 Pedestal Drill • 150mm wheels • Fine/coarse grit • 0.37hp, 240V motor • • • • • • • • • • TORE IN S INE ONL - CAM 3 x drawers with ball bearing slides 420 x 235mm padded seat 2 x magnetic side trays 406mm seat height 360º swivel wheels 129 $ $ 16mm drill capacity 2MT spindle 12 spindle speeds Swivel & tilt table 1hp, 240V motor 319 $ 143 (G150) $ 352 (D590) Be a Mate & 16mm drill capacity 2MT spindle 12 spindle speeds Swivel & tilt table 1hp, 240V motor 359 $ 396 (D592) $ How to Enter 1 SPEND $100 2 LOG INTO YOUR ACCOUNT www.machineryhouse.com.au/SignUp UNIQUE PROMO CODE 3 ENTER ONLINE SC1018 T&Cs apply. Visit www.machineryhouse.com.au/Win-a-Harley Permit No. LTPS/18/23950 SYDNEY BRISBANE Australia’s electronics magazine (02) 9890 9111 1/2 Windsor Rd, Northmead (07) 3715 2200 625 Boundary Rd, Coopers Plains PERTH MELBOURNEOctober 2018  63 (03) 9212 4422 4 Abbotts Rd, Dandenong (08) 9373 9999 11 Valentine St, Kewdale Specifications & Prices are subject to change without notification. All prices include GST and valid until 31-10-18 10_SC_270918 ONLINE OR INSTORE! siliconchip.com.au www.machineryhouse.com.au/Win-A-Harley call this “siesta” and it is colloquially known as that here too. While the big malls and supermarkets stay open from 7am until 11pm during the tourist season, many tourists from outside Europe grumble about smaller, local shops being closed at these seemingly odd hours. But I’m OK with it. I bought some small plastic cable clamps with a nail at one end. These were masonry nails, designed for the type of walls used in almost all houses here. I also purchased some cable ties because the last part of the cable route follows some copper central-heating pipes and I could tie the cable to the existing clamps. Back at the house, I started at the router and laid out about five metres of cable. I used cable clamps to tack the wire to the walls every 300mm or so. The odd nail would hit a stone in the concrete and either ping out and fly across the room or simply folded up, ruining the cable clamp. But the majority hammered in easily and held fast. I routed the cable up and down door jambs, underneath and up again and around corners until I had the cable wired into the room where the access point would live. I coiled the remaining cable up and sat it beside the access point; the cable I got was a bit too long but that's better than it being a bit too short! The acid test was whether our computers and phones could now connect and actually reach the internet. While we could connect periodically before, surfing the web was a lesson in frustration. Now, once I connected to the access point I got five bars and web pages loaded in double-quick time. First world problems I need remote access to our machines back in Christchurch and with the old WiFi connection, I couldn’t even reach the logon screens. Now, clicking the remote desktop icon for any of our three remotely-accessible machines resulted in our familiar desktop being displayed almost instantly. While it takes a while to get used to the slower pace of the Internet here (2Mb/s compared to our 900Mb/s at home), at least we are back online. It isn't all roses, though. When I logged into my email server, I saw I had over 120 emails waiting in my personal inbox and I haven’t even looked at 64 Silicon Chip my work email yet. All this after only six days offline! While being away from it all is appealing, we have to be locatable by the likes of the airlines, friends and family, so it just isn’t feasible to unplug and walk away. At least I don’t have any more work to do... yet! Editor's note: running a network cable gives the best performance but if you don't want to (or can't) then power line networking is often the easiest way to add extra WiFi access points. A series of solar-related failures Several years ago, N. D. retired and decided to move from suburban Perth to the countryside of Western Australia. He and his partner decided to install a solar-powered hot water system and solar photo-voltaic (PV) system with grid-tied inverter at their new property, employing a local company to install them. Recently, he ran into problems with these systems... The solar hot water system circulates water between a storage tank under the house and a roof collector panel. It also has a natural-gas powered booster which initially masked some of the failures. Early on, we had to call the installers to fix the circulation pump as it was running constantly, undoing all the good work done by the sun of heating water in the day by re-radiating it at night. After a lot of fiddling about, it was pronounced fixed by the installers and they went on their way. Six months later, I discovered the pump was not running at all. An inspection of the controller showed fault lights that indicated the roof sensor was open-circuit. Meanwhile, the installers had gone out of business! An internet search revealed that new sensors were $75 each plus postage; a bit steep I thought, but if that was the problem, it would save me the call-out fee for a plumber. So I ordered one and when the sensor turned up, I fitted it and the system went back to working correctly. Two years passed until one day I was under the house and could hear the sound of a relay clicking on and off, followed by a pause of a minute or so, then more relay noises. But it was not the hot water service this time, it was the PV inverter. The inverter was displaying an error code that an internet search showed Australia’s electronics magazine was a common problem for this particular brand and model. The inverter was still under warranty and luckily, despite the fact that the installers who sold it to us were no long a going concern, the manufacturer (a large German company) arranged to exchange it for a new unit at no cost to us. So that solved that problem. But another six months down the track, on the first hot day of the summer, we were startled by loud growling and bubbling noises coming from the roof space. It turns out that the water in the solar hot water system was boiling! A trip under the house showed the circulation pump was not running and the controller was dead. Fortunately, the pump plugged into the controller used a standard mains plug and connecting that directly to the mains got the pump working and water circulating again. More internet searching determined that a new controller was $240. That also seemed pretty steep, especially after I took a look inside and saw that the major component was a printed circuit board with an IC, a couple of transistors, a relay and a handful of components. Notably, there was a small SMD device marked “F2” in series with the primary of a PCBmounted transformer; presumably this was a fuse. It was showing signs of distress and measured open circuit. Although I’ve never been employed in electronics industry, I’ve maintained a keen hobby interest over the years building many projects so I could not let this go by without attempting to fix it. Despite doing more internet search- siliconchip.com.au es, I could not find a circuit for this controller. It was obvious that it controlled the relay that turned the pump on and off. The IC was most likely a comparator with the two inputs being from the tank temperature sensor and the one on the roof. The PCB-mounting transformer was marked to show it had a nine volt output. The secondary was connected to a bridge rectifier, feeding an electrolytic capacitor rated at 25V. The relay showed it had a 12V coil so that probably meant the supply voltage to the comparator and a nearby switching transistor was around 12V. I hooked my current-limited variable power supply across the output of the bridge rectifier and powered it up. Success! The indicator lights came on with about 50mA of current drawn from the supply. The relay clicked in and plugging in the sensors showed them to be working. That left as suspects the bridge rectifier, the transformer or the fuse. The bridge rectifier appeared to be OK as determined by in-circuit testing of its diodes. I decided to replace the fuse and try it again. SMD fuses are not something that I carry so I replaced it with a 1W ¼W resistor, figuring that it would quickly destroy itself if there was a fault in the transformer, and that’s exactly what happened; it went up in a cloud of smoke! Measuring the transformer primary showed a resistance of around 14W which is way too low. With hindsight, I should have tested the primary resistance first. A replacement transformer of the same brand did not appear to be available locally (the controller was made in Israel) and none of the regular suppliers had one with the same pin spacing. However, with a bit of pin bending, I managed to fit one from Altronics to the board and as that had an internal fuse I did not bother to try and source a replacement SMD fuse; I simply shorted it out. The controller is now back in place and working until the next thing goes wrong with the hot water system or solar inverter. Or should I sell the house? It seems to be cursed… Faulty stepper motor G. C., of Nelson Bay, NSW, had a faulty stepper motor in his 3D printer that intermittently jammed. He siliconchip.com.au couldn't find any information on Google about what might be causing this problem so he decided to investigate... I fitted a new extruder to my 3D printer which uses a stepper motor to feed the plastic filament into the heater. Unfortunately, it quickly started to jam up and I discovered that it was the motor that was at fault. When it jammed, it wouldn't rotate until I manually rotated it in reverse. It would then work for a little while before jamming up again. I decided to bite the bullet and see if it was repairable. After some fiddling with the four screws holding its case together, I pulled the stepper motor apart. It's a relatively simple design. The body comes apart in three pieces; there's also a stator, the rotor, two ball bearings and some washers. The rotor has a very strong magnetic field. Having gotten it apart, I still couldn't see a reason for this intermittent stopping but I suspected that the rotor was the likely culprit. It is, after all, the only part that actually moves. Careful checking it, using my iPhone as a magnifying glass, revealed a possible cause. I could see tiny pieces of metal swarf stuck to the very strong stator magnet. I used long-nose pliers, tweezers, compressed air, percussive maintenance (hitting it) and managed to remove many, many pieces of swarf. But every time I reassembled and tested the stepper motor, it kept on jamming. It seemed likely that the tiny metal pieces were hidden away inside some other part (a bearing?) but during operation, they were pulled into the rotor by the intense magnetic field, causing it to jam again. The problem remained as these tiny pieces kept resisting my best efforts to remove them. Then I had an epiphany – if I surrounded the rotor with epoxy, filling in the gaps between it and the stator (without actually causing any friction), there would be nowhere for the swarf to get in between the two and jam it up. So I put the rotor in a battery drill, mixed up a big blob of five-minute epoxy, liberally covered the rotor in epoxy and started the drill at a very low speed. This rotated the rotor, preventing any big blobs from forming at the bottom as it flowed down due to gravity. I waited an hour until the epoxy Australia’s electronics magazine The stator magnet had small pieces of metal swarf stuck to it; the likely suspect for the cause of jamming. The disassembled stepper motor comes in three major pieces: the stator, rotor and two ball bearings. An epoxy coating was applied to the rotor and then machined so that swarf could not get in and jam it. October 2018  65 was fully hardened, put it in my lathe and removed the excess epoxy so that the rotor and stator would have sufficient clearance. After carefully cleaning the rotor, I carefully reassembled everything (yet again) and, success! No more jamming. So it was rubber to the road time. I put the repaired stepper motor into my 3D printer. Everything worked this time, and I've been printing successfully for several days now, with no problems and no jamming. Honda CR-V ignition system lacking a bright spark The very same G. C. also had some family drama when his 17-year old granddaughter was getting in some last minute practice an hour before her driving test and the car died. Luckily, the family had a spare car and she passed her test. But their 2000 Honda CR-V was sitting dead at the end of the street... Armed with some ether starting fluid and a digital multimeter, I walked to the car and tried to start it. Naturally, Murphy was having fun with me and it started first time, so I drove it home straight away. I was deciding exactly where to park it when it died once again. At least it was parked out the front of our house at the time. I tried the normal car diagnostic techniques, starting with removing the air filter and squirting in some starting fluid but the CR-V showed not the slightest sign of starting. That suggested that it probably wasn’t a problem with the fuse system. I then checked the ignition system by connecting an old spark plug to one EHT lead but there was no spark. So it seemed that the ignition system was the culprit. There was no alternative but to remove the distributor cap, rotor and plastic dust cover, to expose the electronics inside. This revealed three main components: a crankshaft position sensor (presumably a Hall-effect device), a sealed electronic ignition system and one coil. I could now determine that there was no output from the EHT end of the coil, so it was time to (literally) drag out my old Tektronix CRO and a 20 metre extension lead. This showed that there was 12V to the coil positive terminal but no signal at all on the coil negative terminal, which should have shown +12V to 0V transitions as the crankshaft turned. So either the position sensor was faulty, or the ignition system was dead. I removed both (fighting some unnecessarily tight 4mm Posidrive screws) and took them inside to my workshop. I tried connecting and disconnecting 12V across the coil manually, which gave a noticeable spark upon disconnection, so the coil was OK. Then I made up a simple test jig (just three wires and some connectors) and applied 12V from a regulated and current-limited power supply but there was not the slightest spark when I grounded the ignition system trigger input, which has an internal pull-up resistor. Figuring I had nothing to lose, I removed the top from the ignition system module using a screwdriver and 25mm diamond saw in my trusty Dremel. This device was made by NEC and marked "MC-8541". Inside I found a small PCB, a transistor/Mosfet and a sticky, jelly-like substance. Presumably this was intended for protection against vibration but it had never hardened – I don't know if this was on purpose, or just some dodgy silicone that never set properly. Based on my previous experience, I suspect the latter. There were seven wires connecting the PCB to the terminals and main transistor with four spot-welded to the PCB and external terminals and the other three running between the PCB and switching transistor. The five slightly thicker wires were OK but two of the wires were extremely thin, which combined with the failure of the potting compound, had resulted in both wires breaking off their spot welds. Using the biggest tip I had on my Hakko soldering iron and some aggressively fluxed aluminium solder, I managed to replace one broken wire with some more robust wire (stripped from an old Cat5 network cable). Luckily the other wire was the tachometer output and is not used in this model, so I removed it to avoid any future problems. Left: the inside of the Honda CR-V. Above: The ignition system module made by NEC. 66 Silicon Chip Australia’s electronics magazine siliconchip.com.au I re-connected everything to my testjig, grounded the ignition system input and a very healthy spark appeared, so my gamble paid off. After that, I carefully cleaned as much of the jelly-like gunk off as I could, then potted everything with some 5-minute Epoxy. The conclusion was a bit of an anti-climax; I reinstalled everything, turned on the ignition and the Honda started right up and has been running perfectly ever since. As a post-script, this adventure finally pushed me to order a phonesized $30 DSO150 oscilloscope so that I wouldn’t have the hassle of dragging out my CRO next time something like this happens. Palsonic TFTV3920MV 39-inch LCD TV repair They say one man’s trash is another’s treasure and that certainly seems to be true for S. G., of Bracknell, Tasmania. He recently came across a nice looking TV that had been discarded and decided that he could probably fix it... When analog television broadcasting stopped, many working CRT TVs appeared at the tip. These days you even see flat-panel televisions in seemingly good condition that have been thrown away. Having moved to a small country town in Tasmania, one day I took a load of garden waste to the tip and spotted a 39-inch Palsonic television (TFTV3920MW) that someone had thrown out. The set only took my eye because it was white. It did not look too bad, just a bit dusty, and as far as I could see, the LCD screen was intact. So this set followed me home and into my workshop (“Can I keep him? Please!”). Now that I have a man cave with a good bench, power and lighting, I felt confident that I could fix whatever was wrong with it, that had made the original owner discard it with such disdain. It did not take long to remove the back cover. After a good check over, I found that the power supply ran and was producing 12V DC and also 90odd volts for the backlight. Turning the set on produced not a flicker on the screen and after about 60 seconds, it would shut down. So it seems that the backlight had gone out to lunch. That made it very hard to see if the rest of the set was also dead. siliconchip.com.au In the past, in cases like this, I have shone a high-powered torch on the screen at an angle to see if there is any display. One has to be quick in cases like this, what with the set shutting down by itself. Using this technique, I was able to determine that the set-up menu was indeed being shown on the screen. You just couldn’t see it because the backlight wasn’t working. So I proceeded to totally dismantle the set. This took a fair bit of time as I had to remove many screws. A clean workbench helps since you won’t lose any of the parts; you also need somewhere to store the many parts so you won’t lose them before it’s time to reassemble it. I removed the plastic trim from around the screen and flipped the set on its back so that I could remove the LCD panel. This is the hardest part, as the LCD panel can be damaged very easily and that would make the set a complete write-off. I managed to do that successfully and this revealed a couple of light diffusers and a thick plastic piece that acts both as a diffuser and to help keep the whole set rigid. I could also see a white plastic sheet that covered the LED backlight so I removed that too. Finally, I could see the backlighting LEDs. These are arranged on three boards with 12 LEDs per board. They are connected as a series string; if one goes open-circuit, the whole string will fail to light. That turned out to be the cause of the failure in this set. I used Google to determine how to test the LEDs. The suggestion was to connect a battery made from two "D" cells; this would provide enough voltage to light each LED individually while they were still soldered to the board. Luckily, the boards had test points to make this easier. So I connected the battery across a pair of test points with both orientations until one of the LEDs lit up, then I proceeded to test all 36 LEDs across the three boards. I found two that would not light up across two different boards. There are many types of LEDs on the market so I did a web search for the part number used in this set and I came up with a Chinese supplier offering replacement LEDs boards. They also had the original remote control for this set in stock. But I baulked at the price, as did my wife; I wanted to make sure that the set would work 100% before pulling the trigger. That's when I had a brainwave; holding the LCD panel up to the workshop light allowed me to check it to make sure it wasn’t damaged. Thankfully, it looked good. I could not see any cracks or scratches and with the wife's blessing, I soon ordered the parts. They arrived in just six days. Fitting the replacement LED boards and reassembling the set was not easy; I had to remember where all the screws went and I also had to reassemble the parts in the correct order. After re-connecting all of the plugs and taping back down the many looms, it was time for the big test. With the set now back on its own stand, I applied power and connected the antenna lead, turned the set on and waited. Soon the on-screen display appeared, followed then by one of the local television stations. I did a factory reset, followed by a re-tune (scan) and then the only thing left to do was to clean the LCD panel. For this, I used a clean cloth (actually a cloth nappy; I have a small stockpile of these for cleaning glass). A circular motion and a bit of elbow grease (not pressing too hard) and the set came up like a new one. Another plus for this set is that it has a built-in DVD player which still works fine. So was it worth the time and effort? Given the number of hours I spent fixing it, arguably not, but I did enjoy taking an electronic device that had thrown into the rubbish dump and turning into a fully working and practically new-looking TV. SC Servicing Stories Wanted Do you have any good servicing stories that you would like to share in The Serviceman column? If so, why not send those stories in to us? We pay for all contributions published but please note that your material must be original. Send your contribution by email to: editor<at>siliconchip.com.au Please be sure to include your full name and address details. Australia’s electronics magazine October 2018  67 A 5-year design odyssey: The CS448 1kV isolated 4-channel oscilloscope If you open up a piece of modern test equipment, such as a spectrum analyser or oscilloscope, you will be amazed at the sheer number of components, the intricacy of the layout and the huge amount of work which must have gone into its design. Here’s a rare glimpse into the challenges which Bart Schroeder, of Cleverscope, had to overcome in designing their latest product, a USB ’scope with particularly strict performance requirements. He tells the story in his own words . . . W people will find it interesting and enlightening. ay back in September 2011, I was at the ElectroneX show in Melbourne demonstrating our Determining the requirements CS328A two-channel, 100MHz USB scope. Rather The key specifications we came up with for the scope, than resting on my laurels, I started to plan our next product. based on the requirement for working with a VSD, were: This would be a four-channel scope with each channel • A ±800V range, adequate for probing circuits like moproviding 1kV isolation from the others, and from the host tor speed controllers which are powered from rectified PC. Having isolated channels makes a scope much more three-phase mains. versatile since it frees you up to probe voltages across any • 1 part in ±8000 resolution (1 part in 16000). This requires component in a circuit. This is especially useful when worka 14-bit analog-to-digital converter (ADC; 214 = 16384) ing on motor speed controllers, especially variable-speed with very low noise. The result will be a voltage resodrives (VSD) – see the panel below for details. lution of 0.1V on the ±800V range. Less than two LSB As well as adding two channels and providing the iso(least significant bits) RMS noise would be good, giving lation, the new scope would also have significantly better a usable resolution of 0.2V – just enough for accurately resolution and bandwidth than our then-current models. measuring the current through floating low-value shunts. It would be by far our best offering. • Less than 1% error when measuring the current through a I had no idea at the time that it would take so long to low-value sense resistor with achieve this! I was finally able a 1x probe while slewing over to reveal our new high-perfora 680V range (ie, full-wave mance CS448 PC-based scope The Cleverscope CS448 is most definitely NOT rectified mains). at PCIM in Nuremberg, Ger• An input capacitance many in July 2017. a ’scope you would find on many workbenches. ×10pF to limit common mode It has been a learning expeIndeed, its price alone (more than $13,000 capacitively-coupled current rience for me and I have a lot plus options!) would strongly suggest that. to a tolerable level. more grey hair than I did five However, for engineers, design labs, QC/QA years ago. ADC selection departments and other “high end” users it In this article, I will describe The first question was the journey from idea to finwould be very high on their “wish list”. where to put the ADC; on ished product and some of The Cleverscope CS448 is right up there with the isolated side, or the nonthe pitfalls that I encountered other “professional” scopes; – there aren’t isolated side. The noise floor along the way. I want to share sets the dynamic range and is the story since I think many many that can beat it at anything like the price! WHO’S IT INTENDED FOR? 68 Silicon Chip Australia’s electronics magazine siliconchip.com.au Inside the CS448 (shown here about 2/3 life size). Of particular note is the extensive shielding and the fibre optic links. The five symmetrical transformers transmit power to the isolated inputs and signal generator. related to the number of components between the input and the ADC. A reduced component count means lower noise and since low noise was a requirement, that meant that the ADC needed to be on the isolated (ie, input) side. We already determined that our ADC needed a resolution of at least 14 bits. And it would help for it to be a lowpower device because we have to get its power across the isolation gap. We would also need a method for sending the digitised signal to the non-isolated side. The only realistic transfer method is via an optically isolated serial bus and the only standard method that allows synchronization (which is important in a multi-channel scope) is JESD204B, a standard for ADC and DAC data transfer. The scope also incorporates a signal generator and digital input. Multiple units can be linked together. siliconchip.com.au Australia’s electronics magazine October 2018  69 Variable Speed Drives and H-bridges The idea for the CS448 Isolated Channel Oscilloscope came to me when I was designing Variable Speed Drives (VSDs) for electronic motor speed control. A VSD uses three halfbridges to generate a three-phase signal to control the rotation of a three-phase motor. SILICON CHIP has published a three-phase VSD design in the past, the Induction Motor Speed Controller from the April and May 2012 issues (later updated in the December 2012 and August 2013 issues). It uses an integrated threephase bridge containing six IGBTs (insulated gate bipolar transistors, a BJT/Mosfet hybrid device), drivers and controlling circuitry. You can also use two half bridges to control a stepper motor or permanent magnet DC motor. This is called a full bridge or H-bridge. Each half-bridge uses two transistors to switch one side of the load between a negative and positive supply voltage. The half-bridge is sometimes known as a “totem pole” arrangement, as the two transistors are stacked between the supply rails. Fig.1 shows a full bridge circuit built using Mosfets and half-bridge gate driver ICs, which switches the voltage across Zload. Normally, one end of Zload is connected to +VBUS and the other end, to -VBUS. When Q1 and Q4 are switched on (and Q2 and Q3 off), current flows from +VBUS to -VBUS through the path indicated by the solid grey line, with the red probe giving a reading near +VBUS and the blue probe near -VBUS. In contrast, when Q2 and Q3 are switched on (and Q1 and Q4 off), current flows through the path indicated by the dashed grey line, with the red probe reading near -VBUS and the blue probe near +VBUS. In other words, current flows through Zload in the opposite direction in this case. If you alternate between these two conditions rapidly, the inductance of Zload (which is normally a motor coil) causes the current to increase or decrease more slowly and so by controlling the percentage of time spent in each state (using pulse width modulation [PWM]), you can vary the voltage across Zload smoothly. The voltage is normally made to vary in a sinusoidal manner, with a frequency determined by the desired motor rotation speed. Design challenges That all sounds pretty nice and neat but in the real world, designing a good bridge circuit and controlling it properly is not that easy. For example, when switching between the two states, you need to make sure that you never have both Q1 and Q2 on at the same time, or else current will “shoot through” them from +VBUS to -VBUS and they will heat up and possibly fail. The same applies for Q3 and Q4. But at the same time, you want to transition between the two states as rapidly as possible for maximum efficiency. So you really need to tune the Mosfet gate drive to suit the particular devices. You have to keep in mind the gate charge and discharge times as well as the Mosfet switch-on and switch-off times (which are all different and can vary between samples of the same device). And with the high voltages, currents and fast slew rates, you have all sorts of other factors such as parasitic capacitance within the Mosfets and between tracks and compo70 Silicon Chip Fig.1: a typical H-bridge driver. Because the load is “floating”, using a traditional ’scope will not give useful readings . . . and might let the smoke escape! nents, which cause induced voltages to appear in places where you may not necessarily expect them. The bottom line is that when you are developing this type of motor drive, you really need to be able to observe its behaviour and that means monitoring the gate drive waveforms, the voltage across the motor winding(s) and the current through each device. And once you have done this with a dummy load, you also need to test with a real motor – this is known as functional testing. You have to make allowances for temperature, component variation and drift. All this is virtually impossible if you can’t use an oscilloscope to measure the signals at various points in the circuit and make sure they are correct and match your design calculations. The ground reference bugbear But, and it’s a big but, in circuits like this, many of the signals you are interested in are not ground referenced Unfortunately, most scopes have ground-reference inputs. Look at the purple and green probes in Fig.1, which are measuring the gate drive for high-side Mosfets Q1 and Q3. These voltages are relative to the sources of those FETs, at the red and blue probes, which are switching rapidly between -VBUS and +VBUS. You could “float the scope” by powering it from an isolating transformer but that only gives you one floating channel, and besides, it’s dangerous, and there might be quite a high capacitance or inductance to ground through the power supply, which would cause very high currents to flow through the probes, possibly causing damage. FETs (including GaN and SiC varieties) can switch in 10100ns. If the switching time is 10ns, with 100pF capacitance and a 680V bus, you’ll get 6.8A (CV÷dt = 100pF x 680V ÷ 10ns)! So you really need a low capacitance to Earth. The traditional way to overcome these limitations is to use a differential probe but even a good one will have a poor Common Mode Rejection Ratio (CMRR) at high frequencies. As an example, the Tektronix P5200A has a CMRR of 30dB at 3.2MHz. 3.2MHz equates to a rise time of tr 100ns (1÷Δf). Lots of modern transistors switch faster than that. Australia’s electronics magazine siliconchip.com.au If you had a 680V bus (as is typical for three-phase power supplies), the probe will generate a spurious signal equal to 680V <at> -30dB = 0.032 x 680V or 21.8V That’s a larger magnitude than the signal you’re actually trying to probe so it will obliterate it! Why measure the gate drive you say? After blowing up quite a few IGBT modules, I can tell you that the gate drive has to be right. Adequate signal resolution It’s also important to ensure that there was not too much power loss in the transistors. Running the motor and having the switching devices blow up is not the best way to test this! A better way is to measure the voltage across the transistor while measuring the current through it and multiply to get power. Referring to Fig.2, this means that you need to measure VDS across the transistors as well as the voltage across the drain resistors, which is a proxy for the current through the transistor. These resistors are typically low value (1-10mΩ) types. VDS will transition between the saturation voltage, say 0.23V and the off state voltage, say 680V. So you really need a resolution of 0.1V, or one part in 6800, to measure this accurately. Your average scope has an 8-bit ADC, giving one part in 256 resolution. Assuming that the input range is close to 680V, the resolution will be 2.6V and noise will mean that the actual practical resolution is at least 5V. That’s not very useful. So to really see what is going on in this H-bridge, we need an isolated scope with good CMRR at high frequencies and high enough resolution to do 1 part in 6800. If you now look at the target specifications for the CS448 scope at the start of this article, you will see that they are all based on the requirements of working with this type of circuit. Having said that, this is far from the only situation in which you will need these capabilities. Many circuits have sections that are floating or which have different local grounds, and high-side shunts are quite common. A scope with isolated channels is very helpful in these cases. And a good CMRR, high resolution and low noise are all desirable attributes no matter what you are probing. After a search, we settled on the Intersil ISLA214S50 ADC, a 500Msps 14-bit ADC which could transfer all the samples over two serial lanes, at 4.375 Gbps per lane (using data compression). The ADC needs a buffer/amplifier in front of it and the best part we could find for this job was the Analog Devices ADA4817, a 1GHz bandwidth FET-input op amp. This has just 4nV÷√Hz voltage noise, low distortion and a good slew rate. We matched this with the ADA4937 differential ADC driver, with only 5.8nV÷√Hz output noise, 1.9GHz bandwidth and -102dB (<0.001%) distortion. We talked to Analog Devices and discovered that the ADA4817 included an input analog multiplexer, so the plan was to have two ranges and use the multiplexer to switch between them to keep everything as simple as possible. We’d make the ranges ±800mV and ±8V. With these two ranges, we could use a 10:1 probe to get ±8V or ±80V with full bandwidth and the ±800mV range would work well with current sense resistors, giving a 100µV resolution. A 100:1 probe would give us a ±800V range and some combination of these probes would cover just about every situation. Isolation We did a market search looking for the best way to transmit the two serial data streams to the FPGA (field-programmable gate away) that would be used to control all the scope functions. Eventually, we found an English company, Advanced Fibreoptic Engineering, who could make us pairs of optically isolated transmitters and receivers with a holder and fibre links between them. We paired these with the Texas Instruments ONET4291VA transmitter driver and limiting amplifier receiver. It sounds simple but it wasn’t! Clock generation We wanted all four channels to use the same clock source so that they would be perfectly synchronised but that would have meant another fibre channel and anyway, the jitter on a fibre channel is way too high for precise timing. In effect, our 14-bit ADC would become an 8-bit ADC. So we settled on using a programmable clock oscillator (the Silabs Si598) as the low-jitter clock source. The idea was that we could measure the channel frequency from the serial data coming back and adjust the clocks to make them all the same. Power supply and other details Fig.2: high side gate drive waveforms – the parasitic effects are the big deal! siliconchip.com.au As we said above, a low capacitance between the channel common (- input) and the real system ground is absolutely critical. This capacitance is determined by the power transformer inter-winding capacitance and the capacitance between the channel components/tracks and the chassis, plus the capacitance of the scope probe to the surrounding environment. We can control the power transformer and the channel placement. We decided to use a Maxim MAX13256 H-bridge driver to provide the isolated supplies for each channel with the companion Halo TGMR-501V6LF lowcapacitance (10pF) capacitor as specified in their literature. The transformer chosen was UL/EN60950 approved, which we needed. Australia’s electronics magazine October 2018  71 Fig 3: clock jitter reduces the usable resolution of the ADC. The jitter from our clock generator is very low and does not adversely affect ADC performance. We decided to use a cheap-as-chips STM8 8-bit microcontroller for channel control, communicating via an optoisolated serial link with the system FPGA. Most scopes offer 1MΩ and 50Ω input impedances, so we put in a relay in each channel to switch in the 50Ω. You need a relay to switch the 50Ω resistor in and out, to ensure low parasitic impedance and capacitance. We knew we’d need shielding to stop noise from all those high-frequency FPGA signals from getting into the sensitive analog front end. So we design a U-shaped shield with fingers which could be pushed down through slots in the board, to make a shield right around the board. This would mate with a ground plane on the main board that the digitiser would be plugged into. Building a prototype We put a lot of time and effort into designing and building a prototype, only to find that it a lot of problems! But I guess you only find problems by building something and then you have to learn from that and revise your design. The problems we found included: • The ADA4817 has bugs in it – the multiplexer did not work as specified and when the device was disabled, it dragged the inputs to -5V instead of the inputs going high-impedance. I was able to contact the designer of the chip at Analog Devices and they confirmed our findings. That means that our two-range design was unusable. • The MAX13256 H-bridge driver and transformer generated large common mode transients on the isolated ground which added to any signal being measured. Our power supply design was simply not suitable • The relay and 50Ω load resistor could not be turned off fast enough when the 1kV maximum input voltage was applied, with the resistor and relay disappearing in a puff of smoke. We had to abandon a 50Ω input impedance option. (Users could still connect a 50Ω terminator to the input if you really needed it, with the responsibility for possibly blowing it up being with them!) • The Si598 clock generator output drifted at the rate of about 15Hz/second, which meant that long duration captures would not have inter-channel synchronisation after 60 milliseconds or so. It also meant our intent to do Frequency Response Analysis (FRA) would fail. We needed a better clocking system. 72 Silicon Chip Fig 4: common mode rejection ratio is below -115dBc all the way to 65MHz in the unit being tested here. This is way better than just about any differential probe you’re likely to come across – even those costing many thousands of dollars. And a differential probe only gives you a single isolated channel – this scope has four! • The ISLA214S50 ADC lost gain/offset alignment between the two internal ADC’s used to achieve 500MSPS and became horribly non-linear if the signal exceeded the input range by even 1mV. This meant that we could not use the ADA4937 differential amplifier because input overloading is very common when a user is looking at a portion of a signal. We needed to add components to limit the input signal, to keep it within the ADC’s specified range • The shielding was good for stopping noise but useless for achieving a good CMRR. Because the shield was referred to the system earth, any capacitance between components on the board and the shield injected current into the front end circuit, polluting the measured signal. We needed a better shield design. • We had different RC time constants between the AC and DC paths in our two ranges. These generated slowly rising or falling pulse responses when using 10:1 probes. Of these problems, the power supply was the most serious and hardest to fix. Making an isolated supply that injects only microvolts into the system being measured became one of the most difficult challenges of the whole design. Coming up with a better design In the end, we went through three major versions of the scope, with two tweaks to the last version, before we were 100% happy with the performance. The power supply took a year to completely sort out. The main lesson learned during this process was that it was absolutely vital to keep everything symmetrical! You need a very symmetrical power switch, controlled equal slew rates on the power switch edges and a symmetrical power transformer (see photo of main PCB). The transformer needs to be balanced and centre-tapped with minimal inter-winding capacitance. Our final design has two very widely separated winding with a very low capacitance between them. The windings are wound bifilar so that each half of the winding is symmetrical to the other. The clock system also needed a considerable amount of work. The only way to have all the clocks synchronised was to have a common clock. This meant that we had to use the FPGA as a clock master and distribute that clock to all the channels. This approach means we can also synchronise more than one scope together, effectively turning Australia’s electronics magazine siliconchip.com.au ADA4817 At left is the original input PCB which looked good on paper but had a number of shortcomings which we had to address. The final version of the board ADA4817 is shown at right – there’s a lot more performance 50 OHM packed into RELAY this one! shows the Murata FOTs and the interconnecting optic fibre. You can also see the 1kV isolation gap and the isolation power transformer. Shielding STM8 ADA4937 Si5344 STM8 ISLA214S50 Si598 ONET4291VA ONET4291VA POWER TRANSFORMER AC/DC SWITCH POWER TRANSFORMER The shielding is absolutely crucial to getting a good common-mode rejection ratio (CMRR); in other words, to preADA4817 vent changes in the channel ground relative to Earth from showing up in the differential signal. LMH6553 The key is that the common-mode current (due to the channel capacitance, as described earlier) must flow along the outside of the shield to the common point, which is ISLA214S50 the centre tap of the isolation transformer. From there, it flows through the transformer inter-winding capacitance to the case. The shield goes right around the PCB and is soldered to the BNC socket shields. It incorporates a heatsink for the ADC and clock generator chips. The plastic cover is to provide the required 1kV isolation. FIBRE FIBRE ONET4291PA (2x under) FOT two 4-channel scopes into one 8-channel scope. So we needed another optic fibre isolated channel between the FPGA and each input channel to carry the clock signal, which is a 100kHz square wave generated by the FPGA. This is then fed to an SiLabs Si5344 PLL/jitter attenuator and multiplied by a factor of 5000, resulting in a 500MHz clock for the ADC. The Si5344 is a truly magical device; its output has a jitter of below 0.1ps. That is good enough for an 85dB signal-to-noise ratio when sampling at 100MHz, which is more than the ADCs are capable of, so it does not compromise its performance (see Fig.4). The Si5334 output is precisely in-phase with the 100kHz master clock, meaning all four channels (and any downstream units) are properly synchronised. Range switching and isolation While the multiplexer in the ADA4817 does not work, the part is otherwise very good and so we decided to keep it. That meant that we needed a new scheme to switch input ranges. We ended up doing this using RF photomos switches, which are a similar to optocouplers (the two white packages). We used a clamping LMH6553 differential ADC driver to avoid saturating the ADC, solving the problems mentioned above, and we got rid of the 50Ω option since there was no way to make it failsafe. We determined that our two-way fibre isolator was now limiting the performance of the scope. Murata in Japan came to the rescue with Fibre Optic Transceivers (FOTs) and interconnect fibre. These dual-channel, bidirectional 10Gbps units have only 60ps edge uncertainty variation between units. This meant that we could do a good job of synchronizing our 2ns clock periods; our final system achieves ±160ps phase variation between channels. The adjacent photo siliconchip.com.au The end result The final design is shown in the photo at left. It’s always good to end with something which works well, especially after putting in so much effort. Fig.4 shows the measured CMRR for Channel D of the CS448 scope with serial number EQ10019. It’s above 110dB right up to 65MHz! There are slight variations from unit to unit but they all exceed 100dB up to 65MHz. 110dB down from 680V is 2mV. With a 10:1 probe, that means you have a useful resolution of about 20mV, which is more than good enough for examining floating gate voltage signals, as we shall demonstrate below. Alternatively, if you are using a 1:1 probe to measure the voltage across a current sense resistor, given the typical 1% accuracy, that means you can measure around 200mV fullscale, which equates to 100A through a 2mΩ shunt. That sounds pretty useful to me. Now for some real measurements demonstrating just how handy the CS448 scope is. Fig.2 shows a direct measurement of two Mosfet high-side gate drives, where the common (bridge output) is slewing 500V in 8ns, as shown at the bottom of the plot on page 71. We can clearly see the Miller plateau (where the gate voltage stops rising as the gate charges up) on Gate 1 (orange trace) and the droop caused by the parasitic capacitive voltage divider formed by the Mosfet’s inherent gatedrain and gate-source capacitances, through which current flows as the Mosfet switches on, affecting the drain-source voltage as the switch goes high. Similarly, on Gate 2 (green trace), we see a pulse caused by the capacitive divider as the corresponding output (blue trace) goes low. We have never seen plots of actual gate measurements as detailed and accurate as these for such a high-voltage bridge slewing so quickly. Many such measurements that you see are swamped by noise and commonmode signals. Conclusion It was a lot of work but I am very pleased with the performance of the new scope. You can get more information about the Cleverscope CS448 from the company’s website at: https://cleverscope.com/products/CS448 SC Australia’s electronics magazine October 2018  73 Keep the bitey bits out of harm's way! Opto-Isolated Mains Relay By Tim Blythman If you need to switch mains voltages, say from a micro's output or any other low voltage source, you need to isolate them from each other. That's what this project does – it's easy to build and keeps mains voltages locked away from the controller . . . and you! Virtually any low voltage source will do – from 2.7 to 10V. A rduino and Raspberry Pi modules are popular because it's so easy to get into them, even if you're a beginner. But many people do not like working with mains, and with good reason – it’s easy to create an unsafe situation if you don’t know better. Incorrect wiring or inadequate insulation is a hazard not just to you but to anyone who comes in contact with your invention. This project is an ideal way of switching mains power, whether you are a beginner or not. If you follow the instructions in this article carefully, within an hour or two, you will have a working and importantly, safe, mains switch. You could control a heater, light, fan, pump, television, amplifier, computer – just about anything that plugs into a mains socket. You can use a wide range of sensors to decide when to switch those devices on and off; we've covered many easy-to-use sensors in our El Cheapo Modules series (siliconchip.com.au/ Series/306). which do this job but they all seem to be designed for 110-120VAC mains, as used in the USA and some other countries. For example, Adafruit’s PowerSwitch Tail performs a similar function to our design. But you definitely wouldn't want to use these with 230VAC mains as used in Australia, Europe and elsewhere. It would probably blow up and even if it didn't, it wouldn't be safe. In the past, when we needed to control mains outlets using a microcontroller, we modified a 433MHz remote mains switch to do the job. The last time we did this was in the November 2014 issue – see siliconchip.com. au/Article/8063 While simple and elegant, it's more expensive and more work, as you need to buy and modify the remote mains switch units. So we have designed this unit which is simple, cheap, reliable and able to switch just about any mains device, up to 10A rating. You could even connect several units to one micro to switch multiple devices. Other versions How it works There are some existing designs 74 Silicon Chip The 230V Opto-Isolated Relay uses Australia’s electronics magazine a logic signal (eg, 3.3V or 5V or up to 10V) and switches a mains-rated relay on or off based on the state of that signal. The optical isolation ensures that there is no chance that mains voltages could appear on the logic input and cause a shock hazard, or damage the driving circuitry. The 4N25 optocouplers we are using have an isolation rating of 5300V RMS. It also has a logic signal output which can be used by the driving circuitry to detect whether mains power is present and also allows the phase and frequency of the mains waveform to be sensed. This output uses the same type of optocoupler for safety. An optocoupler consists of a LED (usually infrared) and phototransistor in a plastic package. The LED shines on the phototransistor junction through an insulating clear plastic section, so that the phototransistor conducts when the LED illuminates it. It behaves like a transistor with separate base-emitter and collector-emitter junctions. But the gain (called the “current transfer ratio” or CTR) is much lower than a standard transistor, so the collector current is generally of a similar siliconchip.com.au magnitude to the LED drive current. The CTR may be above or below 100%, depending on the particular optocoupler used (it can vary from sample to sample) and on the LED current; the CTR tends to peak at a few milliamps of LED drive current. Take a look now at the circuit diagram, shown in Fig.1. The control signal is applied to pin header CON2. When a sufficient voltage is applied, current flows through the 220W current-limiting resistor and through OPTO1’s internal LED, which usually has a forward voltage of around 1V. So with 3.3V across CON2, around 10mA flows through it. Assuming the 24V mains-derived power supply on the other side of the optocoupler is present, the phototransistor then acts as an emitter-follower, supplying voltage to the base of NPN transistor Q1 via a 10kW current-limiting resistor. Q1 provides some gain so that sufficient current flows through the coil of RLY1 to latch its armature, connecting pins 1 and 2 of CON1, the mains terminal and connecting the Active pin of the mains output socket to the mains input. Diode D6 prevents OPTO1’s internal LED from being reverse-biased if the voltage at CON2 is reversed, mainly to protect against damage from static electricity. The outgoing Active line also drives the LED in OPTO2 via a 100kW 1W mains-rated resistor and a simple halfwave rectifier consisting of diodes D7 and D8. So when the Active voltage is above about 2V, D7 is forward-biased and current flows through the LED in OPTO2. As a result, current flows between the pins of CON3 during the positive half of the mains waveform, if RLY1 is latched on. CON3 can be connected between a microcontroller digital input pin and ground so that the micro's pin is pulled low in this case. A pull-up of some sort is required on that pin, to ensure its state changes when OPTO2's output switches off; many micros have built-in pullups which can be enabled in software. That micro can also measure the frequency of the pulses from CON3 to determine the mains frequency (this is usually pretty accurate, so it could be used as a reference) and the transitions are near the zero crossings. There will be a slight phase shift siliconchip.com.au due to the threshold being 2V rather than 0V but this can be compensated for in software if accurate detection of zero crossings is necessary. Mains power supply RLY1 has a 24V DC coil because a higher coil voltage means a lower coil current for the same power, and we have limited current available to drive it with such a simple power supply. Neutral is connected directly to the circuit ground and the supply current comes from the Active conductor via a 470nF X2-class capacitor which limits the average current and a 150W series resistor which limits the inrush current. The resulting voltage is then rectified by a bridge rectifier comprising diodes D1-D4 and filtered to pulsating DC using a 100µF electrolytic capacitor. A 470kW resistor across the X2 capacitor discharges it when the unit is unplugged, to minimise the risk of getting a (small) shock from the circuit. If you consider what happens starting at a zero crossing, when the Active voltage is rising, the right-hand side of the X2 capacitor rises to around 350V DC while the left-hand side is limited to around 25V, due to zener diodes ZD1 and ZD2 which are effectively across the output of the bridge rectifier. Thus, the X2 capacitor charges up to around 325V DC. When the Active voltage starts to drop again, current flow through this part of the circuit ceases, until the Active voltage drops to around 300V DC. The left-hand side of the X2 capacitor will then be at about -25V and so current will flow through the other half of the bridge rectifier and the X2 capacitor will start to discharge. It will have fully discharged when the Active voltage is around -25V and then it will start to charge in the opposite direction and the whole process will repeat as Active reaches -350V and then starts heading back towards 0V. This process repeats continually, maintaining the charge across the 100µF capacitor at around 30V while drawing just a few milliamps from the mains. Voltage regulation When there is no signal at CON2 and RLY1 is off, the two zener diodes keep the positive end of RLY1’s coil at around 24V; this is more than enough Australia’s electronics magazine What do you use it for? Have solar panels and a pool? You can use a light sensor and a real-time clock (RTC) module to switch the pool pump on during the day when solar power is available, or during off-peak hours if the weather is bad. Own a different type of pump? Use a float switch to control a pump. Turn it on when a storage tank is full or off when empty. Some float switches are light duty and may fail when switching high currents. Using the Opto-Isolated Relay to buffer the signal from a float switch will save its contacts from burning out Need to control a heating/cooling system? Add a temperature sensor (and/or a RTC) to build a custom thermostat. Own an amplifier (or other appliance) without a power switch? Add a remotecontrolled on/off switch to an amplifier, by merely adding an IR decoder to a microcontroller module, hooking up our isolated relay, writing a few lines of code and using a spare TV remote. Unreliable internet connection? Automatically reboot your router if your internet connection goes down, using a micro board with a WiFi module. What about a wireless power switch? Controlled by a micro or handheld remote control; just wire up a remote control receiver to its logic-level control input (the receiver needs a separate DC power supply). Or you can implement a complex light switching arrangement, with multiple light switches controlling the same set of lights. Wire the switches to perform low-voltage signalling and then use this signal to drive the lights via the Opto-Isolated Relay. You could even use switches that are not mainsrated, incorporate remote control etc. You don't even need a microcontroller to use the Opto-Isolated Relay. Any logic signal, from 2.7V up to about 10V can be used to activate the relay. This could come from an op amp output, logic gate, relay, switch, battery, plugpack or any other source of switched DC. WARNING: this project involves mains voltages which can be dangerous if not handled correctly. Follow the instructions in this article carefully. October 2018  75 WARNING! The Opto-Isolated Relay operates directly from the 230VAC mains supply and contact with live components is potentially lethal. Fig.1: the complete circuit and wiring diagram for the Opto-Isolated Relay. The control signal at CON2 drives the LED in OPTO1 which switches NPN transistor Q1 to activate relay RLY1. The incoming mains Active voltage is applied to a 470nF X2 capacitor and then rectified by diodes D1-D4 and filtered by a 100µF capacitor to provide around 25V DC for the relay coil. OPTO2 allows mains phase sensing and indicates when the load has mains power. voltage to allow its armature to latch. When Q1 does pull in, it diverts some but not all of the current that was flowing through the zener diodes to the relay’s coil instead. At 50Hz, the 470nF capacitor has an impedance (reactance) of about 6.8kW, limiting the current drawn from the mains (230VAC) to around 33mA. The 24V relay draws around 22mA at 24V, so the current through the zener diodes drops from around 33mA to around 11mA. This assumes the mains is at the nominal 230V. These numbers change if the supply voltage changes, and so the extra current means the relay will work reliably even with mains voltages slightly below 230V. ZD1 and ZD2 also limit the voltage across the 100µF filter capacitor to a safe level. We have used two 12V zeners rather than one 24V zener as the total dissipation with RLY1 off is not much below 1W and could be higher if the mains voltage is elevated. The second 150W series resistor, between the 100µF capacitor and relay coil, helps to prop up the coil voltage for the first few milliseconds after Q1 switches on, ensuring that it latches 76 Silicon Chip correctly. This works because the 100µF capacitor can charge a to a slightly higher voltage initially, due to the voltage across this added resistor. Diode D5 protects Q1 from voltage spikes from back-EMF when RLY1 switches off, while fuse F1 blows if there is a fault on the mains side of this circuit, or if the load goes short-circuit, preventing any further damage. As noted, RLY1 requires around 22mA to operate. Q1’s hfe is typically over 400, meaning a base current of 55µA is needed to activate the relay. Assuming that OPTO1’s CTR is at least 20%, that means the driving circuitry needs to be able to supply around 0.3mA at a minimum voltage of about 2.2V, to switch on the relay. Construction As with any circuit involving mains voltages, it is imperative that the case and mechanical construction are completed correctly to ensure the safety of the completed circuit. Attention to detail when building the PCB is critical too, as a single reversed diode could destroy other components in the circuit before the fuse Australia’s electronics magazine has a chance to blow. The Opto-Isolated Mains Relay is built on a PCB coded 10107181 which measures 99 x 60mm. The PCB is designed to clip into the internal side rails of a UB3 Jiffy box, leaving just enough room at the end of the box to fit two cable glands, which are used to secure the mains cables. Use the PCB overlay diagram, Fig.2, as a guide during assembly. The first step is to fit the low-profile passive devices, starting with the resistors. Table.1 shows the colour coding used on the resistor bodies but it's best to double-check the values with a multimeter before soldering them in place where shown in Fig.2. Fit diodes D1-D8 next. Take care to insert them with the cathode stripe in the orientation as shown in the overlay diagram. Note that D1 and D2 face the opposite direction to D3 and D4. Then mount the two identical zener diodes. Again, ensure that the cathode band is orientated correctly. Q1 is the only transistor, and it should be orientated as shown in Fig.2. You may need to bend and adjust the legs to fit the holes on the PCB (eg, using smaller pliers). siliconchip.com.au The two optocouplers, OPTO1 and OPTO2, should be soldered next. Note that the notches on the packages both point in towards the centre of the board. The PCB has been slotted to reduce the chance of leakage between the two halves of the board (ie, increase the creepage distance), so we have added a dot adjacent to the number one pin in each case. Align this with the dot on the optocoupler packages. If you are going to install header terminals for CON2 and CON3, now is a good time to do so. You could instead solder wires directly to these pads later. If you are installing the extension pieces, fit the header terminals with the long pins down. Next, fit the fuse holder clips to the board. Make sure the retention tabs are facing towards the outside or else the fuse will not fit. You can temporarily install the fuse to make sure the holder clips are placed correctly but be careful if you solder the clips with the fuse in place, as the heat could damage the fuse (eg, you could accidentally desolder the end caps). Remove the fuse after soldering. Install the electrolytic capacitor next. It is polarised, so it must be fitted the right way around. The stripe on the capacitor body indicates the negative lead while the positive lead is longer. The positive lead should go into the pad marked with a + sign. We have specified a 50V capacitor, but a 35V or 63V rated capacitor would work fine. Solder the barrier terminal in place now. If you're using the Jaycar version, which we prefer, you should attach it to the board using two machine screws, washers and nuts before soldering the pins. These screws prevent any stress on the solder joints. But the cable glands we're going to use to clamp the mains cords should also prevent stress so the Altronics version without the moutning screw holes should be OK too. The terminals on the barrier terminal are quite large, so you may need a bit of extra solder and heat to ensure a good mechanical and electrical connection. Finally, fit the X2 capacitor and relay. Both should be pushed down fully onto the PCB before soldering. The capacitor is not polarised while the relay can only go in one way. Putting it in the box You must mount the PCB in the Jifsiliconchip.com.au Fig.2: use this overlay diagram to assemble the PCB. The safe, low-voltage side is at the right while the rest of the board is connected directly to the mains. During construction, take care with the orientation of the diodes and the electrolytic capacitor. The PCB should be sealed in its box before plugging it in. The layout has changed slightly since the prototype was built, to increase track clearances. fy box to provide sufficient insulation to make it safe. Start by drilling two holes at the end of the UB3 Jiffy box to suit the cable glands. The specified glands require 16mm holes. If you are using a different gland, you may need a different hole size. Use the cutting template, Fig.3, as a guide. The two slots on one end of the box are designed to provide access to CON2 and CON3. You could simply solder some light-duty figure-8 wires to those pads, or use twin leads with DuPont headers on the end to plug into the pin headers. We've also prepared two slim PCBs which are supplied along with the main PCB and these can be soldered to the board in place of CON2 and CON3. They then pass through slots in the case and have mounting pads for small terminal blocks, which sit just outside the plastic case and make it easy for you to attach wires for connection to your control module. Australia’s electronics magazine Regardless of which approach you take, we suggest you make the slots anyway since you need some way to get the control signals into the case. They can be made by drilling a few small holes in a row (eg, using a 2mm drill bit) and then joining and shaping them with a needle file. You could drill a larger hole but that would make it easier for dust and debris to get inside the box. You certainly shouldn't make these holes any larger than necessary to prevent wires from accidentally poking inside the case, which could (in an admittedly unlikely scenario) make contact with live portions of the board. A step drill is handy for drilling the larger holes for the cable glands but if you don't have one, you can use a tapered reamer instead. Fit the cable glands to the enclosure and make sure the nuts are done up tight. We found that the lips on the mounting nuts overlapped slightly, so we trimmed October 2018  77 Left: the Opto-Isolated Relay mounted inside a UB3 Jiffy box with the mains power plug and power socket wired up. Note the terminal extension boards, as shown above, are wired positive (+) to positive. These are optional attachments to make connecting your control module easier. them with a sharp pair of sidecutters. Preparing the mains cable It's up to you where to cut the mains cable to form the two leads. You could cut it in the middle to get two equallength cords, or you could make the plug or socket end longer, depending on your application. Make sure there is at least 30cm of cable left at each end after cutting it. Once you have cut the cable, there are exposed ends that present an electrocution risk if the plug is connected to a socket. Take great care to ensure that the plug cannot be plugged into a socket while you are working on it (or if you leave it unattended). It helps to plug the plug end into the socket end until you have finished wiring it up. Feed the cut ends of the cable through the glands. The plug end should go through the gland closest to the fuse. Make sure to thread the domed nut onto the cable first, if you had to remove it. Strip back the outer insulation by 25mm on both ends, then strip the insulation back by 5mm on the Active (brown) and Neutral (blue) wires. The Earth wires (green and yellow stripes) should be stripped back about 15mm. Remove the clear barrier from the terminal barrier and attach the wires as shown in Fig.2. The top screw terminal takes the incoming Active (brown) from the plug lead. The next screw terminal is for the outgoing Active wire to the socket, also brown. Ensure both of these are firmly screwed down. The bottom two screws are for the two Neutral wires (blue) and they are connected together on the PCB. While it will work regardless of which wire goes to which screw, it is neater to connect the incoming (plug) Neutral wire to the third terminal and the outgoing (socket) Neutral wire to the bottom screw terminal. The two Earth leads should now be joined using the BP-style double screw connector. Twist the wires together and then insert them into the connector, making sure that they both reach all the way to the end, then do up both screws tight and check that they have both clamped the wires. Now check your work to ensure there are no exposed copper strands from any of the wires either floating around or touching the wrong terminals and then replace the transparent barrier strip over the barrier terminal. Fig.3: drilling and cutting diagram for the UB3 plastic Jiffy box, reproduced same size. The two 16mm holes are for the cable glands that clamp the mains cords while the slots are for either figure-8 wires or extension PCBs to give access to the isolated control and feedback signals. The slots can be made by drilling a series of small holes which are then joined and shaped using a needle file. 78 Silicon Chip Australia’s electronics magazine siliconchip.com.au Check also that none of the wires can move around in their respective screw terminals. To test the unit insert a 100mA (or similar current) fuse in the holder and slot the PCB into the grooves in the enclosure, then tidy up the wires using cable ties. You can tuck the BP-style screw connector under the gland entry inside the box. Check that around 5mm of the outer mains cable insulation is visible inside the box before firmly tightening the glands. This ensures that the glands grip the cables securely. Testing The first tests (with the low-value fuse in place) are to verify there are no problems with the PCB construction. Don’t connect anything to the mains socket yet. Place the unit somewhere stable and during testing, stay well away from it – don't touch anything inside the box. Plug the unit into a switched-off GPO and then switch it on. If the fuse blows or the relay activates (you will hear it click), you may have mis-wired something. Turn off the power point and unplug the plug. You can test for the presence of residual charge by carefully connecting a multimeter on a high DC volts range across the Active and Neutral pins of the mains plug. If there is voltage present after a few seconds, your bleed resistor may not have been fitted correctly. If all is well, nothing obvious should happen. Turn off the power point, unplug the unit and connect a 3.3-10V DC voltage source to CON2 with the indicated polarity. Turn on the power again and check that the relay clicks as the armature pulls in. That shows that the circuit is working. Turn off the power, unplug the lead and replace the fuse with the final value. For example, if you are using the Jaycar 5A relay, the fuse rating should be no higher than 5A. If you are using the 16A relay from Altronics, use a 10A fuse, as the mains leads cannot safely carry a higher current. Testing the mains presence/ phase output The easiest way to test that the CON3 output is working is to connect a high-brightness LED with its cathode to pin 1 of CON3, then connect the anode to pin 1 of CON2 (the positive control signal input) and wire pin 2 of CON3 to pin 2 of CON2. You still need to apply the DC voltage to CON2 since the CON3 output is only active when the relay is latched. If you plug the unit back into mains and switch it on, you should find that the LED lights when the relay is engaged and switches off when you cut mains power. It will actually be flash- ing at 50Hz with a ~50% duty cycle but this may not be obvious to the naked eye. The LED current will be limited to one or two milliamps due to the limited CTR of OPTO2. Finishing it off Before you put the lid on, if you haven't already done so, make the control connections to CON2 and CON3. If using our small extension boards, fit the terminal blocks on the wider end, then feed the boards through the slots in the case (lining up + with + and − with −) and place the holes in the extension PCBs over the header pins. You can then solder them in place. Note that once this has been done, they need to be desoldered to remove the PCB, so it is important that everything is working and the lid fits correctly before doing this. If soldering wires to the pads for CON2 and CON3, pull them tight and then glue them into the holes in the box with silicone sealant. This ensures that if the solder joints fail, the wires cannot come in contact with the high voltage section of the PCB. Now screw the lid on, to ensure that no live parts are exposed. Also, unwind the cable gland nuts and add a few drops of super glue to the threads, then do them up tight again. This stops anyone from undoing them while the device is plugged in. The 230V Opto-Isolated Relay is now complete and can be used for your intended purpose. The finished Opto-Isolated Relay. The two small extension boards make it very easy to connect the low voltage isolated terminals to a suitable controlling module. siliconchip.com.au Australia's Australia’s electronics magazine O october ctober 2018 2018  79 2018     79 79 Parts List – Opto-Isolated Mains Relay 1 double-sided PCB, coded 10107181, 99mm x 60mm 2 double-sided PCBs, coded 10107182, 38mm x 10.5mm (optional) 1 230V 10A extension cord (or mains plug and socket with leads) 2 cable glands to suit mains cord [eg, Jaycar HP0724 or Altronics H4312A/H4313A] 1 UB3 Jiffy box [Altronics H0153/H0203 or Jaycar HB6013/HB6023] 1 4-way PC mount terminal barrier (CON1) [Jaycar HM3162 or Altronics P2103] 1 BP-style double screw connector [Jaycar HM3192 or Altronics P2125A] 1 250V-rated 24V DC coil relay (RLY1) [Altronics S4199 (16A, recommended) or Jaycar SY4051 (5A)] 2 M205 PCB-mount fuse clips (F1) [Jaycar SZ2018, Altronics S5983] 1 M205 slow-blow fuse to suit relay contact rating, no more than 10A [Altronics S5662, Jaycar SF2178] 1 M205 100mA or similarly rated fuse (for initial testing only) 2 2-way headers, 2.54mm pitch (CON2,CON3) 2 M3 x 20mm Nylon machine screws 2 M3 Nylon hex nuts 2 M3 Nylon flat washers Semiconductors 8 1N4007 1A 1000V diodes (D1-D8) 2 12V 1W zener diodes, eg, 1N4742 (ZD1,ZD2) 2 4N25 optocouplers (OPTO1,OPTO2) 1 BC549 100mA NPN transistor (Q1) Capacitors 1 470nF 275VAC X2-class MKT/MKP 1 100µF 50V RB electrolytic Resistors (all 1W, 5% unless otherwise stated) 2 150W 1 470kW 1 100kW 1 10kW 0.25W 1% 1 220W 0.25W 1% Table.1: Resistor Colour Codes      No. 1 1 1 1 2 Value 470kΩ 100kΩ 10kΩ 220Ω 150Ω 4-Band Code (1%) yellow violet yellow brown brown black yellow brown brown black orange brown red red brown brown brown green brown brown If you are planning to use the output/phase sense signal from CON3 with an Arduino, you can enable an internal pull-up current on the digital input pin using a command like this, within your setup() function: pinMode(3,INPUT_PULLUP); In this example, connect digital pin 3 to the + terminal of CON3 and GND to the – terminal of CON3. When the mains is off, pin 3 will read high (1), while you would get a low reading (0) during the positive-going half of the mains cycle when the relay is on. You could use a pin change interrupt or counter function to detect the pin toggling if you simply need to know whether the load is powered. 80 Silicon Chip Australia’s electronics magazine 5-Band Code (1%) yellow violet black orange brown brown black black orange brown brown black black red brown red red black black brown brown green black black brown In the event of a blackout or if, for some reason, the relay fails to close, that pin will remain high. You can detect that condition and flag an error (eg, by sounding a buzzer). Mains phase detection is possible using this signal but it's a little bit complicated due to the phase shift – you need to use a timer to measure the positive and negative times, calculate the delay between the zero crossing and the pin going low, then use another timer (or possibly the same one) to compensate. That's a bit too much detail to get into here. You don’t necessarily need to use the output sensing function, though. You can leave CON3 disconnected if you do not need that feature. SC siliconchip.com.au HO SE U ON SE W E CH IT TO IP IN JA N 20 16 ) .au THIS CHART m co ip. h c on IC SIL t a ee ic sil r f o( r • Huge A2 size (594 x 420mm) • Printed on 200gsm photo paper • Draw on with whiteboard markers (remove with damp cloth) • Available flat or folded will become as indispensable as your multimeter! How good are you at remembering formulas? If you don’t use them every day, you’re going to forget them! In fact, it’s so useful we decided our readers would love to get one, so we printed a small quantity – just for you! Things like inductive and capacitive reactance? Series and parallel L/C frequencies? High and low-pass filter frequencies? And here it is: printed a whopping A2 size (that’s 420mm wide and 594mm deep) on beautifully white photographic paper, ready to hang in your laboratory or workshop. This incredibly useful reactance, inductance, capacitance and frequency ready reckoner chart means you don’t have to remember those formulas – simply project along the appropriate line until you come to the value required, then read off the answer on the next axis! Here at SILICON CHIP, we find this the most incredibly useful chart ever – we use it all the time when designing or checking circuits. If you don’t find it as useful as we do, we’ll be amazed! In fact, we’ll even give you a money-back guarantee if you don’t!# Order yours today – while stocks last. Your choice of: Supplied fold-free (mailed in a protective mailing tube); or folded to A4 size and sent in the normal post. But hurry – you won’t believe you have done without it! #Must be returned post paid in original (ie, unmarked) condition. Read the feature in January 2016 SILICON CHIP (or view online) to see just how useful this chart will be in your workshop or lab! NOW AVAILABLE, DIRECT FROM www.siliconchip.com.au/shop: Flat – (rolled) and posted in a secure mailing tube $2000ea inc GST & P&P* Folded – and posted in a heavy A4 envelope $1000ea inc GST & P&P* *READERS OUTSIDE AUSTRALIA: Email us for a price mailed to your country (specify flat or folded). ORDER YOURS TODAY – LIMITED QUANTITY AVAILABLE siliconchip.com.au Australia’s electronics magazine October 2018  81 Introduction to Programming ˃Cypress’ System on a Chip A Programmable System on a Chip (PSoC) is much more than just a microcontroller. It also contains analog circuitry which can be configured in thousands of different ways, greatly reducing the external components required. Does it sound exotic? Well, you can buy a module with one of these chips for around $6 and be up and programming it within an hour or so! ˃By Dennis Smith T he CY8CKIT-049-42XX Prototyping Kit is one of the best development platforms available at the moment. It can be used with Cypress' Integrated Development Environment (IDE) with “schematic capture” system. This allows you to draw up the circuit configuration that you need, write some software, then compile it all together, using the very components you have just placed on your schematic. The product page for this unit, with a wealth of documentation and downloads, is at siliconchip.com.au/ link/aaku This development board is available in Australia for around $6 (at time of writing) from element14 (2420489) or Radio Spares (RS 124-4190). The IDE, complete with compiler and device specific libraries, is totally free and available for download from the link above. PSoC4 details According to its data sheet: “PSoC 4 is a scalable and reconfigurable platform architecture for a family of mixed-signal programmable embedded system controllers with an ARM Cortex-M0 CPU. It combines programmable and reconfigurable analog and digital blocks with flexible automatic routing.” “The PSoC 4200 product family, based on this platform, is a combination of a microcontroller with digital programmable logic, high performance analog-to-digital conversion, op amps with comparator mode, and standard communication and timing peripherals.” 82 Silicon Chip Its features include: • 32-bit microcontroller • Programmable analog and digital circuitry • Low power 1.71-5.5V operation • Capacitive button sensing • Segmented LCD driver • Serial communication • Integrated timers and pulse-width modulation (PWM) generators • Up to 36 programmable general purpose I/O pins (GPIOs) Included with the PSoC kit is a removable USB-to-serial adaptor. It's visible in the photo of the PCB, at the left-hand end. The PCB plugs straight into a USB port for programming. Once you have finished your project, assuming you don’t need USB communications, this section of the board can be snapped off and used as a general-purpose USB/serial adaptor. This adaptor also has the ability to be used as a USB-to-GPIO device – just one of the many “hidden gems” in this design. Preparing the board To get started, plug the board into a USB port on your PC. An orange LED lights up on the USB/serial adaptor to indicate that power has been applied. You should also see a blue LED flashing on the main section of the board, which indicates that all is well and the program loaded into the board during manufacture is running. Now unplug the board and plug it back in again but this time, hold down the button at the end of the board while you plug it in. Notice how the blue light now flashes at a faster rate. This is because the board is now in bootAustralia’s electronics magazine loader mode. We will use this facility later to load our program onto it. But first, you need to download the IDE (PSoC Creator 4.1, siliconchip. com.au/link/aakv) and device-specific files from the bottom of the main product page above. These additional files are the “USB-Serial Software Development Kit” (www.cypress. com/?docID=47673) and the “CY8CKIT-049-42xx Kit Only (Kit Design Files, Documentation, Examples)” (www. cypress.com/file/135786/download). Note that at the moment, the IDE is only available for Windows PCs (Windows 7, 8, 8.1 and 10). The IDE download is 499MB and the device-specific file is only 15.4MB. When you elect to download these files, the download page will ask if you wish to use the Akamai download manager. I suggest that you bypass the download manager (Cypress provide a link for that) since otherwise, it requires a separate program to be installed on your PC which remains there for future downloads. However, either approach should get you the files that you need. Once downloaded, start the installation by double clicking first on the “PSoCCreatorSetup_4.1_Update1_ b3210.exe” file (the name may change with future updates). Accept the default file installation locations and the license agreement. The IDE and compiler support files, including drivers, will be installed. You may be prompted to install a Microsoft .NET Runtime if this isn't already on your system. Just follow the prompts, as this is required for the IDE to run. siliconchip.com.au You will be asked for some contact details (name, company and e-mail address). You can opt to skip this step by selecting the “Continue Without Contact Information” checkbox. We recommend that at this stage, you check the “Launch Update Manager” option, to ensure you have the latest version of the software. Next, double click on the “USBSerialSDKSetup.exe” to install the USB driver. Finally, double click the “CY8CKIT04942xxSetupOnlyPackage_ revSA.exe” file. Once again, accept the default file installation locations and license. For some bizarre reason, when we downloaded this file it was named “VirtualBox-4.3.14-95030-Win.exe”. VirtualBox is a different piece of software entirely! But when we opened it, it installed the Cypress IDE. This seems to be a quirk of their download mechanism. Our example project We're going to start off with a premade example project which you can get up and running easily. The PSoC IDE has a plethora of other example projects you can easily test (over 500). This example project monitors ambient temperature using an NTC thermistor and displays this temperature on a standard 16x2 alphanumeric LCD. The next step therefore is to download the demonstration project files for this article from the Silicon Chip website. The package is named “PSoC4_ Thermistor Code.zip” and is just over 4MB. Having downloaded this, unzip the contained files to the “PSoC Creator” subdirectory in your Documents folder. You can place them elsewhere if you wish but this is the suggested location. Navigate to the “PSoC4_Thermister.cydsn” folder inside the files you unzipped and double-click on the file named “PsoC4_Thermistor.cyprj”. This will open PSoC Creator 4.1 IDE and load the project files automatically. Alternatively open PSoC Creator 4 from the Start Menu, click “Open Existing Project” on the Start page and navigate to the project folder. You may be asked to create a MyCypress account at this stage but you can click the “Register Later” button to skip it, if you don't want to. The IDE window should then look something like the screen grab shown in Fig.1 below. If the diagram is not shown, double click on the “TopDesign.cysch” item at the top of the left-hand panel. Now you are ready to put the hardware together. Click on the Page 2 tab at the bottom of the diagram, this will display a wiring diagram. We've prepared an easier-to-read version of this diagram and it's shown in Fig.2. We recommend that you solder pin headers along the edges of the PSoC board and then use jumper leads to plug them into a breadboard, where you can arrange the components. Alternatively, you could simply solder the components onto those pads directly but that would make it difficult to re-configure the circuit for other uses. Then the components should be wired up to the PSoC board as shown in Fig.2. Now that you've built the hardware, we need to compile and upload the firmware to the chip for it to do its thing. Using PSoC Creator 4.1 The PSoC Creator workspace has four main areas as shown below: 1 3 2 4 Fig.1: the main view of the PSoC Creator IDE. After building the code, you will receive a confirmation in the output window which shows the total flash and SRAM usage. While the photos show version 4.2, it’s functionally identical to 4.1. siliconchip.com.au Australia’s electronics magazine October 2018  83 Fig.2: circuit diagram for the thermometer example project, with the equivalent IDE view shown in Fig.3. Note that you may want to make the Vdd connection for the thermistor on the opposite side of the board, in case you want to break off the USB section. 1. Files and Resources, at centre. This contains a series of tabs with open files and resources which can be viewed and edited. Fig.1 shows four pages currently open: the Start page, TopDesign.cysch (the schematic diagram), PSoC4_Thermistor.cydwr (the Design Wide Resource) and main.c (where most of our program goes). 2. Component Catalogue, at right. A tree view list of all components currently available, both internal to the board (like ADC, Digital functions, Analog functions etc), and “off-chip” components such as resistors, capacitors etc. To use a component, you drag the one you are interested into the Top Design view. 3. Workspace Explorer, at left. This is a tree view list of all files in the project. Double-click on a file in this list to open it for editing. In our example, only three files need to be edited: Top Design, Design Wide Resource and main.c. 4. Output, at bottom. This panel shows results of compiling the project 84 Silicon Chip such as the compilation time, warnings and errors. Connecting and configuring components We need to tell the IDE which parts of the chip we will be using and how they will interact. This is done by dragging the internal components into the Top Design view and virtually wiring them up. After dragging these components into place, they need to be assigned parameters and connected to other components to form a circuit. To connect them, use the drawing tools to the left side of the Top Design, just to the right of the Workspace Explorer. The “Connect” icon is used to join the components. The other tools are for annotating it to improve clarity. They do not form part of the actual circuit. You will notice that the lines drawn using the Connect tool will change from solid to broken lines (dashes) depending on whether you are connecting internal or external components. Australia’s electronics magazine To change the parameters for a component, you double click on it and this brings up the “Configure Box”. For each component, there is a data sheet accessible through a button in this box. This explains how the component works, how to change it dynamically from your code and what each of the parameters does. Having opened the sample file, we suggest you double-click on some of the components such as the ADC, Thermistor and LCD and read the data sheets to get an idea of what's available. Most of the time you will be using external components with the board, such as a Mosfet to control the brightness of a LED or the speed of a motor. If you want to use the board's internal functions so that they can interact with the outside world, you need to assign a pin (or a full port) to that function. In the supplied example program, you will notice labels such as “Vhi” and “Vlow”. These refer to external siliconchip.com.au Parts List – example project 16x2 alphanumeric LCD 1 10kW NTC thermistor 1 10kW resistor 1 10kW potentiometer Fig.3: schematic diagram for the example project as shown in the IDE. You can view this on page 2 of the TopDesign.cysch file as marked below. ▼ Enlarged view of the circuit layout shown in Fig.1. This example project (a thermometer) displays the current temperature, Vdd and Vbat (Solar) values. siliconchip.com.au Australia’s electronics magazine October 2018  85 In our example, we have three main components: the ADC, AMux (analog multiplexer) which selects which signals are fed to the ADC inputs, and the LCD controller. The code initialises all three of these components as follows: /* Start all the hardware components required */ ADC_Start(); AMux_Start(); LCD_Start(); Fig.4: the pin configuration used in the example project for the PSoC chip. This is viewed in the PSoC4_Thermistor.cydwr file under the pins sub-heading. pins on the chip (a pin being a component from the Cypress Component Catalogue). If you double-click on the “Pins” item in the tree under “Design Wide Resources” (in the Workspace Explorer, at left) you will get a view of the PSoC chip as shown in Fig.4 above. This indicates which I/O pins are available and lets you assign labels to them; double click on a pin to change its properties, including the name. You can also see a list at the right edge which shows the names assigned to each pin or port. The “\ LCD:LCDPort[6:0]\” entry indicates that six pins of port P0, starting at pin 0, are assigned to the 16x2 character LCD. You can check the LCD component data sheet for a description of what each pin does. When you add a pin to your schematic diagram, from the Component Catalog at right, it will be assigned to one of the pins on the package. If you aren't happy with its chosen assignment, you can simply drag it to any other free pin. Double clicking on a pin in the schematic brings up an impressive list of options. It can be made into an analog input, digital input, digital output with eight different drive methods (including open drain or with a resistor in 86 Silicon Chip series with either or both output transistors) or bidirectional. You also can select which system clock is used to determine when the input or output state changes. For outputs, you can have a separate “output enable” line which allows other parts of the system to enable or disable that pin. In fact, there are a lot more options for I/O pins than are available with just about any other type of microcontroller. Combining code with the schematic The aforementioned component data sheets contains not only details of the parameters required for the component but also details of the software commands that can be used to control the component. This is the API (Application Program Interface). You will often find yourself referring to this when writing your own programs. Examine the contents of main.c by clicking on the main.c editor tab at top, or by double clicking “main.c” in the Workspace Explorer window to open it. You will see many API calls in the code. One of the most important is the Component_Start() function. This initializes the component and gets it ready for use. Australia’s electronics magazine For those of you that are used to the Arduino environment, you will notice there is no “setup” or “loop” section. This is because PSoC Creator uses standard ANSI C/C++. All your code will go into the main() function with setup code at the top and repeated code within a for(;;) or while(1) statement block. The rest of the code first clears the LCD screen and then measures the voltage across the thermistor and reference resistor. An API function is called to obtain the temperature by comparing the two aforementioned voltages. A string containing the temperature in degrees Celsius (to two decimal places) is made and printed to the first line of the display. This is followed by measuring and printing the Vbat value on the second line of the display, after which it updates this line with the supply voltage Vdd and keeps alternating between displaying either of the two values with half second delays between each. This process repeats indefinitely. Compiling, linking and uploading the code You need to compile and link the C code before it can be uploaded to the chip. To do this, click on the build icon in the tools bar just above the Workspace Explorer window. If all is well you will see “Build Succeeded...” appear in the Output window, as shown in Fig.1. Plug the board into a USB port on the PC (a USB extension cable comes in handy for this) while holding down the programming button at the rear of the board and make sure the blue light is flashing rapidly indicating that the board is in programming mode. Click on the Tools menu item at the top of the PSoC Creator main window and select “Bootloader Host…”; the window shown in Fig.5 will appear: Click on the drop-down arrow at the right-side of the box and make sure the siliconchip.com.au Fig.5: the programming window which you use to upload your project to the device. Note you will need the bootloader file which is found in your project's directory. Fig.6: the log output in the Bootloader Host window when programming is successful. Fig.7: if programming fails for some reason, an error message will be displayed. In this case, the wrong COM port was selected. siliconchip.com.au Australia’s electronics magazine “Baud:” parameter is set to 115200. Select the binary file for uploading to the board by clicking the “…” button at the right of the “File:” parameter. Navigate to the “ARM_GCC_541\ Debug\PSoC4_Thermistor.cyacd” file, which will be located in the “PSoC4_ Thermistor.cydsn” project folder and click “Open”. You may see numerous Communications Port entries depending on what devices are present on your PC but the bottom one is usually the PSoC board so select this by clicking on it. Finally, click the “Program” button just below the “Actions” menu item. If programming is successful you will see something similar to Fig.6. Otherwise, if it fails you will see an error message as shown in Fig.7. Check that you get the successful program indication. If programming fails, you may have selected the wrong Communication Port selected. Try to find the board in “Devices and Printers” in the Windows Start menu to find out which COM port has been assigned. Otherwise, check that the board is in programming mode by unplugging it from the computer, and while holding the pushbutton at the end of the board re-insert it. Assuming it worked, you should see the current temperature plus Vdd and Vbat voltages displayed on the LCD, if not check your connections. Also check the datasheet of the particular LCD you are using as there are different types, some even have the Vdd and Ground connections reversed. Also try adjusting the contrast potentiometer from one end to the other. There is always much to learn when embarking on a new development environment but the Cypress PSoC range of Microprocessor boards and the PSoC Creator IDE are some of the most intuitive systems around, and at a total cost of around $6 (plus components you probably already have in your parts box) for a board which includes a 32-bit ARM CPU (not 8-bit) makes the device hard to beat. In future articles I hope to explore the PSoC CY8CKIT-059 series of boards that have more computing power and a USB-to-serial adaptor, which doubles as a Serial Wire Debug (SWD) device that enables programming of the board without needing the Bootloader. It even has real-time single step debugging of your code. SC October 2018  87 SILICON CHIP .com.au/shop ONLINESHOP Looking for a specialised component to build that latest and greatest Silicon Chip project? Maybe it’s the PCB you’re after? Or a pre-programmed micro? Or some other hard-to-get “bit”? The chances are they are available direct from the Silicon Chip Online Shop. • • • • • PCBs are normally IN STOCK and ready for despatch when that month’s magazine goes on sale (you don’t have to wait for them to be made!). Even if stock runs out (eg, for high demand), in most cases there will be no longer than a two-week wait. One low p&p charge: $10 per order, irregardless of how many items you order! (AUS only; overseas clients – check the website for a postage quote). Our PCBs are beautifully made, very high quality fibreglass boards with pre-tinned tracks, silk screen overlays and where applicable, solder masks. Best of all, subscribers receive a 10% discount on purchases! (Excluding subscription renewals and postage costs) HERE’S HOW TO ORDER: 4 4 4 4 INTERNET (24 hours, 7 days): Log on to our secure website – All prices are in AUSTRALIAN DOLLARS ($AUD) siliconchip.com.au, click on “SHOP” and follow the links EMAIL (24 hours, 7 days): email silicon<at>siliconchip.com.au – Clearly tell us what you want and include your contact and credit card details MAIL (24 hours, 7 days): PO Box 139, Collaroy NSW 2097. Clearly tell us what you want and include your contact and credit card details PHONE (9am-5pm AET, Mon-Fri): Call (02) 9939 3295 (INT +612 9939 3295) – have your order ready, including contact and payment details! YES! You can also order or renew your SILICON CHIP subscription via any of these methods as well! PRE-PROGRAMMED MICROS PIC12F617-I/P PIC12F675-I/P PIC12F675-E/P PIC16F1455-I/P PIC16F1507-I/P PIC16F88-E/P PIC16F88-I/P PIC16LF88-I/P PIC16LF88-I/SO PIC16LF1709-I/SO Micros cost from $10.00 to $20.00 each + $10 p&p per order# $10 MICROS Temperature Switch Mk2 (June18), Recurring Event Reminder (Jul18) PIC16F84A-20I/P Door Alarm (Aug18), Steam Whistle (Sept18), White Noise Source (Sept18) UHF Remote Switch (Jan09), Ultrasonic Cleaner (Aug10) PIC16F877A-I/P Ultrasonic Anti-fouling (Sep10), Cricket/Frog (Jun12), Do Not Disturb (May13) PIC16F2550-I/SP IR-to-UHF Converter (Jul13), UHF-to-IR Converter (Jul13) PIC18F4550-I/P PC Birdies *2 chips – $15 pair* (Aug13), Driveway Monitor Receiver (July15) PIC32MM0256GPM028-I/SS Hotel Safe Alarm (Jun16), 50A Battery Charger Controller (Nov16) PIC32MX170F256B-50I/SP Kelvin the Cricket (Oct17), Triac-based Mains Motor Speed Controller (Mar18) Heater Controller (Apr18) Courtesy LED Light Delay for Cars (Oct14), Fan Speed Controller (Jan18) Microbridge (May17), USB Flexitimer (June18) Wideband Oxygen Sensor (Jun-Jul12) Hi Energy Ignition (Nov/Dec12), Speedo Corrector (Sept13) PIC32MX170F256D-501P/T Auto Headlight Controller (Oct13), 10A 230V Motor Speed Controller (Feb14) PIC32MX795F512H-80I/PT Automotive Sensor Modifier (Dec16) Projector Speed (Apr11), Vox (Jun11), Ultrasonic Water Tank Level (Sep11) dsPIC33FJ64MC802-E/SP Quizzical (Oct11), Ultra LD Preamp (Nov11), 10-Channel Remote Control Receiver (Jun13), Revised 10-Channel Remote Control Receiver (Jul13) PIC32MX470F512H-I/PT Nicad/NiMH Burp Charger (Mar14), Remote Mains Timer (Nov14) Driveway Monitor Transmitter (July15), Fingerprint Scanner (Nov15) MPPT Lighting Charge Controller (Feb16), 50/60Hz Turntable Driver (May16) PIC32MX695F512L-80I/PF Cyclic Pump Timer (Sep16), 60V 40A DC Motor Speed Controller (Jan17) PIC32MX470F512H-120/PT Pool Lap Counter (Mar17), Rapidbrake (Jul17), Deluxe Frequency Switch (May18) PIC32MX470F512L-120/PT Garbage Reminder (Jan13), Bellbird (Dec13), GPS Analog Clock Driver (Feb17) dsPIC33FJ128GP802-I/SP LED Ladybird (Apr13) Battery Cell Balancer (Mar16) $15 MICROS Programmable Ignition Timing Module (Jun99), Fuel Mixture Display (Sept00) Oscar Naughts And Crosses (Oct07), UV Lightbox Timer (Nov07) 6-Digit GPS Clock (May-Jun09), 16-bit Digital Pot (Jul10), Semtest (Feb-May12) Batt Capacity Meter (Jun09), Intelligent Fan Controller (Jul10) Multi-Purpose Car Scrolling Display (Dec08), GPS Car Computer (Jan10) Super Digital Sound Effects (Aug18) GPS Tracker (Nov13), Micromite ASCII Video Terminal (Jul14) Micromite Mk2 (Jan15) + 47F, Low Frequency Distortion Analyser (Apr15) Micromite LCD BackPack [either version] (Feb16), GPS Boat Computer (Apr16) Micromite Super Clock (Jul16), Touchscreen Voltage/Current Ref (Oct-Dec16) Micromite LCD BackPack V2 (May17), Deluxe eFuse (Aug17) Micromite DDS for IF Alignment (Sept17), Tariff Clock (Jul18) 44-pin Micromite Mk2 Maximite (Mar11), miniMaximite (Nov11), Colour Maximite (Sept/Oct12) Touchscreen Audio Recorder (Jun/Jul 14) Induction Motor Speed Controller (revised) (Aug13) $20 MICROS Stereo Audio Delay/DSP (Nov13), Stereo Echo/Reverb (Feb 14) Digital Effects Unit (Oct14) Colour MaxiMite (Sept12) Micromite PLUS Explore 64 (Aug 16), Micromite Plus LCD BackPack (Nov16) Micromite PLUS Explore 100 (Sep-Oct16) Digital Audio Signal Generator (Mar-May10), Digital Lighting Cont. (Oct-Dec10) SportSync (May11), Digital Audio Delay (Dec11) Quizzical (Oct11), Ultra-LD Preamp (Nov11), LED Musicolor (Nov12) When ordering, be sure to select BOTH the micro required AND the project for which it must be programmed. SPECIALISED COMPONENTS, HARD-TO-GET BITS, ETC STEAM WHISTLE / DIESEL HORN Set of two programmed PIC12F617-I/P micros (SEPT 18) $15.00 SUPER DIGITAL SOUND EFFECTS KIT (AUG 18) PCB and all onboard parts (including optional ones) but no SD card, cell or battery holder $40.00 RECURRING EVENT REMINDER PCB+PIC BUNDLE (JUL 18) USB PORT PROTECTOR COMPLETE KIT (MAY 18) PCB and programmed micro for a discount price All parts including the PCB and a length of clear heatshrink tubing AM RADIO TRANSMITTER (MAR 18) VINTAGE TV A/V MODULATOR (MAR 18) MC1496P double-balanced mixer IC (DIP-14) MC1374P A/V modulator IC (DIP-14) SBK-71K coil former pack (two required) ALTIMETER/WEATHER STATION (DEC 17) Micromite 2.8-inch LCD BackPack kit programmed for the Altimeter project GY-68 barometric pressure and temperature sensor module (with BMP180, Cat SC4343) DHT22 temperature and humidity sensor module (Cat SC4150) Elecrow 1A/500mA Li-ion/LiPo charger board (optional, Cat SC4308) PARTS FOR THE 6GHz+ TOUCHSCREEN FREQUENCY COUNTER (OCT 17) DELUXE EFUSE PARTS (AUG 17) Explore 100 kit (Cat SC3834; no LCD included) one ERA-2SM+ & one ADCH-80A+ (Cat SC1167; two packs required) IPP80P03P4L04 P-channel mosfets (Cat SC4318) BUK7909-75AIE 75V 120A N-channel SenseFet (Cat SC4317) LT1490ACN8 dual op amp (Cat SC4319) MICROBRIDGE COMPLETE KIT (CAT SC4264) $15.00 P&P – $10 Per order# STATIONMASTER (CAT SC4187) (MAR 17) Hard to get parts: DRV8871 IC, SMD 1µF capacitor and 100kW potentiometer with detent $12.50 MICROMITE LCD BACKPACK V2 – COMPLETE KIT (CAT SC4237) (MAY 17) includes PCB, programmed micro, touchscreen LCD, laser-cut UB3 lid, mounting hardware, SMD Mosfets for PWM backlight control and all other on-board parts $70.00 ULTRA LOW VOLTAGE LED FLASHER (CAT SC4125) (FEB 17) SC200 AMPLIFIER MODULE (CAT SC4140) (JAN 17) kit including PCB and all SMD parts, LDR and blue LED $15.00 hard-to-get parts: Q8-Q16, D2-D4, 150pF/250V capacitor and five SMD resistors $2.50 $5.00 $5.00 ea. $65.00 $5.00 $7.50 $15.00 $69.90 $15.00/pk. $4.00 ea. $7.50 ea. $7.50 ea. (MAY 17) PCB plus all on-board parts including programmed microcontroller (SMD ceramics for 10µF) $20.00 $12.50 $35.00 VARIOUS MODULES & PARTS 2.8-inch touchscreen LCD module with SD card socket (Tide Clock, JUL18) $22.50 ESP-01 WiFi Module (El Cheapo Modules, Part 15, APR18) $5.00 WiFi Antennas with U.FL/IPX connectors (Water Tank Level Meter with WiFi, FEB18): 5dBi – $12.50 ~ 2dBi (omnidirectional) – $10.00 NRF24L01+PA+NA transceiver with SNA connector and antenna (El Cheapo 12, JAN18) $5.00 WeMos D1 Arduino-compatible boards with WiFi (SEPT17, FEB18): ThingSpeak data logger – $10.00 ~ WiFi Tank Level Meter (ext. antenna socket) – $15.00 Geeetech Arduino MP3 shield (Arduino Music Player/Recorder, VS1053, JUL17) $20.00 1nF 1% MKP (5mm lead spacing) or ceramic capacitor (Wide-Range LC Meter, JUN18) $2.50 MAX7219 LED controller boards (El Cheapo Modules, Part 7, JUN17): 8x8 red SMD/DIP matrix display – $5.00 ~ red 8-digit 7-segment display – $7.50 AD9833 DDS module (with gain control) (for Micromite DDS, APR17) $25.00 AD9833 DDS module (no gain control) (El Cheapo Modules, Part 6, APR17) $15.00 CP2102 USB-UART bridge $5.00 microSD card adaptor (El Cheapo Modules, Part 3, JAN17) $2.50 DS3231 real-time clock with mounting spacers and screws (El Cheapo, Part 1, OCT16) $5.00 MICROMITE PLUS EXPLORE 100 COMPLETE KIT (no LCD panel) (SEP 16) (includes PCB, programmed micro and the hard-to-get bits including female headers, USB and microSD sockets, crystal, etc but does not include the LCD panel) (Cat SC3834) $69.90 THESE ARE ONLY THE MOST RECENT MICROS AND SPECIALISED COMPONENTS. FOR THE FULL LIST, SEE www.siliconchip.com.au/shop *All items subect to availability. Prices valid for month of magazine issue only. All prices in Australian dollars and include GST where applicable. # P&P prices are within Australia. O’seas? Please email for a quote 10/18 PRINTED CIRCUIT BOARDS NOTE: The listings below are for the PCB ONLY. If you want a kit, check our store or contact the kit suppliers advertising in this issue. For unusual projects where kits are not available, some have specialised components available – see the list opposite. NOTE: Not all PCBs are shown here due to space limits but the Silicon Chip Online Shop has boards going back to 2001 and beyond. For a complete list of available PCBs etc, go to siliconchip.com.au/shop/8 Prices are PCBs only, NOT COMPLETE KITS! PRINTED CIRCUIT BOARD TO SUIT PROJECT: PUBLISHED: PCB CODE: Price: SPEEDO CORRECTOR SEPT 2013 05109131 $10.00 SiDRADIO (INTEGRATED SDR) Main PCB OCT 2013 06109131 $35.00 SiDRADIO (INTEGRATED SDR) Front & Rear Panels OCT 2013 06109132/3 $25.00/pr TINY TIM AMPLIFIER (identical Headphone Amp [Sept11]) OCT 2013 01309111 $20.00 AUTO CAR HEADLIGHT CONTROLLER OCT 2013 03111131 $10.00 GPS TRACKER NOV 2013 05112131 $15.00 STEREO AUDIO DELAY/DSP NOV 2013 01110131 $15.00 BELLBIRD DEC 2013 08112131 $10.00 PORTAPAL-D MAIN BOARDS DEC 2013 01111131-3 $35.00/set (for CLASSiC-D Amp board and CLASSiC-D DC/DC Converter board refer above [Nov 2012/May 2013]) LED Party Strobe (also suits Hot Wire Cutter [Dec 2010]) JAN 2014 16101141 $7.50 Bass Extender Mk2 JAN 2014 01112131 $15.00 Li’l Pulser Mk2 Revised JAN 2014 09107134 $15.00 10A 230VAC MOTOR SPEED CONTROLLER FEB 2014 10102141 $12.50 NICAD/NIMH BURP CHARGER MAR 2014 14103141 $15.00 RUBIDIUM FREQ. STANDARD BREAKOUT BOARD APR 2014 04105141 $10.00 USB/RS232C ADAPTOR APR 2014 07103141 $5.00 MAINS FAN SPEED CONTROLLER MAY 2014 10104141 $10.00 RGB LED STRIP DRIVER MAY 2014 16105141 $10.00 HYBRID BENCH SUPPLY MAY 2014 18104141 $20.00 2-WAY PASSIVE LOUDSPEAKER CROSSOVER JUN 2014 01205141 $20.00 TOUCHSCREEN AUDIO RECORDER JUL 2014 01105141 $12.50 THRESHOLD VOLTAGE SWITCH JUL 2014 99106141 $10.00 MICROMITE ASCII VIDEO TERMINAL JUL 2014 24107141 $7.50 FREQUENCY COUNTER ADD-ON JUL 2014 04105141a/b $15.00 TEMPMASTER MK3 AUG 2014 21108141 $15.00 44-PIN MICROMITE AUG 2014 24108141 $5.00 OPTO-THEREMIN MAIN BOARD SEP 2014 23108141 $15.00 OPTO-THEREMIN PROXIMITY SENSOR BOARD SEP 2014 23108142 $5.00 ACTIVE DIFFERENTIAL PROBE BOARDS SEP 2014 04107141/2 $10.00/set MINI-D AMPLIFIER SEP 2014 01110141 $5.00 COURTESY LIGHT DELAY OCT 2014 05109141 $7.50 DIRECT INJECTION (D-I) BOX OCT 2014 23109141 $5.00 DIGITAL EFFECTS UNIT OCT 2014 01110131 $15.00 DUAL PHANTOM POWER SUPPLY NOV 2014 18112141 $10.00 REMOTE MAINS TIMER NOV 2014 19112141 $10.00 REMOTE MAINS TIMER PANEL/LID (BLUE) NOV 2014 19112142 $15.00 ONE-CHIP AMPLIFIER NOV 2014 01109141 $5.00 TDR DONGLE DEC 2014 04112141 $5.00 MULTISPARK CDI FOR PERFORMANCE VEHICLES DEC 2014 05112141 $10.00 CURRAWONG STEREO VALVE AMPLIFIER MAIN BOARD DEC 2014 01111141 $50.00 CURRAWONG REMOTE CONTROL BOARD DEC 2014 01111144 $5.00 CURRAWONG FRONT & REAR PANELS DEC 2014 01111142/3 $30.00/set CURRAWONG CLEAR ACRYLIC COVER JAN 2015 SC2892 $25.00 ISOLATED HIGH VOLTAGE PROBE JAN 2015 04108141 $10.00 SPARK ENERGY METER MAIN BOARD FEB/MAR 2015 05101151 $10.00 SPARK ENERGY ZENER BOARD FEB/MAR 2015 05101152 $10.00 SPARK ENERGY METER CALIBRATOR BOARD FEB/MAR 2015 05101153 $5.00 APPLIANCE INSULATION TESTER APR 2015 04103151 $10.00 APPLIANCE INSULATION TESTER FRONT PANEL APR 2015 04103152 $10.00 LOW-FREQUENCY DISTORTION ANALYSER APR 2015 04104151 $5.00 APPLIANCE EARTH LEAKAGE TESTER PCBs (2) MAY 2015 04203151/2 $15.00 APPLIANCE EARTH LEAKAGE TESTER LID/PANEL MAY 2015 04203153 $15.00 BALANCED INPUT ATTENUATOR MAIN PCB MAY 2015 04105151 $15.00 BALANCED INPUT ATTENUATOR FRONT & REAR PANELS MAY 2015 04105152/3 $20.00 4-OUTPUT UNIVERSAL ADJUSTABLE REGULATOR MAY 2015 18105151 $5.00 SIGNAL INJECTOR & TRACER JUNE 2015 04106151 $7.50 PASSIVE RF PROBE JUNE 2015 04106152 $2.50 SIGNAL INJECTOR & TRACER SHIELD JUNE 2015 04106153 $5.00 BAD VIBES INFRASOUND SNOOPER JUNE 2015 04104151 $5.00 CHAMPION + PRE-CHAMPION JUNE 2015 01109121/2 $7.50 DRIVEWAY MONITOR TRANSMITTER PCB JULY 2015 15105151 $10.00 DRIVEWAY MONITOR RECEIVER PCB JULY 2015 15105152 $5.00 MINI USB SWITCHMODE REGULATOR JULY 2015 18107151 $2.50 VOLTAGE/RESISTANCE/CURRENT REFERENCE AUG 2015 04108151 $2.50 LED PARTY STROBE MK2 AUG 2015 16101141 $7.50 ULTRA-LD MK4 200W AMPLIFIER MODULE SEP 2015 01107151 $15.00 9-CHANNEL REMOTE CONTROL RECEIVER SEP 2015 1510815 $15.00 MINI USB SWITCHMODE REGULATOR MK2 SEP 2015 18107152 $2.50 2-WAY PASSIVE LOUDSPEAKER CROSSOVER OCT 2015 01205141 $20.00 ULTRA LD AMPLIFIER POWER SUPPLY OCT 2015 01109111 $15.00 ARDUINO USB ELECTROCARDIOGRAPH OCT 2015 07108151 $7.50 FINGERPRINT SCANNER – SET OF TWO PCBS NOV 2015 03109151/2 $15.00 LOUDSPEAKER PROTECTOR NOV 2015 01110151 $10.00 LED CLOCK DEC 2015 19110151 $15.00 SPEECH TIMER DEC 2015 19111151 $15.00 TURNTABLE STROBE DEC 2015 04101161 $5.00 CALIBRATED TURNTABLE STROBOSCOPE ETCHED DISC DEC 2015 04101162 $10.00 VALVE STEREO PREAMPLIFIER – PCB JAN 2016 01101161 $15.00 VALVE STEREO PREAMPLIFIER – CASE PARTS JAN 2016 01101162 $20.00 QUICKBRAKE BRAKE LIGHT SPEEDUP JAN 2016 05102161 $15.00 SOLAR MPPT CHARGER & LIGHTING CONTROLLER FEB/MAR 2016 16101161 $15.00 PRINTED CIRCUIT BOARD TO SUIT PROJECT: PUBLISHED: MICROMITE LCD BACKPACK, 2.4-INCH VERSION FEB/MAR 2016 MICROMITE LCD BACKPACK, 2.8-INCH VERSION FEB/MAR 2016 BATTERY CELL BALANCER MAR 2016 DELTA THROTTLE TIMER MAR 2016 MICROWAVE LEAKAGE DETECTOR APR 2016 FRIDGE/FREEZER ALARM APR 2016 ARDUINO MULTIFUNCTION MEASUREMENT APR 2016 PRECISION 50/60Hz TURNTABLE DRIVER MAY 2016 RASPBERRY PI TEMP SENSOR EXPANSION MAY 2016 100DB STEREO AUDIO LEVEL/VU METER JUN 2016 HOTEL SAFE ALARM JUN 2016 UNIVERSAL TEMPERATURE ALARM JULY 2016 BROWNOUT PROTECTOR MK2 JULY 2016 8-DIGIT FREQUENCY METER AUG 2016 APPLIANCE ENERGY METER AUG 2016 MICROMITE PLUS EXPLORE 64 AUG 2016 CYCLIC PUMP/MAINS TIMER SEPT 2016 MICROMITE PLUS EXPLORE 100 (4 layer) SEPT 2016 AUTOMOTIVE FAULT DETECTOR SEPT 2016 MOSQUITO LURE OCT 2016 MICROPOWER LED FLASHER OCT 2016 MINI MICROPOWER LED FLASHER OCT 2016 50A BATTERY CHARGER CONTROLLER NOV 2016 PASSIVE LINE TO PHONO INPUT CONVERTER NOV 2016 MICROMITE PLUS LCD BACKPACK NOV 2016 AUTOMOTIVE SENSOR MODIFIER DEC 2016 TOUCHSCREEN VOLTAGE/CURRENT REFERENCE DEC 2016 SC200 AMPLIFIER MODULE JAN 2017 60V 40A DC MOTOR SPEED CON. CONTROL BOARD JAN 2017 60V 40A DC MOTOR SPEED CON. MOSFET BOARD JAN 2017 GPS SYNCHRONISED ANALOG CLOCK FEB 2017 ULTRA LOW VOLTAGE LED FLASHER FEB 2017 POOL LAP COUNTER MAR 2017 STATIONMASTER TRAIN CONTROLLER MAR 2017 EFUSE APR 2017 SPRING REVERB APR 2017 6GHz+ 1000:1 PRESCALER MAY 2017 MICROBRIDGE MAY 2017 MICROMITE LCD BACKPACK V2 MAY 2017 10-OCTAVE STEREO GRAPHIC EQUALISER PCB JUN 2017 10-OCTAVE STEREO GRAPHIC EQUALISER FRONT PANEL JUN 2017 10-OCTAVE STEREO GRAPHIC EQUALISER CASE PIECES JUN 2017 RAPIDBRAKE JUL 2017 DELUXE EFUSE AUG 2017 DELUXE EFUSE UB1 LID AUG 2017 MAINS SUPPLY FOR BATTERY VALVES (INC. PANELS) AUG 2017 3-WAY ADJUSTABLE ACTIVE CROSSOVER SEPT 2017 3-WAY ADJUSTABLE ACTIVE CROSSOVER PANELS SEPT 2017 3-WAY ADJUSTABLE ACTIVE CROSSOVER CASE PIECES SEPT 2017 6GHz+ TOUCHSCREEN FREQUENCY COUNTER OCT 2017 KELVIN THE CRICKET OCT 2017 6GHz+ FREQUENCY COUNTER CASE PIECES (SET) DEC 2017 SUPER-7 SUPERHET AM RADIO PCB DEC 2017 SUPER-7 SUPERHET AM RADIO CASE PIECES DEC 2017 THEREMIN JAN 2018 PROPORTIONAL FAN SPEED CONTROLLER JAN 2018 WATER TANK LEVEL METER (INCLUDING HEADERS) FEB 2018 10-LED BARAGRAPH FEB 2018 10-LED BARAGRAPH SIGNAL PROCESSING FEB 2018 TRIAC-BASED MAINS MOTOR SPEED CONTROLLER MAR 2018 VINTAGE TV A/V MODULATOR MAR 2018 AM RADIO TRANSMITTER MAR 2018 HEATER CONTROLLER APR 2018 DELUXE FREQUENCY SWITCH MAY 2018 USB PORT PROTECTOR MAY 2018 2 x 12V BATTERY BALANCER MAY 2018 USB FLEXITIMER JUNE 2018 WIDE-RANGE LC METER JUNE 2018 WIDE-RANGE LC METER (INCLUDING HEADERS) JUNE 2018 WIDE-RANGE LC METER CLEAR CASE PIECES JUNE 2018 TEMPERATURE SWITCH MK2 JUNE 2018 LiFePO4 UPS CONTROL SHIELD JUNE 2018 RASPBERRY PI TOUCHSCREEN ADAPTOR (TIDE CLOCK) JULY 2018 RECURRING EVENT REMINDER JULY 2018 BRAINWAVE MONITOR (EEG) AUG 2018 SUPER DIGITAL SOUND EFFECTS AUG 2018 DOOR ALARM AUG 2018 STEAM WHISTLE / DIESEL HORN SEPT 2018 NEW PCBs DCC PROGRAMMER DCC PROGRAMMER (INCLUDING HEADERS) OPTO-ISOLATED RELAY (WITH EXTENSION BOARDS) OCT 2018 OCT 2018 OCT 2018 PCB CODE: 07102121 07102122 11111151 05102161 04103161 03104161 04116011/2 04104161 24104161 01104161 03106161 03105161 10107161 04105161 04116061 07108161 10108161/2 07109161 05109161 25110161 16109161 16109162 11111161 01111161 07110161 05111161 04110161 01108161 11112161 11112162 04202171 16110161 19102171 09103171/2 04102171 01104171 04112162 24104171 07104171 01105171 01105172 SC4281 05105171 18106171 SC4316 18108171-4 01108171 01108172/3 SC4403 04110171 08109171 SC4444 06111171 SC4464 23112171 05111171 21110171 04101181 04101182 10102181 02104181 06101181 10104181 05104181 07105181 14106181 19106181 04106181 SC4618 SC4609 05105181 11106181 24108181 19107181 25107181 01107181 03107181 09106181 09107181 09107181 10107181/2 Price: $7.50 $7.50 $6.00 $15.00 $5.00 $5.00 $15.00 $15.00 $5.00 $15.00 $5.00 $5.00 $10.00 $10.00 $15.00 $5.00 $10.00/pair $20.00 $10.00 $5.00 $5.00 $2.50 $10.00 $5.00 $7.50 $10.00 $12.50 $10.00 $10.00 $12.50 $10.00 $2.50 $15.00 $15.00/set $7.50 $12.50 $7.50 $2.50 $7.50 $12.50 $15.00 $15.00 $10.00 $15.00 $5.00 $25.00 $20.00 $20.00/pair $10.00 $10.00 $10.00 $15.00 $25.00 $25.00 $12.50 $2.50 $7.50 $7.50 $5.00 $10.00 $7.50 $7.50 $10.00 $7.50 $2.50 $2.50 $7.50 $5.00 $7.50 $7.50 $7.50 $5.00 $5.00 $5.00 $10.00 $2.50 $5.00 $5.00 $5.00 $7.50 $7.50 WE ALSO SELL AN A2 REACTANCE WALLCHART, RADIO, TV & HOBBIES DVD PLUS VARIOUS BOOKs IN THE “Books, DVDs, etc” PAGE AT SILICONCHIP.COM.AU/SHOP/3 CIRCUIT NOTEBOOK Interesting circuit ideas which we have checked but not built and tested. Contributions will be paid for at standard rates. All submissions should include full name, address & phone number. Arduino (ESP32) Talking Clock I came across this tiny, low-cost MP3 playback module from a Chinese vendor on the AliExpress website (DFRobot DFPlayer Mini MP3) and came up with the idea of using it to build a talking clock. My friend’s son suggested that it could even play different music at different times, which I thought was a good idea. We decided that it should also be able to read out the temperature and humidity. I was originally going to base it on an Arduino Uno but unfortunately, the Uno is not powerful enough to drive the ILI9163 128x128 pixel TFT display that I was planning to use, so I ended up using an ESP32 module with builtin WiFi. I find myself using one of these modules for a wide range of tasks these days, since they are not expensive, have heaps of computing power and the WiFi capability is a bonus! 90 Silicon Chip You can see and hear my Talking Clock in action in this YouTube video: https://youtu.be/ryscF5IYixQ The talking feature involves playing back a series of pre-recorded audio samples, arranged in 127 separate files which are played back in sequence. You can either record these using your own voice, or that of someone you know, or you can use a speech synthesiser to generate them. You can customise exactly what it says and even add snippets of music if desired. The circuit is quite simple as it is based on four modules: the ESP32 microcontroller with WiFi, a 128x128 pixel colour LCD screen, a miniature MP3 player module and an optional real-time clock (RTC) for timekeeping. The RTC is not required if you have internet access. In that case, the clock can get the time using the Network Time Protocol (NTP). Australia’s electronics magazine The ESP32 module is powered from a 5V USB supply (not shown), such as a phone charger, with the other modules all being powered from the ESP32’s on-board 3.3V regulator. It controls the MP3 module using a serial port on the TX2 and RX2 pins. The small 8W speaker is connected between the SPK1 and SPK2 pins with a 470µF AC-coupling capacitor to prevent DC current flow – note its polarity. Another 470µF capacitor is required to provide sufficient bypassing. * I found the extra 1kW resistor from the TX pin on the ESP32 to the RX pin on the MP3 module was necessary to prevent sputtering noises from the speaker when commands are being transmitted to the MP3 module. The ESP32 sends display data to the LCD module via an SPI bus with D18 on the ESP32 providing the clock signal and D23 transmitting data. The siliconchip.com.au chip select (CS) pin is driven by digital output D2, reset by D15 and the address/mode pin A0 from digital output D4. The backlight is permanently powered by connecting in pin 8 (LED) to the 3.3V rail. Communication with the optional RTC is via an I2C bus in the usual manner, using pins D21 and D22 as SDA and SCL respectively. Sound recordings To record someone’s voice, you could use a smartphone, tablet, notebook or desktop PC. For a desktop PC, you will need an external microphone. Most other devices will have a built-in microphones. I suggest that if you are using a PC, you download and use the free Audacity software to make the recordings and save them as MP3 files. On other platforms, you will simply need to install a voice recorder app, if you don’t have one already. But note that you will need to figure out how to move the MP3 files off the device when you are finished. For example, you may be able to email them to yourself, or download them to your PC using a USB cable. I created the sound samples for my clock using “python-text-to-speech” speech synthesis software (pyttsx/ gTTS). This requires the Python lan- guage to be installed on your computer. It supports about 52 languages, including English, Bengali and Hindi. The voice is surprisingly realistic, as you will know if you watched the video linked above. On a Linux computer (Debianbased), you can install this software and start creating the MP3 files using the following sequence of commands: sudo apt-get install python sudo pip install pyttsx sudo pip install gTTS gtts-cli.py “The time is now” -l en -o 0101.mp3 Repeat the final line with different speech text and file names to generate the files. I have also collected the MP3 files I used for my clock in a .zip package, which will be available for download from the Silicon Chip website. Note that the file names must be of the form “0001.mp3” where the number varies depending on the sound. This is what the clock firmware expects. There is a text file in the download package which lists of all the sounds required along with their number. When you have finished creating them, make a folder called “mp3” in the root directory of the SD card and copy all the MP3 files into it. For the introductory sounds, you can use whatever sound you like, including possibly a short snippet of music. One is played at the start of each audio sequence in the morning and the other in the afternoon. Software The ESP32 board is programmed with a firmware sketch using the Arduino IDE. There are two sketches provided; one suits clocks using the DS3231 module for timekeeping and the other fetches the time over the internet (via NTP). ● If using the DS3231 module, you must first load a third sketch which sets the real-time clock to the correct time and date. ● If using the NTP version, you will first need to edit the sketch to include your WiFi network SSID and password. Before uploading these sketches, you need to install the Arduino IDE and the ESP32 board files. You will find instructions for the latter at siliconchip.com.au/link/aaiw Once installed, select the ESP32 Dev Module board (or whichever one suits your ESP32) via the Tools → Boards menu. Then make sure the correct serial port for your board is selected in the Tools → Ports menu. Bera Somnath, Vindhyanagar, India. ($90) The Talking Clock uses an ESP32 in conjunction with a 128x128 TFT display, as an Arduino Uno isn't powerful enough to drive it. The MP3 player module which plays back the speech and music files is mounted on the other side of the PCB. siliconchip.com.au Australia’s electronics magazine October 2018  91 Data Logger using Micromite Plus Explore 64 This data logger uses the Micromite Plus Explore 64 module and was designed to monitor 12V automotive and solar charging systems but it can do more. It can sample a 0-18V signal at intervals between two and 60 seconds long. This data is then saved to SD card. Part of the design criteria was to use a limited number of I/O pins as the same project required the use of a touchscreen LCD panel which occupies many of the other pins on the Explore 64. The data logger exclusively uses pins 18, 21, 22, 30, 31 and 32 on the Explore 64 which are close to the USB socket. It also requires connections to be made to the I2C pins, SDA1 (pin 43) and SCL1 (pin 44). The sampled voltage is reduced via a resistive divider and applied to pin 18, one of the analog-capable pins. Trimpot VR1 is used to fine-tune the division ratio to ensure accurate measurements. The Micromite's internal analog-to-digital converter turns the voltage into a number which is averaged several times in software to provide some digital low-pass filtering and then saved to the SD card on the Explore 64 module. 92 Silicon Chip The Explore 64 also samples the temperature and humidity using a DHT22 sensor and this data is logged at the same time as the sampled voltage. A real-time clock module with an onboard DS3231 IC ensures accurate time stamps. The time and date are retrieved over the I2C digital bus. Each data file contains one hour worth of samples and is named according to the date and time. The data is saved in CSV (comma-separated value) format, in the following order: date, time, voltage, temperature, humidity. The CPU speed can be selected as 30MHz (JP1 in) or 100MHz (JP1 out) and CPU sleep can be enabled by plugging in JP2. Both jumpers have 10kW pull-up resistors to define the state of pins 22 and 30 when the corresponding jumper is not fitted. Jumpers JP3-JP8 provide the logging interval options. To save on I/O pins, all six options are provided using a single I/O pin (pin 21). A “ladder” of five 10kW resistors is connected between the +3.3V and GND rails, providing six distinct voltage levels equally spaced between the two extremes and depending on which of JP3-JP8 is fitted, a different voltage is applied to pin 21. Australia’s electronics magazine This is sampled using the internal ADC and the voltage level then determines the logging interval used. LED1 lights up to indicate that the data logger is waiting for the start of a new minute at power up and then flashes each time data is saved to the SD card. The module draws approximately 80mA at 100MHz and about 40mA at 30MHz but it drops to around 7mA during sleep. It would be lower but the Explore 64 power LED is permanently lit, as is the power LED on the real-time clock module. You could remove them both to get a much lower sleep current. If the logger is to be used for extended periods, the CPU sleep function should be enabled. In that case, a power supply as described in the Touchscreen Altimeter project (December 2017; siliconchip.com.au/Article/10898) could be used. This consists of a small battery charger/regulator module, a lithium-ion cell and a small solar panel. Note that you could power the data logger from a USB power bank but these usually switch off their outputs automatically if the load current drops below about 30-55mA, depending on the model. So you may need to connect a resistor across the supply to make the current draw high enough for the power bank output to remain on. A typical 2500mAh power bank can power the data logger for more than a day with the minimum two-second sampling interval, using the 30MHz system clock and with sleep mode disabled. Neil Cox, West Haven, NSW. ($80) siliconchip.com.au Eight-button Quiz Master system This Quiz Master system is suitable for quiz competitions with up to eight players and can be used in schools, colleges and at children’s parties. When one of the eight buttons is pressed, it will produce a buzzing sound and display the number of the first player to press their button. It has an alternative mode where the players divide into two teams of four and the players work together as a team to answer the quiz questions. You do not actually need eight players; the minimum number is two. The unused buttons can be unplugged or simply ignored. The buzzer sound is software generated and consists of a sequence of four tones, fed to digital output B0 (pin 18) of PICAXE20M2 microcontroller IC1. The square waves are buffered by the 74HC14 hex inverter (IC2) with five parallel inverters driving the capacitor-coupled 8W loudspeaker, to produce plenty of sound. The eight C0-C7 digital inputs of IC1 (pins 3-10) are used to monitor the eight momentary pushbuttons, PB1-PB8. Each input is held high by a pull-up current from inside IC1. When one button is pressed, it pulls that input low. The 1kW series resistors assist the internal protection diodes to dissipate any spikes picked up by the player but- siliconchip.com.au ton cables, which could be long. The player buttons (PB1-8) should have tactile or snap action contacts. Digital outputs B1-B7 (pins 11 -17) of IC1 drive the segments of a 56mm high jumbo 7-segment display (DISP1) via 220W current-limiting resistors. These segments have four LEDs in series (around 8V forward voltage drop) so the display is powered from a 12V supply provided by a second 6V battery. As the LEDs are diodes, negative voltages are not applied to pins 11-17 of IC1. To extend the battery life, the 7-segment display is blank until a player presses a button. The player’s number is then shown for 10 seconds before blanking again. For the eight-player game, the display shows the player number between “1” and “8”. For team games, the capital letters “E” and “H” are used with the letter “E” for players 1-4 and “H” for players 5-8. The team mode and display on-time are saved in EEPROM and the defaults are eight-player mode and ten seconds. To change these settings, turn on power switch S1 while pressing one of the player buttons and release the button when you hear a beep. Hold PB1 to select the eight-player game or PB2 for the two team game. You change the display on-time by holding PB3 (6 seconds), PB4 (8s), Australia’s electronics magazine PB5 (10s), PB6 (12s), PB7 (14s) or PB8 (16s) instead. The first battery of four AA cells (BAT1) is switched by S1 and supplies IC1 and IC2 via diode D1, which drops the voltage to just over 5V, as required for IC1. It also supplies current to the power-on indicator (LED1). The second battery (BAT2) is only used to provide the extra voltage needed to drive DISP1 and is connected directly to its common cathode pins. It fits in a large plastic Jiffy box and the parts can be mounted on two DILpattern strip boards, one for IC1 and IC2 and the other for the 7-segment display. You will also need two battery holders, a power switch and connectors for the player buttons. The eight external player buttons can be either small hand-held pushbuttons or large mushroom buttons. The PICAXE website explains how to use your PC or laptop to program the PICAXE20M2 microcontroller (IC1). You need an AXE027 USB cable (Altronics Cat Z6198) and a copy of the free “program editor software” and “USB driver software” from the PICAXE website. Having downloaded my BASIC program, “quiz_master_20m2.bas” from the Silicon Chip website, upload it using the USB cable and the ICSP header. Ian Robertson, Engadine, NSW. ($75) October 2018  93 Switchmode Solar Battery Charger with Sunset Switch Maximum Power Point Tracking (MPPT) solar battery chargers are very efficient but they are normally designed to operate with relatively large panels and may not function at all when fed from a small panel. But there are many applications for solar panels in the 5-40W range where efficiency is the priority in that every last available milliamp is to be harvested where possible. Commercial solar chargers are abundant as well as the plethora of DC-DC converters found on the net. The efficiency of these chargers is usually measured at or near maximum power and can be significantly worse than quoted, when used in low-power applications. This circuit is tailored for 5-40W 94 Silicon Chip panels producing up to 3A output and it will charge a lead-acid battery very efficiently, with no heatsinking required. It is cheap to build and is based on commonly available components. The main DC-DC converter has a measured efficiency of 92-95% across its designed output range. This is not an MPPT charger since it doesn’t actually measure the current flow and so can’t determine the maximum power point. However, it has been designed with a simple control scheme which attempts to keep the panel near its maximum power point in bright sunlight. So it generally gives much better results than a simpler charging scheme (eg, using a linear regulator). Australia’s electronics magazine It also has the ability to power a light from the battery when the solar panel is in darkness (which you can ignore if it isn’t needed) and the light will automatically switch off if the battery voltage drops too low. The circuit works as follows: at dawn, the solar panel voltage rises rapidly and the 2200µF input filter capacitor commences charging. The two halves of op amp IC1 are used as comparators. In the case of IC1a, its non-inverting input (pin 3) is biased to 5.1V by zener diode ZD1 while its inverting input (pin 2) receives a voltage proportional to that of the solar panel. The division ratio is adjusted using VR2 so that this voltage reaches 5.1V when the panel voltage is 18V. siliconchip.com.au Initially, since the panel voltage is below 18V, the voltage at pin 2 of IC1a is below 5.1V and so output pin 1 is high. This forward-biases diode D6 which pulls the pin 5 feedback voltage of switchmode regulator IC2 (MC34063) high. With the feedback voltage high, the switching action of IC2 is disabled. Once the panel voltage rises above 18V, output pin 1 of IC1a goes low so D6 is no longer forward-biased and the feedback voltage to pin 5 of IC2 returns to its normal state, which is as a fraction of the battery voltage, determined by the setting of trimpot VR1. Since the battery voltage will normally be low at this point (the battery having discharged overnight), switchmode regulator IC2 will start up. Its operating frequency is set to 30-33kHz by the 1nF capacitor between pin 3 and ground. Its internal transistor emitter at pin 2 is grounded while the collector at pin 1 controls P-channel Mosfet Q1 via drive circuitry identical to that used in the February 2016 Solar Charger/Lighting Controller (see Fig.6 on page 35 at siliconchip.com.au/Article/9813). This allows the open-collector drive from IC2 to quickly switch Mosfet Q1 on and off. When Q1 switches on, power can flow from the solar panel (nominally at 18V), through D1, Q1 and then L1 and into the battery. The voltage across L1 causes its magnetic field strength to increase. When Q1 switches off, the magnetic field collapses and so current continues to flow through L1 and into the battery, but now it comes from ground via D2 as it can no longer flow through Q1. This means that only a small amount of the energy from the panel is wasted, despite the voltage difference between it and the battery, as that extra energy is stored in L1 and then released into the battery, rather than simply being turned into heat as would be the case with a linear regulator. If there is full sunlight on the panel, despite the current drawn from it to charge the battery, its voltage will remain high and so the switchmode converter will continue to operate. However, if the sunlight is not strong or the panel is partially shaded, the input capacitor will discharge as current is drawn and so the panel voltage will drop. siliconchip.com.au If it drops below 15.8V, output pin 1 of IC1a will go high and so IC2 will shut down and the input capacitor will begin to charge up to 18V again. This cycle repeats until either there is not enough light on the panel to charge the input capacitor up to 18V, or the sunlight becomes stronger and is able to sustain the panel voltage above 15.8V (the required light level will also depend on the state of the battery charge). The panel voltage must drop below 15.8V because of the hysteresis applied to the inverting input of IC1a. This is a slightly unusual configuration as hysteresis is more commonly applied to the non-inverting input, as it is a form of positive feedback. But in this case, NPN transistor Q4 inverts the voltage at the output of IC1a and the 100kW hysteresis resistor connects from its collector to inverting input pin 2 of IC1a. The pulsating charging action of the circuit is indicated by green LED1 flashing. This usually happens at dawn, dusk and under cloudy circumstances, with increasing frequency as the sunlight intensity increases, until it becomes solid under optimal conditions. Throughout this process, the average solar panel voltage is maintained at around 17.2-17.5V, approximately the maximum power point of a 12V solar panel. Q1 is a P-channel Mosfet with a very low on-resistance, so no heatsinking is required. Similarly, D1 and D2 are dual schottky diodes with very low forward voltage drops for maximum efficiency. D1 can be paralleled with another, identical diode to increase efficiency by a few percentage points. The capacitors across the solar panel and battery and at the cathode of D1 must be low-ESR types. Sunset switch sub-circuit This sub-circuit is based on IC1b and associated components. The non-inverting input (pin 5) is held at approximately 3.75V by the battery through diode D4 and a resistive divider of 33kW and 10kW. When there is light on the panel, the voltage at the inverting input (pin 6) is maintained at 5.1V by ZD1. So during the day, its output pin 7 is low and so is the gate of N-channel Mosfet Q3, keeping the light off. Australia’s electronics magazine At dusk, the voltage at pin 6, which is ultimately derived from the panel voltage, falls below the 3.75V at pin 5 and so IC1b’s output swings high, switching on Q3 and any lamps connected. IC3a is another op amp used as a comparator and it provides the lowbattery cutout. The battery voltage and zener diode ZD3 biases its pin 2 inverting input to +5.1V while a fraction of the battery voltage (set using trimpot VR3) is applied to non-inverting pin 3. So when the battery voltage drops below the threshold set by this trimpot, its output pin 1 goes low. This forward-biases diode D7, pulling the gate of Mosfet Q3 low, thus switching the lamp(s) off. It also causes red LED2 to light up, indicating that the battery is flat. A 100kW resistor between pins 1 and 3 of IC3a provide some hysteresis in the typical manner. The other half of the op amp, IC3b, is unused and wired up as a voltage follower to prevent it from oscillating. IC3 is powered directly from the battery while IC2 is powered from the solar panel. IC1 is powered from whichever has a higher voltage, via diode D3 or D4. Winding the inductor L1 is wound on a powdered-iron toroidal core. There are two options: Jaycar Cat LO1244 with 33 turns of 0.8mm enamelled copper wire or Cat LO1242 with 45 turns of 0.8mm wire (both 100µH). The larger LO1244 toroid is preferred as it gives a slightly higher efficiency. D1, D2, Q1, L1, IC2 and the three low-ESR capacitors should be mounted in close proximity and connected using thick tracks or heavy-gauge wire. Take particular care with Q1's drain connection to L1. Use multi-turn trimpots for VR1, VR2 and VR3. Adjust VR1 for 14.2V at the battery when it’s fully charged and the panel is in sunlight. VR2 should be set such that the charger switches on when the panel voltage rises to exactly 18.0V, and VR3 is set to switch off the lamps when the battery voltage drops to 11.75V (or your preferred threshold voltage). LED1 and LED2 should be high-brightness types. Colin O'Donnell, Glenside, SA. ($90) October 2018  95 PRODUCT SHOWCASE New dual-mode AC/DC power monitoring IC from Microchip Applications such as solar inverters, smart lighting and cloud servers often use AC as the main power source and DC as backup, or vice versa, to maintain safe operations. To provide customers with a simplified development path and ability to optimise their product performance, Microchip Technology Inc offers a flexible dualmode power monitoring IC (MCP39F511A) that measures both AC and DC modes with industry-leading accuracy of 0.1% error across a wide 4000:1 range. The MCP39F511A minimises parts cost and firmware development time by integrating two 24-bit delta-sigma ADCs, each offering 94.5dB of SINAD performance, with an on-chip EEPROM that logs critical events and a 16-bit calculation engine into a single IC. It provides standard power calculations that enable designers to easily add highly accurate power monitoring functions to end applications. Other advanced features include auto-save and auto-load of power quantities to and from the EEPROM at power loss or start as well as event monitoring of various power conditions. Contact: This ensures that Microchip Technology Inc measurement results Unit 32, 41 Rawson St Epping NSW 2121 are never lost if powTel: (02) 9868 6733 er is unexpectedly Website: www.microchip.com disrupted. Dial Down the Noise: Mouser’s online EMI white paper A new guide from Analog Devices and Coilcraft will help designers address electromagnetic interference (EMI) concerns in automotive and industrial applications. The new page hosts a variety of reference material and paired electronic components to aid designers in achieving lower EMI using a combination of Analog Devices’ Silent Switcher 2 LT8640S/LT8643S/LT8650S synchronous step-down regulators and Coilcraft’s power inductors. Featuring Analog Devices’ second-gen- eration Silent Switcher architecture designed to minimize EMI emissions, Analog Devices’ Silent Switcher 2 LT8640S, LT8643S, and LT8650S synchronous step-down regulators Just add water: medical diagnostic kit for remote communities A scientist at the Australian National University (ANU) is developing a new just-add-water diagnostic kit for use in remote communities to detect malaria and other diseases. Dr Lee Alissandratos from the ANU Research School of Chemistry said the diagnostic kit, which can be easily transported and stored at room temperature, would be ideal for non-specialists in remote and resource-limited communities. “Early detection of microorganisms that cause diseases, such as malaria, is critical in the global fight to control and eradicate some of the most devastating diseases,” said Dr Alissandratos, who is a CSIRO Synthetic Biology Future Science Fellow. Diagnostic tests used today to detect the malarial pathogen are expensive and only effective when carried out within well-equipped laboratories operated by highly skilled staff. “They are not avail- Contact: able to resource-limited Australian National University communities where they Tel: (02) 6125 5111 are urgently needed,” Dr Email: apostolos.alissandratos Alissandratos said. <at>anu.edu.au 96 Silicon Chip deliver high efficiency at high switching frequencies using a combination of bypass capacitors, a ground plane, copper pillars, and other components to optimize all the fast current loops. The 42V, 6A regulators offer a 2.5µA quiescent current and up to 96% efficiency at 1MHz, and provide fast, clean, and low-overshoot switching edges that enable high-efficiency operation and step-down ratios even at high switching frequencies. Download the white paper from: www. mouser.com/applications/limiting-emi/ Quick-Mount Convection Heatsink for TO-220, TO-257 and TO-264 packages Involve Audio has a new heatsink series that is said to drastically reduce both assembly times and manufacturing costs while providing an effective solution for high-powered devices. Designed for use with forced convection, assisted tunnel heat is concentrated within the heatsink to prevent leaks to other components within a device. This revolutionary mounting system provides even pressure distribution to ensure effective thermal coupling along devices. “It has reduced our assembly times from 30-40 minutes, down to 3-4” said Charles van Dongen, Involve Audio’s Chief Technical Officer. Currently, the heatsink series is only available for commercial use but they are currently in discussion with major Contact: distributors in Austral- Involve Audio, Australia ia and internationally, 2 Shearson Cresc, Mentone, Vic 3194 to have the product re- Tel: 0438 698 325 Website: www.involveaudio.com leased later this year. Australia’s electronics magazine siliconchip.com.au New WE1010 Temperature-Controlled Soldering Station Weller’s WE1010 Soldering Station has been available overseas for around six months now (120VAC power only) but the 230VAC-powered version is about to be released in Australia (available mid November). It has the now typical temperature-controlled soldering station configuration, with a base station incorporating the temperature readout and adjustment (and a few other features), a soldering pencil and a stand for the pencil. The tip heating power is 70W. A few seconds after switching the unit on, the temperature display appears and the iron starts heating up. While it only takes about 20 seconds or so to get up to operating temperature, which is quicker than many irons I have used, it is a little irksome that it doesn’t start heating until a few seconds after switch-on. I found the iron easy to use and had no trouble assembling a few PCBs which I was working on, including an Arduino shield that included some fairly large terminals. Large terminals and components connected to copper pours take a little bit longer to solder than the others but I didn’t find that there was any need to turn the temperature up. The supplied chisel tip is large enough to heat up two component leads at the same time, which occasionally comes in handy. The pencil is quite well-balanced and feels light in my hand and both the lead from GPO to the base (2.4m) and the base to the iron (1.6m) are quite long but not excessive. Having long leads suits the way that I work. The lead from the base to the iron is a flexible silicone material which doesn’t hinder movement at all, including tip rotation, unlike some plastic cords. The base has an on-off switch and three buttons (up, down and menu). Without reading the manual (which a previous reviewer had pilfered!), I had no trouble figuring out how to change the temperature and standby time. Standby mode is activated when you haven’t used the iron in a little while, with the tip dropping to 180°C, to increase its lifespan. siliconchip.com.au Review by Tim Blythman This is a good idea in a production environment but not necessary for me, since I turn the iron off when I’m not using it for a little while. Unfortunately, there is no way to disable standby mode and I found that it didn’t always power back up when I went to use it, so I had to train myself to press the menu button to wake it up before picking up the pencil each time. The WE1010 takes ET-series tips, which are readily available and relatively cheap. There are flat, conical, knife and screwdriver type tips available in this range. You can see the tips sold by Digi-Key for this iron at: http://siliconchip. com.au/link/aal5 The recommended retail price is $230+GST. The WE1010 offers a little more soldering power, Contact: more features and Apex Tool Group Australia Pty Ltd a better range of ac- 519 Nurigong Street, Albury NSW 2640 cessories than its Tel: (02) 6021 6666 Email: alburysales<at>apextoolgroup.com competitors. Australia’s electronics magazine October 2018  97 Vintage Radio By Ian Batty Emerson 838 hybrid valve/transistor radio The Emerson 838 is a transitional design in more ways than one. It came at the end of the valve era, as transistors were starting to become widely available and thus uses both. Many of its components are mounted on a riveted phenolic board but it also has a metal chassis, representing the fact that it was introduced just before sets began to be built using printed circuit boards. The Emerson 838, with its punched and riveted phenolic board chassis and metal frame, sits between the older allmetal chassis designs and upcoming printed circuit models. All the RF stages, the detector and the audio preamp stage are valve-based while the push-pull Class-B output stage is based on a pair of PNP transistors. Despite the use of transistors, the loudspeaker is still transformercoupled. While the use of valves means that 98 Silicon Chip this set is not as compact as the Regency TR-1, shown next to it for comparison, it’s impressively small for a hybrid set. We covered the all-transistor Regency TR-1 set in our April 2013 issue; see siliconchip.com.au/Article/3761 The two sets were contemporaries, with the TR-1 (the first all-transistor set) released in late 1954 and the Emerson 838, in 1955. The Emerson 838 was an evolution of the all-valve 747. Besides the labelAustralia’s electronics magazine ling, there’s little externally to distinguish them. The 838 comes in several different colour combinations. I have the silver set shown here, which is also available with a red back and tuning knob, one in a maroon case with a gold faceplate and one in cream. You can see photos of other versions of this set at www.radiomuseum.org Construction method Major components such as the IF transformers are mounted using twistsiliconchip.com.au The Emerson 838 (153 x 90 x 33mm) shown at left with the Regency TR-1 (76 x 127 x 32mm) to its right. Considering the Emerson 838 used three sub-miniature valves, compared to the all transistor TR-1, its size is quite impressive. ed metal lugs and the valves insert into in-line valve sockets specially designed to contact the thin wire connections of the miniature battery valves. Likewise, the two transistors insert into chassis-mounted sockets. Most minor components are wired point-topoint, either to socket/IF transformer contacts or to chassis eyelets. Like some other sets of the era, many minor components are fitted to a “Couplate”/ “Printed Electronic Circuit” (PEC), an early method of packaging components onto an encapsulated substrate. As it’s buried behind other circuitry, you can’t really see it in the photos. These can crack over time, or become damaged but replacements for the more common PEC assemblies are available online. If you can’t find a replacement, in the worst case, it is possible to make a substitute using more modern assembly techniques. The “A” battery fits into a conventional spring-loaded bay retained by a slide cover while the “B” battery (also behind a slide cover) uses a snap fastener identical to those on the familiar PP9 transistor radio battery. were common by 1955, with the only real difficulty being in how to obtain an appropriate voltage to power the output stage. The solution was to use a 4V “A” battery rather than the more typical 1.5V type and compensate by connecting the three valve filaments in series, so they could also run from this 4V supply. Dispensing with the output pentode also removed the need for its biasing circuit, so there’s no wasteful back bias resistor, as there was in the 747. The set uses a ferrite rod antenna, moulded into the top of the case. The tuned antenna circuit feeds the signal to the mixer section of the converter, a 1V6 triode-pentode. Triode-pentodes fell out of favour in larger sets after the 1940s; while subminiature battery pentagrids (1E8) and triode-hexodes (2G21) were available, their conversion conductances are significantly inferior to that of the 1V6. Also, the 1V6 has only about half the conversion gain of its 1R5 B7G cousin. Given the 1V6’s superior performance to its subminiature alternatives, it’s no surprise that the 1V6 dominated commercial battery valve designs of this era. While pentagrids and triode-hexodes rely on the oscillator’s signal directly modulating the electron stream from cathode to anode, the 1V6 relies on the coupling between the two sections for LO (local oscillator) injection. Circuit description Rather than the conventional 1AG4 output pentode of its Model 747 predecessor, the 838 uses a push-pull transistor output stage. This significantly improves battery life as it eliminates the 1AG4’s constant 40mA filament current and 3mA HT current. The “A” battery operating current falls by 25% but the “B” battery current drops by over 50%. Transistor audio amplifier designs siliconchip.com.au Inside the Emerson 838 case everything is packed neatly. The antenna in the set is directional, so you might be able to get better reception over its 540-1620kHz range by rotating the case. Australia’s electronics magazine October 2018  99 Aside from the use of the triode-pentode, it’s a conventional converter stage. The tuned signal is fed directly to the converter’s signal grid. Bias for this stage, derived from the AGC circuit, is series-fed through the antenna winding. The oscillator is a little unusual; the expected capacitive coupling from the top of the oscillator’s tuned winding is absent. Instead, an open-ended coil winding is used, using parasitic capacitive coupling between the grids. Grid resistor R3 (at 1MW) is much higher than usual, reflecting the generally lower voltages and currents in subminiature valve circuits. The triode’s anode current is supplied via the oscillator coil’s primary and the mixer’s anode via the tuned primary of first IF transformer T1. Its secondary, also tuned, feeds the signal to V2, a conventional sharp-cutoff pentode (1AH4). Despite its small size, it gives more gain than the larger B7G 1T4 work-alike with a 45V supply. The IF amplifier does not receive gain control from the AGC circuit. That’s a result of the set’s series filament connection. Since each filament is some 1.25V more above ground than the previous one, series-connected filament designs demand some tricky AGC action. There’s an excellent description of this on pages 1114-1115 of the Radiotron Designer’s Handbook. Emersons’ designers have picked the elegant solution of “contact potential” bias with no external gain control. Grid resistor R4 (10MW) allows V2’s grid to drift weakly negative and provide self-bias. I thought that this might also allow grid rectification on strong signals and thus provide its own local AGC but in later testing, I was not able to find any evidence of this. Unusually, the second IF stage is neutralised by 5pF capacitor C12’s feedback from the valve’s anode to the “cold” end of the first IF transformer’s secondary. This is odd because pentodes generally exhibit very low anodegrid capacitances and do not usually need such a high neutralisation capacitance. The 1AH4’s Cg-a is just 0.01 pF but note that C12 forms a capacitive voltage divider with 2nF bypass capacitor C11, reducing its effectiveness, hence the relatively high value. Note also 22nF capacitor C3 from the bottom end of the antenna to ground, which is necessary to cancel out feedback in the overall circuit wiring in this tightlypacked little set. V2 feeds its amplified IF signal to the tuned primary of second IF transformer T2 and T2’s secondary delivers the IF signal to the diode section of V3, the demodulator. The AGC signal is derived from the DC component of the demodulated signal, fed back to the grid of converter V1 via the resistive divider formed by R1/R2. The AC component of the signal is filtered out by C3 (it’s also an RF bypass capacitor, as mentioned above). Since the “cold” end of the second IF transformer is returned (via R6 and R5) to the valve’s filament, there’s no delayed AGC effect. The audio signal at the wiper of volume control pot R5 is AC-coupled via C16 to the grid of V3’s pentode section. It gets bias from the negative filament terminal of V2, around -1.2V, via 5.6MW resistor R7. V3, a 1AJ5, is basically a subminiature version of the B7G 1S5, with about 80% of the gain for a 45V supply. 100 Silicon Chip Australia’s electronics magazine siliconchip.com.au Tuning gang V3 Output transformer 2nd IF transformer V1 1st IF transformer V2 Above: labelled bottom view of the 838 chassis showing the two IF transformers, output transformer and tuning gang. Below: labelled top view of the chassis. The large 50µF ceramic capacitor (C21) just under the volume control bypasses the 4V LT supply, while the smaller 8µF ceramic next to it (C19) bypasses the 45V HT supply. Driver transformer Q1/Q2 output Volume Control Audio output stage Audio preamplifier stages ideally have anode load and screen dropping resistors in the megohm range. These very high values hit the “sweet spot” between increasing gain (with increasing load resistance) and decreasing mutual conductance (with lower anode/screen currents). But this valve needs to deliver sufficient current to drive the following Class-B transistor output stage. The screen voltage of 30V gives V3 a mutual conductance of about 300µS (microsiemens), enough to provide both useful voltage gain and an adequate current. Transformer T3 matches V3’s high anode impedance to the low input impedance of Q1/Q2, with a high impedance primary and low-impedance, tapped secondary. The circuit shows Q1 and Q2 as proprietary Part No. 815003. This set’s devices were 2N34s, a grown-junction germanium PNP audio transistor type. Crossover distortion is minimised by the biasing network of resistors R10/R9, providing the usual 150mV of forward bias to both bases. Unlike later designs, there is no shared emitter resistor to improve bias stabilisation and add local feedback. The transistor collectors feed push-pull output transformer T4, with C20 providing a top cut function. T4’s secondary feeds the 12W speaker directly as there is no Volume Control Driver transformer Oscillator coil V2 (behind) V3 Output transformer siliconchip.com.au V1 The side view of the chassis shows the oscillator coil, converter (V1) & demodulator valve (V3), with the IF amplifier (V2) hidden. Australia’s electronics magazine October 2018  101 light application of a heat gun. Don’t be tempted to use the sprays meant for loosening bolts and screws. My experience with the Emerson 747 shows that these lubricants can freeze the adjustment slugs. Luckily, in my case I was able to remedy the problem by applying heat but it’s best to avoid the problem altogether by not attempting to lubricate coil slugs. Also, the 747 service guide advises that you do not measure valve filaments with an ohmmeter. Analog meters can put out around 100mA on low range and this advice also applies to the 838. Comparisons & performance Trimmer alignment is done with the chassis and batteries in place. C2 and C5 can then be adjusted by removing a small plate on the side of the case as shown. earphone socket on this set. 8µF capacitor C19 bypasses the 45V HT supply from the B battery while the LT supply is bypassed by 50µF capacitor C21. Editor's note At the end of the valve era, hybrid car radios were quite common as local Australian manufacturers made the transition to transistors. As with the American Emerson set described here, Australian manufactured car radios used battery valves for the RF sections and germanium transistors in the audio stages, mostly using a single germanium power transistor in Class-A mode. The heavier current drain of the Class-A output stage was generally not a problem in these cases since the sets ran from the car’s battery. These hybrid car radios were a significant advance on the earlier sets with their vibrator power supplies. The Emerson logo features a take on a G-clef followed by the phrase “Emerson Television and Radio”. 102 Silicon Chip The lack of audible vibrator buzz was most welcome. As far as we can determine, no other hybrid radios were produced by Australian manufacturers although there were a number of hybrid TV sets and here the situation was reversed: silicon transistors did all the work in the small signal stages, while valves were used in the high voltage video and sweep stages (ie, yoke and EHT circuitry). Cleanup and adjustment The example shown here was in good physical and electrical condition, needing only a polish to smarten it up. It worked right away and didn’t need any adjustment. But if you do need to adjust an 838 (or its predecessor, the 747), I have some helpful hints. The chassis sits behind the front cover. To gain access, remove the tuning knob and gently prise the latch beside the tuning gang to begin releasing the front cover catches. Replace it by first seating the catches at the opposite end to the gang and then work towards it. The chassis needs to be removed for IF and oscillator core alignment. Trimmer alignment must be done with the chassis in place in the cabinet, so an access plate is provided for trimmer capacitors C2 and C5 (see above). Be careful when adjusting the coil slugs. Many sets of this era used a wax seal and this is best eased off with the Australia’s electronics magazine The most direct comparison I can make is with Emerson’s own 747, a four-valve set similar in design to the classic four-valve B7G portables of the ‘50s and ‘60s. There’s also the Hoffman “Nugget” and the ingenious Crosley book radios, where the radio chassis nestles inside a “book-alike” case. Then there’s the contemporary all-transistor Regency TR1, as mentioned in the intro. The TR-1 used a hearing aid battery that lasted only about 20 hours, compared to the Emerson 838 which I would estimate would last around 40 hours, despite having a more powerful output stage. So it compares quite favourably. Overall, I would have to say that the 838 is a great performer for its size. Its audio output is adequate, and sensitivity is good – it’s superior to many transistor sets of the day. The maximum audio output is around 50mW. I did all my testing at 5mW as this seemed like a typical use case. I measured the sensitivity at 600kHz at around 300µV/m, rising to 600µV/m at 1400kHz. In both cases, the signalto-noise ratio was over 20dB. That equates to around 900~1800µV/m at a 50mW output, compared to adjusted figures for the TR-1 of 2000~2800µV/m for the same theoretical output level. Selectivity at –3dB measured ±1.9kHz, at –60dB it was ±30kHz. The AGC allowed a 6dB increase in output volume for a 60dB increase in input signal level. It was hard to overload, needing some 750mV/m before producing noticeable distortion. At 50mW audio output, Total Harmonic Distortion (THD) is around 10%, with 6% THD at 40mW and only siliconchip.com.au A brief history of Emerson Victor Emerson incorporated a phonograph company in 1915. Releasing America’s first radio-phonograph combination in the 1930s, Emerson emerged from obscurity offering the wildly successful “peewee” set in 1932. With the peewee selling as many as 60% of all radios in the first half of 1933, Emerson’s 50% share of this bonanza saw them become a major player. The 1947 release of a 10-inch television marked Emerson as an innovator, continuing to release the first clock radio, and solar-powered transistor pocket radio. The Emerson hybrid model 838 radio described in this article was released in 1955. The miniaturisation of valves The triode was invented around 1907 and the tetrode in 1919. By 1939, multi-function valves (eg, diode-triodes) were common. That was also the year that the B7G series of battery valves was released, which abandoned the historic pinch construction, connecting the internal assembly directly to a set of base pins embedded in the bottom sealing disc. These valves were electrically similar to their older, octal predecessors but the B7G series occupied some 25% of even the most compact octal valves’ volumes. While the B7G design allowed such advances as the revolutionary BC-611 “Handy-Talky”, the pressure for even greater miniaturisation remained. Abandoning base pins entirely and bringing connecting wires through the envelope’s base allowed further compaction. Three strategies emerged: I. The E8 format has a cylindrical T3 (3/8-inch) envelope, retained a miniaturised version of the B7’s base disc, but with eight connecting wire leads rather than pins. The compaction was remarkable. The subminiature 1E8 valve has only 6.25% of the original 6SA 7GT’s volume. E8 types could be soldered directly in place or, with clipped leads, plugged into sockets. The E8 base also allowed the encapsulation, for example, of independent dual triodes, a construction that had been impossible in B7G construction. Directly and indirectlyheated E8 valves were built, from VHF transmitting triodes to audio output pentodes, at least one pentagrid, one triode-heptode and even a subminiature version of the iconic “Video Pentode”, 6AC7. II. A second approach reverted to pinch construction, with all leads (between three and seven) in the one plane exiting through the flattened “press” at the base of the envelope. These types generally used a flattened envelope such as the T2X3 (2/8-inch x 3/8-inch). Some came with long “flying” leads and could be soldered in or (again with clipped leads) plugged into a socket. III. A third class used a cylindrical envelope and base but presented the leads in a row, similar to the T2X3 and could also be soldered or plugged into sockets. A few EHT rectifier diodes (designed for solid-state television sets) with two leads in the base and one at the top (for the anode) used this construction Generally, a reduction in filament/cathode heating power leads to a reduction in mutual conductance and (at least for pentodes) in gain. The designers of the 1V6-1AH4-1AJ51AG4 series (replacing the 1R5-1T4-1S5-1S4), as used in the Emerson 838, economised a little by cutting filament currents from 50mA to 40mA. Although manufacturers managed to retain good performance in amplifying stages, Emerson’s designers still had to work hard when designing the 838 to ensure it was a credible performer. Miniaturisation and the cachet of “military-type” subminiature valves had appeal but the practically-minded would also be wary of running costs, so battery life was important too. The 20% reduction in filament current helped the 838 achieve a good battery life. But the most significant improvement was from eliminating the typical Class-A valve output stage and its poor efficiency, as described in the main text. Pentagrid converters from left to right: 2A7, 6SA7, 1R5, 1E8 siliconchip.com.au Australia’s electronics magazine 3% at 10mW. Audio response from volume control to the speaker (–6dB) is 300Hz to 6.5kHz, from antenna to speaker is 280Hz to 1.7kHz. Small sets are notorious for having a short battery life but this one draws a modest 2.6mA from the B battery (HT), falling to around 1.4mA on strong stations. This implies a life of more than 70 hours from the National Electronics Distributors’ Association (NEDA) Type 213 battery, which had a typical capacity of 140mAh. I wasn’t able to find data for the 4V NEDA 1300 A battery. The set only draws about 50mA so I’m guessing an original “A” battery would have a life of 40+ hours, as mentioned above, given that mercury batteries had capacities roughly double that of alkaline types. Replacement batteries The Eveready 415 45V battery (or its equivalents) can be bought online but at some $25+ it’s an expensive way to power these sets. I have previously bundled up four 12V batteries (as used in remote controls) using everybody’s favourite wrapping – duct tape. Likewise, I taped up three AA cells in series for the A battery. Bruce Wilkie (Radio Waves, January 2016) has a more elegant solution. His Crosley JM-8 “book radio” now uses a plastic AA holder for four 12V batteries and a 3-cell holder from a cheap LED torch for three 1.5V cells. Bruce’s radio is very similar to my Emerson set and it’s worth reading his article to compare the two sets. I’d prefer to use three NiCd/NiMH rechargeable cells (for about 3.8V total) to give closer to the original Mercury battery’s 4V. Further reading ● Emerson 838: siliconchip.com. au/link/aal7 ● Series-filament AGC systems, in Radiotron Designer’s Handbook (complete, searchable PDF, around 90 MB in size): siliconchip.com.au/link/aal8 ● Complete Centralab catalogue: www.audiophool.com/Techno.html (search for Centralab; it’s a Deja View [.DJVU] file, so you’ll need the viewer plugin). ● Bruce Wilkie, The Crosley JM-8 Hybrid Book Novelty Radio, pp10-14, Radio Waves, Jan. 2016, Historical Radio Society of Australia (HRSA). SC October 2018  103 ASK SILICON CHIP Got a technical problem? Can’t understand a piece of jargon or some technical principle? Drop us a line and we’ll answer your question. Send your email to silicon<at>siliconchip.com.au How does pulse width modulation work? I have a question about the Highcurrent 12/24V Speed Controller, described in the June 1997 issue of S ilicon C hip (siliconchip.com.au/ Article/4868). The article says that the output switching frequency is 2kHz. 5kW potentiometer VR1 is used to adjust the motor speed and this is connected between pins 14/15 of the TL494 IC and ground, with the wiper going to pin 3 (feedback) via two series resistors. Does this potentiometer adjust the output voltage? I connected my frequency meter to the output and I measured 2.089kHz with the pot set to its halfway point. When I adjusted the pot, I got a reading of 1.8kHz and then OL. I'm pretty sure if you were making an adjustable frequency pulse width modulator, you would have used a trimpot between pin 6 of the IC and ground, rather than the fixed 10kW resistor, which forms part of the oscillator circuit. I am new to electronics and am trying to understand how the voltage and frequency adjustments are occurring and where to measure them. (D. S., via email) • Trimpot VR1 is used to adjust the pulse width. The switching frequency is constant. Essentially, Mosfets Q3 and Q4 switch on simultaneously 2000 times per second (ie, at 2kHz) and the rotation of VR1 controls how long they stay on each time, before switching off. A higher setting of VR1 means a higher duty cycle and thus the average motor voltage is higher, so it has more torque. Your frequency meter may not accurately measure the frequency of the signal as it is not a square wave most of the time. The output waveform is near to a 50% duty cycle (a square wave) at mid potentiometer settings, changing to almost entirely on at maximum settings. The frequency meter will not read 104 Silicon Chip the signal if the duty cycle is such that the output is at a high level most of the time and at a low voltage level for a short period. Similarly, at low duty cycles, the output is at a low level most of the time and at a high voltage level for a short period, so you may not get an accurate frequency reading in that case either. The fact that you do get a frequency reading of around 2kHz suggests the oscillator is working correctly. The frequency does not change but the amount of time the output is at a high voltage level compared to a low voltage level is what varies. That is what is called the duty cycle. Any discrepancy in the frequency with varying duty cycle is just a measurement issue. Laser cutter recommendation Our business is considering purchasing a laser cutter for thin acrylic and MDF, primarily for producing custom project cases. I've read a few of your articles on getting your cutter up and running and improving its cooling. What make and model are you using? (D. H., Orange, NSW) • We are not sure of its make and model; most of the writing on it is in Chinese! Many of the laser cutters presently for sale on market places like eBay look very similar or identical. We suspect that most of them come from the same source. Our one looks similar to this: www.ebay.com. au/itm/321904100932 It has worked pretty well for us although it is a bit slow. The bed size of 600 x 900mm is great since it means we can use large sheets and cut many jobs in one pass. In addition to fitting a proper cooling system, we had to tighten some screws; not unusual with Chinese mechanical equipment. There is a warning on our cutter which apparently was so important that they decided to translate it into English. It reads: “The guide rail and the transmission part of Limerick Australia’s electronics magazine weekly maintenance time”. Sage advice indeed! Trickle charger for small SLA battery Have you produced a project for a trickle charger for a 12V 9Ah SLA battery? This battery is used to power my computerised telescope so its usage is intermittent but I would like to keep the battery always topped up. (K. J., Campbelltown, NSW) • You're probably after a float charger, rather than a trickle charger as this is more suitable for lead-acid batteries. We published a very simple charger using a 5V regulator, 9.1V zener diode and series resistor in Circuit Notebook, April 2003 (siliconchip.com.au/ Article/6660). It was designed to give full charging as well as maintaining charge if kept connected. For bulk charging an SLA, around 14.1V is applied to the battery but the float charging voltage is lower, at around 13.2V. So an 8.2V zener could be used instead of the 9.1V zener. You could use a switch to connect the 8.2V zener in parallel with the 9.1V zener, allowing you to switch between fast charging and float charging. Pool pump controller tripping at switch-on I have built the Induction Motor Speed Controller from an Altronics K6032 kit. I am generally very happy with it. It works well on a daily basis but maybe once or twice a month, it will fail to start and a fault indication will come on. I am assuming that because we are talking about a failure to start from cold that it is failing on startup surge current. The motor is a new, conventional 1hp pool pump. I note that the ramp trimpot seems to have no effect on startup speed. Presumably, this is ignored when run in pool mode as the motor just starts at full speed before reducing to the set speed after 30 seconds or so. Please siliconchip.com.au confirm that this is normal operation. Do you have any suggestions for how I may proceed to resolve this problem? My expectation is that to make a change to enable the ramp speed on startup in pool mode will require a programming change to the microcontroller. It would be good if the ramp control was active whilst still supporting pool mode in all other respects. (P. W., via email) • The initial ramp rate should still be controlled using trimpot VR2, even in pool pump mode. The relevant text from the original article says: “The rate at which the motor ramps up and down is set by a second onboard trimpot. The ramp is adjustable from 1-30 seconds, for a full ramp from 0.5Hz to 50Hz. It is important to set this rate sufficiently long, particularly if the load has high inertia. If the acceleration is too fast, the motor will draw very high current and trip the over-current protection.” It sounds like you have a fault on the board which is causing VR2 to have no effect and the ramp speed to be high, hence the tripping. Check VR2’s soldering and if it looks OK, try replacing VR2. Editor’s note: the constructor subsequently contacted us to say that the trimpot was faulty and replacing it fixed the problem. Looking for an old article in RTV&H I am attempting to find details of a Playmaster No. 12 amplifier, presumably published in Radio, TV & Hobbies. I have the RTV&H archive DVD and can find other Playmaster articles but nothing about the No. 12 amp. Do you know where I can find it? (B. G., Glen Iris, Vic) • We don't have any special index for RTV&H projects besides what is on the DVD. Unfortunately, the only way to search for projects is by looking through the index PDFs to find when they published the yearly index (which wasn't consistent at all) and then open up that issue and look through the yearly project index. The first reference we can find to "Playmaster" is in the October 1951 issue (Playmaster Amplifier No. 1) and by the 60s, they were already on Playmaster 100. So your No. 12 is likely to be somewhere in the mid-to-late 50s. siliconchip.com.au Finding mains cables in walls Could you tell me whether the Experimental Mains Hum Sniffers from the July 1989 issue of Silicon Chip would allow me to find mains power cables behind a plasterboard wall? I want to put shelving on the wall but I need to know where the mains cables are located first. (A. C., Gembrook, Vic) • The Experimental Mains Sniffer will detect the presence of live mains cabling. However, it will not necessarily give you the precise location of the wiring. The differential hum detector version described in the article may allow the cable location to be found with more precision. The location accuracy depends on wire depth, wire orientation and what type of construction materials are in the region behind the plasterboard. Stop press: we managed to find the Playmaster 12 article, which starts on page 32 of the September 1955 issue, but it took a lot of searching. It doesn't help that the article is indexed as "A High-Power Playmaster". On a hunch, we checked the article itself, and in the circuit diagram it's called "Playmaster No. 12 (20W)". Using Heater Controller with frypan is difficult How difficult would it be to adapt the April 2018 Thermopile-based Heater Controller (siliconchip.com. au/Article/11027) to get proportional control of a Sunbeam frying pan up to around 300°C? It would not have to be accurate, only consistent. If you are trying to poach or simmer something, it either boils like crazy or switches off. Maybe I could use an infrared filter in front of the thermopile? (F. T., Narrabeen, NSW) • The Thermopile sensor used in that Heater Controller is only rated for measurements up to 100°C. Thermopiles rated for higher temperature measurements are available but tend to run from a higher voltage and are more expensive. It is not easy to convert the Heater Controller design for use at higher temAustralia’s electronics magazine Steel frames may produce a distorted result and metal conduit will shield the mains wire hum, possibly preventing the unit from picking it up. In all situations, power should be switched off at the fuse box before drilling into plasterboard. Stud locators available from hardware shops often include an electrical cable warning indicator. The location of the cabling should also be confirmed by examining the routing of the mains wiring by finding power points and switches in the vicinity and how the wires are brought into the wall, whether from the underneath of the house, from the roof cavity or horizontally along the wall. There are several commercial mains wiring detectors available which will do exactly what you want; we would suggest one of these. peratures but you could still use it in proportional control mode and adjust the power manually to achieve the desired temperature. Your idea is good and we will investigate the viability of developing a similar controller for higher temperatures. Troubleshooting Super-7 AM Radio I am having trouble getting the Super-7 AM Radio (November & December 2017; siliconchip.com.au/Series/321) to work. I have measured the following voltages at the test points: Test Point Voltage Reading TP+ 8.71V TP1 1.53V TP2 8.71V TP3 1.15V TP4 8.71V TP5 1.77V TP6 8.84V TP7 8.40V TP8 0.34V TP9 8.4V TP10 8.20V So the first six are right but the voltages at TP7-TP10 are no good. I can’t work out why the voltages are so high. October 2018  105 There is no noise whatsoever from the radio, I would have thought there would be some static even though it has not been aligned. I have checked all the components are in the right place and that the values are correct. Do you have any idea what might be wrong? I noticed that if I remove the battery, there is still a voltage at TP9 and TP10 of around 7.0V. Also, the antenna coil is right in the middle of the ferrite rod. What is the best way to move it? I tried a heat gun but it won’t move, it just bubbles the glue up. (E. J. B., Bridgetown, WA) • The incorrect voltage at TP7 is causing the readings at TP8-10 to be invalid. The voltage at TP7 (Q4’s base) is determined by the 47kW, 820kW and 1MW resistor between the supply rail and ground. Most likely, there is a problem with either the 820kW resistor (shorted) or the 1MW resistor (open-circuit). Check these components and their solder joints and replace whichever one is faulty. Some voltage will remain at TP9 and TP10 after power is switched off due to the charge on the 470µF capacitor at TP10. Note also that test point voltage measurements at TP8-10 must be done with the loudspeaker connected. Once you fix the faulty component at the base of Q4, that should give you the correct reading of around 4.7V at TP7. But based on the fact that your readings at TP9 & 10 are higher than TP8, we suspect you have another component fault on your board. If the voltages at TP8-10 are still wrong after getting the correct voltage at TP7 then that suggests a problem with one of transistors Q4-Q7, diode D2 (which may be reversed) or perhaps the speaker is not connected properly. It should not be possible to have voltages at TP9 & 10 that are higher than at TP8 unless there is a faulty solder joint or component. The wax seal between the coil and ferrite rod can be broken with a sharp knife. The wax can then be re-melted with a hot air gun. wound transformer, then we would have used it. That doesn't mean such a thing doesn't exist but if it does, we can't point you to it. Winding the transformer is not difficult and all the parts you need to do so are still available. Once you have gathered the parts, it would probably take you less than 30 minutes to make the transformer. The only tricky bit is tinning the ends of the wires since you need to scrape off the enamel to allow the solder to adhere. You can use a sharp hobby knife or fine sandpaper (emery). So we suggest you make the transformer yourself by carefully following the instructions in the article. Any variation may mean that the unit does not work as expected. Digital Insulation Meter Ultra-LD amplifier has transformer winding noticeable hum I want to build the Digital Insulation Meter from the June 2010 issue (siliconchip.com.au/Article/186). I am buying the PCB from you but I am looking for an integrated device for transformer T1. Do you think I can find this kind of transformer already assembled? Can you help me to pick one? (M. de R., Toulouse, France) • We are not aware of any pre-made transformers suitable for this project. If we could have found a suitable pre- I have built a complete stereo amplifier using the Ultra-LD Mk.4 modules (July-October 2015; siliconchip.com. au/Series/289). There’s a very faint 100Hz noise that comes through the speakers, at all times, but its volume is mostly independent of the volume control setting on the Mk.3 preamplifier I’m using. Would it help if I replace the 10W input ground resistors with 47W resistors, as was recommended for the Using an audio amplifier chip in an unusual way I am an engineering student and am currently doing my thesis. I am building a ripple generator test suite, to superimpose a sinewave onto DC power lines. For this purpose, I need an audio amplifier that is capable of delivering 50W into a 0.5W resistive load with signals in the range of 50Hz to 200kHz. The amplifier would be driving a 2:1 transformer so the load the amplifier would see is 2W. I've built two LM3886 amplifier kits and am just waiting for heatsinks I've ordered to arrive. Before connecting everything up, I just wanted to check if running the two amplifiers in parallel would allow me to drive the transformer’s primary. (E. M., via email) • The LM3886 amplifier IC is designed to drive a 4-8W load. In order to connect two in parallel, you 106 Silicon Chip would need to connect series resistors at each amplifier output to prevent them from “fighting” each other and so that they share the load current equally, as they will not have precisely the same output voltage offset or gain. You could use high-wattage 2W resistors but they will dissipate half the power. It would be much better to use an amplifier that is designed to drive a 2W load. They are quite common since some subwoofers and car speakers have 2W coils but your requirement for operation to 200kHz certainly limits your options. You might want to look at the TDA7851F from STMicro. It’s a fourchannel amplifier which can deliver around 75W into 2W loads with a 14.4V supply and its “typical” highfrequency cut-off point is 300kHz. Australia’s electronics magazine Regardless of which chip you use, note that most amplifiers will have a DC output offset voltage and that will cause current to flow in the transformer winding; likely a significant amount of current, due to the low winding DC resistance. You need to find a way to minimise/trim out that offset or AC-couple the signal to the transformer with a suitably large value capacitor. The LM3886 has an open loop gain of 30dB at 200kHz and so you may be able to produce power to the load to that frequency, provided the input signal level is sufficient. You would need to have some negative feedback to reduce distortion and that would reduce the amplifier gain. Open loop gain is not specified for the TDA7851F; you may need to feed in a high-amplitude signal to get sufficient output amplitude at 200kHz. siliconchip.com.au Ultra-LD Mk.3 power amplifier? Or could the noise be coupling into the modules from the power transformer, even though it is fitted with a copper strap? (N. G., Dubbo, NSW) • The modules themselves shouldn't be injecting any noticeable amount of 100Hz hum or buzz into the audio. It’s either due to direct radiation into the modules from the power transformer or wiring, being picked up in the signal leads to the modules, or (most likely) it's due to the way you have wired the ground/Earth connections. You have to be very careful when wiring up the ground connections in a power amplifier like this; if you make a ground loop via the signal cable grounds/shields, then you can quite easily wind up with significant hum in the signals. Have a look at Fig.1 on pages 34 and 35 of the March 2012 issue (in the article on the Ultra-LD Mk.3 complete amplifier). Check that your ground/Earth wiring is routed in the same manner. Electromagnetic radiation from the transformer can couple into the input of the modules, the wiring and other places. That is why we located the modules as far away from the transformer as possible. Since your transformer has a copper strap, that should significantly reduce such coupling. The wiring to the bridge rectifier can also be a source of EMI (“buzz”) due to the high current pulses. Our complete Mk.3 amplifier had very low hum/buzz in both outputs, so you should be able to achieve the same result with the Mk.4 modules. Have a look at the March 2012 article if you haven’t already. GPS LED Clock not getting satellite lock I’ve finally built the High-Visibility 6-digit LED GPS Clock from the December 2015 and January 2016 issues (siliconchip.com.au/Series/294) but on power up, it doesn’t seem to recognise the GPS module and just shows GPS 00. I am using a VK16E SIRF III GPS module but note that you needed to use a startup resistor on the EM408 in the prototype. Could that be my problem and if so, what value resistor should I use and where do I connect it? Incidentally, I built your original GPS clock design from the May and June 2009 issues (siliconchip.com.au/ Series/37) and it has worked in a Com- munity Radio Station in Canberra 24/7 for nine years non-stop. An impressive reliability record I think and a testament to your great design! Thanks for your help. (L. G., Phillip Island, Vic) • The GPS 00 message indicates that the GPS module has been detected and thus is probably configured and wired correctly. The baud rate should be detected automatically. That the number after GPS is still 00 means that it hasn’t locked onto any satellites. This can take up to fifteen minutes, longer if it has not had a satellite fix recently. You don’t mention where you have the unit located but we have found that these GPS modules need a period of time outside (with a clear “view” of the sky) to get a good initial fix on the satellites. Once it has an initial fix, it should stay locked on indoors, as long as the walls and roof (eg, corrugated iron) don’t totally block the GPS signals. Hopefully, the GPS module you used has an onboard backup battery so it doesn’t totally lose its state if you power it off to move it. Once the GPS module has a lock, you should see the number on the Radio, Television & Hobbies: the COMPLETE archive on DVD YES! NA MORE THA URY T N E QUARTER C NICS O OF ELECTR ! HISTORY This remarkable collection of PDFs covers every issue of R & H, as it was known from the beginning (April 1939 – price sixpence!) right through to the final edition of R, TV & H in March 1965, before it disappeared forever with the change of name to EA. For the first time ever, complete and in one handy DVD, every article and every issue is covered. If you’re an old timer (or even young timer!) into vintage radio, it doesn’t get much more vintage than this. If you’re a student of history, this archive gives an extraordinary insight into the amazing breakthroughs made in radio and electronics technology following the war years. And speaking of the war years, R & H had some of the best propaganda imaginable! Even if you’re just an electronics dabbler, there’s something here to interest you. • Every issue individually archived, by month and year • Complete with index for each year • A must-have for everyone interested in electronics siliconchip.com.au 62 $ 00 +$10.00 P&P Exclusive to: SILICON CHIP ONLY Order now from www.siliconchip.com.au/Shop/3 or call (02) 9939 3295 and quote your credit card number. Australia’s electronics magazine October 2018  107 Water Tank Level Meter gets maximum level wrong I built the WiFi Water Tank Level Meter from the February 2018 issue (siliconchip.com.au/Article/10963) and after a number of challenges, I have gotten it working but can't seem to get it calibrated properly. The reading is shown as 28% when in fact the tank is about 75% full. I ran the unit with the sensor out of the water for several hours to set a minimum, disconnected the power and took it to another tank which is about the same height and is full. I left it there overnight to set a maximum. I then put it into the 75% full tank and it reads 28%. I've done this twice with the same result. I didn't press the reset button either time but surely cycling the power has the same result. Is there a way of reading the maximum and minimum values out of the Arduino? Not that would help much as I know one or both are wrong. Many thanks for some great projects. (K. G., One Tree Hill, SA) • We suspect that your unit is continually rebooting and so it never gets a chance to update the minimum/maximum readings properly. You may not notice the rebooting since it would still send the periodic updates. display increase as it acquires more satellites and it should be able to start working after a few have been detected (at least three but ideally more). If it still won’t work when placed outdoors for some time, we suggest that you try setting the GPSLCK parameter to IGNORE via the menus, as explained on page 43 of the January 2016 issue (part two). If this gives a time (even if it is incorrect), that suggests that the GPS is probably working fine but hasn’t gotten or isn’t reporting a satellite lock. The other potential problem is that the configuration of the GPS module may have been changed, and it is not producing the output that the clock expects. This can be diagnosed by connecting the module to a computer (via a USB/ serial adaptor) and examining the output using a serial terminal program. We would try the above first though. If none of our advice helps, send us 108 Silicon Chip You may have the same problem as Trevor Woods did; we published a letter from him on page 4 of the July 2018 issue. He had one Water Level unit that would randomly reboot (but not another, which is odd) and he made some small changes in the software that fixed it. Frequent rebooting can also be caused by an insufficient power supply so you should check with a different supply if possible, to ensure your power supply is not at fault. If you still can't get it to work, the easiest solution is to hardcode the minimum/maximum values. To do this, comment out or remove the following lines locate in the setup() function: EEPROM.begin(4); EEPROM.get(0, min_tank_level); EEPROM.get(2, max_tank_level); if( min_tank_level == 65535 && max_tank_level == 65535 ) max_tank_level = 0; if( max_tank_level < min_tank_level ) max_tank_level = min_tank_ level; Also comment out or remove these lines from the loop() function: some photos of your assembled PCB so we can see if there is anything that might be amiss. Questions about MultiSpark Ignition I have questions about the article “High-Energy Multi-Spark CDI for Performance Cars” by John Clarke, from the December 2015 and January 2016 issues (siliconchip.com.au/Series/279). These questions are regarding the transformer used in the project. 1) I read that it takes 25mJ to fire a spark plug. Your September 1997 CDI design (siliconchip.com.au/ Article/4837) had a spark energy specification of 45mJ whereas the newer 2015/2016 design specifies just 15mJ. Why does this new design deliver so much less energy? Can it be increased to 45mJ? 2) How much current does it draw at its 12V input when operating? Australia’s electronics magazine if( reset_min_max_levels ) { min_tank_level = 65535; max_tank_level = 0; } if( max_level < min_tank_level && max_level > 5000 ) { min_tank_level = max_level; EEPROM.put(0, min_tank_level); changed = 1; } if (min_level > max_tank_level) { max_tank_level = min_level; EEPROM.put(2, max_tank_level); changed = 1; } Then, change the line above which reads: unsigned short min_tank_level, max_tank_level; to: unsigned short min_tank_level = 1234, max_tank_level = 56789; Replace 1234 with your minimum level, as determined by your logged raw readings, and replace 56789 with the maximum level, determined by the same method. We think there might have been some change to the Arduino software which is causing problems our prototype did not suffer from this problem. 3) How much current can it deliver? 4) What is the maximum operating frequency of the transformer? 5) What is the maximum output power of the transformer? 6) In your specifications, you list the current drain with multi-sparking as 2A <at> 150Hz, 3A <at> 400Hz and 4A <at> 500Hz. So an increase of about 1A with every additional 100Hz. The oscillator is running at 22kHz, does that mean the current drain is 219A? 7) Can I get the formulas used to design the transformer? I suggest that the formulas and their nomenclature should be included in every article. Your readers learn more and love you all the more for it. (G. L., via email) • The energy delivered to the ignition coil depends on the coil itself. The Multi-spark CDI circuitry, including the ETD29 transformer (T1), will deliver (within reason) the current required for the ignition coil to deliver siliconchip.com.au the energy it is designed to produce. As such, the input and output currents depend on the coil used. The transformer is driven at a fixed 60kHz and can deliver up to 50W. Circuit current drain is dependent upon the firing frequency of the ignition coil and it does increase as expected with increased firing rates. For example, the 400Hz rate where we have specified a 3A drain is equivalent to 6000RPM for an eight-cylinder, fourstroke engine or 12000RPM for a fourcylinder engine. You would never have a firing frequency as high as 22kHz. Perhaps you are confusing the operating frequency of T1 with the firing rate of the ignition coil. The ignition coil firing rate is dependent on engine RPM and is relatively low. You can get specifications for the ETD29 transformer from: siliconchip. com.au/link/aaks Design information for the transformer windings can be found at: siliconchip.com.au/link/aakt Trouble with Electrolytic Capacitor Reformer I bought an Electrolytic Capacitor Reformer & Tester PCB (code 04108101) and a programmed PIC16F88-I/P a few months ago. I have built the PCB but have not been able to make it work. I have some experience in electronics so I think I have built it correctly but it fails to deliver higher voltages (the 450V & 630V settings don't work). I have re-wound the transformer several times and have replaced most of the major components but it still does the same thing. I don't know if it is because a defective PIC/PCB or the transformer has a fault or maybe due to a design error. Can you help me? (M. R., Mexico City, Mexico) • We didn’t explicitly specify in the article that the secondary winding of transformer T1 must be wound in the same direction as the primary winding but it is necessary. If the two windings were in opposite directions (one clockwise and the other anti-clockwise), the secondary voltage would be much lower than expected and this could explain the failure to achieve the correct output on the 450V and 630V ranges. Try measuring the voltage at test point TP3 and see if it reaches the specified +2.5V on all ranges – particu110 Silicon Chip larly on the 450V and 630V ranges. If it drops on these ranges, that indicates that the problem is probably not with the MC34063 IC. The only other reason that we can think of for a low output from the DCDC converter is driver transistors Q1 & Q2 have been accidentally transposed. That would reduce the drive to Q3 and hence lower its peak current through the transformer primary winding. It would be easy to transpose Q1 and Q2 because they are both in a standard TO-92 plastic package. Running CDI on a bike with points I bought the CDI for Small Petrol Engines kit KC5466 from Jaycar (May 2008; siliconchip.com.au/Article/1820). Would it be possible to fit this kit to a bike that has ignition points rather than a sensor coil? (T. C., via email) • This project was designed for ignition systems which have two coils: one high-voltage generation coil and one trigger coil. Ignition systems with points are usually of the Kettering type where the sole ignition coil is charged from a battery or low-voltage generator coil via the closed points. When the points open, the magnetic field of the coil collapses and this generates the high voltage for the spark plug(s). If your engine has a high-voltage generator coil and points, you should be able to adapt the CDI for small petrol engines using the SCR triggering arrangement as shown on page 37 of the Circuit Notebook section in the July 2008 issue (see siliconchip.com. au/Article/1878). If your bike has a 12V supply, you could simply use the entire circuit as presented in that issue. Alternative speaker for Ultimate Jukebox I want to build the Ultimate Jukebox project (December 2005-February 2006; siliconchip.com.au/Series/67) but the specified Altronics 12-inch woofer is no longer available. The woofers that Altronics now sell don’t match the volume of the enclosure. Can you suggest a substitute? I contacted Altronics and they suggested I contact you. (R. C., via email) • Altronics Cat C3030 is a very close match in terms of enclosure volume Australia’s electronics magazine (130.3L compared to 121.7L) and has a sufficiently high power rating. However, its high-end frequency response is not as good as the original woofer. You could use it but we think their Cat C3070 is a better choice. C3070 has good frequency response. Its VAS is a lot higher but that’s most likely because its frequency response goes a lot lower (25Hz compared to 44Hz). Even in the smaller-than-ideal enclosure, it would likely out-perform the originally specified driver. CLASSiC-D troubleshooting I am running a CLASSiC-D amplifier module (November & December 2012; siliconchip.com.au/Series/17) from a 30-0-30 300VA transformer. I expected to get DC supply rails of ±42V but I am getting a reading of ±44.5V. What voltages can I expect to see on the test points? (B. C., Melbourne, Vic) • While a 30-0-30VAC transformer could potentially provide ±42V DC supply rails, this usually is only realised when the transformer is loaded at its rated current. With lighter loads, the voltage will be higher due to the regulation of the transformer. So your readings would be considered normal. The voltage at Vaa should be +5.6V while Vss and Csd should be -5.6V, all measured with respect to GND. Vcc should be 14-15V, measured between Vcc and COM. Vb and Vs should be above 9V and about 14V when the amplifier is running. These voltages will be the same regardless of the supply rails, as long as those rails are within the recommended range of ±25-50V and the correct components have been installed. Using Courtesy Light Delay with LEDs I recently bought a Courtesy Light Delay kit from Jaycar (Cat KC5392), based on the article in the June 2004 issue of Silicon Chip (siliconchip.com. au/Article/3566). I want to put this into my very old car. The circuit is supposed to keep the interior car light on for a period after the door is closed and turn it off immediately when the tail lights are turned on. I built it but I ran into problems with it. After closing the door, the light instantly fades to half brightness for a second or two then turns off. siliconchip.com.au MARKET CENTRE Cash in your surplus gear. Advertise it here in SILICON CHIP FOR SALE LEDs, BRAND NAME and generic LEDs. Heatsinks, fans, LED drivers, power supplies, LED ribbon, kits, components, hardware, EL wire. www.ledsales.com.au tronixlabs.com.au – Australia’s best value for supported hobbyist electronics from Adafruit, SparkFun, Arduino, Freetronics, Raspberry Pi – along with kits, components and much more – with same-day shipping. Where do you get those HARD-TO-GET PARTS? Where possible, the SILICON CHIP On-Line Shop stocks hard-to-get project parts, along with PCBs, programmed micros, panels and all the other bits and pieces to enable you to complete your SILICON CHIP project. SILICON CHIP On-Line SHOP www.siliconchip.com.au/shop PCB PRODUCTION PCB MANUFACTURE: single to multi­ layer. Bare board tested. One-offs to any quantity. 48 hour service. Artwork design. Excellent prices. Check out our specials: www.ldelectronics.com.au KIT ASSEMBLY & REPAIR KEITH RIPPON KIT ASSEMBLY & REPAIR: * Australia & New Zealand; * Small production runs. Phone Keith: 0409 662 794 keith.rippon<at>gmail.com DAVE THOMPSON (the Serviceman from SILICON CHIP) is available to help you with kit assembly, project troubleshooting, general electronics and custom design work. No job too small. Based in Christchurch, NZ but service available Australia/NZ wide. Email dave<at>davethompson.co.nz VINTAGE RADIO REPAIRS: electrical mechanical fitter with 36 years ex­ perience and extensive knowledge of valve and transistor radios. Professional and reliable repairs. All workmanship guaranteed. $17 inspection fee plus charges for parts and labour as required. Labour fees $38 p/h. Pensioner discounts available on application. Contact Alan, VK2FALW on 0425 122 415 or email bigalradioshack<at>gmail. com NEED A NEW PCB DESIGNED? Or need to update an old board? We do PCB layouts from circuits, drawings, photocopies or sample boards. Contact Steve at sgobrien8<at>gmail.com or phone 0401 157 285. Get a new PCB and keep production going! ADVERTISING IN MARKET CENTRE Classified Ad Rates: $32.00 for up to 20 words (punctuation not charged) plus $1.20 for each additional word. Display ads in Market Centre (minimum 2cm deep, maximum 10cm deep): $82.50 per column centimetre per insertion. All prices include GST. Closing date: 5 weeks prior to month of sale. To book, email the text to silicon<at>siliconchip.com.au and include your name, address & credit card details, or phone Glyn (02) 9939 3295 or 0431 792 293. I believe that it’s because I use LED interior lights in my car. The circuit draws its power from being connected in series with the light and the LED light drops the supply voltage for the delay unit to around 5V, rather than the 12V an incandescent globe would supply (and what the circuit requires). Is there a simple modification you could suggest to adapt this circuit for use with LED lights? I believe that I could have the circuit drive a relay which in turn would drive the LED lights. That would provide a delay but I’d miss out on the fading effect, which siliconchip.com.au would be nice to have. I’m also not sure what effect the fading would have on switching the relay. Do you have any better ideas for me, or am I resigned to buying a more up to date module that supports LEDs? • We published a revised Courtesy Light Delay (October 2014; siliconchip.com.au/Article/8031) to solve this very problem. You could build that unit instead, as it is designed to give a smooth dimming of LED lamps. The PCB and programmed microcontroller are available from the Silicon Australia’s electronics magazine Chip Online Shop at siliconchip.com. au/Shop/?article=8031 If you prefer the June 2004 version, you will need a filament lamp as a lamp load. You can still use the LED lighting in the car but you will need to connect a filament (ie, incandescent) lamp in parallel to provide a low resistance supply to the circuit. While this should work, the LED dimming will not be as effective compared to the revised October 2014 version. We don’t suggest you use a relay as the coil resistance would be too high for the circuit to work properly. SC October 2018  111 Coming up in Silicon Chip DownUnder GeoSolutions' Supercomputer DUG's supercomputer is up there with some of the fastest in the world, and it was all done locally in Perth. The supercomputer is used to help DUG find gas and oil deposits deep underground using seismic surveys. Advertising Index Altronics............................. 24-27 Control Devices.................. OBC Dave Thompson................... 111 El Cheapo Modules Jim Rowe describes two low-cost electronic compass modules which sense the Earth's weak magnetic field. He explains how to use these modules with an Arduino and Micromite, including compensation for variations between the magnetic field lines and the local meridian, to give accurate compass readings. Digi-Key Electronics................. 3 Expandable LED Christmas Tree Jaycar......................... IFC,53-60 This simple but ingenious design can be expanded from a small, simple flashing LED Christmas Tree up to a large design that branches out to cover a much larger area. It's dead easy to build, doesn't cost much and we've also designed a small and simple control module which produces different LED patterns. Emona Instruments.............. IBC Hare & Forbes........................ 63 Keith Rippon Kit Assembly... 111 LD Electronics...................... 111 LEACH Co Ltd........................ 11 Vintage Radio The 1939 HMV 904L is a valve-based 5-inch TV with integrated 3-band AM receiver. It's a 16-valve design, compatible with the old 405-line TV standard. This example was in a sorry state but was stripped right back to the bare chassis and received a complete restoration. Note: these features are planned or are in preparation and should appear within the next few issues of Silicon Chip. The November 2018 issue is due on sale in newsagents by Thursday, October 25th. Expect postal delivery of subscription copies in Australia between Octobber 23rd and November 8th. Notes & Errata Steam Train Whistle / Diesel Horn, September 2018: in Fig.1, the 100kW resistor to the right of JP4 should be between JP4 and the mixing junction, with no connection to the 5V rail. On page 36, the text states that microcontroller IC1 generates the volume control signal but it is IC2 instead. On page 37, the reference to Fig.3 should be to Fig.2. On page 38, in the panel, it should read "... around eight seconds.", not "... around eight settings." Finally, the Jiffy box should be a UB5 type, not UB3. Arduino Data Logger, August-September 2017: a reader discovered a bug in the code which sometimes caused the unit to fail to detect the GPS module. This has been fixed in software version v1.12 which is now available for download from the Silicon Chip website. LEDsales.............................. 111 Master Instruments................... 7 Microchip Technology............. 37 Ocean Controls........................ 9 PCB Designs........................ 111 Silicon Chip Back Issues......... 5 Silicon Chip Shop............. 88-89 Silicon Chip Subscriptions.. 109 Silicon Chip Wallchart........... 81 Silicon Chip RTV&H DVD.... 107 The Loudspeaker Kit.com......... 8 Tronixlabs............................. 111 Vintage Radio Repairs......... 111 Wagner Electronics................ 80 WARNING! SILICON CHIP magazine regularly describes projects which employ a mains power supply or produce high voltage. All such projects should be considered dangerous or even lethal if not used safely. Readers are warned that high voltage wiring should be carried out according to the instructions in the articles. When working on these projects use extreme care to ensure that you do not accidentally come into contact with mains AC voltages or high voltage DC. If you are not confident about working with projects employing mains voltages or other high voltages, you are advised not to attempt work on them. Silicon Chip Publications Pty Ltd disclaims any liability for damages should anyone be killed or injured while working on a project or circuit described in any issue of SILICON CHIP magazine. Devices or circuits described in SILICON CHIP may be covered by patents. SILICON CHIP disclaims any liability for the infringement of such patents by the manufacturing or selling of any such equipment. SILICON CHIP also disclaims any liability for projects which are used in such a way as to infringe relevant government regulations and by-laws. Advertisers are warned that they are responsible for the content of all advertisements and that they must conform to the Competition & Consumer Act 2010 or as subsequently amended and to any governmental regulations which are applicable. 112 Silicon Chip Australia’s electronics magazine siliconchip.com.au “Rigol Offer Australia’s Best Value Test Instruments” Oscilloscopes FREE OPTIONS Bundle! New Lower Prices! RIGOL DS-1000E Series RIGOL DS-1000Z Series RIGOL DS-2000E/A Series 450MHz & 100MHz, 2 Ch 41GS/s Real Time Sampling 4USB Device, USB Host & PictBridge 450MHz, 70MHz & 100MHz, 4 Ch 41GS/s Real Time Sampling 424Mpts Standard Memory Depth 470MHz, 100MHz & 200MHz, 2 Ch 41GS/s & 2GS/s Real Time Sampling 4From 14Mpts Memory Depth FROM $ 379 FROM $ ex GST 579 FROM $ ex GST RIGOL DG-1022 RIGOL DG-1000Z Series RIGOL DM-3058E 420MHz Maximum Output Frequency 42 Output Channels 4USB Device & USB Host 425MHz, 30MHz & 60MHz 42 Output Channels 4160 In-Built Waveforms 45 1/2 Digit 49 Functions 4USB & RS232 539 FROM $ ex GST Power Supplies ex GST Multimeters Function/Arbitrary Function Generators ONLY $ 912 517 ONLY $ ex GST Spectrum Analysers 673 ex GST Real-Time Analysers New 2018 Product! RIGOL DP-832 RIGOL DSA Series RIGOL RSA-5000 Series 4Triple Output 30V/3A & 5V/3A 4Large 3.5 inch TFT Display 4USB Device, USB Host, LAN & RS232 4500MHz to 7.5GHz 4RBW settable down to 10 Hz 4Optional Tracking Generator 49kHz to 3.2GHz & 6.5GHz 4RBW settable down to 1 Hz 4Optional Tracking Generator ONLY $ 649 FROM $ ex GST 999 FROM $ ex GST 11,499 ex GST Buy on-line at www.emona.com.au/rigol Sydney Tel 02 9519 3933 Fax 02 9550 1378 Melbourne Tel 03 9889 0427 Fax 03 9889 0715 email testinst<at>emona.com.au Brisbane Tel 07 3392 7170 Fax 07 3848 9046 Adelaide Tel 08 8363 5733 Fax 08 83635799 Perth Tel 08 9361 4200 Fax 08 9361 4300 web www.emona.com.au EMONA