SOLAR MPPT CHARGER AND LIGHTING CONTROLLER • Switchmode charger operation • Maximum power point tracking (MPPT) • 12V or 24V operation • 120W/220W solar panel rating
microchipDIRECT offers access to the world’s largest inventory of Microchip products microchipDIRECT offers access to the world’s largest inventory of Microchip products and the most comprehensive online resource for pricing and support directly from and the most comprehensive online resource for pricing and support directly from Microchip Technology. We invite you as a valued Microchip customer to experience our Microchip Technology. We invite you as a valued Microchip customer to experience our service 24 hours a day, 7 days per week. service 24 hours a day, 7 days per week. Visit www.microchipDIRECT.com and enjoy the confidence and convenience of buying Visit www.microchipDIRECT.com and enjoy the confidence and convenience of buying from microchipDIRECT and take advantage of the following features: from microchipDIRECT and take advantage of the following features: Direct stock from factory Long-term orders and scheduling Direct stock from factory Long-term orders and scheduling Direct customer service Programming and value add services Direct customer service Programming and value add services Secure ordering Ability to adjust open orders Secure ordering Ability to adjust open orders Volume pricing Ship to your sites globally Volume pricing Ship to your sites globally Credit lines Online order status and notifications Credit lines Online order status and notifications
STEREO VALVE PREAMPLIFIER Part 2 – Building the bespoke case
WIN A MICRO CH dsPICD IP EM MCLVDevelo 2 pmen Board t
TURNTABLE LED STROBE Check your turntable’s speed precisely
MICROCHIP EXCLUSIVE OFFER Check out our AMAZING offer – see page 5
www.microchipDIRECT.com www.microchipDIRECT.com
The Microchip name and logo, the Microchip logo are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. All other trademarks are the property of their registered owners. © 2015 Microchip Technology rights reserved. MEC2010Eng04/15 The Microchip name and logo,Inc. theAll Microchip logo areDS40001752B. registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. All other trademarks are the property of their registered owners. © 2015 Microchip Technology Inc. All rights reserved. DS40001752B. MEC2010Eng04/15
MEET THE MIGHTY MICROMITE
Part 1 – An amazing low-cost microcontroller that uses BASIC
ELECTRONIC BUILDING BLOCKS, TECHNO TALK, NET WORK, PIC n’ MIX, AUDIO OUT, COOL BEANS & CIRCUIT SURGERY FEB 2017 Cover V2.indd 1
FEB 2017 £4.40
20/12/2016 16:17
JAN 2017 Page BC.indd 1
14/11/2016 11:18
ISSN 0262 3617 PROJECTS THEORY NEWS COMMENT POPULAR FEATURES VOL. 46. No 2
February 2017
INCORPORATING ELECTRONICS TODAY INTERNATIONAL
www.epemag.com
Projects and Circuits SOLAR MPPT CHARGER AND LIGHTING CONTROLLER 12 by John Clarke Use 12/24V solar panels to charge batteries or drive lighting circuits CHECK YOUR TURNTABLE’S SPEED WITH THIS WHITE LED STROBE 20 by John Clarke Get the very best from your vinyl using this precision turntable speed checker HIGH-PERFORMANCE STEREO VALVE PREAMPLIFIER – PART 2 28 by Nicholas Vinen Time to put our pre-amp in its custom-designed case; plus upgrading the bass response HIGH VISIBILITY 6-DIGIT LED GPS CLOCK – PART 2 34 by Nicholas Vinen We explain how to use the clock anywhere in the world thanks to GPS
Series and Features TECHNO TALK by Mark Nelson 11 Just a flash in the pan? MEET THE MIGHTY MICROMITE 44 by Geoff Graham Part 1: Introduction NET WORK by Alan Winstanley 52 A Slice of Alexa Pi... Content is king... Up close and personal CIRCUIT SURGERY by Ian Bell 54 Darlington relay switch AUDIO OUT by Jake Rothman 58 Totally derailed: powering amplifiers – Part 3 PIC n’ MIX by Mike O’Keeffe 60 PICs and the PICkit 3: A beginner’s guide – Part 9 MAX’S COOL BEANS by Max The Magnificent 64 Having fun with Stone Age LEDs… Where does the space go?... So much fun stuff to do ELECTRONIC BUILDING BLOCKS by Julian Edgar 68 Four-Channel Car Sound Amplifier
Regulars and Services
Meet the mighty
Micromite
© Wimborne Publishing Ltd 2017. Copyright in all drawings, photographs and articles published in EVERYDAY PRACTICAL ELECTRONICS is fully protected, and reproduction or imitations in whole or in part are expressly forbidden.
Our March 2017 issue will be published on Thursday 2 February 2017, see page 72 for details.
Everyday Practical Electronics, February 2017
Contents (MP 1st) – FEB 2017.indd 1
SUBSCRIBE TO EPE and save money 4 EPE–MICROCHIP SPECIAL OFFER – NOT TO BE MISSED! 5 EDITORIAL 7 Control – spoilt for choice?... And then there were four! NEWS – Barry Fox highlights technology’s leading edge 8 Plus everyday news from the world of electronics MICROCHIP READER OFFER 26 EPE Exclusive – Win a Microchip dsPICDEM MCLV-2 Development Board EPE BACK ISSUES CD-ROM 27 EPE TEACH-IN 7 43 DIRECT BOOK SERVICE 66 A wide range of technical books available by mail order, plus more CD-ROMs EPE PCB SERVICE 70 PCBs for EPE projects ADVERTISERS INDEX 71 NEXT MONTH! – Highlights of next month’s EPE 72
Readers’ Services • Editorial and Advertisement Departments
7
1
20/12/2016 16:08
Quasar Electronics Limited PO Box 6935, Bishops Stortford CM23 4WP, United Kingdom Tel: 01279 467799 Fax: 01279 267799 E-mail:
[email protected] Web: www.quasarelectronics.co.uk
All prices INCLUDE 20.0% VAT. Free UK delivery on orders over £35 Postage & Packing Options (Up to 0.5Kg gross weight): UK Standard 3-7 Day Delivery - £3.95; UK Mainland Next Day Delivery - £8.95; Europe (EU) - £12.95; Rest of World - £14.95 (up to 0.5Kg). Order online for reduced price Postage (from just £3) Payment: We accept all major credit/debit cards. Make PO’s payable to Quasar Electronics Limited. Please visit our online shop now for full details of over 1000 electronic kits, projects, modules and publications. Discounts for bulk quantities.
Card Sales & Enquiries Solutions for Home, Education & Industry Since 1993
PIC & ATMEL Programmers We have a wide range of low cost PIC and ATMEL Programmers. Complete range and documentation available from our web site. Programmer Accessories: 40-pin Wide ZIF socket (ZIF40W) £9.95 18Vdc Power supply (661.121UK) £19.96 Leads: Parallel (LDC136) £2.56 | Serial (LDC441) £2.75 | USB (LDC644) £2.14 USB & Serial Port PIC Programmer USB or Serial connection. Header cable for ICSP. Free Windows software. See website for PICs supported. ZIF Socket & USB lead extra. 16-18Vdc. Kit Order Code: 3149EKT - £49.96 £23.95 Assembled Order Code: AS3149E - £38.95 Assembled with ZIF socket Order Code: AS3149EZIF - £74.96 £48.95 USB PIC Programmer and Tutor Board The only tutorial project board you need to take your first steps into Microchip PIC programming using a PIC16F882 (included). Later you can use it for more advanced programming. Programs all the devices a Microchip PICKIT2® can! Use the free Microchip tools for PICKit2™ & MPLAB® IDE environment. Order Code: EDU10 - £46.74 ATMEL 89xxxx Programmer Uses serial port and any standard terminal comms program. 4 LED’s display the status. ZIF sockets not included. 16Vdc. Kit Order Code: 3123KT - £32.95 £21.95 Assembled ZIF: AS3123ZIF- £48.96 £37.96 Introduction to PIC Programming Go from complete beginner to burning a PIC and writing code in no time! Includes 49 page step-by-step PDF Tutorial Manual + Programming Hardware (with LED test section) + Windows Software (Program, Read, Verify & Erase) + a rewritable PIC16F84A. 4 detailed examples provided for you to learn from. Parallel port. 12Vdc. Kit Order Code: 3081KT - £17.95 Assembled Order Code: AS3081 - £24.95 PICKit™2 USB PIC Programmer Module Versatile, low cost, PICKit™2 Development Programmer. Programs all the devices a Microchip PICKIT2 programmer can. Onboard sockets & ICSP header. USB powered. Assembled Order Code: VM203 - £39.54
DEC 2016 Page 2.indd 1
PIC Programmer & Experimenter Board With test buttons and LED indicators to carry out educational experiments such as the supplied programming examples. Includes a 16F627 Flash Microcontroller that can be reprogrammed up to 1000 times. Software to compile and program your source code is included. Supply: 12-15Vdc. Kit Order Code: K8048 - £29.58 £21.54 Assembled Order Code: VM111 - £38.88
Controllers & Loggers Here are just a few of the controller and data acquisition and control units we have. See website for full details. 12Vdc PSU for all units: Order Code 660.446UK £10.68 USB Experiment Interface Board Updated Version! 5 digital inputs, 8 digital outputs plus two analogue inputs and two analogue outputs. 8 bit resolution. DLL. Kit Order Code: K8055N - £39.95 £22.74 Assembled Order Code: VM110N - £39.95 2-Channel High Current UHF RC Set State-of-the-art high security. Momentary or latching relay outputs rated to switch up to 240Vac @ 12 Amps. Range up to 40m. 15 Tx’s can be learnt by one Rx. Kit includes one Tx (more available separately). 9-15Vdc. Kit Order Code: 8157KT - £44.95 Assembled Order Code: AS8157 - £49.96 Computer Temperature Data Logger Serial port 4-ch temperature logger. °C/°F. Continuously log up to 4 sensors located 200m+ from board. Choice of free software applications downloads for storing/using data. PCB just 45x45mm. Powered by PC. Includes 1xDS1820 sensor. Kit Order Code: 3145KT - £19.95 £16.97 Assembled Order Code: AS3145 - £22.97 Additional DS1820 Sensors - £4.96 each 8-Channel Ethernet Relay Card Module Connect to your router with standard network cable. Operate the 8 relays or check the status of input from anywhere in world. Use almost any internet browser, even mobile devices. Email status reports, programmable timers, ... Assembled Order Code: VM201 - £134.40
Many items are available in kit form (KT suffix) or pre-assembled and ready for use (AS prefix)
4-Ch DTMF Telephone Relay Switcher Call your phone number using a DTMF phone from anywhere in the world and remotely turn on/off any of the 4 relays as desired. User settable Security Password, Anti-Tamper, Rings to Answer, Auto Hangup and Lockout. Includes plastic case. 130 x 110 x 30mm. Power: 12Vdc. Kit Order Code: 3140KT - £79.95 Assembled Order Code: AS3140 - £94.95 8-Ch Serial Port Isolated I/O Relay Module Computer controlled 8 channel relay board. 5A mains rated relay outputs and 4 optoisolated digital inputs (for monitoring switch states, etc). Useful in a variety of control and sensing applications. Programmed via serial port (use our free Windows interface, terminal emulator or batch files). Serial cable can be up to 35m long. Includes plastic case 130x100x30mm. Power: 12Vdc/500mA. Kit Order Code: 3108KT - £74.95 Assembled Order Code: AS3108 - £89.95 Infrared RC 12–Channel Relay Board Control 12 onboard relays with included infrared remote control unit. Toggle or momentary. 15m+ indoor range. 112 x 122mm. Supply: 12Vdc/500mA Kit Order Code: 3142KT - £64.96 £51.96 Assembled Order Code: AS3142 - £61.96 Temperature Monitor & Relay Controller Computer serial port temperature monitor & relay controller. Accepts up to four Dallas DS18S20 / DS18B20 digital thermometer sensors (1 included). Four relay outputs are independent of the sensors giving flexibility to setup the linkage any way you choose. Commands for reading temperature / controlling relays are simple text strings sent using a simple terminal or coms program (e.g. HyperTerminal) or our free Windows application. Supply: 12Vdc. Kit Order Code: 3190KT - £79.96 £49.96 Assembled Order Code: AS3190 - £59.95 3x5Amp RGB LED Controller with RS232 3 independent high power channels. Preprogrammed or user-editable light sequences. Standalone or 2-wire serial interface for microcontroller or PC communication with simple command set. Suits common anode RGB LED strips, LEDs, incandescent bulbs. 12A total max. Supply: 12Vdc. 69x56x18mm Kit Order Code: 8191KT - £29.95 Assembled Order Code: AS8191 - £29.95
19/10/2016 12:31
Official UK Main Dealer Stocking the full range of Cebek & Velleman Kits, Mini Kits, Modules, Instruments, Robots and more...
2-Ch WLAN Digital Storage Scope Compact, portable battery powered fully featured two channel oscilloscope. Instead of a built-in screen it uses your tablet (iOS, Android™ or PC (Windows) to display the measurements. Data exchange between the tablet and the oscilloscope is via WLAN. USB lead included. Code: WFS210 - £161.95 iinc VAT & Free UK Delivery
LCD Oscilloscope Self-Assembly Kit
Build your own oscilloscope kit with LCD display. Learn how to read signals with this exciting new kit. See the electronic signals you learn about displayed on your own LCD oscilloscope. Despite the low cost, this oscilloscope has many features found on expensive units, like signal markers, frequency, dB, true RMS readouts. 64 x 128 pixel LCD display. Code: EDU08 - £49.99 inc VAT & Free UK Delivery 200 Watt Hi-Fi Amplifier, Mono or Stereo (2N3055) Self-assembly kit based on a tried, tested and reliable design using 2N3055 transistors. Relay soft start delay circuitry. Current limiting loudspeaker protection. Easy bias adjustment. Circuit consists of two separate class AB amplifiers for a STEREO output of up to 100 Watts RMS @ 4Ω / channel or a MONO output of up to 200W @ 4Ω. Includes all board mounted components and large pre-drilled heatsink. Order Code 1199KT - £69.95 inc VAT & Free UK delivery 130-in-1 Electronic Project Lab Get started on a great hobby or career in electronics. Contains all the parts and instructions to assemble 130 educational and fun experiments and circuits. Build a radio, electronic organ, kitchen timer, logic circuits and more. Built-in speaker, 7-segment LED display, two integrated circuits and rotary controls. Manual has individual circuit explanations, schematic and connection diagrams. Requires 6 x AA batteries (not included). Age 14+. Order Code EPL130 - £59.95 inc VAT & Free UK delivery Also available: 50-in-1 £39.95 | 75-in-1 £49.95
PC-Scope 1 Channel 32MS/s With Adapter 0Hz to 12MHz digital storage oscilloscope, using a computer and its monitor to display waveforms. All standard oscilloscope functions are available in the free Windows program supplied. Its operation is just like a normal oscilloscope. Connection is through the computer's parallel port, the scope is completely optically isolated from the computer port. Supplied with one insulated probe x1/x10. Code: PCS100A - £124.91 inc VAT & Free UK Delivery 2-Channel PC USB Digital Storage Oscilloscope Uses the power of your PC to visualize electrical signals. High sensitivity display resolution (down to 0.15mV), high bandwidth and sampling frequency up to 1GHz. Easy setup USB connection. No external power required! In the field measurements using a laptop have never been this easy. Stylish vertical space saving design. Powerful free Windows software. Code: PCSU1000 - £246.00 inc VAT & Free UK Delivery Four Legged AllBot Kit From the AllBot modular robot system with Arduino® compatible robot shields. Build and enhance the robot, learn how to program, use the app and have fun! Includes all necessary plastic parts, 4 x 9G servo motors, a servo motor connector shield (VRSSM), a battery shield (VRBS1). Code: VR408 - £104.34 inc VAT & Free UK delivery Stereo Valve Amplifier Kit- Chrome Version For most of us, a high power valve audio amplifier was an unaffordable luxury. The Velleman K4040 Chrome Stereo Valve Amplifier SELFASSEMBLY electronic kit changes that, so now everybody can enjoy that sublime "valve sound". For many audiophiles, the rich, warm sound created by vacuum tube valves cannot be surpassed, either by transistors or FETs. Code: K4040 - £839.94 inc VAT & Free UK delivery
Secure Online Ordering Facilities ● Full Product Listing, Descriptions & Images ● Kit Documentation & Software Downloads
DEC 2016 Page 3.indd 1
19/10/2016 12:33
EXCLUSIVE OFFER
Microchip and EPE have teamed up to bring you this AMAZING offer
USUAL PRICE
£68.64 (Inc VA T )
(mode l DV16
4131)
The PICkit 3 allows debugging and programming of PIC and dsPIC Flash microcontrollers using the powerful graphical user interface of the MPLAB Integrated Development Environment (IDE). This kit includes the 44-pin demo board with a PIC18F45K20 microcontroller and a USB cable. Microchip’s FREE MPLAB IDE software and the FREE Edition of the C Compiler provide a complete code development environment, and are available via free download from microchip.com
Spend over £125 on any of EPE’s products, including subscriptions, and receive a PICkit 3 worth £68.64 for FREE This offer is available to UK & overseas customers; however, for orders in Europe & ROW the following amounts will be added to cover postage: £4.05 Europe: £5.10 ROW
50 to give away so hurry while stocks last!
hip products rectly from experience our
nce of buying
Go to www.epemag.com to check availability
heduling
(Please note: subscriptions purchased with this offer cannot be cancelled before they expire; also, goods purchased with this offer can only be returned for exchange)
e add services
ders
OFFER ONLY VALID WHILE STOCKS LAST – DON’T MISS OUT!! notifications JUST CALL 01202 880299 OR VISIT OUR SECURE ONLINE SHOP AT: www.epemag.com
ly
www.microchipDIRECT.com
other countries. All other trademarks are the property of their registered owners.
EPE/M'chip offer page.indd 1
14/11/2016 11:03
Arduino Starter Kit
£69.90
Genuine Arduino Starter kit which comprises of a 170 page instruction manual, Arduino UNO Board, Breadboard, components & more.
Inc Delivery* & VAT
The kit walks you through the Arduino programming and basic electronics in a hands on way. You will be able to build 15 projects using the components supplied. They allow you to control the physical world through different kinds of sensors and actuators. Once you have mastered this knowledge, you will have the ability and circuits to create something beautiful, and make someone smile with what you invent. So build, hack and share!
Teach-In 2016
The Arduino Starter kit is the ideal partner for anyone following the Teach-In 2016 which started in the February 2016 issue of EPE Everyday Practical Electronics.
Exploring the Arduino
This Starter kit is supplied with a Wood base, USB & Interconnect leads, Electric motor, Piezo sounder, Movement and Temperature sensors, Switches, LCD, Breadboard & Servo motor. The kit also includes over 100 electronic components:- Diodes, Transistors, Capacitors, h-Bridge, Resistors, LED's, Switches and Trimmers. Quote: EPEARDSK
Offical Arduino Dealer Genuine Arduino UNO R3 from
£18.98+p&p
Wide range of Boards,Shields & Accessories
HPS140i Oscilloscope
The HPS140i Oscilloscope packs al lot of power in a tiny box. Now you can really take a powerful oscilloscope everywhere. These features make the HPS140 indispensable to the professional user, service centres and even to the hobbyist. Supplied with a probe. * 40Mhz real time sample rate * Full auto range option * Hold & store function * Operates up to 6 hours on one charge * Scope Lead and Charger Supplied
HPG1 Function Generator
A complete pocket function generator. Now you can take test signals on the move, 3 waveforms can be selected. Set the output voltage or frequency and select signal waveform using the on the screen menu. A powerful sweep function is also included. * Frequency range: 1Hz to 1.000.000Hz * Frequency steps: 1Hz, 10Hz, 100Hz, 1kHz and 10kHz * Sine, square and triangle wave forms * Runs on NiMH rechargeable battery pack (includeed) * BNC Lead and Charger Included. Quote: EPEHPG 0.01Hz to 2.4GHz 8 Digit LED Display Gate Time: 100ms to 10s 2 Channel Operating mode Power Supply: 110-220Vac 5W Quote: EPE24G
£69.90 £99.60
£81.00
Inc Delivery* & VAT
Inc Delivery* & VAT
30V 5A Programmable PSU
Dual LED (Voltage & Current) Displays Course & Fine Voltage /Current Adjustment Volatge or Current Limiting. * 5 Memories * PC Link via USB or RS232 *Output: 0-30Vdc 0-5A 07/ 11
£99.90
Inc Delivery* & VAT 10
www.esr.co.uk
ESR – MARCH 2016.indd 1
Inc Delivery* & VAT
2.4GHz Frequency Counter
Quote: EPEHPS
Quote: EPEPSU
£101.95 £69.90 £87.60
/15
Build your own Oscilloscope
A new self assembly kit, ideal for education and way to visualise signals. Features: Markers, Frequency, dB, True RMS readouts Timebase range: 10µs-500ms/division (15 steps) Input sensitvity: 100mV-5V/division (6 steps) Max Input voltage: 30Vpp Max Sample Rate: 1ms/s repetitive signal, 100ks/s real time signal Dim: 80 x 115 x 40mm Quote: EPESCOPE
Tel: 0191 2514363 Fax: 0191 2522296
[email protected]
£49.99
Inc Delivery* & VAT
ESR Electronic Components Ltd
Station Road, Cullercoats, Tyne & Wear. NE30 4PQ
Prices INCLUDE Delivery* & VAT. *Delivery to any UK Mainland address, please call for delivery options for Highland & Island, Northern Ireland, Ireland, Isle of Man, Isle of Wight & Channel Islands
20/09/2016 12:23
EDI T OR I AL VOL. 46 No. 02 FEBRUARY 2017 Editorial Offices: EVERYDAY PRACTICAL ELECTRONICS EDITORIAL Wimborne Publishing Ltd., 113 Lynwood Drive, Merley, Wimborne, Dorset, BH21 1UU Phone: 01202 880299. Fax: 01202 843233. Email:
[email protected] Website: www.epemag.com See notes on Readers’ Technical Enquiries below – we regret technical enquiries cannot be answered over the telephone. Advertisement Offices: Everyday Practical Electronics Advertisements 113 Lynwood Drive, Merley, Wimborne, Dorset, BH21 1UU Phone: 01202 880299 Fax: 01202 843233 Email:
[email protected]
Editor: MATT PULZER Subscriptions: MARILYN GOLDBERG General Manager: FAY KEARN Graphic Design: RYAN HAWKINS Editorial/Admin: 01202 880299 Advertising and Business Manager: STEWART KEARN 01202 880299 On-line Editor: ALAN WINSTANLEY Publisher:
MIKE KENWARD
READERS’ TECHNICAL ENQUIRIES Email:
[email protected] We are unable to offer any advice on the use, purchase, repair or modification of commercial equipment or the incorporation or modification of designs published in the magazine. We regret that we cannot provide data or answer queries on articles or projects that are more than five years’ old. Letters requiring a personal reply must be accompanied by a stamped selfaddressed envelope or a self-addressed envelope and international reply coupons. We are not able to answer technical queries on the phone. PROJECTS AND CIRCUITS All reasonable precautions are taken to ensure that the advice and data given to readers is reliable. We cannot, however, guarantee it and we cannot accept legal responsibility for it. A number of projects and circuits published in EPE employ voltages that can be lethal. You should not build, test, modify or renovate any item of mainspowered equipment unless you fully understand the safety aspects involved and you use an RCD adaptor. COMPONENT SUPPLIES We do not supply electronic components or kits for building the projects featured, these can be supplied by advertisers. We advise readers to check that all parts are still available before commencing any project in a backdated issue.
Control – spoilt for choice? One of the biggest developments in electronics over the last couple of decades has been the increasing integration of intelligent control into products, systems and projects. The key ingredient in this revolution has been the microcontroller, a standalone IC that can interface with the real world, store and run programs, and – crucially – be ‘easy’ to use. At EPE we have always been huge fans of Microchip’s range of microcontrollers – the PIC. Long-time readers will fondly remember our early forays into PIC use with John Becker’s imaginative projects, coupled with our regular PIC n’ Mix column, in which originator Mike Hibbett and now Mike O’Keeffe describe the fascinating world of that particular brand of silicon control. Of course, there’s more than one way to skin a silicon cat, and in 2014 we ran a very popular Teach-in series on the Raspberry Pi, and over the last 12 months Mike and Richard Tooley have been describing the Arduino. We try to avoid too much overlap in our coverage of the silicon zoo and it’s interesting to note that PICs, Pis and Arduinos do provide different, if related functions. PICs are fast and powerful devices that operate at a circuit-board level and are deeply integrated into projects. The Raspberry Pi is much more like a cut-down standalone PC, capable of running its own operating system, while the Arduino is a kind of electronic building block, which really comes into its own when teamed up with the many add-on systems, sensors and actuators – ‘shields’ – that have been developed for it. And then there were four! Now, hot on the tail of Teach-In 2016, we are bringing you a new microcontroller to add to your arsenal of smart silicon. Called the ‘Micromite’, it is the brainchild of Australian engineer Geoff Graham. So, why do we need yet another way to exert control? Put simply, the Micromite provides the ease of use that we associate with a high-level language like BASIC with the low cost, low power demands and small footprint of a PIC. In fact, it is based on a powerful and fast 32-bit PIC, but you don’t need to be a PIC guru to use it. We think you’re going to love constructing projects with this device, and our three-part introduction starts here!
ADVERTISEMENTS Although the proprietors and staff of EVERYDAY PRACTICAL ELECTRONICS take reasonable precautions to protect the interests of readers by ensuring as far as practicable that advertisements are bona fide, the magazine and its publishers cannot give any undertakings in respect of statements or claims made by advertisers, whether these advertisements are printed as part of the magazine, or in inserts. The Publishers regret that under no circumstances will the magazine accept liability for non-receipt of goods ordered, or for late delivery, or for faults in manufacture. TRANSMITTERS/BUGS/TELEPHONE EQUIPMENT We advise readers that certain items of radio transmitting and telephone equipment which may be advertised in our pages cannot be legally used in the UK. Readers should check the law before buying any transmitting or telephone equipment, as a fine, confiscation of equipment and/or imprisonment can result from illegal use or ownership. The laws vary from country to country; readers should check local laws.
EPE Editorial_100144WP.indd 7
7
13/12/2016 04:29
NEWS
A roundup of the latest Everyday News from the world of electronics
Pain-free Wi-Fi extension – report by Barry Fox ou don’t have to live in a big Y house to have problems with Wi-Fi cover. Thick walls or doors can play havoc with signal strength, and some Wi-Fi modem/routers (eg, early models from BT) have small antennae buried inside the case with very limited radio reach. So there is now a ready market for Wi-Fi extenders or signal boosters, which either pick up the signal off-air and repeat/re-transmit it, or use an Ethernet-over-mains connection from the router to a second Wi-Fi transmitter. Some extenders (eg, from Belkin) can daisy chain, so that one extends the signal from the router, and another extends the signal from the first extender. I have tried many of these solutions and found multiple practical problems. Extenders can be tricky to set up, and the best spacing between router and extender will often depend on variables like doors that are sometimes open, sometimes closed. The extender may need a different SSID and password from the main router, so Wi-Fi devices need multiple logins. Also, using extenders can slow data speed, which really matters for homes that are using many Wi-Fi devices, some streaming HD or 4k video, along with hi-res audio. Netgear Orbi To date, by far the best solution I’ve found is Orbi from Netgear. It’s expensive, costing close to £400, but there is a lot of clever technology under the hood. Orbi looks stylish and really works – without the need for extra power line or Ethernet cable connections. Orbi is a two part solution, a router that connects by Ethernet cable to an ordinary, existing broadband modem or modem/router, and a satellite extender unit that is placed some-
8
News (MP 1st) – FEB 2017.indd 8
where in the house where the signal would normally be getting weak. What makes Orbi special is that it’s a tri-band system – it uses one WiFi band (at the top end of the 5GHz band) to connect the Orbi router with the satellite unit. The satellite unit then radiates
Wi-Fi at 2.4GHz and also at the bottom end of the 5GHz band. So one band is behaving like a virtual Ethernet cable and the other two bands are filling the house with Wi-Fi. Strong cover for over 4,000 square feet is claimed. I tried a prototype from the US, ahead of the official European launch (December 2016) and found a couple of quibbles with the Quick Start guide and online registration – which should now have been fixed. (If not, the early guide wrongly assumed that users will have a modem
with single Ethernet port; in fact most people will have a combined modem/router with multiple Ethernet ports and multiple Ethernet cables. To avoid subnet conflicts, only one Ethernet port on the existing router should be used, to connect to the Orbi router, with the Orbi router taking all other Ethernet connections. Also, there will be Wi-Fi conflicts if two networks use the same SSID. If necessary, disable all Wi-Fi on the existing modem/router.) The Orbi online registration process is something of an obstacle course. The password requirements and forced double-security questions and the need to verify steps by email will surely just make many people give up and not bother to register their devices. So any benefit from registering, updates perhaps, may be lost. This sums up the dilemma now facing the IT industry. Too little security is asking for trouble; too much security drives users into using no security at all. Fixing AOL file corruption Talk Talk (the ISP recently hacked by a teenager to impress his friends) now runs the AOL email service in the UK. I have used AOL for decades and would love to ditch it, but I have too much back correspondence stored in the proprietary data format used by the Personal Filing Cabinet, which is an integral part of AOL’s Desktop software. It recently took me weeks of work to nail a problem that may well be crippling other long-term AOL users. Since I can find no advice from AOL on this, I pass on the following simple explanation; when the PFC file hits 2GB, it corrupts! So users should archive their PFC while under 2GB and start a new one. While (pointlessly, as it turned out)
Everyday Practical Electronics, February 2017
13/12/2016 04:04
Pain-free Wi-Fi extension continued reinstalling the AOL Desktop software many times to stop the PFC data corruption, and trying both the US and UK versions, I stumbled across an intriguing piece of trivia. The US version comes with rather annoying American voice prompts, while the UK version has for years used Joanna Lumley’s more appealing tones. The UK version downloads from: http://download.newaol.com/clients/ blair/waol_uk/0.4346.2018.1/road-
ie1.8.8.3/AOLUK_Desktop98.exe The US version comes from: http:// download.newaol.com/clients/bush/ waol/0.4346.2023.1/roadie1.8.8.3/ AOL_Desktop_9.8.exe So Bush and Blair are the US/UK file identifiers! Both files gave the same security warning when installed on a Windows 10 PC. ‘This type of file can harm your computer. Do you want to keep anyway. Keep? Discard?’
When programming was physical
he 2016 Tony Sale Award for T computer conservation has been won by the Heinz-Nixdorf Museums
Forum (HNF) for its evocative and educational reconstruction showing how ENIAC, one of the first electronic computers, was programmed. The Tony Sale Award, managed by the Computer Conservation Society and sponsored by Google, recognises achievements in the growing area of computer conservation. ENIAC was programmed by plugging wires and turning knobs, a physical skillset quite different from those deployed today. The reconstruction of part of the huge 1946 US computer has the look and feel of the original, but has been simplified to make it readily understood and even programmable by non-specialists. Operating six days a week in the museum, the reconstructed ENIAC accumulator (the ‘register’ in modern terminology) is safe and robust enough to be operated unsupervised by visitors. A video discussing the new ENIAC is available at:
https://youtu.be/QUQWH1jzWoI Other entries shortlisted for the 2016 award included a restoration of a 1972 PDP-12 computer by the Rhode Island Computer Museum; the conservation of a 1980s IBM 30684 computer in the Jim Austin collection in York, England; and the restoration of a 1960s computer peripheral, an IBM 1403-N1 printer at the Computer History Museum in California. For those with an active interest in preserving past computers, ‘Making IT Work’, a meeting on computer conservation, will be held over 22-23 May 2017. The international meeting will be the first of its type and is jointly organised by the Computer Conservation Society and The National Museum of Computing. Conference sessions with international speakers will be on Monday, 23 May at the BCS HQ in London and workshop sessions at The National Museum of Computing on Tuesday, 24 May 2017. More details at: www.computerconservationsociety.org and www.tnmoc.org
LEDs attract fewer insects
esearchers at the University R of Bristol have revealed that domestic LED lights are much less
attractive to nuisance insects such as biting midges than traditional filament lamps. The study, funded by the Natural Environment Research Council and UK lighting manufacturer Integral LED, used customised traps at 18 field test sites across south-west England, illuminated by a series of LED, filament and fluorescent light sources. Over 4,000 insects were carefully identified. The results showed that LEDs attracted four times fewer insects compared with the traditional incandescent lamps, and half as many as were attracted to a compact fluorescent lamp. Notably, for biting flies (midges in the genus Culicoides, some species of which are vectors of wildlife disease), 80 percent were attracted to the filament lamp, 15 percent to the compact fluorescent and only 2-3 percent to each of the two different LED lamps. The team urges further research on heat-seeking flies that transmit disease, including mosquitoes that are carriers of pathogens that cause damaging diseases such as malaria and Zika fever.
Unstealthy bike technology
Microchip launches new 8-bit AVR MCUs
icrochip has announced a new M generation of 8-bit tinyAVR MCUs. The four new devices range
from 14 to 24 pins and 4KB or 8KB of Flash and are the first tinyAVR microcontrollers to feature ‘core independent peripherals’ (CIPs). The new devices will be supported by START, an innovative online tool for intuitive, graphical configuration of embedded software projects. The new ATtiny817/816/814/417 devices provide all the features needed to help to drive product innovation, including small, low pin-count and feature-rich peripherals with 4 or 8KB of Flash memory. Other integrated features include: a core-independent peripheral touch controller (PTC); event system for peripheral co-operation; custom programmable logic blocks; self-programming for firmware upgrades; non-volatile data
storage; 20MHz internal oscillator; high-speed serial communication with USART; operating voltages ranging from 1.8 to 5.5V; 10-bit ADC with internal voltage references; and sleep currents at less than 100nA in powerdown mode with SRAM retention. CIPs allow the peripherals to operate independently of the core and include serial communication and analogue peripherals. Accompanying the release of the four new devices, Microchip is adding support for the new AVR family in START, the online tool to configure software components and tailor embedded applications. This tool is free and offers an optimised framework that allows the user to focus on adding differentiating features to their application. For more information, visit Microchip’s Web site at www. atmel.com/tinyAVR
tealth technology for helping S military aircraft evading radar is well known – but what about
technology to do the exact opposite? The iLumaware Shield is a bicycle rear light that doesn’t just sport a red light, but also includes a radar reflector that makes bikes more visible to cars equipped with radarbased crash-avoidance systems. The device’s technology amplifies the radar’s reflected signal, helping the bike and rider be seen more easily by the car’s radar system – see ilumaware.com
Everyday Practical Electronics, February 2017 9
News (MP 1st) – FEB 2017.indd 9
13/12/2016 04:04
microchipDIRECT offers access to the world’s largest inventory of Microchip products and the most comprehensive online resource for pricing and support directly from Microchip Technology. We invite you as a valued Microchip customer to experience our service 24 hours a day, 7 days per week. Visit www.microchipDIRECT.com and enjoy the confidence and convenience of buying from microchipDIRECT and take advantage of the following features: Direct stock from factory
Long-term orders and scheduling
Direct customer service
Programming and value add services
Secure ordering
Ability to adjust open orders
Volume pricing
Ship to your sites globally
Credit lines
Online order status and notifications
www.microchipDIRECT.com The Microchip name and logo, the Microchip logo are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. All other trademarks are the property of their registered owners. © 2015 Microchip Technology Inc. All rights reserved. DS40001752B. MEC2010Eng04/15
FEB 2017 Page 10.indd 1
15/12/2016 10:37
Just a flash in the pan?
Mark Nelson
How many times do you read about some amazing new development in electronics and then never hear about it again? Did the technologists really foul up? Or were other factors at play?
Y
ES, OF COURSE, SCIENTISTS DO create some duds or ‘solutions looking for problems’, but most new tech fulfils its promise. By the time it does, it’s no longer ‘hot’. You don’t turn to Barry Fox’s news roundup to read stale stories, so it’s understandable if the media fails to report progress with technologies that are no longer novel. In this article we’ll revisit and celebrate two developments that are doing very nicely thank you, even if they’re no longer on everybody’s lips. What happened to supercapacitors? ‘Supercapacitors’ or ‘ultracapacitors’, which were hot stuff back in 2007, are electrochemical energy storage devices that are ideal for delivering high power for relatively short periods. The capacitance of a single device can be as high as 2.6kF (kilofarads), combining high efficiency, strong lowtemperature performance with virtually maintenance-free operation. They are not a substitute for conventional batteries, which are optimised for delivering lower power for longer periods, but the combination of supercapacitors and batteries is an attractive option for powering hybrid diesel-and-electric vehicles that start and stop frequently. The latest generation of city buses has turned out to be a classic application for supercapacitors. A diesel engine drives an integrated electrical generator that powers the bus. When the bus is not in motion the diesel engine turns off automatically to save fuel, with the supercapacitor acting as a kind of ‘electronic’ flywheel that can restart the bus. The supercapacitor also stores the power produced in regenerative braking, which improves efficiency by recovering energy otherwise lost as heat in the braking system. In Spain, electric trams already run off lithiumion batteries in some sections of the networks in Zaragoza, Seville and Cadiz, and also use supercapacitors to provide on-board energy storage. The same combination of supercapacitors and lithium-ion battery banks is being used experimentally in the US by the AFS Trinity Power Corporation for hybrid petrol-electric cars, claiming up to 150mpg fuel efficiency. Renewable power applications too Renewable energy production is another niche market that supercapacitors are now filling. Duke Energy, one of
the largest electric power companies in the US, supplies electricity to approximately 7.4 million consumers in the Carolinas, the Midwest and Florida. Last spring, it started testing a first-ofits-kind battery technology in North Carolina. The hybrid ultracapacitorplus-battery energy storage system provides extended operational life, rapid response, real-time solar smoothing and load shifting. Thomas Golden, technology development manager for Duke Energy, explains: ‘We must look for innovative ways to better incorporate renewable energy into our system – and still provide reliable service at a competitive price for our customers. With North Carolina fourth in the nation for installed solar power, managing and maintaining these gridconnected renewable installations is critical now and in the future.’ In Ireland, where wind power is expected to generate 40 per cent of electrical power by 2020, supercapacitors are also playing a role. At Tallaght, just outside Dublin, a Smart Grid Testbed has been established by South Dublin County Council and the Micro Electricity Generation Association to demonstrate how energy storage can minimise electricity distribution issues and grid instability. With multiple sources of energy generation, the grid network in Ireland must deal with voltage and frequency issues before distributing the electricity to end users. The testbed uses a combination of lithium-ion batteries and supercapacitors for active voltage and frequency stabilisation in the grid’s distributed network. Ultracapacitors made by Maxwell Technologies perform fast functions such as frequency response, leaving the batteries to handle peak shifting and operating reserve. What became of 3D printing? Remember how computers were going to connect to gadgets that could ‘print’ three-dimensional objects from liquid plastic in your own home? Well, you can still buy them at Maplin Electronics, but they’re by no means cheap, the consumables are eye-wateringly expensive and the skills needed to design objects in 3D are significant. Although ‘makers’ love them, these devices have not become a mass-market for hobbyists. However, the same technology, often termed ‘additive manufacturing’, is
Everyday Practical Electronics, February 2017
TechnoT (MP 1st & AE) – FEB 2017.indd 11
A sample multidimensional circuit carrier made by Beta LAYOUT using EOS equipment. widely used in industry for making prototypes of all manner of products. Just recently it has also been applied to manufacturing what you might call ‘3D PCBs’. The correct term, however, is multidimensional circuit carriers and a leader in this field is German firm EOS (Electro Optical Systems). As the company explains, in many electronic devices there is often only a very small amount of installation space available for conventional circuit boards, and there tends to be very little space left over for the actual electronics. Often, the circuitry has to compete for limited space within the housing, which leaves product designers forced to abandon conventional PCBs and fit in everything three-dimensionally, using whatever space is left. Three-dimensional circuit carriers made of plastic are now the solution of choice. That’s all well and good, but injection moulding would be fiendishly expensive (making the moulds costs mega-money and takes time). So plastic parts manufactured by 3D printing are the solution, something that EOS’s client Beta LAYOUT (well-known for its PCB-POOL operation) has perfected. Very good then, but how on earth do you add the metallic electrical connections? This is the really clever part, which takes place after the printing process itself. The parts created are coated with a special finish that contains an additive that can be turned into conductive tracks by activating the finish. A laser triggers a physical-chemical reaction that creates metallic powder while simultaneously roughening the surface. Afterwards, copper particles are deposited on the previously activated areas to create PCB tracks that can either undergo further electroplating or else be given a surface finish directly. Electronic components are then added to the initial prototypes and samples, allowing functional testing and a check of design layouts. I bet you’d like one of these gizmos at home!
11
13/12/2016 04:08
Constructional Project Part 1 by JOHN CLARKE
Solar MPPT Charger and Lighting Controller This MPPT charger/light controller will work with 12V or 24V solar panels to charge a 12V or 24V lead-acid or lithium iron phosphate battery. You can then use the battery to run 12V DC lighting or a 12V/24V 230VAC inverter to run lighting or other loads.
S
OLAR PANELS are becoming cheaper all the time, so now you can build a low-cost system to power lighting and other loads around your home, your boat or caravan, or for a home that’s not connected to the grid. This unit gives you the choice of running a 12V solar panel up to 120W, or a 24V panel up to 220W. It can switch lights on at dusk and off at dawn. By including a PIR (passive infrared) detector, you can also have lights switch on with movement detection and off with the timer. You can also manually switch the lights on or off at any time. The unit incorporates ‘maximum power point tracking’ (MPPT) to maximise the output from the solar panel, regardless of the solar intensity, and it provides three-stage charging for SLA (sealed lead-acid) batteries or two-stage charging for LiFePO4 batteries. Cell equalisers will be required if using a
12
Solar Lighting Controller0216 (MP 1st) – FEB 2017.indd 12
LiFePO4 battery; more about this later. Whether you intend operating with a 12V or 24V system, you are not limited to 12V DC lighting. The battery can be used with a 12V or 24V/230VAC inverter of up 600W or more (depending on the size of your battery) to run 230VAC LED downlights, laptop computers, TV sets, power tools and so on. Mind you, while the unit can work with a solar panel rated up to 120W at 12V, or 220W up 24V, you can use a smaller panel if that is all you require. A big advantage of using a 230VAC inverter is that you will have a much larger choice of lights than if you are confined to a 12V DC system. Fig.1 shows the arrangement of our Solar Lighting Controller and depicts the solar panel, battery and the 12V lighting or 230VAC inverter. Additional inputs to the controller include
a light sensor to monitor the ambient light, a PIR detector and a timer. For use in garden lighting, the light sensor allows the lights to switch on at dusk and they can remain lit for a preset period of up to eight hours, as set by the timer. Alternatively, you may wish to have the lights lit for the entire night and to switch off automatically at sunrise, provided there is sufficient battery charge (and capacity). For security or pathway lighting, the lights can be set to switch on after dusk, but only when someone approaches the area. In this case, a PIR movement detector switches on the lights, while the timer switches off the lights after a predetermined period, typically about one to two minutes. Periods extending up to the full 8-hour timer limit are available if you need more time. The actual total wattage of the lights that you can use does depend on the
Everyday Practical Electronics, February 2017
13/12/2016 04:39
Constructional Project application. With its internal MOSFET switching, it will supply a load drawing up to 10A from a 12V or 24V battery. You will get the best efficiency using LED lighting or 12V fluorescent lamps rather than using standard or halogen filament lamps. Alternatively, the controller can switch a heavy-duty relay to drive a 12V or 24V inverter, as noted above, and it will protect the battery by switching off to prevent over-discharge, since it includes low battery detection, with a cut-off below 11V. This is most important for lead-acid or lithium iron phosphate batteries. Standby current drain of the Solar Lighting Controller is quite low at 2.2mA, but this increases to around 12mA if a PIR detector is used.
SOLAR PANEL 12V 120W OR 24V 220W
12V LIGHTING OR 230VAC INVERTER
TEMPERATURE SENSING (NTC1) SOLAR CHARGER CONTROLLER
LIGHT SENSING (LDR1)
12V/24V BATTERY
Fig.1: block diagram of the lighting system. It uses a a solar panel, a 12V/24V battery and the MPPT charge controller to drive either 12V lighting or a 230VAC inverter and can be switched using various sensors.
PIR DETECTOR
TIMER (VR4)
ON/OFF SWITCH
Multi-stage charging As mentioned above, the Solar Lighting Controller provides three-stage charging for lead-acid batteries or a two-stage charge for LiFePO4 batteries. Fig.2 shows the three-stage charging with bulk, absorption and float modes. Bulk charge is applied when the battery voltage drops below 12.7V and feeds maximum power from the solar panel until the battery voltage reaches cut-off at 14.4V (20°C). Next is the absorption phase, where the battery is maintained at the cut-off voltage of 14.4V for one hour, to ensure full charge. After that, the battery is maintained on float charge at 13.5V.
The cut-off voltage for bulk charge and the float voltage are reduced for temperatures above 20°C, in line with the battery manufacturers’ charging specifications. Typically, this is 19mV per °C for a 12V battery. So at 30°C, the voltages are reduced by 190mV, ie, 14.2V and 13.3V respectively. The ambient temperature is measured using an NTC (negative temperature coefficient) thermistor which should be located close to the battery or preferably, attached to the case of the battery for more accurate temperature
sensing. Charging will not occur if the thermistor is shorted or not connected. The two-stage charging used for LiFePO4 batteries is shown in Fig.3 and consists of bulk and absorption stages. In fact, the bulk and absorption stages are exactly the same as for lead-acid batteries, but there is no subsequent float charge mode. We based these modes on information to be found at www.powerstream.com/ LLLF.htm and similar websites. Note that it is important that a cell balancer is used when charging
CUTOFF BATTERY VOLTAGE
BATTERY VOLTAGE FLOAT VOLTAGE
BULK
ABSORPTION
BULK
FLOAT
TIME
TIME
CHARGE CURRENT
CHARGE CURRENT
TIME
Fig.2: Three-stage is used for lead-acid batteries, startFIG.2:charging THREE-STAGE CHARGING ing with an initial bulk charge. When the battery reaches the cut-off voltage, the absorption stage takes over to fully charge it. The float stage then maintains the charge.
Everyday Practical Electronics, February 2017
Solar Lighting Controller0216 (MP 1st) – FEB 2017.indd 13
ABSORPTION
TIME
Fig.3: Two-stage charging is used for LiFePO4 batteries and FIG.3: TWO-STAGE CHARGING consists of bulk and absorption stages. These stages are exactly the same as for lead-acid batteries, but there is no subsequent float charge mode.
13
13/12/2016 04:39
Constructional Project SOLAR PANEL POWER CURVE SIMULATION (120W PANEL) 24V
OPEN CIRCUIT VOLTAGE (Voc = 21.8)
22V
VOLTAGE DROP WITH CURRENT SLOPE
20V
OUTPUT VOLTAGE
18V
Fig.4: the current/ voltage curve for a typical 120W solar panel. MAXIMUM POWER POINT
17.8V
16V
CURRENT LIMIT THRESHOLD
14V 12V
CURRENT LIMIT SLOPE
10V 8V 6V 4V
0V
6.74A
2V
0
0.8
1.6
2.4
3.2
4.0
4.8
5.6
6.4
SHORT CIRCUIT CURRENT (Isc = 7.14A)
7.2
8.0
OUTPUT CURRENT (AMPS)
LiFePO4 batteries. We intend publishing a suitable cell balancer shortly after Part 2 of this project. Charge indication An LED indicator shows the charging stage. It is on continuously for the bulk charge mode; flashes on for 0.5s and off for 0.5s for the absorption mode, and flashes on for one second and off for one second during float mode. If you have a battery that has been discharged below 10.5V, it will be charged with short bursts of current until it reaches 10.5V, whereupon bulk charging will begin. This initial charging will be indicated by a short flash of the charge LED every four seconds. MPPT operation Fig.4 shows the output of a typical 12V solar panel. It will deliver maximum current when the output is shorted and maximum voltage when the output is open-circuit (ie, no load). So the maximum short circuit current might be around 7.2A and the maximum voltage can be anywhere between 21.8V and 22.5V, or maybe a little more. However, the maximum power output for a nominal 12V 120W panel will be between those extremes, at a load current of 6.74A and a voltage of 17.8V (or very close to those figures). When we consider the power delivered to the battery, the story becomes
14
Solar Lighting Controller0216 (MP 1st) – FEB 2017.indd 14
more interesting. If we were to connect the 120W solar panel directly to the battery, the charge current would be about 6.9A at 12V (ie, 82.8W) and about 6.8A at 14.4V (ie, 97.9W). Both these values are far less than the 120W available from the solar panel when its voltage is at 17.8V. Ideally, the solar panel should be operated at peak efficiency, to deliver maximum power. And that is where the MPPT aspect of the controller comes into play. It’s essentially a switchmode step-down power converter, which increases the available power from the solar panel to the battery with minimal power loss. At the same time, it provides the required two-stage or threestage charging to the battery. Fig.5 shows how this takes place. When MOSFET Q1 is closed, current from the solar panel flows through paralleled dual diode D1 and this is filtered with two 2200µF capacitors. The current (i1) flows through inductor L1 into the battery. The inductor charges (ie, current rises to its maximum value) and after a short period, Q1 is switched off and the stored charge in L1 maintains current flow (i2) via paralleled dual diode D2. The ratio of the on-to-off period (duty cycle) for Q1 is controlled so that the solar panel delivers the maximum available power. The solar panel is not required to supply the peak current into the
inductor, as this is drawn from the 2200µF capacitors. Incidentally, these capacitors are low-ESR (effective series resistance) types, suited to the switching frequency of 31.24kHz. The voltage from the solar panel is monitored by op amp lC2a, and the current is monitored by measuring the voltage across a 0.01Ω shunt resistor. This voltage is multiplied by –45 in op amp lC2b, which also acts as a low-pass filter. Both op amps feed their signals to microcontroller IC1 and this controls the whole circuit operation. Circuit details The full circuit for the Solar Lighting Controller is shown in Fig.6 and is based around a PIC16F88 microcontroller (IC1). This monitors the solar panel voltage and current signals from IC2, a PIR sensor (if used), switch S1, a light-dependent resistor (LDR) and an NTC thermistor, and controls the lighting using MOSFET Q4. A 12V supply is provided for the PIR sensor at CON2 via resistor R2 from the 12V battery supply. Many PIR sensors can be operated from a 9-16V supply, and in these cases R2 can be a wire link and zener diode ZD4 omitted. If the PIR sensor requires a fixed 12V supply, then R2 should be 270Ω and zener diode ZD4 is included. For 24V operation, R2 should be 1.2kΩ. A pushbutton switch (S1) is monitored by IC1’s RB1 input, normally held high at 5V with a 100kΩ pullup resistor. Pressing the switch pulls the RB1 input low. S1 is included for test purposes, but an external on/off (pushbutton) switch can be connected as well, using two of CON2’s terminals. The 100nF capacitor at RB1 prevents interference from causing false switching when long leads are used to an external switch. Ambient light is monitored using a light-dependent resistor (LDR) at the AN5 analogue input of IC1. The LDR forms a voltage divider with a seriesconnected 100kΩ resistor and trimpot VR5, all across the 5V supply. In normal daylight, the LDR is a low resistance (about 10kΩ) but this rises to over 1MΩ in darkness. Therefore, the voltage at the AN5 input will be inversely proportional to the ambient light. If the voltage across LDR1 is below 2.5V, IC1 determines it is daylight; above 2.5V it reads it as dark. This measurement is made when MOSFET Q5 is switched on, tying
Everyday Practical Electronics, February 2017
13/12/2016 04:39
Constructional Project
Table 1: Lamp operation options JP1
JP2
Lamp on
Lamp off
LDR position
Night-to-day transition. With S1 during day Day-to-night transition. With S1 during night
Day-to-night transition, with S1 or timer time-out Night-to-day transition, with S1 or timer time-out
Night position
LDR position and with the LDR disconnected from CON3
S1 during day or night
Timer time-out or S1
Day position
PIR position
Night position
PIR position
Night position
PIR position and with the LDR disconnected from CON3
PIR movement detection or with S1 during the day only PIR movement detection or with S1 during the night only PIR movement detection or with S1 during the day or night
Day-to-night transition, with S1 or timer time-out Night-to-day transition, with S1 or timer time-out Timer time-out or with S1
Day position
LDR position
Night position
We’ll cover the procedure for adjusting VR4 later.
Note, if an inverter is to be controlled, Q4 is used to switch a heavy-duty relay.
Lamp driver The lamp or lamps are powered on using MOSFET Q4. This is switched on with gate voltage from the RB0 output of IC1. Q4 is an IRF1405 and this can be driven using a low-voltage gate signal such as the 5V from IC1. The expected voltage drop between drain and source is around 0.12V when conducting 10A. A small heatsink ensures that this MOSFET runs relatively cool.
Charging For charging, we use the switchmode step-down circuit previously described in Fig.5. MOSFET Q1 is a P-channel type that switches on with a gate voltage that is negative with respect to its source. The voltage at Q1’s source (from the solar panel and diode D1) can range up to about 22V when the solar panel is not delivering current.
D1 is a twin-diode package, which has the advantage that both diodes are closely matched for forward voltage, since they are both on the same silicon die. This means that they will share current equally when they are connected in parallel, to give a total rating of 20A. MOSFET Q1 is controlled by NPN transistor Q3 that’s driven by the PWM output at pin 9 of ICI via a 100Ω resistor. Q3’s emitter is connected to ground via another 100Ω resistor. With about 5V at Q3’s base, the emitter is at about 4.3V and so there is 43mA through its
Building the Solar Charger and Lighting Controller is easy, with all parts mounted on a single PCB. This is housed in a diecast metal case which provides the necessary heatsinking. The full assembly details are in Part 2 next month.
16
Solar Lighting Controller0216 (MP 1st) – FEB 2017.indd 16
Everyday Practical Electronics, February 2017
13/12/2016 04:40
Everyday Practical Electronics, February 2017
Solar Lighting Controller0216 (MP 1st) – FEB 2017.indd 17
λ
+
100nF
1.5k
A
K
S1
10k
ZD4 12V
100nF
5
4
IC2b
100nF
SEE TEXT
(1.2k)
1
1W
ZD2 30V
A2
7
+12V
IC2: LM358
A
K
470pF
IC2a
8
R2 270Ω
6
68k
2
3
100Ω (1k)
100nF
R1 100k
2.2k
2.2k
35V
10 µF
K
E
100k
NIGHT
DAY
PIR
LDR
JP1
+5V
SOLAR PANEL CURRENT MONITOR
JP2
1k
B
RB1
RB2
RA6
RA7
A
RA2/AN2
K
K
5
Vss
RB0
RB4
RB5
RB6
TP2
470Ω
S
2N7000
G
11
12
17
18
13
D
RA0/AN0
RA1/AN1
RB7/AN6
1
6
+5V
100 µF
TP1
TPGND
D
10
10Ω
100nF
G
IC1 PIC1 6F8 8 PIC16F88
AN4/RA4
AN3/RA3
PWM/RB3
ZD1 – ZD4
A
Vdd
14
1W
S
ZD3 18V
MCLR/RA5
100nF
A
K
D3: 1N4148
7
8
15
16
3
2
9
4
E
Q2 BC337 C
Q1 SUP53P06-20
TP3
E
10nF
B C
BC337
VR3 10k
10Ω
LED1
REF
REG1 TL499A
5
+5V
A1
4
K
A2
7
10Ω
100k
D1, D2
VR5 500k
VR4 10k
VR2 20k
SW IN
K
λ
A
K
C
G
S
D
2
1
E
TIP31C
470Ω
B
1nF
4
5
3
6
SERIES 1 IN
100nF X2
SW REG IN2 SW CUR GND CTRL PGND
OUT
100nF X2
22k (51k)
+5V
2
8
D2 MBR20100CT
4.7k
A2
10nF
K
λ
A
VR1 20k
TP4
A1
K
L1: 5 µH (12V) 10 µH (24)
C
Q5 2N7000
10k
G
OPTO1 4N28
+12V
1W
ZD1 30V
330Ω
+12V
G
K A
LED
D
S
+
D
LDR
NTC
–
LAMP
CON3
Q4 IRF1405N
Q1, Q4
S
D
CON1 F
CON1 E
CON1 D
12V (24V) BATTERY
CON1 C
F1 10A
Fig.6: the full circuit for the 12V/24V Solar Lighting Controller is based on PIC16F88 microcontroller IC1. This monitors the solar panel voltage and current signals from IC2, a PIR sensor (if used), switch S1, a light-dependent resistor (LDR) and an NTC thermistor. The resulting PWM (pulse-width modulation) output on pin 9 of IC1 then drives power MOSFET Q1 via transistors Q3 and Q2 to control the charge current for the battery, while Q4 controls the lighting.
20 1 6
A
K
Q3 TIP31C
100Ω
C
D3
1k
1W
SOLAR PANEL VOLTAGE MONITOR
100Ω
B
63V (24V)
2 x 470 µF
25V (12V)
2 x 2200 µF
SC SOLAR SOLAR CHARGE/LIGHTING CHARGE/LIGHTINGCONTROLLER CONTROLLER
GND
SIGNAL
+
3W
8.2k
12V 120W OR 24V 220W SOLAR PANEL
0.01Ω
CON2
TO EXT SWITCH
TO PIR SENSOR
CON1 B
CON1 A
4.7k
22k (47k)
A1
D1 MBR20100CT
Constructional Project
17
13/12/2016 04:40
Constructional Project Parts list: Solar MPPT Charger/Lighting Controller 1 double-sided PCB, available from the EPE PCB Service, coded 16101161, 141 × 112mm 1 diecast box 171 × 121 × 55mm 1 6-way PC-mount screw terminal block (CON1) 1 3-way PC-mount screw termin al block, 5.08mm pin spacing (CON2) 3 2-way PC mount screw terminals 5.08mm pin spacing (CON2,CON3) 1 powdered-iron toroid 28 × 14 × 11mm 1 SPST PC mount tactile membrane switch with 3.5 or 4.3mm actuator (S1) 1 10kΩ NTC thermistor 1 LDR with 10kΩ light resistance, 1MΩ dark resistance 2 IP68 cable glands for 8mm cable 1 IP68 cable gland for 6.5mm cable 1 DIL18 IC socket 2 M205 PC mount fuse clips 1 10A M205 fast blow fuse (F1) 1 TO-220 U shaped heatsink, 19 × 19 × 10mm 1 M3 × 10mm machine screw 4 TO-220 silicone insulation washers 4 TO-220 insulating bushes 4 M3 × 12mm machine screws 5 M3 nuts 2 3-way pin headers with 2.54mm pin spacings (JP1,JP2) 2 jumper shunts for pin headers 2 100mm cable ties 1 3m length of 0.5mm enamelled copper wire
1 50mm length of 0.7mm tinned copper wire (for PIR, see text) 4 PC stakes
collector. When Q3 is on, MOSFET Q1’s gate is pulled negative with respect to its source via diode D3 and the 10Ω resistor, thus switching Q1 on. Q1’s gate is protected from voltages in excess of 18V (which could damage it) by zener diode ZD3. Q3’s emitter resistor is set at 100Ω so that ZD3’s current is limited to 43mA. Whenever Q3 is on, NPN transistor Q2 is off since the base is one diode drop below the emitter, due to D3 being forward biased. Conversely, when IC1 switches Q3 off, Q2’s base is pulled to Q1’s source voltage via
a 1kΩ resistor. This switches Q2 on, pulling Q1’s gate to its source and thus switching it off. Q1 is switched on and off by IC1 at 31.24kHz.
18
Solar Lighting Controller0216 (MP 1st) – FEB 2017.indd 18
Semiconductors 1 PIC16F88-I/P microcontroller programmed with 1610116A. hex (IC1). 1 LM358 dual op amp (IC2) 1 4N28 optocoupler (OPTO1) 1 TL499A regulator (REG1) 1 SUP53P06-20 P channel MOSFET (Q1) 1 BC337 NPN transistor (Q2) 1 TIP31C NPN transistor (Q3) 1 IRF1405N N-channel MOSFET (Q4) 1 2N7000 N-channel MOSFET (Q5) 2 MBR20100CT fast dual diode (D1,D2) 1 1N4148 diode (D3) 2 30V 1W zener diodes (ZD1,ZD2) 1 18V 1W zener diode (ZD3) 1 12V 1W zener diode (ZD4) (for 12V PIR, see text) 1 3mm high intensity LED (LED1) Capacitors 2 2200µF 25V low-ESR PC electrolytic (12V version) 2 470µF 63V low-ESR electrolytic (24V version) 1 100µF 16V 1 10µF 35V 6 100nF MKT polyester 2 100nF X2 class metallised polypropylene 2 10nF MKT polyester 1 1nF MKT polyester 1 470pF ceramic Resistors (0.25W, 1%) 1 100kΩ (R1) – see text
Voltage/temperature monitoring The battery voltage is monitored at lC1’s AN2 input via optocoupler OPTO1 and a resistive divider comprising a 22kΩ resistor and 20kΩ trimpot VR2. This divider is adjusted using VR2 so that the voltage appearing at AN2 is actually 0.3125 times the battery voltage. The reason for this is so that the 5V limit of analogue input AN2 is not
2 100kΩ 1 68kΩ 1 47kΩ (24V version) 1 51k (24V version) 2 22kΩ (12V version) 2 10kΩ 1 8.2kΩ 2 4.7kΩ 2 2.2kΩ 1 1.5kΩ 1 1.2kΩ (use for 24V supply with 12V PIR see text) 1 1kΩ (24V version) 1 1kΩ 1W 1 1kΩ 2 470Ω 1 330Ω 1 270Ω (for 12V PIR, see text) 2 100Ω 1 100Ω (12V version) 3 10Ω 1 0.01Ω 3W resistor Trimpots 2 10kΩ mini horizontal trimpots (103) (VR3,VR4) 2 20kΩ mini horizontal trimpots (203) (VR1,VR2) 1 500kΩ mini horizontal trimpot (504) (VR5) Miscellaneous 1 12V or 24V SLA or LiFePO4 battery 1 12V (up to 120W) or 24V (up to 220W) solar panel array 12V lamps suitable for 14.4V use 1 12V PIR 10A cable, battery clips, shielded cable, heatshrink tubing Reproduced by arrangement with SILICON CHIP magazine 2016. www.siliconchip.com.au
exceeded. For example, a 15V battery voltage will be converted to just 4.69V. We’ll cover this in the setting-up procedure later. The resistive divider is not directly connected to the battery but via the transistor within optocoupler OPTO1 and this connects the battery voltage to the divider whenever the LED within OPTO1 is on. The collector-emitter voltage of the transistor has a minimal effect on the battery voltage measurement, as it is only around 200µV. The divided voltage is converted to a digital value by IC1. The optocoupler’s
Everyday Practical Electronics, February 2017
13/12/2016 04:40
Constructional Project LED is driven from the 5V supply through a 470Ω resistor to 0V when MOSFET Q5 is switched on. The NTC thermistor forms a voltage divider with a 10kΩ resistor across the supply when Q5 is switched on. IC1’s AN6 input monitors this voltage and converts it to a value in degrees Celsius. At the same time, IC1’s AN1 input monitors the setting of trimpot VR3. This trimpot is effectively connected across the 5V supply when Q5 is switched on. The AN1 input voltage is converted to a mV/°C value and this can range from 0mV/°C when VR3 is set to 0V to 50mV/°C when VR3 is set for 5V. Power saving As mentioned, MOSFET Q5 connects trimpots VR3 and VR4, the LDR and the NTC to 0V and also powers the optocoupler LED. Q5 is powered on with a 5V signal from the RB5 output of IC1. The MOSFET then momentarily connects these sensors to 0V so that microcontroller IC1 can measure the values. When Q5 is off, these trimpots, sensors and battery divider are disconnected from the supply to reduce battery drain. One problem with using Q5 to make the 0V connection for the trimpots, battery and sensors is that these sampled voltages cannot be easily measured with a multimeter. This is because a multimeter will not capture the voltage when Q5 switches on momentarily. And we do need to measure some of these voltages for setting up. For example, we need to be able to set VR2 so that the battery divider is correct and we need to measure the timer and mV/°C values as set with
VR4 and VR3. So in order to make these measurements, Q5 is switched on whenever S1 is pressed. Other power saving techniques include driving the charge LED (LED1) from the solar panel instead of the battery. The only time this LED will light using battery power is if the thermistor is open or short circuit. In these cases, the LED flashes at a low duty cycle, again conserving power. Op amp lC2 is also powered from the solar panel, because we only want to measure the solar panel voltage and current when solar power is available. Therefore, IC2 is fed via a 100Ω series resistor for a 12V panel and a 1kΩ resistor in the case of a 24V panel. Zener diode ZD2 limits the voltage to 30V. Diode D1 prevents the battery from powering IC2 via Q1’s internal diode and L1. The solar panel voltage is monitored using a 22kΩ and 4.7kΩ voltage divider, while a 100nF capacitor filters any transient voltages or noise that could be induced through long leads from the panel. IC2a is connected as a unity-gain buffer and its output is applied to the AN3 input of IC1. As noted previously, current from the solar panel is measured by the voltage developed across a 0.01Ω shunt resistor. This is around 70mV for a current of 7A. The voltage developed across the shunt is negative and this is inverted and amplified by IC2b, which has a gain of –45. Therefore, lC2b’s output will be around 315mV per 1A of current from the solar panel. This output is applied to the AN4 input of IC1 via a 2.2kΩ current-limiting resistor. Note that the actual calibration of voltage and current is not particu-
larly important. The software within IC1 multiplies the voltage and current readings obtained at the AN3 and AN4 inputs to find where the maximum power point is for the solar panel This calculation is not after any particular value, but just the maximum in a series of power calculations. It does this calculation periodically (once every 20 seconds) and varies the on/off duty cycle of MOSFET Q1 to find the duty cycle that provides the maximum power from the solar panels. Power for the remainder of the Solar Lighting Controller circuit comes from the 12V battery via REG1, a TL499A regulator. This is a low quiescent current type that can run as a linear step-down regulator and as a switchmode step-up regulator. We have used it as a 12V to 5V linear regulator, with the output voltage trimmed using VR1 to as close to 5V as possible. This then calibrates the analogue-to-digital conversion within IC1, ensuring correct charging voltages for the battery. Protection against reverse polarity connection of both the 12V battery and solar panel are included. If the solar panel is connected with reverse polarity, IC2 is protected because ZD2 will conduct in its forward direction, preventing more than 0.6V reverse voltage from being applied across its pin 4 and pin 8 supply rails. D1 prevents reverse voltage from the solar panel being applied to the remainder of the circuit. Finally, should the battery be connected back to front, D2 will conduct via inductor L1 and the fuse will blow, breaking the connection. Next month, we’ll cover constructional details and set-up procedure.
Extruded enclosures standard and heatsink www.hammondmfg.com/1455.htm www.hammondmfg.com/1455NHD.htm
01256 812812
[email protected] Everyday Practical Electronics, February 2017
Solar Lighting Controller0216 (MP 1st) – FEB 2017.indd 19
19
13/12/2016 04:40
Constructional Project
By JOHN CLARKE
Check your turntable’s speed with this white LED strobe
So you have dragged out the old turntable and are playing vinyl records again. Good. But how do you know that the turntable speed is correct? The old way to do it was to use a circular disc with strobe markings, but that does not necessarily work these days. Why not? Read on.
P
LAYING VINYL records has made a big comeback in recent years and many people are resurrecting their old turntables or buying new ones. But there are a few hurdles before you get the optimum result, such as making sure the cartridge stylus is not worn out and that your preamplifier provides the correct equalisation. On a more prosaic note, many turntables which have been out of action for decades may not necessarily operate at the correct speeds of 33.3, 45
20
Turntable Strobe1215 (MP 1st) – FEB 2017.indd 20
and 78 RPM. So you need to check that aspect. How do you do that? The old tried and true method was to use a circular card which had stroboscopic markings on it and run the turntable under mains voltage lighting; 230VAC 50Hz in the case of Australia, New Zealand and most of Europe or 120VAC 60Hz in the case of the Americas, parts of Japan or Asia. These stroboscopic cards have four or six bands of markings and depending on the speed selection, one of those
bands would appear to be stationary. The reason for this was that incandescent or fluorescent lighting had a strong 100Hz or 120Hz component and this would act to make the relevant strobe band on the circular card appear to stop moving. The same method applies to those turntables that have strobe markings on the rim of the platter. But while the principle is still correct, it does not work very well in most homes these days. Why not? Because our political
Everyday Practical Electronics, February 2017
13/12/2016 04:57
Constructional Project masters have deemed that old-fashioned incandescent lights are ‘wasteful’ and ‘bad for the environment’. At the same time, fluorescent lighting in most homes is now out of fashion, unless it is using those ugly compact fluorescent lamps (CFLs) with their unnatural hues and copious electromagnetic interference. So why can’t these modern lamps provide the same stroboscopic effect? The reason is that they run at much higher frequencies so that any residual AC component in the light output is very small. This applies to any lighting which uses electronic ballasts. Mind you, even when you are using incandescent or fluorescent lighting powered by 50Hz or 60Hz mains, the strobing effect is not particularly strong, and it is even weaker with halogen lamps with their much hotter filaments. We will explain why later in this article. Turntable types Most good turntables are either beltdriven or direct drive. Cheaper turntables were driven from an idler wheel inside the rim of the platter. The beltdriven types usually have a small synchronous motor which can be assumed to be locked to the mains frequency, provided the belt is not slipping on the motor shaft. This could happen if the belt is perished, kinked or hardened. Idler-driven turntables typically have a shaded pole motor and they are not so tightly locked to the mains frequency (and because of the idler-drive, they are more likely to produce rumble). Direct-drive turntables should run at the correct speed but again, that cannot be taken for granted. Also, some direct drive turntables had or have a variable speed feature which allows the music pitch to be shifted over a a range of about a semitone. Again, how do you know what is the correct speed setting (unless you have absolute pitch)? Any substantial speed variation is liable to cause any music to sound off-pitch. And if you want to dance to records and the number of beats per minute is important, then again, the turntable speed should be correct. Our solution has been to design a white LED stroboscope which produces one millisecond pulses of light at a very precise 100Hz or 120Hz (ie, twice the mains frequency). But our recommendation is to use it at 120Hz
Turntable speed variations
Turntables that rely on a 50Hz or 60Hz mains supply to drive a synchronous or shaded pole motor may not necessarily run at the correct speed. Typically, the 50Hz mains frequency can vary between 49.85Hz and 50.15Hz (ie, ±0.15Hz) over the course of a day. Typically, the mains frequency will be slightly low during periods of peak power demand and a little high at other times. That variation would mean that middle C could be as low as 260.841Hz and as high as 262.411Hz. Whether this is noticeable or not depends on how well you discern pitch. Further turntable speed problems can be present if an incorrect-sized pulley on the motor spindle is used to drive the belt. This could be because you have an imported turntable that’s been designed to operate from 60Hz instead of 50Hz (or instead designed to run with 50Hz instead of 60Hz). You may be able to supply the correct voltage for the motor using a transformer but the frequency will not be correct. For precision speed from a synchronous motor drive, an electronic driver circuit could be used to produce a suitable sinewave source for the motor. This could be a low-powered crystal-locked sinewave inverter such as for an uninterruptible computer supply. Modified sinewave inverters may not be suitable since the square wave supply may introduce noise into the motor and cartridge pick-up leads.
Why is this white LED strobe necessary?
In the ‘olden days’ the usual method of providing a strobe light source involved using an in-built Neon discharge lamp powered from the 240VAC 50Hz or 120VAC 60Hz mains supply. The neon would produce light pulses at 100Hz or 120Hz and this would give a stationary pattern for the set speed. However, using the mains supply is most unlikely to give a completely steady strobe pattern when you are using a crystal-controlled direct-drive turntable unless the mains frequency is precisely 50.000Hz or 60.000Hz. Even a slight error will cause the strobe pattern to rotate slightly. Of course, with a belt-driven synchronous motor turntable, you would never be aware of these speed errors (unless you build our Turntable Strobe).
to give the most accurate speed indication with a strobe card. So why is that? Funnily enough, a lot of strobe cards are not necessarily accurate and if you want the most accurate speed indications at 33.33 and 45 RPM, you should use a strobe pattern designed for 60Hz operation. Interestingly, as far as 78RPM records are concerned, it is not possible to get an absolutely accurate speed indication at 100Hz or 120Hz, but 100Hz is the more accurate, with a speed error of 0.1%. Because of these issues, we have also designed a PCB strobe disc that you can place on your turntable to check its speed. It is just the right size to fit on the record label and will not cover the playing area. Since it is precisely etched and machined, it will not have the common fault of some printed strobe discs which can be slightly off-centre or the centre hole is a little over-size. A turntable rotating at the correct speed will have one band of the strobe disc markers remaining stationary.
Everyday Practical Electronics, February 2017
Turntable Strobe1215 (MP 1st) – FEB 2017.indd 21
If the markers drift clockwise, then the turntable speed is fast and if the markers drift anticlockwise, the turntable speed is too slow. Any slight wavering forwards or backwards of the markers will be due to irregular speed variations and significant variations of this nature may be audible as ‘wow and flutter’. What can be done about a turntable that doesn’t run true to speed? More information on this is detailed in the above panel. Our LED Turntable Strobe is built on a small PCB that fits into a small plastic utility box. Alternatively, the PCB can be installed inside the turntable cabinet and the strobe LED can be mounted to illuminate strobe markings on the platter’s rim. It can be powered with a 9V battery, an external DC supply or a 5V supply via a USB connector. Circuit description Fig.1 shows the circuit and it is based on a PIC12F675 microcontroller (IC1). The microcontroller vastly simplifies
21
13/12/2016 04:57
Constructional Project S1
D1 1N4004
CON1
A
9-12V DC IN
1N4004
REG1 78L05
K
OUT
IN
A
GND
100 µF
470 µF
GND
1N5819
16V
16V
+
78L05
K
IN
OUT
K
A D2 1N5819
9V
A
–
USB MICRO‘B’ SOCKET
K
+5V
100nF
1k
1 2 3 4 5
4
CON3
2
Reproduced by arrangement with SILICON CHIP 33pF magazine 2016. www.siliconchip.com.au
X1 4.0MHz
33pF
3
1 Vdd GP3/MC GP5
68Ω A
GP1
6
LED1
(WHITE)
GP2
C
470Ω
5
Vss 8
EXTERNAL LED
λ CON2
K
7 IC1 PIC12F675 GP0
GP4
68Ω
B
JP1
IN: 120Hz OUT: 100Hz
Q1 BC337
E
BC 33 7
LED
SC TURNTABLESTROBOSCOPE TURNTABLE STROBOSCOPE
K A
20 1 5
B E
C
Fig.1: the circuit is based on a PIC12F675 microcontroller (IC1), with 4MHz crystal X1 used as the reference clock. Pin 7 of IC1 drives transistor Q1 to flash white LED1 while jumper JP1 sets the strobe frequency to 120Hz or 100Hz.
the circuit, compared to using a separate crystal oscillator and dividers. In addition, the microcontroller makes it easy to incorporate 100Hz and 120Hz operation. IC1 uses a 4MHz crystal as the reference clock for its program to run the strobe. The un-calibrated accuracy of the crystal (typically 50ppm) is sufficiently accurate for the strobe. IC1 internally divides the 4MHz frequency by four, so that the program runs at 1MHz. Single clock instructions of the
program are therefore 1μs in duration. As already noted, the strobe LED is driven with 1ms pulses and this gives a duty cycle of 10% at 100Hz or 12% at 120Hz. This will ensure that the strobe disc markings appear quite sharp. Longer pulse durations will cause noticeable blurring of the strobe pattern as the markings move further during the on-period. This is a distinct advantage of our LED strobe compared to the light from an incandescent lamp powered from a 50Hz or
Designing the strobe disc We have designed our strobe disc to suit 120Hz operation for 33.33 RPM and 45 RPM. We have also provided a strobe band for 78 RPM at 120Hz, but it will produce a speed error of –0.325%. To counter that, we have also provided a 78 RPM strobe band for 100Hz operation and this will have a speed error of –0.1% (close, but no cigar). Mind you, precision speed setting at 78 RPM is not so important because most records from that era were not cut at a precise 78 RPM. Note that there are lots of strobe disc patterns that can be down-loaded from the Internet, but most are incorrect. They may be correct at one speed, say 45 RPM, but incorrect at 33.3 RPM or 78 RPM. As an example, some patterns are designed for 33 RPM, not the correct value of 33.33 RPM. If you already have a strobe disc, how do you check that the pattern is correct? It’s a simple calculation. Just multiply the strobe frequency (100Hz or 120Hz) by 60 to convert to pulses per minute. Then divide the turntable speed in RPM into this number. So 33.33 RPM requires 100 x 60 ÷ 33.33333 or 180 bars for a 100Hz strobe or 216 bars for 120Hz. It’s not possible to obtain a correct pattern for 45 RPM at 50Hz, since the number of bars is not an integral number; it is 133.333. So any card with 133 bars is doomed to error. So, if you want to be sure of the result, use our strobe disc from the Silcon Chip On-line Shop, part number 04101162.
22
Turntable Strobe1215 (MP 1st) – FEB 2017.indd 22
60Hz mains supply, with the resultant display being quite indistinct by comparison. The white LED (LED1) is driven via transistor Q1 and a 68Ω resistor connected to the +5V supply rail. Q1 is switched on/off by the GP0 output of IC1, using a 470Ω base resistor. The LED is driven at a nominal current of 29mA, assuming a 3V drop across the LED. Connector CON2, a 3.5mm jack socket, is provided so that an external LED can be connected. We have provided several options for the power supply: a 9V battery, a 9-12V DC plugpack via CON1 or 5V via a micro-USB ‘B’ socket. If using a 9V battery or a DC supply via CON1, the 78L05 3-terminal regulator (REG1) provides 5V to the micro. Alternatively, if you are using a 5V USB supply, this is fed to the micro via Schottky diode D2. If you intend using a USB power source exclusively, you can omit the other supply components such as CON1, D1, switch S1, REG1 and the 100μF capacitor. For those interested in the effects of the strobe flash length, you can select a 2ms flash duration by tying pin 6 of IC1 to pin 8 using a short piece of wire under the PCB. This will set the strobe to flash for 2ms but it will still run at 100Hz or 120Hz, as selected with JP1. This change needs to be done while power is off. A return to a 1ms flash duration will only occur when pin 6
Everyday Practical Electronics, February 2017
13/12/2016 04:57
Constructional Project TOP OF CASE (NO LID) 12mm
12mm +
13mm
B
A
+
A = 5mm dia. B =- 6mm dia.
TOP OF CASE (NO LID) 24mm
10mm
5mm
C +
+
E C = 6mm dia. D = 9 x 5mm E = 5 x 9mm
10mm
D
9mm +
Fig.2: the two end-panel drilling templates. They can either be copied or downloaded as PDF files from the EPE website.
is disconnected from pin 8 with power switched off and on again. The program checks the GP2 input level and produces the 100Hz strobe signal when this input is high at 5V. It produces a 120Hz signal when the input is low. The GP2 input is pulled high via an internal pull-up resistor in IC1 when JP1 is out and is pulled low when jumper shunt JP1 is inserted. The jumper setting can be altered while the strobe is operating and the strobe frequency will change immediately. Drilling the case The Turntsable Strobe is housed in a UB5 plastic utility box (83 × 54 × 31mm) with holes cut in one end for the LED and the external LED socket (if fitted) and in the other end for the on/ off switch, the DC socket and microUSB socket. It’s necessary to drill and cut the case before installing any parts on the PCB. There are a few options here, though. First, if you will be running the unit from battery power only, then there’s no need to cut holes in the case for the DC socket and the micro-USB socket and these two parts can be left off the PCB. Alternatively, if you will be supplying power via the DC socket or micro-USB socket only, then the battery and on/ off switch can be left out and there’s no need to cut a hole for the switch. You could also leave out either the DC socket or the micro-USB socket, depending on the external supply. At the other end of the case, you can leave out the 3.5mm jack socket if you don’t intend using an external LED.
By the way, the micro-USB input does not have to connect to the USB port on a computer. Any USB output from a 5V plugpack or power board can be used to supply power. Some modern turntables even include a USB port on the turntable plinth. The first job with the case is to remove the internal ribs on each side and this can be done using a small pair of sidecutters. You can then finish off by using a sharp chisel to remove any remaining rib material. The next step is to use the PCB as a template to mark out its three mounting holes in the case. That’s done with the PCB sitting inside the case and pushed hard against two of the side pillars (see photo). The PCB is then removed and the mounting holes drilled to 3mm. Countersink these holes on the outside of the case using an oversize drill. You now have to cut and drill the holes in the end panel and that’s done using the templates shown in Fig.2. These templates can either be copied from the magazine or downloaded in PDF format from the EPE website and printed out. Once you have the templates, cut them to size and attach them to the end panels using adhesive tape. Be sure to attach the correct template to its panel – the template with the two circular holes must go on the end that matches the LED end of the PCB. It’s now just a matter of drilling and cutting the holes in the panels as required. The square cut-outs for the micro-USB socket and switch S1 can be made by drilling a series of small holes in a row, then joining them and filing to the required shape. Note that it’s a good idea to always use a 1mm pilot drill to start the holes (to ensure precise location) and then enlarge them to the required size using successively larger drills. PCB assembly All parts (except the battery) are mounted on a PCB which measures 79 × 31mm and is available from the EPE PCB Service, coded 04101161. Fig.3 shows the parts layout. Begin by soldering the surface-mount micro-USB socket (if used) to the underside of the PCB, then flip the board over and install the resistors on the top side. It a good idea to check each one using a digital multimeter before soldering it into place.
Everyday Practical Electronics, February 2017
Turntable Strobe1215 (MP 1st) – FEB 2017.indd 23
Parts List 1 PCB, available from the EPE PCB Service, coded 04101161, 79 × 31mm 1 set turntable templates (see text) 1 UB5 case, 83 × 54 × 31mm 1 4MHz crystal (X1) 1 DIL8 IC socket 1 SPDT vertical slider switch (S1) 1 2-way header (2.5mm pin spacing) (JP1) 1 pin header shunt 3 6.3mm tapped nylon stand-offs 3 M3 × 5mm countersink head screws 3 M3 × 5mm machine screws 1 Micro-USB type B socket (CON3) (FCI 101035940001LF) (element14.com – Part No. 2293752) 1 PCB-mount DC socket (CON1)* 1 9V battery* 1 9V battery snap connector* Semiconductors 1 PIC12F675-I/P microcontroller programmed with 0410116A. hex (IC1) 1 78L05 regulator (REG1)* 1 5mm white LED (LED1) 1 BC337 NPN transistor (Q1) 1 1N4004 diode (D1)* 1 IN5819 Schottky diode (D2) Optional external LED parts 1 5mm white LED 1 switched stereo 3.5mm PCBmount jack socket (CON2) 1 mono 3.5mm jack plug 1 length of single-cored shielded cable 1 100mm length of heatshrink tubing (1mm and 5mm) Capacitors 1 470µF 16V PC electrolytic 1 100µF 16V PC electrolytic* 1 100nF MKT polyester 2 33pF ceramic Resistors (0.25W, 1%) 1 1kΩ 1 470Ω 2 68Ω *Note: omit DC socket CON1, diode D1, switch S1, the 100µF capacitor, regulator REG1, the 9V battery and the battery snap connector if the unit is to be exclusively powered via the micro USB socket.
23
13/12/2016 04:58
Constructional Project
REG1 78L05
100 µF100nF 470 µF
+
1k
4004
CON1
9V
IC1 PIC12 F675 33pF
4MHz
X1 D1
33pF
+
D2
5819
CON3
68Ω
+
68Ω
S1
JP1 out 100Hz JP1 in 120Hz 04101161 © 2016 revB
Turntable Strobe 470Ω Q1 BC337 JP1
LED1 A WHITE CON2 K
MICRO USB-B T S
+
R
+
FROM 9V BATTERY CLIP
Fig.3: follow these two parts layout diagrams and the photos below to assemble the PCB. The micro-USB socket (CON3) should be soldered to the underside of the PCB first, after which the remaing parts are installed on the top side.
24
Turntable Strobe1215 (MP 1st) – FEB 2017.indd 24
CHIP
Turntable Turntable Strobe Strobe
SILICON SILICON CHIP SILICON CHIP
siliconchip.com.au siliconchip.com.au
CON1, jack socket CON2 and switch S1 are optional. CON1 is required if you are using a 9-12V DC plugpack (ie, one with no USB output) to power the unit, CON2 if you are using an external LED and S1 if you are using battery power. If you are using a DC plugpack to power the unit (via CON1) but will not be fitting a battery, switch S1 can be replaced by a wire link. LED1 is installed by first bending its leads down by 90° exactly 10mm from its plastic body. Make sure that it is correctly oriented before doing this though (the anode lead is the longer of the two). The LED is them mounted with its leads 4mm above the PCB (use
siliconchip.com.au
CHIP CHIP
Follow with diodes D1 and D2, making sure that the 1N5819 is used for D2. Make sure also that D1 and D2 are correctly oriented. The DIL8 socket can be then installed, followed by the 100nF capacitor and the two 33pF ceramic types. Crystal X1, transistor Q1 and REG1 are next on the list, but don’t get Q1 and REG1 mixed up. The two electrolytic capacitors can then go in, along with the 2-way pin header (the header’s shorter pins go into the PCB). Once the header is in place, install the jumper shunt (ie, to short the pins) so that the unit will operate at 120Hz. As explained earlier, DC socket
SILICON SILICON
CHIP
siliconchip.com.au
SILICON siliconchip.com.au siliconchip.com.au
Left: inside the completed unit. The battery and switch S1 can be omitted if the unit is to be powered only via the DC socket or microUSB connector. Similarly, CON2 can be left out if you won’t be using an external LED.
a 4mm-thick spacer to set this height), so that the centre of its lens lines up with the adjacent jack socket. The last part to connect is the battery snap. Feed its leads through the stress relief holes as shown in Fig.3 before soldering them to the PCB. If you intend using an externally connected LED, this can be now wired to a length of single-core shielded cable. Connect the centre lead to the LED’s anode and the shield wire to the cathode.
Turntable Strobe Fig.4: the front panel label can be downloaded as a PDF file from the EPE website.
Everyday Practical Electronics, February 2017
13/12/2016 04:58
Constructional Project
These two views show the completed unit. Note that some of the holes in the end panels can be omitted, depending on the options chosen when you build the unit (see text).
The other end of the cable is then terminated in a 3.5mm jack plug, with the centre lead going to the tip contact and the shield to the outer sleeve contact. Final assembly Now for the final assembly. First, attach three M3 × 6.3mm tapped nylon stand-offs to the PCB mounting holes and secure them using M3 × 5mm machine screws. The PCB assembly is then installed by angling it down into the case so that LED1 and CON2 pass through their respective holes, then squeezing the sides of the case together and pushing the other end of the PCB down until the switch and micro-USB socket go into their panel cut-outs. The PCB is then secured in position using three M3 × 5mm countersinkhead screws which go through the base and into the stand-offs. Once it’s in place, fit the battery snap to the battery and slide the battery into the case as shown in the photo. Testing Now for the smoke test. Apply power and check that there is 5V (4.855.15V) between pins 1 and 8 of IC’s socket (or 4.5-5.2V if using USB power). If this is correct, switch off and install IC1 (watch its orientation),
Dataflex/Datapol Labels (1) For Dataflex labels, go to: www.blanklabels.com.au/index. php?main_page=product_info& cPath=49_60&products_id=335 (2) For Datapol labels go to: www. blanklabels.com.au/index.php? main_page=product_info&cPath =49_55&products_id=326
Fig.4: this screen grab shows the waveform at the GP0 output, pin 1, of IC1. In this case, the circuit is set for 100Hz operation (JP1 out). The LED is lit for 1ms at a 10% duty cycle. Ignore the error of the displayed 100.032Hz, which is because the oscilloscope frequency calibration is not particularly precise.
then reapply power and check that the LED lights. If it does, then your Turntable Strobe is working and you can attach the lid which now becomes the base of the unit. If you now move the unit rapidly from side-to-side with the LED viewed side-on (ie, not looking directly into the lens), it should be seen to light in several different positions. That indicates that the LED is being flashed on and off. By contrast, if you look directly at the LED when it is stationary, it will appear to be continuously lit due to its 120Hz flash rate. Finally, if you have made up an external LED cable, plug it in and check that its LED also operates. Front panel label The front-panel label is available in PDF format on the
Everyday Practical Electronics, February 2017
Turntable Strobe1215 (MP 1st) – FEB 2017.indd 25
EPE website. It’s just a matter of downloading it and printing it out onto an A4-sized synthetic Dataflex or Dataplex sticky label (see panel). This label is then attached to the top of case (ie, not the lid), as shown in the photos. Alternatively, you can print out a paper label and attach this using doublesided tape. That’s it – your Turntable Strobe is ready for use.
25
13/12/2016 04:58
STORE YOUR BACK ISSUES ON CD-ROMS low-cost Precision 10V Dc reference
• CD sound quality • SD card memo • Powe ry red by a single • Colou AA-size r touch lithium-ion -screen with no cell external controls
Burp Cha rge
WIN MICR A dsPIC OC HIP CA 33EV STARN-LIN 5V TE KIT R
Deluxe fan speed controller rGB leD striP DriVer
TeACh-In 2015 – PArT 4
TeaCh-
in 201 5–
PluS
MAY 2015 £4.40
CirCuit Surgery, Net work, audio out, readout, PiC N’ MiX, teChNo talk & PraCtiCally SPeakiNg
es!
half a The first CenTuR Y of Pow 2N3055 50 years of eR the powe
Decoration and illumination with a rainbow of colours
• understand discrete linear circuit design • Learn about noise and distortion
iconic r trans istor
• unde rstand PaRT 5 discrete • learn linear about circuit filters desig and tone controls n
PluS
CirCuit Surgery, teChNo Net work talk & iNterFaCe , audio out, PiC N’ MiX,
JUNE 2015 20/03/2015 10:39:48 Cover
V2.indd
www.epemag.com (go to the UK store) or by phone, fax, email or post
Your Bat teri
Rapid alternate process charge/disc – harge temperatureduces press ure and and increa re build-up in cells, ses effici ency
Precise control without noise or interference
MAY 2015 Cover.indd 1
Order on-line from
TouChauDio SCReen Dig ReCoRD iTal eR – PaR T1
• Perfect for checking DMMs • 10.000V without adjustment • Compact and battery powered • Accurate and affordable
MIC WIN RO A BL PI CH UE C3 ST TO 2 IP AR OT KI TER H T
JUNE 2015
£4.40
1
01/04/2015
VOL 1:
13:08:17
BACK ISSUES – January 1999 to June 1999
Plus some bonus material from Nov and Dec 1998
VOL 2:
BACK ISSUES – July 1999 to December 1999
VOL 3:
BACK ISSUES – January 2000 to June 2000
VOL 4:
BACK ISSUES – July 2000 to December 2000
VOL 5:
BACK ISSUES – January 2001 to June 2001
VOL 6:
BACK ISSUES – July 2001 to December 2001
VOL 7:
BACK ISSUES – January 2002 to June 2002
VOL 8:
BACK ISSUES – July 2002 to December 2002
VOL 9:
BACK ISSUES – January 2003 to June 2003
VOL 10: BACK ISSUES – July 2003 to December 2003 VOL 11: BACK ISSUES – January 2004 to June 2004 VOL 12: BACK ISSUES – July 2004 to December 2004 VOL 13: BACK ISSUES – January 2005 to June 2005 VOL 14: BACK ISSUES – July 2005 to December 2005 VOL 15: BACK ISSUES – January 2006 to June 2006 VOL 16: BACK ISSUES – July 2006 to December 2006 VOL 17: BACK ISSUES – January 2007 to June 2007 VOL 18: BACK ISSUES – July 2007 to December 2007 VOL 19: BACK ISSUES – January 2008 to June 2008 VOL 20: BACK ISSUES – July 2008 to December 2008
ONLY
£219.965.F4OR55 YEAR) (£
d ing VAT an each includ
p&p
VOL 23: BACK ISSUES – January 2010 to June 2010 VOL 24: BACK ISSUES – July 2010 to December 2010 VOL 25: BACK ISSUES – January 2011 to June 2011 VOL 26: BACK ISSUES – July 2011 to December 2011 VOL 27: BACK ISSUES – January 2012 to June 2012 VOL 28: BACK ISSUES – July 2012 to December 2012 VOL 29: BACK ISSUES – January 2013 to June 2013 VOL 30: BACK ISSUES – July 2013 to December 2013 VOL 31: BACK ISSUES – January 2014 to June 2014 VOL 32: BACK ISSUES – July 2014 to December 2014 VOL 33: BACK ISSUES – January 2015 to June 2015
NEW Vol.34
VOL 34: BACK ISSUES – July 2015 to December 2015
VOL 21: BACK ISSUES – January 2009 to June 2009 VOL 22: BACK ISSUES – July 2009 to December 2009
FIVE YEARMs DVD/CD-ROLE NOW AVAILAB
FIVE YEAR CD/DVD-ROMs
NEW No.9
No.1 – Jan ’03 to Dec ’07 No.2 – Jan ’04 to Dec ’08 No.3 – Jan ’05 to Dec ’09 No.4 – Jan ’06 to Dec ’10 No.5 – Jan ’07 to Dec ’11 No.6 – Jan ’08 to Dec ’12
BACK ISSUES DVD/CD-ROM ORDER FORM Please send me the following Back Issue DVD/CD-ROMs. Volume Numbers:. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....................................................... Price £16.45 each, £29.95 for Five Year DVD/CD-ROMs – includes postage to anywhere in the world. Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....... Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Post Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
No.7 – Jan ’09 to Dec ’13
I enclose cheque/P.O./bank draft to the value of £ . . . . . . . . . please charge my Visa/Mastercard £ . . . . . . . . . . . . . . . . . . .
No.8 – Jan ’10 to Dec ’14
Card No. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
No.9 – Jan ’11 to Dec ’15
Card Security Code . . . . . . . . . . (The last 3 digits on or just under the signature strip)
NOTE: These DVD/CD-ROMs are suitable for use on any PC with a DVD/CD-ROM drive. They require Adobe Acrobat Reader (available free from the Internet – www.adobe.com/acrobat)
WHAT IS INCLUDED
All volumes include the EPE Online content of every listed issue. Please note that we are unable to answer technical queries or provide data on articles that are more than five years old. Please also ensure that all components are still available before commencing construction of a project from a back issue.
Back Issues CDs - New copy.indd 53
Valid From . . . . . . . . . . . . . . . . Expiry Date . . . . . . . . . . . . . . . . SEND TO: Everyday Practical Electronics, Wimborne Publishing Ltd., 113 Lynwood Drive, Merley, Wimborne, Dorset BH21 1UU. Tel: 01202 880299. Fax: 01202 843233. E-mail:
[email protected] Payments must be by card or in £ Sterling – cheque or bank draft drawn on a UK bank. Normally posted within seven days of receipt of order.
15/12/2016 10:53
Constructional Project laser cutter software, including AutoCad DXF. We used a 60W CO2 laser operating at full power and at a speed of 8mm/s (10mm/s also works, but we’re being a little conservative to ensure it cuts reliably). The parts are cut from a sheet of acrylic measuring at least 230 × 315mm. The cuts shown in red are done first, in case the sheet isn’t perfectly flat. In this case, if the outer sections were cut first they could shift slightly and then the inner cuts would be less accurately placed. We have optimised the cutting path to eliminate the duplication of overlapping cuts, although typical laser cutters have an extremely high degree of repeatability so this will generally not affect the quality of the end result. The case pieces incorporate holes in the top for the valves and some cooling slots over the power supply. The front panel has holes for the power switch, volume pot, its anti-rotation tab and the two power LEDs, while the rear panel has holes for the input and output RCA sockets and the DC power connector. There are also four screw holes in the top and bottom panels corresponding to holes on the PCB, to hold the whole thing together. If you’re building the musical instrument version of the PCB with the extra panpot (VR2) and mixed output (CON5), we’ll supply a modified version of the cutting diagram with these extra holes. Their locations are shown in Fig.9, relative to the pre-cut holes. Putting it together You will now have the completed PCB, six case pieces (with protective film on both sides) and an assortment of machine screws, tapped spacers and feet (as specified in the parts list last month). Start by removing the two 12AX7 valves (or ‘vacuum tubes’, if you prefer) and set these aside so they won’t get damaged – don’t put them on a surface they might roll off! The bottom, rear and side panels of the case are glued together into one assembly, which screws to the PCB. The top panel is also screwed to the PCB while the front panel is held on by the potentiometer nut(s). The PCB is sandwiched between the top panel and the bottom panel assembly and held in place with screws and spacers. It’s a good idea to check that everything will fit before gluing. Leave
Note: diagram not to scale
Fig.8: the laser cutting pattern used to produce the six pieces for the Stereo Valve Preamplifier case, from a 230 × 315mm piece of 3mm-thick clear acrylic (perspex). The sections shown in red are cut first to maximise precision of the hole placement. Note the cooling slots in the top cover, which go over the power supply circuitry. The prototype lacked an onboard power switch, so a hole has been added to the front panel for the final version (note: diagram not to scale).
the protective film on the case pieces for now, so they don’t get scuffed or dirty – clear acrylic shows fingerprints quite well unfortunately, so you want to avoid getting these on the inside of the case if possible, where they’re hard to clean off. Using Fig.10 as a guide, pass an M3 × 32mm machine screw through a hole in the top panel and screw on one of the
Everyday Practical Electronics, February 2017
Stereo Valve Preamp0216 Pt2 (MP 1st) – FEB 2017.indd 29
shorter spacers. Do it up tight against the underside of the lid, then thread the other spacer on and repeat the procedure for the remaining corners. Next, orient the lid so that the valve socket holes are above the sockets, then push the protruding screw threads through the PCB mounting holes and attach the M3 × 25mm tapped spacers to hold the PCB in place.
29
13/12/2016 05:21
Constructional Project M3 x 32mm MACHINE SCREW
Rear panel
CASE TOP PANEL
25.4mm
( 8.25mm)
25.4mm
2 x 9mm or 1 x 6.3mm & 1 x 12mm TAPPED NYLON SPACERS
50.8mm
PCB
25mm TAPPED SPACER
Front panel 50.8mm 20.32mm
22.86mm
CASE BOTTOM PANEL RUBBER FOOT
Note: diagram not to scale
7.62mm
( 8.25mm)
M3 x 10mm MACHINE SCREW
Fig.9: here’s where to drill the extra holes in the rear panel (for the mixed output RCA socket, CON5) and in the front panel (for panpot VR2) if required
You can then screw the bottom panel on using the remaining 10mm machine screws (no need to fit feet just yet). With the top and bottom panels held rigidly in place, check that the rear panel fits. The RCA sockets will be a relatively tight fit through the holes, but assuming they have been soldered evenly, it should slide into place. Otherwise, you may need to use a tapered reamer to open the holes up slightly. RCA sockets Note that, on our prototype, we used the RCA sockets which are available from the Silicon Chip Online Shop, because it’s hard to find white sockets of this type at the usual retailers. They have a slightly different footprint but will fit on the board with some slight bending of the pins. We mention this because this is likely to affect the height that the sockets sit at, so if you use a different type,
they may not line up with the holes in the case. In that case, you would either need to adjust the RCA socket height by melting the solder joints (tricky) or simply enlarge the panel holes until they fit through. You may find, depending on the exact height of the spacers you have used, that the rear panel will be slightly too tall to fit between the top and bottom panels. In our prototype, it was an almost an exact fit, but spacer lengths can vary slightly. In this case, you may need to add some sort of a shim (eg, a washer or two) somewhere in the spacer stack to increase the gap enough for the panel to fit correctly. Assuming it fits OK, remove the nut from the pot(s) and fit the front panel. This can be held in place temporarily with the potentiometer nut(s). If necessary, reach behind the front panel using small pliers to push the LEDs through their respective holes.
Changing the preamplifier’s gain The circuit as presented last month has a maximum gain of four (12dB). While the output swing is limited by the valve operating conditions, if you have a situation with low-level input signals, you may wish to increase this. This can be achieved by increasing the value of the 10kΩ 1W resistors to the lower left of each valve socket. For example, using a 15kΩ resistor will give a gain of 15kΩ / 3.3kΩ + 1 = 5.5 or 15dB. A 22kΩ resistor will give 22kΩ / 3.3kΩ + 1 = 7.5 or 17.5dB. And a 30kΩ resistor gives a gain of 10 or 20dB. Note that increasing the gain will slightly prejudice the performance by increasing the distortion and reducing the signal-to-noise ratio. Having said that, the performance as specified is sufficiently good that you probably won’t notice the difference.
30
Stereo Valve Preamp0216 Pt2 (MP 1st) – FEB 2017.indd 30
Fig.10: the top panel, bottom panel and PCB are sandwiched together using four sets of machine screws and tapped spacers. This spaces the top and bottom panels the correct distance apart for the front, back and side panels to fit. If they’re too close together, add 3mm inner diameter washers in each stack as spacer shims.
With the front and rear panels in place, it should be possible to slide the side panels into place. Gluing the case Once you’ve confirmed that everything fits, disassemble it and peel the protective film off the pieces. Reassemble the top and bottom halves and the PCB as before, using the screws and tapped spacers, to form a rigid assembly. The parts are glued together using a specialised, solvent-type plastic adhesive formula. We used SciGrip ‘Weld On 16’ fast set clear, medium-bodied solvent cement. This is available from www.multibondsolutions.co.uk With a clean cloth at hand to wipe up any excess, the next step is to glue two pieces of the case together (see below) by applying a moderate amount of the adhesive to all the mating surfaces and then pressing and holding them together. Try to avoid getting any of the adhesive on the faces, especially via your fingers. Start by gluing the rear panel to the base. Make sure it’s pressed in fully until the adhesive sets (this takes a few minutes). You may find that friction holds it in for you, otherwise you may have to hold it. Once it’s nice and rigid, carefully unscrew the base and remove the two panels which are now
Everyday Practical Electronics, February 2017
13/12/2016 05:21
Constructional Project
The rear panel of the case has holes for the RCA stereo input and output sockets and a square cut-out to provide access to the DC power socket. Note the ventilation slots in the top cover above regulator REG1 and MOSFET Q2.
Warning! Voltages of up to 285V DC are present on the PCB when power is applied and whenever the red LED is lit. Never operate this unit without the top cover in place!
joined. You can then glue the two side panels on, again making sure they are pressed in fully before it sets. Don’t use great dollops of glue but don’t be too stingy either. If you’re quick, you can wipe off any excess from the outside with a cloth. Leave this assembly aside for some time (ideally, overnight) before refitting it using the four screws. If you have stick-on rubber feet, stick them on now, otherwise attach screw-on feet using the four mounting screws. That’s what we did on the prototype (see photos). Fitting the front panel All that’s left is to push the front panel in place, ensuring the LEDs pass through the two holes, attach the potentiometer nut and fit the knob. DO NOT glue the front panel or any of the panels to the top cover. If you find the front panel won’t sit flat, it may be that the LEDs are protruding too far and pushing on it. Pressing them carefully
The case is assembled by first fastening the top and bottom panels and the PCB together (see also Fig.10). The rear panel is then glued to the base, after which the base is removed and the remaining panels fitted as detailed in the text. DO NOT glue the front panel or any of the other panels to the top cover.
Everyday Practical Electronics, February 2017
Stereo Valve Preamp0216 Pt2 (MP 1st) – FEB 2017.indd 31
31
13/12/2016 05:21
Constructional Project Improving the bass response A reader has brought to our attention the fact that the circuit, as presented last month, could have a significant amount of bass attenuation when driving a fairly typical power amplifier load impedance of around 10kΩ. This is because the 220nF output coupling capacitor is not quite large enough. Our Audio Precision test equipment has a 100kΩ input impedance and in combination with the 220nF coupling capacitor and 1MΩ onboard bias resistor, this results in a –3dB point of around 8Hz.
www.poscope.com/epe
However, with a 10kΩ load impedance, the –3dB frequency increases by nearly a factor of 10, to 72Hz. We’ve confirmed this by simulating the full preamp circuit. This is not an unrealistic load impedance for a power amplifier. The solution is simple: increase the coupling capacitor value. At the very least, use 470nF 630V capacitors (one in each channel) for a –3dB point of 34Hz for a 10kΩ load. Ideally, though, they should be at least 1μF. The simplest way to achieve this is to use pairs of parallel 470nF capacitors, one on either side of the PCB for each channel. This will yield a –3dB point below 20Hz.
minutes and this may affect performance slightly.
back into the case should fix this. You will need to do this to both LEDs or the result could look strange. It’s now ready to use. Remember that it takes 10-15 seconds each time you power it up before the HT rail rises to its normal level and all the bias voltages stabilise. Until then, you aren’t likely to get much output. Ideally, wait 30 seconds or so after powering up for it to achieve a reasonable level of performance. The valves will continue to warm up for some
Kit of parts Altronics has preparied a kit for this project, Cat. K5192. This complete kit includes the parts required to make the case. However, the case may not be identical to the one described here.
-
USB Ethernet Web server Modbus CNC (Mach3/4) IO
- PWM - Encoders - LCD - Analog inputs - Compact PLC
Reproduced by arrangement with SILICON CHIP magazine 2016. www.siliconchip.com.au
Get the answer Get you’ve the been answer you’ve been looking Get the answer you’vefor been looking for - up to 256 Get the answer you’ve been looking for Get the answer you’ve been microsteps looking for ? PICs
?
?PICs
PICs
Can anyone help ICs? Can Pme? Can anyone help anyone help me? me? Cs? PI
l Generaic s n o tr c le E t a h c l Generaic s Electron chat
me?
Can anyone help me?
Problem sourcing so Problem ftware? sourcing software?
Problem sourcing software?
l Generaic s Electron chat
Can looking for anyone help
Problem sourcing software?
- up to 32 microsteps - 50 V / 6 A - 30 V / 2.5 A - USB configuration - Isolated
Problem sourcing software?
l Generaic s
nl rora cte len GEe chat ics Electron chat
I Can help!
I Can help!
I Can Visthelp! the
I Can help!
I Can help!
EPE Chat Zone
Vist the EPE Chat Zone www.epemag.com
Vist the EPE Vist Chatthe Zone EPE Chat Zone www.epemag.com
32
PoScope Mega1+ PoScope Mega50
- up to 50MS/s - resolution up to 12bit - Lowest power consumption - Smallest and lightest - 7 in 1: Oscilloscope, FFT, X/Y, Recorder, Logic Analyzer, Protocol decoder, Signal generator
Vist the EPE Chatwww.epemag.com Zone Everyday Practical Electronics, February 2017 www.epemag.com
www.epemag.com
Stereo Valve Preamp0216 Pt2 (MP 1st) – FEB 2017.indd 32
13/12/2016 05:22
Explore SENSORS Learn C with hands-on tools that inspire real world applications!
Sensors Explorer Kit • The inexpensive E3mini board can be used to Learn Embedded C on a PIC® MCU. • The Microchip PIC® MCU is the most popular microcontroller for new designs. • Learn about real world interfaces with the included devices.
Learn Embedded C with the most popular microcontroller using real world interfaces
Sensors Included
Accelerometer
Human Touch
Magnetic Field (2)
Sound
Temperature (2)
Humidity
Ultrasonic Range
Rotary Encoder
Vibration
Light
Kit Includes: • E3mini Prototyping Board • 16 Sensors/Devices • Getting Started with C Tutorial • C Compiler • Breadboard and Jumpers
Advanced Options Text Book $59.95 A text book for a formal course in learning C on a microcontroller
E3mini Advanced Accessories Kit $25 Includes GPS, Keypad, and more parts referenced in the textbook
Barometric Pressure
Included Output Devices
Stepper Motor
Generic Relay
Full Color LED
www.ccsinfo.com/epe217
[email protected] | Sales 262.522.6500 Ext 35
CCS Info – FEB 2017.indd 1
When you buy all 3!
Sensors Explorer Kit Text Book E3mini Advanced Accessories Kit
9 $13 Expires: March 31, 2017 Use Discount Code: epe217
15/12/2016 10:48
Constructional Project
High Visibility 6-Digit LED GPS Clock Last month, we introduced our GPS high-visibility 6-digit LED clock. We want to emphasise its main feature: it automatically changes time zones as you travel – is important if you are cruising the world on a yacht or just touring the world. This second article provides all the information you need to build and use the clock.
W
E’RE VERY pleased with this clock because its big, bright display is so eye-catching and can be viewed from quite some distance. It also has quite a few features beyond just displaying the time, as will become apparent when you read the operating instructions below. In Part 1, we mentioned you can use a module with RS-232 signalling but that TTL is preferred. Modules with RS-232 signalling have a bipolar voltage swing on their serial port pins of between ±3V and ±15V. This allows longer cable runs and improves noise immunity. However, with the module only a few centimetres away from the microcontroller this is unnecessary and
34
LED Clock0116 Part 2 (MP 1st) – FEB 2017.indd 34
complicates interfacing. As a result, many GPS modules simply use a 0-3.3V (or thereabouts) swing, ie, TTL levels and the signals are inverted too. You may get a better deal on an RS232 module, and in this case you can simply wire a resistor of say 4.7kΩ10kΩ between the GPS module’s TX line and the clock’s RX pin. The microcontroller’s internal clamp diodes will then limit the applied voltage to a safe level. This works despite the signal inversion because if the clock detects gibberish from the GPS module, it tries inverting the signal level. If that doesn’t work, it will also try various baud rates from 2400 bps up to 115,200 bps with
both inverted and non-inverted sense until it detects valid NMEA data. The most common rates of 4800 and 9600 baud are tried first. By the way, GPS modules are now becoming available with GLONASS support. GLONASS is a GPS competitor built by Russia, and modules which support this will typically work better indoors or in poor signal areas because they have access to more satellites – in other words, they can use both GPS and GLONASS satellites to get a fix. Last month, we mentioned the ublox Neo-6M, available for around US$10.42, but do consider the Neo-7M for around $20, which is very similar to the 6M but with GLONASS support.
Everyday Practical Electronics, February 2017
13/12/2016 05:31
Constructional Project Scale: 1mm on diagram = 3mm (⅓ actual size) 341mm Top (rear) (bottom)
Back
Left
217mm
(rear)
(rear) Bottom
(rear) Front
Part 2 by Nicholas Vinen
Right
(bottom)
Fig.4: this diagram shows how the single sheet of 350 × 225mm (or larger) acrylic is cut up into the six large pieces and six smaller pieces that are then glued together to form the case. Cutting takes about five minutes. The case includes slots for wallhanging and some holes to make the piezo sound louder.
X1 is shorted to the case or some other adjacent metalwork. If a GPS module is detected, the unit will indicate that it is waiting for a position fix by showing ‘GPS’ on the display, along with a progress display. Otherwise, the clock will flash ‘12:00:00’ until you set the date and time (see below for information on how to do this). Assuming it’s working, you can move on to making the case.
Fig.5: the front of the case with the left and right panels already in place and the top and bottom about to be glued. The red shaded areas show where adhesive would need to be applied for the top panel to be glued, although as stated in the text, you could apply adhesive to only the top piece as long it’s applied to all the faces that will contact the shaded ones. Note carefully the hole positions in the four surrounding panels so that you glue them with the correct configuration.
We should point out that like most other modules, both the Neo-6M and Neo-7M come with ceramic patch antennas, but these are external antennas connected via a short cable. This means you could in theory connect it to a larger external antenna. Testing There isn’t much to testing the clock. The simplest method is to power it up briefly. There might be a short delay (of no more than a few seconds) while the supercap charges up, but it should then immediately perform a display
test where each segment on all the digits lights up in turn and then the piezo buzzer will sound a 100ms beep. If that doesn’t happen after a few seconds, switch off and check for faults, such as incorrectly installed components or bad solder joints. You can also check that the output voltages of REG1, REG2 and REG3 are correct. After the test procedure, IC1 will fire up its 32kHz oscillator. If you get the digit test but nothing else, check for the presence of the 32kHz signal on pin 11 of IC1. If that’s missing, it may be that one of the leads of crystal
Everyday Practical Electronics, February 2017
LED Clock0116 Part 2 (MP 1st) – FEB 2017.indd 35
Assembling the case The case is made from a single piece of clear or tinted acrylic which starts out at 350 × 225mm and is laser-cut into six large pieces plus a number of smaller pieces, which are then glued together. The back is not glued on; it’s held with four self-tapping screws so that it can be removed to allow access to the PCB module for maintenance. The cutting pattern is shown in Fig.4. If you have a laser cutter, or access to one, you can download this pattern from the EPE website in DXF or SVG format and cut it yourself. With a 50W laser, we used settings of 8mm/ second at 80% power. Pre-cut case kits are available form the Silicon Chip On-line Shop – see Parts List last month – together with the PCBs, programmed microcontrollers and some of the 7-segment displays. You can use clear acrylic, as shown on our prototype or acrylic tinted with a colour that matches the displays (ie, green, blue, red). You will see more of
35
13/12/2016 05:31
Constructional Project
This view shows the completed clock PCB from the rear. The PCB is held in position by the two small centre pieces that mount at right angles to the rear panel (see Fig.6).
the workings of the clock with the clear case, but the tinted case may provide better contrast for the display. The clear case is suited to any display colour whereas a tinted case will need to match the display colour used. The case is glued using a special solvent-based adhesive that makes very strong bonds between pieces of acrylic. You could use cyanoacrylate (super glue) in a pinch but we can’t guarantee that the result would last. We used SciGrip Weld-On 16, fastsetting ‘clear, medium-bodied solvent cement’. It states on the label that it’s suited for butyrate, polycarbonate, styrene and acrylics. You are unlikely to find this adhesive in a shop, so go to: www.multibondsolutions.co.uk This forms a strong bond quickly, so you only have about a minute to apply the adhesive to the pieces to be mated, press them together and get them lined up properly. Full strength is achieved after about 24 hours, but it sets well enough to manipulate the pieces after about 10-15 minutes. The bond is clear but you don’t want to get excess adhesive on the material as it will affect the surface finish and you definitely don’t want to drip it on the front face. It tends to get a bit ‘stringy’ (sort of like melted mozzarella) after coming in contact with the acrylic. Keep a clean (disposable) rag on hand to mop up any excess adhesive. Also make sure you have a large, clean, flat surface to lay the pieces down on, eg, lay down some sheets of plain paper on your workbench.
36
LED Clock0116 Part 2 (MP 1st) – FEB 2017.indd 36
Gluing the pieces The front section (ie, where the display will be seen) can be identified by the four 5mm holes for the colon LEDs. Four more sections are glued to this to form an open box. These sections must be fitted with a specific orientation so before gluing them, put them together loosely to make sure you have the right pieces and understand the required orientations. Start the assembly by gluing the top, bottom and side pieces to the front panel, as shown in Fig.5. Note that the front panel does not have mirror symmetry, so be sure to orient it so that the LED colons will slant in the correct direction. The other pieces can then be laid out around the front panel in the correct orientations before you start gluing any pieces. That done, start with one of the smaller left or right end panels. When gluing these pieces, you will need to coat all the mating surfaces with a decent amount of adhesive to make sure the bonds are good. An example is shown in Fig.5 for gluing the top panel; the areas shaded red are where adhesive would need to be applied, assuming the left and right panels were already in place. Note that you could coat just the surfaces of the panel being introduced to the assembly each time – you would need to apply adhesive to those surfaces which would mate with the red surfaces shown on the other pieces (which would have been difficult to depict from this angle).
Glue the first panel, then wait a few minutes for the adhesive to make a decent bond before moving on to one of the adjoining panels. Repeat until all four sides are in place, then quickly drop the rear panel into place (being careful not to get any glue on it) to check that everything is nice and square and nothing will foul the rear panel once the adhesive finishes curing. The next step is to glue six small pieces to the rear panel, as shown in Fig.6. The trick is to use enough adhesive to give a good strong bond without the excess spreading out too much. You also need to be careful to make sure each piece is glued exactly perpendicular to the rear panel. Check that the four pieces which have holes in them are not angled out towards the edge of the panel, as they must slot inside the top and bottom pieces of the case. You can check this once the six pieces are in place and the adhesive has started to set; gently drop the rear panel into place and then remove to set. It’s best to leave the pieces overnight so the bonds achieve full strength. You can then introduce the PCB assembly into the case. Hold it at an angle and slide the DC socket and pushbutton into one side of the case, then rotate it until the 7-segment displays rest on the inside of the front panel. The rear panel can then be attached using four 4GA self-tapping screws through the holes in the top and bottom that bite into the parts glued into the rear panel earlier. The basic idea behind this is illustrated in Fig.7.
Everyday Practical Electronics, February 2017
13/12/2016 05:31
Constructional Project
Reproduced by arrangement with SILICON CHIP magazine 2016. www.siliconchip.com.au
For desk use, fit a small rubber foot to each corner at the bottom. For wall mounting, two screws placed 200mm apart will fit into the slots on the back. The heads must be between 4mm and 9.5mm in diameter. Most small wood screws should fit; check before screwing them into the wall. Don’t hang it until the adhesive has achieved full strength. LDR calibration Once the unit is in place and powered up, calibrating the LDR is simple. Shine a bright light on the LDR for a few seconds (eg, a torch), then cover the unit up for a few seconds (eg, with a pillow case) to block out all light – or simply place it in a dark room and turn the lights off. The unit will automatically record the highest and lowest values read and adjust its calibration to suit. GPS time acquisition If there is no GPS module fitted, by default the unit will power up showing a flashing ‘12:00:00’ display, waiting for the time and date to be set, as explained below. However, if a GPS unit is detected, the display will change to ‘GPS 00’. As satellites are picked up, the number will be updated to show how many are ‘seen’. If the unit has a 1PPS output, the decimal point after ‘GPS’ will flash in time with it, until a GPS lock is acquired. Once the unit has a GPS fix (latitute/ longitude), the display will change to ‘GPS FI’. It will then wait to receive
Fig.6: the six smaller pieces are glued into the rear panel. Be sure to use sufficient adhesive to form strong bonds. The four upper and lower pieces with holes are used to hold the back onto the case and by extension hold the case and whole assembly to the wall. The two smaller pieces glued in the middle press the PCB assembly up against the front of the case. The rear panel is symmetrical so the parts can be glued to either side as long as they’re all on the same side.
Fig.7: this shows the two halves of the case being put together. Machine screws are shown, but we recommend you use No.4 self-tapping screws. Be gentle when cutting the threads initially; if any of the smaller pieces break off during this process you will have to re-glue them and wait for the adhesive to set again.
valid date/time information, at which point the display will change to ‘GPS SE’ as it searches for valid time zone data based on that information. Once the data is found, the display will change to show the local time. If GPS fix is lost, the unit will fall back on its 32.768kHz crystal for timekeeping. After several minutes, the display will start pulsating (ie, varying in brightness over time) to indicate that it is no longer 100% accurate. If a GPS fix is re-acquired, the time is updated and it stops pulsating. Setting up the IR remote By default, the clock is set to respond to infrared remote commands from an Altronics/DynaLink A1012 learning remote on TV code 170. Fig.8 shows the
Everyday Practical Electronics, February 2017
LED Clock0116 Part 2 (MP 1st) – FEB 2017.indd 37
default mapping. The various functions indicated are described below. We’ve chosen this remote because it’s relatively inexpensive, easy to get, looks good and has all the buttons needed for this project. Having said that, just about any universal remote control can be used, including Jaycar’s Cat. AR1719. Whichever remote you use, it just needs to be set up to produce Philips RC5 or NEC-compatible infrared commands. To check this, point the remote at the clock and press the buttons. You may need to guess at some appropriate code settings first (eg, Philips TVs). Check the manual supplied with the remote. If it’s producing commands that the clock can receive, the last decimal
37
13/12/2016 05:31
Constructional Project ESCAPE/ EXIT MENU
SHOW DATE
ESCAPE
DATED
CNTUP START TIMER (COUNT UP) START TIMER (COUNT DOWN)
CNTDN
TV
SAT
CD
VCR
DVD
AUX
1
2
3
4
5
6
7
8
9
AV
0
-/--
+
CH SET VOL
+
ENTER TIMES & NUMBERS NUM NUM NUM NUM NUM
0, 2, 4, 6, 8,
NUM NUM NUM NUM NUM
1, 3, 5, 7, 9
ADJUST BRIGHTNESS BRI UP, BRI DN
NAVIGATE MENU, MOVE CURSOR
ENTER MENU, SELECT ITEM
UP, DOWN, LEFT, RIGHT
SELECT
OK LEARN
MENU
ALA ON TURN ALARMS ON/OFF
TIMER PAUSE TIPAU
DISPON DISPLAY ON/OFF
EXIT
TIMER LOSE ONE MINUTE TISUB
TIMER SPLIT/LAP TILAP TIMER ADD ONE MINUTE TIADD
TIMER RESUME TIRES
DYNALINK
Fig.8: the default button mapping on the Altronics DynaLink A1012 remote control set to TV code 170. Other remotes can be used, but you may have to program the button codes into the clock, as described in the text. If so, use this as a guide as to which buttons to map to which functions. The button function names displayed on the clock during set-up are shown in blue on this diagram.
point on the display will flash. While many different modes will produce some valid commands, you may need to try several different codes before you find one where all the buttons you need actually work. Refer to Fig.8 for guidance, but note that the button mapping for your remote doesn’t need to match exactly (ie, your remote may not have an identical button layout). Once you have decided which remote to use and the setting to use it on, power up the clock and put it in IR set-up mode by holding down the buttons on either side of the clock simultaneously for several seconds. The display will show ‘IR SET’. Release the buttons, then press the right-side button to continue.
38
LED Clock0116 Part 2 (MP 1st) – FEB 2017.indd 38
The display will flash ‘NUM 0’, indicating the button code that is to be set. Hold down the ‘0’ button on your remote control for a second or two. It will then briefly show the remote code received and then the display will switch to flashing ‘NUM 1’. Repeat this procedure for the remaining buttons. The codes corresponding to each button are shown in Fig.8. If at any point you make a mistake, you can go back and reset the previous button code by pressing the lefthand pushbutton on the clock. If you don’t want to assign a button to an IR code, press the righthand pushbutton to skip that one. Once you have set all the codes, ‘IR FIN’ will be shown. You can then press the right-hand button on the clock to go back to normal operation or the left button if you need to change a code first. If necessary, buttons can be re-assigned later, using the ‘CHANGE’ option in the ‘IR’ menu. Menu operation is described below. Setting the time and date This is only necessary if you haven’t fitted a GPS module. Press the OK button on the remote control and then press the down button until the display shows ‘SETDA’. Press OK; the display will then show ‘010116’ representing 1st January 2016 (assuming your date format is set to the default of DDMMYY). Use the keypad on the remote control to enter the correct date then press the select button. You can then go back into the menu and select ‘SETTI’. It will change to show ‘000000’ representing midnight (HHMMSS). Check the current time, then enter what the time will be in a minute or two, in 24-hour notation using the keypad – but don’t put in the last digit yet. Do that the instant that the reference clock matches the time entered. This same procedure can be used to change the time or date at a later stage. Note that you can also use the up/ down/left/right arrows to change the time and date; however, it’s easier to use the numeric buttons. If necessary, you can set the time and date without a remote; see the ‘Operating without a remote’ section below. If you want the clock to make daylight saving time (DST) changes automatically without a GPS module, you will also need to tell it which time zone you are in. This can be done
before or after setting the time. Press the OK button on the remote control and then press the down button until the display shows ‘SETTZ’. Press OK, then refer to Table 1 and choose the appropriate zone using the up/down. Press OK to confirm. The default is ‘NONE’, in which case no time zone calculations are done. If a time zone is selected which has no DST rules (as per Table 1), this will not have any obvious effect, except that changing to a different time zone will then change the time to suit that location. If a time zone with daylight savings rules is selected, those rules will be obeyed and the clock will automatically change the displayed time when appropriate. It’s possible to override the DST rules, should they change after this article is published, or if an error is found; we explain how to do that later in this article. Showing the date Once set, the clock normally displays the time. The date can be shown with a quick press of either button on the clock itself or by pressing the show date button (usually mute) on the remote control. It will be displayed for five seconds with decimal points separating the day/month/year, then the unit will switch back to time display. Display brightness Hold down the volume+ or volume– buttons on the remote control to vary the display brightness. Auto-dimming continues to operate, if configured. For example, if you’ve set the brightness to 50% and the auto-dim is at 50% then the overall display brightness will be 25% of maximum. Menu system The time setting description above involved entering the menu to access the ‘SETDA’, ‘SETTI’ and ‘SETTZ’ options. The full menu tree is shown in Fig.9. The top level menu, shown in the blue boxes at the left, is accessed by pressing the OK button on the remote (or via the pushbuttons, as described later). Up and down scroll through the list. Each additional ‘level’ of the menu is shown in a different colour and is accessed by pressing OK on its ‘parent’ entry. Similarly, pressing the escape button (normally the power on/ off button on the remote) will take you back up to the parent menu or back to the time
Everyday Practical Electronics, February 2017
13/12/2016 05:32
Constructional Project
(Mon-Fri) (Sat,Sun)
ALARM
ALA ON
global on/off OPTS
24 HR
MON
TUE
WED
DISP Show received IR codes
PM
LZB
CHANGE
SAT
WD
SUN
COL
DDMYY
XTAL
DIM
Set colon on/off/ flash or decimal point on/flash
Set date format
32kHz trim set
BRIGHT
NUM 1
Set IR code
ULIM LLIM
Set IR code Set IR code
NUM 0
DISPON
SETDA (no GPS)
FRI
WD WE
WD ALL
on/ set on/ set on/ set on/ set on/ set on/ set on/ set on/ set on/ set on/ set off off off off off off off off off off
12/24 AM/PM Leading hour decimal zero mode point blanking select on/off IR
THU
MINBR
PIEZO Set manual brightness % Set LDR upper limit % Set LDR lower limit % Set dimming mininmum brightness %
DURA HZ DUTY CADENC
Set alarm buzzer duration Set alarm buzzer pulse rate Set alarm buzzer duty cycle Set alarm buzzer cadence
Use up/down buttons to cycle through menu items; OK/Enter (SELECT) to descent into sub-menus or select current menu item; power/standby (ESCAPE) button to return to previous menu or exit.
Set date CURTZ
CHA TZ (GPS)
TZNAM
LATIT
LONGIT
N SAT
OFFSET
DAYDEL
DAYRUL
Show Show Show Show Show Show/set Show/set Show/set detected detected latitude longitude number time zone DST DST rules timezone timezone from GPS from GPS satellites offset in delta in (refer to ID name receiver receiver detected hh:mm minutes Table 1) SETTI (no GPS)
Set time
STAMO STAWE STADAY STA HR ENDMO ENDWE ENDDAY END HR DSMOD Set time Show/set Show/set Show/set Show/set Show/set Show/set Show/set Show/set Show/set DST DST DST DST DST DST DST DST DST zone start start start end end end end mode (from Table 1 start week day hour month week day hour or auto.) month
CHADST (GPS) SETTZ
Fig.9: this shows the complete menu tree for the clock. The main menu is shown in blue on the left; two of the options vary depending on whether a GPS module has been detected or not. Sub-menu options are shown in mauve with their sub-menus shown in green. Pressing the OK/select button activates the function indicated for each menu item, allowing that parameter to be viewed or set. The escape (on/off) button goes out of the current menu and back to the parent, or in the case of the main menu, back to the regular time display.
display, if viewing the top level menu. Below, we’ll go through the remaining menu items and explain what they do, as well as detailing other clock functions accessed by different buttons on the remote. Operating without a remote The menu system can also be accessed without a remote, using the unit’s pushbuttons. Hold down the right pushbutton for at least one second and release it to enter the menu. Pressing the left button is then equivalent to the up button on the remote; pressing the right button is equivalent to down. These then let you scroll through the menus. To escape from a menu, hold down the left button for at least one second and release. To select an item, hold down the right pushbutton for at least one second and release. When you
need to enter a numeric value (eg, setting the time), short presses of each button will increment or decrement the currently selected digit. Holding down the right button for at least one second will cycle to the next digit. Holding down the left button for at least one second will save changes and return to the previous menu item. Holding down both buttons together and then releasing will abort changing that value. In this manner, you can operate the menus without the remote. The buttons can also be used to show the date. However, note that many other functions are not available without a remote, such as timer modes and so on. Basically, the unit is designed to be used with a remote and the button functions are a fall-back, primarily intended for applications where it’s used purely as a clock.
Everyday Practical Electronics, February 2017
LED Clock0116 Part 2 (MP 1st) – FEB 2017.indd 39
Setting the alarm Normally, the right-most decimal point on the clock shows the global alarm status. If on, the alarm is set to go off at least once in the coming week. It’s dim if there is no alarm set in the next 24 hours or bright if there is. To set the alarm, enter the ALARM menu. You will see either ‘ALA ON’ or ‘ALAOFF’, indicating the global alarm on/off status. Press either OK or the record (ALA ON) button on the remote to toggle it. The ALA ON button will also work when the clock is showing the time, as a quick and easy way to enable or disable the alarm. Cycle through the next seven menu entries to turn the alarm on or off for an individual day, or set the time for that day (in 24-hour format). The record button is used to toggle that day’s on/ off status, while select can be pressed
39
13/12/2016 05:32
Constructional Project
Fig.10(a-d): this series of images shows the complete global land mass coverage of the time zone data programmed into the clock. There are 128 separate shaded areas, mapped to 73 different time zones, each with different UTC/GMT offsets and daylight savings rules. Note that many zones overlap, which has been done to reduce the compressed size of the data set; see text for more details.
to set the alarm time, similarly to the way the clock’s own time is set as described above. You will also find menu entries for ‘WD’ (weekdays), ‘WE’ (weekend days) and ‘ALL’. Changing the on/off status or time for any of these entries affects multiple alarms, ie, Monday-Friday for ‘WD’, Saturday-Sunday for ‘WE’ and Monday-Sunday for ‘ALL’. They can still be individually changed after that. When finished setting alarm times, keep pressing on/off to exit the menus and return to the clock display. When the alarm goes off, briefly press either pushbutton or the Escape button on the remote for a 5-minute snooze. A long (1s+) press of either pushbutton or a second press of the Escape button will cancel it altogether. Using the clock as a timer The clock can count time upwards starting at zero (eg, to measure how long something takes) or downwards to zero (eg, to alert you when a certain amount of time has passed). It also has stopwatch type functions such as a lap counter. It counts with 1/100thsecond resolution for times less than one hour, 1/10th-second resolution up to 10 hours, one-second resolution for up to 100 hours and with furtherreduced resolution up to 1000 days. Since infrared commands normally take the same amount of time to transmit, receive and decode, the timing should be pretty accurate, to within a few hundredths of a second. However, since there’s no guarantee an infrared command will be received without corruption, you will need to hold down the button to start the timer reliably, which could result in
40
LED Clock0116 Part 2 (MP 1st) – FEB 2017.indd 40
it sometimes being off by a fraction of a second. There are three basic modes: count up with no limit, count up until a specific time is reached, or count down from a specific time to zero. When the limit is reached (either counting up or counting down), the piezo buzzer sounds, although this can be turned off if desired. Counting can be paused and the counter can have one minute added or subtracted while it’s running. Starting the timer Press the channel+ button and the timer will start counting up from zero. You can tell the timer and not the clock is running since the colon LEDs switch off and the decimal points flash instead. Press the pause button to pause the timer; the display will freeze and flash. Press the play button to resume. If you press the stop button, the display will freeze and flash but it will show the time for the last lap; ie, since the timer started for the first lap, or since the last time you pressed this button for subsequent laps. Press the play button to go back to the normal timer display. Pressing fast forward or rewind will add or subtract one minute from the displayed time. Hold down the on/off button for a second or so to abort timer mode and go back to the normal clock display. If you want to count up to a specific time, press one of the numeric buttons or up/down immediately after pressing channel+ (within a few seconds). Enter the time to count up to (in a similar manner to setting the time), with a maximum of 23 hours, 59 minutes and 59 seconds. Once you’ve entered the time, press select to start counting.
In this mode, the fast forward and rewind buttons change the target time by one minute; it will be briefly displayed when they are pressed, then it will go back to showing the timer. Also, when counting up to a target time, the last decimal point on the display indicates whether the buzzer will sound when the target is reached (by default, it’s on). Press the record (alarm on/off) button on the remote to toggle it while in this mode. Press the channel– (CNTDN) button to initiate counting down. The procedure is essentially identical to counting up, except that you are always prompted to set the initial time, using the same method as described above. Essentially, this mode is identical to counting up towards a target time, except for the fact that the timer starts at the set time instead and counts down to zero. Changing options There are a number of options which can be changed through the ‘OPTS’ menu. Once an option is displayed, use the OK button to change it. Numeric values can be changed using the up/down/left/right buttons or, in some cases, the numeric keypad on the remote. The options are as follows. (1) 12/24-hour time Display shows either ‘12 HRS’ or ‘24 HRS’. Hours are shown as 01-12 in 12hour mode or 00-23 in 24-hour mode. (2) Leading-zero blanking Display shows either ‘LZB ON’ or ‘LZBOFF’. Press select to toggle between them. Applies only to the first digit on the display, ie, 3pm will be shown as
Everyday Practical Electronics, February 2017
13/12/2016 05:32
Constructional Project
‘3:00:00’ with leading zero blanking enabled or ‘03:00:00’ with it disabled. This would normally be disabled in 24-hour mode, but you can enable it. (3) Hours/minutes/seconds separator in time display There are five options: ‘COLFLA’ (colons flash at 1Hz; default), ‘COL ON’ (colons on permanently), ‘COLOFF’ (colons off permanently), ‘DP ON’, (decimal points on instead of colons) and ‘DP FLA’ (decimal points flash instead). (4) Dimming sub-menu Each entry allows you to set a value between 0% and 100%. ‘BRIGHT’ is the current manually displayed brightness setting. It also changes when the volume+ and volume– buttons are pressed. ‘ULIM’ is the percentage of ambient brightness where the display starts to dim automatically. For example, if set to the default of 75%, the display will be at full brightness between 75% and 100% ambient, but will dim below 75% ambient. Set it to 0% to disable auto-dimming. ‘LLIM’ is the percentage of ambient brightness where the display reaches minimum brightness. It will not dim further as the ambient light level falls below. The default is 10%. ‘MINBR’ is the display brightness achieved at the lower ambient limit. Setting this to zero means the display will turn off entirely at the lower ambient limit. The default is 25%. (5) Piezo buzzer sub-menu This determines the sound the piezo makes when the alarm goes off or the timer expires. The duration setting is from 0-900 seconds (0 seconds = off, default = 10s).
Hz indicates the frequency of the pulses from the piezo between 1 and 10Hz (default = 2Hz). Duty is the duty cycle from 1-100% (default = 50%). Each of these can be set by pressing select, then either up/down or using the numeric buttons to enter a value. Cadence lets you enter three pairs of duration/pause values as a 6-digit number. The default is 100000, which gives an even series of pulses from the piezo at the selected frequency but, for example, a setting of 113200, in combination with a 2Hz frequency, would give a 0.5s beep, followed by a 0.5s pause, followed by a 1.5s beep, followed by a 1s pause, with this pattern repeating. (6) Date format This defaults to ‘DDMYY’ as is used in the UK. The other options are ‘MDDYY’ or ‘YYMDD’; affects both date display and setting. Changing infrared codes The infrared menu, labelled ‘IR’ has two sub-menu options: ‘DISP’ and ‘CHANGE’. If ‘DISP’ is selected, the unit shows the Philips RC5 or NEC code for any button pressed on the remote. Press either pushbutton on the clock itself to exit this mode. If ‘CHANGE’ is selected, you can then select any of the remote button functions (as shown in Fig.8) using up and down and re-program it by pressing OK. The procedure is similar to that described in the initial setup above. Use the left pushbutton on the clock to abort and leave that code as it is, or the right pushbutton to deassign the existing infrared code for that button and disable it (until a new code is set). Time zone/daylight saving data As mentioned last month, the clock incorporates geographic data, time zone data and daylight saving data, which allows it to determine the correct local time virtually anywhere on Earth’s land mass with just the output of a GPS module. The geographic data is shown in Fig.10, plotted on top of the Earth’s surface. Each coloured region represents a different time zone. You may notice that many of the boundaries seem rather sloppy; this is done on purpose as borders defined with fewer points take up less flash memory. Basically, where two time zones meet (eg, at the border of two
Everyday Practical Electronics, February 2017
LED Clock0116 Part 2 (MP 1st) – FEB 2017.indd 41
Last-minute extras (1) To calibrate the 32kHz crystal, set the XTAL menu option to between –512 (260ppm slower than default) and +511 (260ppm faster). This is adjusted automatically when a GPS module with a 1pps output is used. (2) The unit can show the day of the week. Simply activate the date display function, then press the same button again. (3) A new menu item, ‘GPSLCK’, has been added to the options menu. If set to ‘IGNORE’, the unit will use GPS time even if the satellite fix is not perfect. This will allow the unit to work in marginal signal areas, although time accuracy may not be quite as good. (4) A new brightness menu item, ‘CUR RD’, shows the minimum/current/maximum raw LDR readings in 8-bit hexadecimal notation. The fourth digit decimal point lights when the data is going to be saved to Flash memory and goes out once it’s saved. This can be used to troubleshoot the autodim function.
countries), we accurately define one border, which is often defined by a river or mountain range and thus has many wiggles – often requiring thousands of co-ordinates to define. When we check whether your current location is within that time zone with the well-defined border, and the result is a negative, we don’t need the border for the adjoining zone to be defined with such precision since we already know that if you are near the border, you are on the other side of it, by a process of exclusion. As you can see, the data involved is substantial and it takes up about 150KB, even after a specially designed compression algorithm has been applied. If you’re interested in more details, see the panel on pages 28 and 29 of the February 2016 issue of EPE. Time zone data updates We’ve made a substantial effort to provide up-to-date time zone geographical data and daylight savings rules in the firmware for the clock. However, the rules are very complex and vary drastically between different locations. They also change over time, so we decided there needed to be a way to keep the rules up-to-date, at least for the locations that constructors occupy.
41
13/12/2016 05:32
Constructional Project Display
Table 1: Time zones and DST rules Details Offset
DST Rules
AU EAS AU QLD AU SA AU NT AU WA AU EUC AU LHI AU COC AUMAC NZ NZ NZ CHA INTHAI JAPKOR FIJI USA HI USA AK NA WE NA MO ARIZON NA CEN NA EAS ASAMO SA BOL CAN NL CAN NB PERU CAN SK EUWES EU IS EU UK EU EAS EUMOS AS NKO AS BAN AS NEP RUWES AFMOR AF ALG AF LIB AF EGY AFNAM AF AZO AFMAU IRAN AFGHAN ISRAEL GAZA S JORLEB SA SEB SA NEB SA PAR BRAZIL SA URA SA VEN MEXBJC MEX W MEX YU MEX EA RU EAS GEORGI INDIAS MONGO GRQAAN GREENL ATLSSI PA BAK PASAM PA TON PA KIR FR PON PAMAR PAGAM
NSW, Vic, Tas Queensland, PNG South Australia Northern Territory Western Australia Eucla Lord Howe Island Cocos Islands Macquarie Island New Zealand Chatham Island Indonesia/Thailand Japan/Korea/Palau Fiji Hawaii Alaska USA/Canada West USA Mountain Arizona USA Central USA Eastern American Samoa Bolivia, Eastern Quebec Newfoundland New Brunswick Peru, Ecuador, etc Saskatchewan Western Europe Iceland United Kingdom Eastern Europe Moscow North Korea Bangladesh Nepal Western Russia Morocco Algeria, Tunisia Libya Egypt Namibia Azores Mauritius Iran Afghanistan Israel Gaza Strip/West Bank Jordan, Lebanon South-east Brazil North-east Brazil Paraguay Rest of Brazil Uruguay Venezuela Baja California Western Mexico Yucatan Eastern Mexico Eastern Russia Georgia, Armenia India, Sri Lanka Mongolia Qaanaaq, Greenland Greenland S. Sandwich Islands Baker Island Samoa Tonga, Tokelau Kiribati, Line Islands French Polynesia Marquesas Islands Gambier Islands
AUST AUST AUST AUST (+30) NZ NZ FIJI NTHAM NTHAM NTHAM NTHAM NTHAM NTHAM NTHAM NTHAM EURO EURO EURO MOROC EGYPT NAMIB EURO IRAN ISRAEL PALEST MIDEA BRAZIL PARAGU BRAZIL URUGUA MEXIC MEXIC MEXIC MEXIC EURO MONGO MEXIC GRNLND SAMOA -
42
LED Clock0116 Part 2 (MP 1st) – FEB 2017.indd 42
+1000 +1000 +0930 +0930 +0800 +0845 +1030 +0630 +1100 +1200 +1245 +0700 +0900 +1200 -1000 -0900 -0800 -0700 -0700 -0600 -0500 -1100 -0400 -0330 -0400 -0500 -0600 +0100 +0000 +0000 +0200 +0300 +0830 +0600 +0545 +0500 +0000 +0100 +0200 +0200 +0100 -0100 +0400 +0330 +0430 +0200 +0200 +0200 -0300 -0300 -0400 -0400 -0300 -0430 -0800 -0700 -0500 -0600 +1200 +0400 +0530 +0800 -0400 -0300 -0200 -1200 +1300 +1300 +1400 -1000 -0930 -0900
As a result, the clock has the facility for you to change the rules for your current location. Updates are stored in the same section of Flash memory as the clock options are kept and override the built-in rules. There are three basic parameters for each location that can be changed: offset from UTC (in hours and minutes), daylight savings time shift (+0, +30 or +60 minutes) and daylight savings rules. The menus that provide these options also offer some information regarding the currently detected time zone and GPS module status. There are 19 different sets of daylight savings rules, listed in Table 1 under ‘DST Rules’. Table 1 also shows which set of rules is used by default in each location. The time zone menu allows you to change the setting for your current location to one of the other rules, including disabling daylight saving for a zone which previously used it, or enabling it for one which did not. To change these options for your location, go into the ‘CHA TZ’ menu (which appears when the unit has a GPS fix). The first five menu items simply show information; press OK to display that particular parameter and then escape (on/off) to go back to the menu. Of the remaining three, ‘OFFSET’ allows you to change the difference in hours and minutes between UTC/GMT and your time zone. This can be set anywhere from 22 hours before UTC to 22 hours after UTC in 15 minute intervals, although few locations use offsets of more than 12 hours from UTC. ‘DAYDEL’ allows you to select how much the time changes when daylight saving starts and ends. This will almost always be one hour (60 minutes) although there is one location, Lord Howe Island, which has a half hour (30 minute) DST delta. To disable daylight saving in your location, you can either set this to zero or change the DST rule to ‘NONE’. ‘DAYRUL’ allows you to select the DST rules for your location. These rules define which hour of which day DST starts and ends in a given year. Changing DST rules Since these rules can also change, there is a separate menu called ‘CHADST’ to change them. There are nine DST settings for each rule, represented by nine menu items, of which four define when it starts and four when it ends. The ninth determines how these are interpreted. The most common mode, used by the vast majority of locations, is ‘HDWM’ which stands for ‘hour, day, week of month’. For example, in Australia at the time of writing, daylight saving starts at 2am on the first Sunday of October and ends at 2am (3am DST) on the first Sunday of April. So in this case, the mode is HWDM and the following rules are used: STAMO: 10 OCT STAWE: 1ST STADAY: SUN STAHR: 2
FINMO: 04 APR FINWE: 1ST FINDAY: SUN FINHR: 2
(In this menu, the hour values always refer to the time before daylight saving is applied, hence FINHR is 2, not 3). The following countries use different modes. Iran uses ‘EQUINO’ where DST start/end dates are relative to the spring and autumn equinoxes. Brazil uses ‘NOCARN’ which is identical to HDWM except that DST changes are delayed by one week if they fall during Carnaval. Similarly, ‘NORAM’ delays DST changes if they fall during Ramadan and likewise ‘NOROSH’ delays DST changes if they fall during Rosh Hashana.
Everyday Practical Electronics, February 2017
13/12/2016 05:33
Meet the mighty
Micromite Part 1: Introduction
The Micromite is an amazing device. A low-cost microcontroller programmed in a Microsoftcompatible version of BASIC with floating point, arrays and extensive string handling. The Micromite can interface to a variety of devices including touch-sensitive LCD panels and a host of sensors for temperature, Overview The Micromite is based on the Microchip PIC32MX170 microcontroller. This is a powerful 32-bit device, which runs at 48MHz and has plenty of memory for programs and data. The Micromite firmware is free and the chip does not cost much (about £2) so the investment to get started is small. The firmware will run on two versions of the PIC32; a 28pin dual-in-line package (DIP) which can be easily soldered or plugged into an IC socket, and a 44-pin package which is surface mount with a reasonably easyto-solder pitch of 0.65mm. Despite its low cost, the Micromite does not scrimp on features. The BASIC interpreter (called MMBasic) is Microsoft compatible with a number of modern extensions. Variables can be either singleprecision floating point, 64-bit integers or strings up to 255 characters long. You can have arrays of these types with up to 8 dimensions, and with 50KB of RAM you have plenty of space to generate large arrays. The names of variables can be up to 32-characters long, so you can use meaningful names such as, ‘TotalCount’, ‘ExternalTemp’ and so on. Your BASIC program is stored in the chip’s Flash memory so it will never be lost, even after cycling the power. The space available is 60KB, and this will accommodate quite complex programs consisting of thousands of lines. The interpreter can be set to automatically run the program on power up so that the Micromite will act as an embedded intelligent controller.
44
MicroMite-Pt1 (MP 1st & Geoff G) – FEB 2017.indd 44
by Geoff Graham
humidity, GPS and more. Even better, the microcontroller only costs a couple of pounds and the BASIC interpreter is free. Available in a user-friendly 28-pin package, the Micromite makes a great controller for your heating system, lighting manager or whatever else your imagination can dream up.
What can you use the Micromite for? Currently, there are thousands of Micromites being used for anything from controlling a fish tank’s temperature to running an automated lathe. The chip itself costs just a couple of pounds, so you can treat it as a low-cost replacement for discrete circuitry, even if it is not doing anything important. When coupled with a touch-sensitive LCD panel it becomes a sophisticated controller, and we are planning a series of articles based on this configuration. These include a garage parking assistant using an ultrasonic sensor and a boat computer which uses a GPS to display speed, heading and other parameters. Futher projects include a sophisticated appliance energy meter, a super-accurate clock and a synthesised 1Hz to 1MHz signal generator. All these projects will cost very little to build because the Micromite and its peripheral devices are low cost and for the most part can be purchased direct from China via Internet sites such as eBay. Input/output The 28-pin Micromite has 19 I/O pins and the 44-pin chip has 33 I/O pins. Under program control these can be individually set to a digital input, digital output, analogue input, frequency measurement, pulse-width measurement and so on. MMBasic commands can also be used to generate pulses and transfer data in parallel. Interrupts can be used to notify your program when an input pin has changed state, so your program
can react instantly without polling the I/O pins. Up to five PWM or SERVO outputs can be used to create various sounds, control servos or generate computer-controlled voltages for driving equipment that uses an analogue input (eg, motor controllers). One of the outstanding features of the Micromite is the range of communications protocols which it supports. There are two serial ports which support ordinary serial (TTL levels), RS232 or IEEE 485. The Micromite also supports I2C, SPI and 1-wire communications, which are great for interfacing to a wide range of sensors including pressure, temperature, acceleration, light and more. Incorporated within the Micromite’s firmware is support for a number of special devices. This includes 3×4 and 4×4 keypads, 2- and 4-line LCD
Fig.1. Top view of the Micromite showing its 44-pin surface-mount IC
Fig.2. Underside of the Micromite
Everyday Practical Electronics, February 2017
13/12/2016 05:54
distance measurement and servos. There is also support for NEC or Sony infrared remote-control protocols, which can be used to control the program running on the Micromite using an ordinary IR remote control.
Fig.3. Examples of the graphics capability of the Micromite displays, temperature and humidity sensors, battery-backed real-time clocks,
Micromite features Fast 32-bit CPU with 256K of Flash and 64K RAM running a powerful BASIC interpreter. 60KB of non-volatile Flash memory is reserved for the program. 50KB of RAM is available for BASIC variables, arrays, buffers, etc. This is sufficient for quite large BASIC programs up to thousands of lines. The BASIC interpreter is fully featured with floating point, 64-bit integer and string variables, long variable names, arrays of floats, integers or strings with multiple dimensions, extensive string handling and user-defined subroutines and functions. Typically, it will execute a program at 30,000 lines per second. MMBasic allows the embedding of compiled C programs for high-performance functions and the running program can be protected from being listed or modified by a PIN number. 19 input/output pins are available on the 28-pin chip and 33 on the 44-pin chip. These can be independently configured as digital input or output, analogue input, frequency or period measurement and counting. MMBasic commands will generate pulses and can be used to transfer data in parallel. Interrupts can be used to notify when an input pin has changed state. Up to five PWM or SERVO outputs can be used to
LCD displays The Micromite has built-in support for touch-sensitive colour LCD displays using the ILI9341 controller. These are manufactured in large numbers for use in common consumer products such as microwave ovens and washing machines. As a result, they are very cheap and can be purchased on eBay for under £5 (often including free freight). The displays supported by the Micromite have 270 × 340 pixels with 65,000 colours and come in three sizes – 2.2-inch, 2.4-inch and 2.8-inch diagonal. Most also have a resistive touch controller built in and MMBasic will report the position of the touch in pixels so you can draw buttons and symbols on the screen and users can then select these by simply touching the screen. There are a wide range of fonts that you can use, including large fonts for easy readability, fonts with special icons and specialty fonts such as seven segment fonts. Using the TEXT command you can position the text anywhere on the screen, select the colour and scale its size. As well as displaying text, you can draw extensive graphics on the LCD screen, including lines, boxes and circles.
Console and editor To communicate with the Micromite you use the console. This is a serial port on the Micromite over which you can issue commands, edit your program and observe error messages. Generally, the Micromite’s console will connect to a serial port on your desktop computer or laptop. On this computer you run a terminal emulator, which provides a window where you can type and observe the Micromite’s output. The best method of making this connection is via a USB-to-serial converter. The USB end plugs into your computer and the serial end connects to the Micromite. To your desktop computer it presents a virtual serial port to which your terminal emulator will connect. We will have more to say on this subject later, when we will cover plugging in and connecting to the Micromite. The Micromite includes its own built-in full-screen editor, which works over this serial interface. It enables you to enter a program, save it to the Micromite’s memory and run it in quick sequence.
create various sounds, control servos or generate computer-controlled voltages for driving equipment that uses an analogue input (eg, motor controllers).
as sophisticated input devices. These LCD panels typically cost US$7 and provide a low-cost, high-tech graphical user interface.
Programming and control is done via a serial console (TTL voltage levels) at 38400 baud (configurable). Once the program has been written and debugged the Micromite can be instructed to automatically run the program on power up with no user intervention. Special software is not needed to develop programs.
A comprehensive range of communications protocols are implemented, including I2C, asynchronous serial, RS232, IEEE 485, SPI and 1-Wire. These can be used to communicate with many sensors (temperature, humidity, acceleration) as well as for sending data to test equipment.
Full-screen program editor is built into the Micromite, which only requires a VT100 terminal emulator and can edit a full program in one session. It includes advanced features such as search and copy, cut and paste to and from a clipboard. Easy transfer of programs from another computer (Windows, Mac or Linux) using the XModem protocol or by streaming the program over the serial console input. TFT LCD display panels using the ILI9341 and other controllers are supported allowing the BASIC program to display text and draw lines, circles or boxes in 65,535 colours. Resistive touch controllers on these panels are also supported, allowing them to be used
Everyday Practical Electronics, February 2017
MicroMite-Pt1 (MP 1st & Geoff G) – FEB 2017.indd 45
Using these features you can display a lot of data on the screen, draw graphs and display on-screen touch-sensitive buttons and graphical objects. The photographs in Fig.3 show some typical displays. They are bright and easy to read and the touch sensitivity means that you often do not need any manual controls such as switches and knobs, the touch screen will do it all.
The Micromite has built in commands to directly interface with infrared remote controls, including the DS18B20 temperature sensor, LCD display modules, battery-backed clocks, ultrasonic distance sensors and numeric keypads. Special embedded controller features in MMBasic allow the clock speed to be varied to balance power consumption and speed. The CPU can be put to sleep with a standby current of approximately 100µA. While in sleep mode the program state and all variables are preserved. A watchdog feature will monitor the running program and can be used to restart the processor if the program fails with an error or is stuck in a loop. The running program can be protected by a PIN number, which will help prevent an intruder from listing or modifying the program or changing any features of MMBasic.
45
13/12/2016 05:54
Because the editor is built into MMBasic you can easily modify a program running on the Micromite. You might have a Micromite controlling something (say your heating system) and you need to make a change. You can just connect to the console, interrupt the running program (with CTRL-C), run the editor to make the change and then set the program running again. Follow that with a disconnect from your laptop and in a matter of minutes your change is done. BASIC interpreter The BASIC interpreter running on the Micromite (called MMBasic) is Microsoft BASIC compatible, which means that the syntax was kept as close to Microsoft BASIC as possible and this makes it possible to download many programs from the Internet and run them with little modifications. There are some functions not covered by Microsoft BASIC (eg, SELECT CASE) and in that case MMBasic relies on the ANSI Standard for Full BASIC (X3.1131987) or ISO/IEC 10279:1991 for the appropriate syntax. MMBasic is an interpreter, but it is optimised for speed. Most commands and functions are converted to singlebyte tokens when a program is loaded, and that makes it possible for the interpreter to execute a command or function with little overhead. Similarly, caching is used for things such as userdefined functions, so that they can be instantly located when a call is made to them. As a result, the Micromite will typically execute each command in 50µS or faster. This is plenty fast for most applications.
Fast enough to respond to a high-revving engine and generate signals such as ignition triggers. And if that is not fast enough, you can embed compiled C functions in your BASIC program (explaineded later). Data types MMBasic on the Micromite supports three data types – floating point, 64-bit integers and strings. Floating point allows Fig.4. Solderless prototyping with the Micromite you to use numbers with a decimal point; for example, 12.4. It also means that required, for instance, when working with general calculations (particularly with frequency synthesisers. involving division) you get the result that The third data type – strings – is an you would intuitively expect. So floating often overlooked but important feature point is good for most applications and of MMBasic. A string is a sequence of is the default used by MMBasic. ASCII characters and MMBasic has an But the problem with floating point extensive set of functions to pull them numbers is that they only store an apart, search them and reassemble them approximation of the number when in many ways. These powerful string the number has more than six or seven functions come into their own when you significant digits. To avoid this issue, are dealing with text displays, GPS data, you can specify numbers as 64-bit signed serial interfaces and so on. integers. These can be used to accurately Before we leave data types we should count and manipulate numbers up remind you that you can define arrays of to nine million million million (or these data types with their size limited ±9223372036854775807 to be precise), only by the amount of free memory. which is a very large number indeed. An illustration of where 64-bit integers Interrupts come in handy is when you are dealing Interrupts are another powerful feature with latitude and longitude, which need of MMBasic. An interrupt is when to be stored with more than six digits of MMBasic suspends the running of the accuracy. There are many other cases main program to execute a subroutine where large and precise numbers are when some signal is received.
Electrical characteristics Power supply Voltage range
.3 to 3.6V (3.3V nominal). Absolute 2 maximum 4.0V Current at 48MHz 31mA typical (plus current draw from the I/O pins) Current at 5MHz 6mA typical (plus current draw from the I/O pins) Current in sleep 90µA to 100µA typical (plus current draw from the I/O pins) Digital inputs Logic low Logic high Input impedance Freq response
Analogue inputs Voltage range Accuracy
Input impedance
0 to 0.65V 2.5V to 3.3V on normal pins 2.5V to 5.5V on pins rated at 5V >1MΩ. All digital inputs are Schmitttrigger buffered Up to 200kHz (pulse width 20nS or more) on the counting inputs (pins 15 to 18) 0V to supply voltage, normally 3.3V Analogue measurements are referenced to the supply voltage on pin 28 and the ground on pin 27. If the supply voltage is precisely 3.3V, the typical accuracy of readings will be ±1%. >1MΩ (for accurate readings, source impedance should be <10kΩ)
46
MicroMite-Pt1 (MP 1st & Geoff G) – FEB 2017.indd 46
Digital outputs Current draw/sink 1 0mA (absolute max 15mA per pin or 200mA for whole chip) Max open-collector voltage is 5.5V PWM output Frequency range Duty cycle
20Hz to 500kHz -100%, 0.1% resolution below 25kHz 0
Communications speeds Default 38400 baud (range is 100 bps Console serial to 230400 bps at 40MHz) COM1 serial Default 9600 baud (range is 10 bps to 230400 bps at 40MHz) COM2 serial Default 9600 baud (range is 10 bps to 19200bps at 40MHz) SPI 10Hz to 10MHz (at 40MHz), limited to 25% of clock speed I 2C 10kHz to 400kHz 1-Wire Fixed at 15kHz Timing accuracy All timing functions (the timer, tick interrupts, PWM frequency, baud rate) are dependent on the internal fast RC oscillator, which has a specified tolerance of ±0.9%, but typically is within ±0.1% at 24oC. Flash endurance Over 20,000 erase/write cycles – every program save incurs one erase/write cycle. In a normal program development it is highly unlikely that more than a few hundred program saves would be required.
Everyday Practical Electronics, February 2017
13/12/2016 05:54
This signal can be a change of state on an I/O pin (for example a button press), it can be when data has been received on a communications port (serial or I2C), or a keypress on the console, reception of a signal from an infrared remote control, and so on. When you use interrupts you can write your main program to just take care of the main job, which might be something like monitoring a collection of sensors and generating the appropriate control signals. While the main program is doing that job, intermittent signals such as key presses and timing events can be handled in interrupt subroutines without disturbing the main program. Embedded features The Micromite is primarily intended as an embedded controller and therefore has a number of features to support this.
These will be explained in more detail in a later article, but the following provides a short summary. The Micromite can be configured to automatically start running its program on power up, so it will act as a dedicated ‘intelligent’ chip. The processor speed can be dynamically changed to provide speed when it is needed and conserve power when it is not. The sleep function results in even more power saving with the chip’s current draw dropping to less than 100µA. All errors can be trapped if necessary, and the watchdog feature will automatically restart the Micromite should the program fail for some reason. To prevent anyone from interfering with the running of the program, the break feature can be disabled and a PIN number can be set to restrict access to the command prompt.
Embedded C routines MMBasic running on the Micromite is an interpreter. This means that your program is held in its original text format and the interpreter steps through it, interpreting each instruction as it is encountered. The alternative is a compiler, as used on the Arduino and other microcontroller systems that use the C or Python language. A compiled language like these requires a desktop type computer to do the translation of the program for the microcontroller. This two-step process (compile/ transfer/run) makes for a slow development process, but the benefit is that the resulting program runs much faster than an interpreted program. An interpreter like MMBasic has a very fast development cycle because you can jump from the editor to running the program in a fraction of a second and then, if an
2.3V to 3.6V, 26mA PICkit 3 connector MCLR – 1 VCC – 2 GND – 3 PGD – 4 PGC – 5 NC – 6
10kΩ
1
28
2
27
3
26
4
25
5
24
6
23
7 8
22 Micromite
21
9
20
10
19
11
18
12
17
13
16
14
15
47µF tantalum or 10µF MMC ceramic
Fig.5. PICkit 3 connection to the Micromite
Programming the chip To program the Micromite firmware into the PIC32 chip you need a suitable programmer and arguably the best for the job is the Microchip PICkit 3. This can be purchased from Microchip and clones are available on eBay for as little as £10. We have tried a few of these clones and they worked just as well as the real thing, so the choice is yours. To program the chip, you need to supply 3.3V power and connect the 47µF capacitor to pin 20 on the 28-pin chip or pin 7 on the 44-pin chip. In this tutorial we are going to concentrate on the 28-pin chip. To drive the PICkit 3 you should load MPLAB IPE (Integrated Programming Environment) onto your desktop computer running Windows, Mac OS or Linux. This software is available from Microchip and is part of their MPLAB IDE programming environment. When you install the software you are given the option to load just the IPE
component, you should select this as the full installation consumes a lot of disk space, which is not needed when you just want to program a chip. To get started you must connect the PICkit 3 as shown in Fig.5. Then run the IPE software, which will display the screen shown in Fig.6. From then on the operation is reasonably intuitive: select the chip then select the programmer (PICkit 3). Next, click on the browse button to load the Micromite firmware. The firmware can be downloaded from the EPE website or from the author (http:// geoffg.net/micromite.html). You need a file with the name Micromite_x.x.hex where x.x represents the current version number. The .hex suffix means that the data is in hexadecimal format, ready for the programmer. The final step is to click on the Program button in the IPE window. IPE will first erase the chip, then program the hex data into the chip, followed by a verify stage, which reads back the programmed chip and compares it to the original
Everyday Practical Electronics, February 2017
MicroMite-Pt1 (MP 1st & Geoff G) – FEB 2017.indd 47
Fig.6. Using the IPE with the Micromite hex data. This operation is fairly fool proof, so if IPE reports that the chip was successfully programmed you can be sure that it is OK. However, that may not happen. A typical error message is ‘Target Vdd not detected’ which means that the programmer could not detect 3.3V on the Vdd pin (ie, the chip is not powered). Another error is ‘Cannot read device ID’. The programmer could tell that you had connected to something (because Vdd was present) but it could not communicate with the chip. This usually means that something was interfering with the MCLR, PGD and/or PGC lines (ie, they were not connected or other components were loading down the signals). Finally, assuming the chip was programmed correctly, you can disconnect the PICkit 3 and cycle the power. This will set the chip running the Micromite firmware. The next step is to connect a terminal emulator to the console, as described in the main text.
47
13/12/2016 05:54
Table 1. Microcontrollers suitable for use as a Micromite
Version
Dimensions (mm)
PIC32MX170F256B-50I/SP
28-pin DIL package. Guaranteed to run at 48MHz
PIC32MX170F256B-50I/SO
28-pin SOIC package. Guaranteed to run at 48MHz
PIC32MX170F256D-50I/PT
44-pin surface-mount package. Guaranteed to run at 48MHz
PIC32MX170F256B-I/SP
28-pin DIL package. Guaranteed to run at 40MHz
PIC32MX170F256B-I/SO
28-pin SOIC package. Guaranteed to run at 40MHz
PIC32MX170F256DI/PT
44-pin surface-mount package. Guaranteed to run at 40MHz
Note: from testing, the chips rated at 40MHz also ran at 48MHz (at room temperatures), so they are a viable choice if you cannot find the higher speed versions.
error is discovered, quickly jump back into the editor. With MMBasic running on the Micromite you can have the best of both worlds – an interpreter for fast and easy program development and embedded
C functions for speed. The embedded C routines require a larger computer (Windows, Mac or Linux) to compile the routines and the resulting code is embedded in your BASIC program. MMBasic will extract this embedded
28-pin Micromite connections RESET Wired to +V directly or via 10kΩ resistor
1
28
ANALOG POWER (+2.3V to +3.6V)
DIGITAL | ANALOG
2
27
ANALOG GROUND
SPI OUT | DIGITAL | ANALOG
3
26
ANALOG | DIGITAL | PWM 2A
PWM 1A | DIGITAL | ANALOG
4
25
ANALOG | DIGITAL | SPI CLOCK
PWM 1B | DIGITAL | ANALOG
5
24
ANALOG | DIGITAL | PWM 2B
PWM 1C | DIGITAL | ANALOG
6
23
ANALOG | DIGITAL
COM1: ENABLE | DIGITAL | ANALOG
7
22
DIGITAL | 5V | COM1: RECEIVE
GROUND
8
21
DIGITAL | 5V | COM1: TRANSMIT
COM2: TRANSMIT | DIGITAL
9
20
47µF TANT CAPACITOR (+)
COM2: RECEIVE | DIGITAL
10
19
GROUND
CONSOLE Tx (DATA OUT)
11
18
DIGITAL | 5V | COUNT | I2C DATA
CONSOLE Rx (DATA IN)
12
17
DIGITAL | 5V | COUNT | I2C CLOCK
POWER (+2.3V to +3.6V)
13
16
DIGITAL | 5V | COUNT | WAKEUP | IR
SPI IN | 5V | DIGITAL
14
15
DIGITAL | 5V | COUNT
The above diagram shows the possible functions of each I/O pin on the Micromite. Note that the physical pins on the chip and the pin numbers used in MMBasic are the same. This means that nine pins are not available in MMBasic because they are dedicated to functions such as power and ground. These pins are shaded in grey in the diagram. The notation is as follows (the mnemonic in brackets is the mode used in the SETPIN command): ANALOG
These pins can be used to measure voltage (AIN).
DIGITAL
an be used for digital I/O including digital input (DIN) and C digital output (DOUT)
COUNT
Can measure frequency (FIN), period (PIN) or counting (CIN)
5V
hese pins can be connected to 5V circuits. All other I/O pins are T strictly 3.3V max
COM xxx
These are used for serial communications (see Appendix A)
I2C xxx
These are used for I2C communications (see Appendix B)
SPI xxx
If SPI is enabled these pins are for SPI I/O (see Appendix D)
PWM xxx
PWM or SERVO output (see the PWM and SERVO commands)
IR
an be used to receive signals from an infrared remote control C (see the IR command)
WAKEUP
Can wake the CPU from sleep (see the CPU SLEEP command)
Pins 27 and 28 are the ground and power for analogue measurements. Normally, they are connected to the general ground and power (pins 8 and 13) but if you require noise-free and accurate analogue readings you should make sure that the power on pin 28 is regulated to 3.3V and well filtered. Also, your analogue inputs should be referenced to pin 27 (the analogue ground).
48
MicroMite-Pt1 (MP 1st & Geoff G) – FEB 2017.indd 48
code and add it to MMBasic so that it will act the same as a built-in command. If you are fluent in the C programming language you can write your own embedded C routines. There is also a selection of embedded C routines included with the MMBasic firmware distribution, which includes drivers for alternative LCD display panels, additional communications ports (serial, I2C and SPI), sorting routines and more. Getting started The Micromite firmware can be programmed into a range of chips as listed in Table 1. These cover a variety of package sizes and two speeds (40MHz or 50MHz). The Micromite will start up at 40MHz, so the firmware will run on any chip, but within your program you can step its speed up to 48MHz to take advantage of the faster chip speed available if you are using a 50MHz chip. You can program the firmware into the chip yourself – see side box Programming the chip for details. You can also buy a pre-programmed chip and this will be much easier if you are just starting out with the Micromite and would like to avoid the added complication that programming the chip would entail. See the Micromite sources box for a list of where to obtain pre-programmed chips. With a pre-programmed chip you can just plug it into a breadboard and start experimenting. However, note that the firmware is often updated with new features and bug fixes, so a programmer will be necessary if you want to take advantage of future updates. Where is the development board? Readers familiar with microcontroller evaluation products might ask, ‘where is the printed circuit board with a display, I/O connectors, etc?’. The answer is to not think of the Micromite as a complex system. It is a single-chip microcontroller, which you build into a circuit and program in place. If you want to experiment with the 28pin chip you can plug it into a solderless breadboard, as illustrated in Fig.4. The 44-pin version of the Micromite is a surface-mount chip and to make it easier for readers to use this you can purchase the 44-pin Micromite module from UK supplier http://micromite.org. This is shown in Fig.1 and Fig.2, and includes the Micromite chip and a USB-to-serial converter for the console. It is designed to plug into a solderless breadboard for testing so it can be used in a similar manner as the 28-pin version. Using a solderless breadboard is invaluable when experimenting with the Micromite, but once you have the hang of how the chip works you would normally design a circuit around it and then continue to develop your program while it is in the circuit. This ‘in-circuit development’ is very productive because it allows you to develop and test small parts of the program as you go. For example, if your project was a home brew controller you could develop and
Everyday Practical Electronics, February 2017
13/12/2016 05:55
Power 2.3V to 3.6V, 26mA 2 x AA batteries or a nominal 3.3V supply
CP2102 USB-serial converter 3V3 DTR RXI
USB
TX)
PC running WIndows / OS X / Linux
GND +5V
1
28
2
27
3
26
4
25
5
24
6
23
7 8
22 Micromite
21
9
20
10
19
11
18
12
17
13
16
14
15
47µF tantalum or 10µF MMC ceramic
Fig.5. Using a CP2102 to enable console connection between the Micromite and a PC Console connection With the chip programmed, the next step is to connect a terminal emulator to the console. The console is a serial
test the temperature sensor first, then the power control and so on. The final program would just string these modules together.
PWM 2B | DIGITAL | ANALOG
DIGITAL | ANALOG
COM1: RECEIVE | 5V | DIGITAL
MicroMite-Pt1 (MP 1st & Geoff G) – FEB 2017.indd 49
ANALOG | DIGITAL | PWM 1C
COM1: TRANSMIT | 5V | DIGITAL
Everyday Practical Electronics, February 2017
ANALOG | DIGITAL | COM1: ENABLE
ANALOG | DIGITAL
47µF TANT CAPACITOR (+)
5V | DIGITAL
ANALOG | DIGITAL
5V | DIGITAL
GROUND
GROUND
5V | DIGITAL
ANALOG | DIGITAL
DIGITAL | COM2: TRANSMIT
5V | DIGITAL
POWER (+2.3V to +3.6V)
DIGITAL | COM2: RECEIVE
I2C DATA | COUNT | 5V | DIGITAL
DIGITAL | 5V
CONSOLE Tx (DATA OUT)
interface over which you can issue commands to configure the chip and edit/run programs. MMBasic also uses the console to display error messages. A serial interface consists of two signals. One, often referred 44-pin Micromite connections to as Tx (for transmit) sends a coded signal to the other device, and the second (called Rx) receives a signal. The data is sent with start and stop bits and uses ASCII coding for each character sent or received. The speed of transmission is referred to as ‘baud rate’, which is another way of saying bits per second. The Micromite starts up with its console serial port set to a baud 33 32 31 30 29 28 27 26 25 24 23 rate of 38400. 34 22 CONSOLE Rx (DATA IN) PWM 1B | DIGITAL | ANALOG The signal level is TTL, which 35 21 DIGITAL | 5V PWM 1A | DIGITAL | ANALOG means that the signal swings 36 20 DIGITAL SPI OUT (MOSI) | DIGITAL | ANALOG between 0V and 3.3V. There are 37 19 DIGITAL | 5V DIGITAL | ANALOG other signalling methods, notably 38 18 DIGITAL | 5V RESET Wired to +V directly or via 10K resist RS232, which swings the voltage 39 17 GROUND ANALOG POWER (+2.3V to +3.6V) ±12 volts. The Micromite can 40 16 POWER (+2.3V to +3.6V) ANALOG GROUND accommodate RS232 too, but to 41 15 DIGITAL | 5V | SPI IN (MISO) PWM 2A | DIGITAL | ANALOG get started you must ensure that 42 14 DIGITAL | 5V | COUNT SPI CLOCK | DIGITAL | ANALOG your signalling levels are TTL. 43 13 DIGITAL | 5V | COUNT | WAKEUP | IR 5V | DIGITAL The best method of accessing the 44 12 DIGITAL | 5V | COUNT | I2C CLOCK 5V | DIGITAL serial console is to use a USB-to1 2 3 4 5 6 7 8 9 10 11 serial converter, which will plug into a USB port on your desktop computer and at the other end connect to the Micromite’s serial console. To your computer it will look like a serial port (via USB), while the connection to the Micromite Plus is a standard serial interface with TTL signals levels. We recommend converters based on the CP2102 chip and they can The above diagram shows the possible functions of each I/O pin on the 44-pin Micromite. be found cheaply on eBay (search Note that the physical pins on the chip and the pin numbers used in MMBasic are the for ‘CP2102’). Fig.7 shows how same. This means that 11 pins are not available in MMBasic (these pins are shaded in grey). such a converter can be connected to the 28-pin Micromite and a 44The notation is the same as described for the 28-pin version. Pins 16 and 17 are the ground pin Micromite module. When the converter is plugged and power for analogue measurements. Normally they are connected to the general ground and power (pins 29 and 28) but if you require noise-free and accurate analogue readings into your computer, and the you should make sure that the power on pin 17 is regulated to 3.3V and well filtered. Also, correct driver is installed, it will appear as a serial port (ie, your analogue inputs should be referenced to pin 16 (the analogue ground). COM29 in Windows). You then
49
13/12/2016 05:55
time you will find yourself repeatedly reconnecting to make one tweak or another, so many people leave the USB to serial converter permanently connected (they do not cost much). Trouble shooting What if it does not work the first time? The first step is to check your power supply. Is it 3.3V and is it stable and free Fig.8. Micromite emulator command prompt from electrical noise? If you have some doubts, you can use two fresh need to start a terminal emulator on your AA batteries in series as a power source computer. For Windows we recommend for testing. Then check that 3.3V is on Tera Term version 4.88, which can be each pin, as specified in Fig.7 and that downloaded for free from http://teraeach ground pin is correctly connected term.en.lo4d.com. Set the interface to ground. speed to 38400 baud and connect to the The next check is the 47µF capacitor serial port created by the USB-to-serial connected to pin 20 on the 28-pin converter. chip or pin 7 on the 44-pin chip. This Macintosh and Linux computers have capacitor is used to stabilise the internal similar features and terminal emulators; 1.8V regulator within the PIC32 chip however, the procedure for setting these and without it you will not be able to up will vary. program or use the chip. This capacitor After the console has been connected must be a tantalum or a ceramic type – to a terminal emulator, apply power to an electrolytic capacitor will not work. the Micromite and you should see the Has the chip been properly programmed? Micromite’s prompt (>), as shown in If you programmed it yourself you should Fig.8. At this point, you can enter, edit check that the programmer did report and run programs using nothing more that the programming operation was than the terminal emulator and a USB successful. Check the current drawn by cable. the chip – a draw of about 26mA means When your program has been tested that the chip is working correctly and and is running on the Micromite you do running the BASIC interpreter. A current not necessarily need the console, so you of less than 10mA indicates that: could set the Micromite to automatically n Power or ground connection is faulty run its program on startup (OPTION n 47µF tantalum capacitor is faulty or AUTORUN). However, unless you got the not connected programming perfectly correct the first n Chip not programmed correctly.
Micromite sources Programmed ICs, modules and kits EPE online store ??? – tbd – ??? Micromite.org http://micromite.org Graeme Rixon (Rictech) www.rictech.nz/pages/5/Products CircuitGizmos http://circuitgizmos.com Mick Gulovsen www.shop-dontronics.com/MicksMites Unprogrammed (blank) chips Microchip www.microchipdirect.com Element14 http://uk.farnell.com RS Components http://uk.rs-online.com/web All suppliers will ship internationally
50
MicroMite-Pt1 (MP 1st & Geoff G) – FEB 2017.indd 50
If you have a current draw of about 26mA the fault is most likely with the USB-to-serial converter or your terminal emulator. To check these two elements you can disconnect the serial connections from the Micromite and short the Tx and Rx pins of the converter together. When you type something on the keyboard into the terminal emulator you should see the characters echoed on the screen. If not, you should diagnose and correct the error in your USB-to-serial converter and terminal emulator before proceeding. If the above test is OK (ie, keystrokes echo on the screen) the only possible remaining fault is in your connection of the USB-to-serial converter to the Micromite. Check that the Tx pin on the converter goes to the Micromite’s Rx pin and that Rx on the converter goes to the Micromite’s Tx pin, as illustrated in Fig.7. User manuals The Micromite is quite a sophisticated device. After all, it is a full computer with a multitude of facilities. As a result, the Micromite User Manual, which describes it adds up to almost 100 pages. This manual is the ultimate reference for the Micromite and covers everything from the I/O pins through to
sophisticated functions that you might only need in specialised circumstances. It is in PDF format and available for free download from the EPE website and the authors website: http://geoffg. net/micromite.html This series of articles will go through many aspects of the BASIC language but they will not cover everything. Many commands have additional features, so it would be worthwhile downloading the manual and having it handy as you read through this and following articles. That way, you can explore the full detail of a command that might interest you. Short tutorial Assuming that you have correctly connected a terminal emulator to the Micromite and have the command prompt (the ‘greater than’ symbol: >) you can enter a command followed by the enter key and it will be immediately run. For example, if you enter the command PRINT 1/7 you should see this: > PRINT 1/7 0.142857 > This is called immediate mode and is useful for testing commands and their effects. To enter a program you can use the EDIT command, which will be described later in this series. However, to get a quick feel for how it works, try this sequence (your terminal emulator must be VT100 compatible): At the command prompt type EDIT, followed by the ENTER key. The editor should start up and you can enter this line: PRINT "Hello World" Press the F1 key in your terminal emulator (or CTRL-Q, which will do the same thing). This tells the editor to save your program and exit to the command prompt. At the command prompt type RUN, followed by the ENTER key. You should see the message: Hello World Congratulations! You have just written and run your first program on the Micromite. If you type EDIT again you will be back in the editor, where you could change or add to your program. Flashing an LED Connect an LED with a suitable currentlimiting resistor (say 470Ω) to pin 15 of
12
17
13 14
16 Micromite
15
470Ω LED
Fig.9. Schematic for a Micromite LED flasher circuit
Everyday Practical Electronics, February 2017
13/12/2016 05:55
the 28-pin Micromite, as shown in Fig.9. Then use the EDIT command to enter the following program: SETPIN 15, DOUT DO PIN(15) = 1 PAUSE 300 PIN(15) = 0 PAUSE 300 LOOP When you have saved and run this program you should be greeted by the LED flashing on and off. It is not a sophisticated program, but it does illustrate how your Micromite can interface to the physical world via your programming. The chapter ‘Using the I/O pins’ later in the manual provides a full description of the I/O pins and how to control them. Setting the AUTORUN option You now have the Micromite doing something useful (if you can call flashing an LED useful). Assuming that this is all that you want the Micromite to do you can then instruct it to always run this program whenever power is applied. To do this, you first need to regain the command prompt and you can do this by entering CTRL-C at the console. This will interrupt the running program and return you to the command prompt. Then enter the command: OPTION AUTORUN ON This will instruct MMBasic to automatically run your program whenever power is applied. To test this, you can remove the power and then reapply it. The Micromite should start up flashing the LED. If this is all that you want to do you can disconnect the serial console and it will sit there flashing the LED on and off forever. If ever you wanted to change something (for example, the pause between on and off) you could reattach your terminal emulator to the console, interrupt the program with a CTRL-C and edit it as needed. This is the great benefit of the Micromite, it is very easy to write and change a program. Next month In Part 2 we will describe the editor, special device control and interfacing to touch sensitive LCD panels.
Keep up to date! For updates to the Micromite firmware you can visit the author’s website at: http://geoffg.net/micromite.html. Another resource is The Back Shed forum where there are many Micromite users who are happy to help newcomers, see: www.thebackshed.com/forum/ Microcontrollers
HIGHPERFORMANCE 8-CHANNEL OSCILLOSCOPE
12-bit
resolution
8 channels
20 MHz bandwidth
256 MS
buffer memory
The PicoScope 4824 is a low-cost, portable solution for multi-input applications. With 8 high-resolution analog channels you can easily analyze audio, ultrasound, vibration, power and timing of complex systems. The PicoScope 4824 has the power and functionality to deliver accurate results. It also features deep memory to analyze multiple serial buses such as UART, I2C, SPI, CAN and LIN plus control and driver signals. Also features: • High-performance arbitrary waveform generator • Advanced digital triggers • Serial bus decoding • SuperSpeed USB 3.1 Gen 1 interface • Windows, Mac and Linux software For more information please visit www.picotech.com/PS487 Email:
[email protected]. Errors and omissions excepted. Prices are correct at the time of publication. Sales taxes not included. Please contact Pico Technology for the latest prices before ordering.
Everyday Practical Electronics, February 2017
MicroMite-Pt1 (MP 1st & Geoff G) – FEB 2017.indd 51
51
13/12/2016 05:56
A Slice of Alexa Pi
I
N RECENT editions of Net Work, I outlined Amazon UK’s Echo, an anglicised version of their network-aware smart speaker that has stolen the lead over Google’s Home smart device. In November, Amazon decided to celebrate ‘Black Friday’, America’s latest export to Britain, by lopping 20% off the price and Echo is starting to appear in major British retail stores as well. Rather perversely, many bricks-and-mortar retail stores claimed they were nearly empty on Black Friday, because shoppers had gone online hunting for bargains instead. Even a DIY store checkout assistant whispered to me how she hates shopping in stores and much prefers using eBay and Amazon! One motive behind Amazon’s Echo is to make online shopping as painless and seamless as possible, removing every physical obstacle between wanting to buy something and actually completing Amazon’s checkout process. Amazon’s Echo will manage a shopping cart for you, as well as handling an increasing number of simple everyday tasks. Amazon’s Alexa is the product of Alexa Voice Service (AVS), Amazon’s cloud-based voice recognition and
control technology that understands spoken commands and responds accordingly. Echo’s so-called ‘skills’ are app-like features designed for a particular task. Alexa’s skillset is not confined to the smart Echo cylinders that are starting to populate our homes though: AVS offers developers of connected products the possibility of integrating Alexa into their devices, along with third-party skills using the Alexa Skills Kit (ASK). Interestingly, Amazon provides examples based on the Raspberry Pi, which gives rise to the prospect of a Pi responding Alexastyle to spoken queries. More details of AVS are at: https://developer.amazon. com/alexa-voice-service/what-is-avs. A sample Java app for Pi is offered on GitHub at: https://github.com/ alexa/alexa-avs-sample-app/wiki/ Raspberry-Pi, along with hardware requirements and an installer – ensuring a hassle-free Alexa setup within an hour... in theory. It is still early days for Google Home, but already they are starting to leak out onto eBay (with US mains adaptor) for £125-£240 ($150-$300). In due course, it will be possible to customise your Google Home with a choice of fabric and metallic bases, but these
Amazon’s Alexa Voice Service (AVS) offers the prospect of adding Alexa’s voice control to a Raspberry Pi for example
52
Network – FEB 2017.indd 52
are buried deep within the Google Play Store and are not yet available. Developments and refinements are a work in progress, so it’s probably better to think of all these devices as ‘a good start’, with the best still to come. Content is king Twenty years ago, when the web was first taking shape, a certain Bill Gates of Microsoft exclaimed that ‘Content is king’ and never has that been more true than today. With broadband services becoming ever more generic and indistinguishable, ISPs have fallen over themselves to add more value (make more profit) and lock customers into deals by bundling more services (mobile phones, data plans, VoIP) but the one thing major providers, portals, blogs and websites are desperate to supply is unique content. Satellite broadcaster Sky and British Telecom stumped up some £5 billion ($6.1 billion) on Premier League soccer rights between them, with BT Sport offering soccer, Australian cricket and tennis to its own subscribers. Meanwhile, Amazon is pressing on with its Prime service, which offers free next-day delivery on many lines and is showing The Grand Tour, the re-incarnation of BBC TV’s Top Gear motoring program, streamed in 4K HDR. Amazon claims the first programme in the series, streamed on 18 November, enjoyed the biggest ever premiere viewing figures on Prime, and the programme was widely acclaimed. The Grand Tour will be released to some 200 countries in December 2016, no doubt giving some viewers the excuse they crave to upgrade to the biggest and best 4K TV! In order to convert an ordinary TV into a ‘smart’ one capable of receiving services such as catch-up TV, Netflix or Amazon Prime, Amazon’s Fire Stick HDMI streaming media player also received the ‘Black Friday’ discount treatment, dropping to just £25, and I admit to finally succumbing to the appeal of the Fire Stick just before Christmas. Other streaming devices such as NowTV, Roku and Google’s very versatile Chromecast dongle may
Everyday Practical Electronics, February 2017
16/12/2016 14:30
also fit the bill. There has never been a more comprehensive but confusing choice for HDMI streaming media devices for your TV, and we can expect the major brands to continue to slug it out in the quest to conquer your home – offering more content than you can ever consume, of course. Up close and personal Isn’t it strange how many people have uneasy or irrational views when it comes to their privacy and anonymity? If a local town council was to rummage through everyone’s wheelie bins one dark night when trying to ‘profile’ the residents, even if the bins were anonymised and contained no personally identifiable materials, people would still complain about being ‘snooped on’. Paradoxically, the same citizens probably won’t complain about surveillance cameras following them everywhere in a shopping mall, claiming that as they have nothing to hide they have nothing to fear. They would never, however, accept CCTV watching them at home in the lounge or anywhere else. So privacy does matter then, it’s just that most people don’t think about it objectively or rationally. This very human phenomenon was the subject of a thought-provoking TED Conference talk by Glenn Greenwald, entitled: Why Privacy Matters, viewable at: www.ted.com/talks/glenn_greenwald_why_ privacy_matters A user’s online experience embraces some of the same confused rationale. I have written in the past about how some online operators seem to know almost everything about you except your name, and this intrusion starts with your IP address. The use of cookies, so-called ‘trackers’ and geolocation services all help the web industry to gather statistics and determine what websites your browser recently visited, what products you looked at recently, roughly where you are located and what your personal tastes and interests are likely to be. Marketers could even use so-called ‘beacons’ to track your progress walking up and down the shopping mall or around a store and target suitable adverts directly to your smartphone, which will become commonplace in the future. To see the scale of this online snooping, try installing the Ghostery Extension for your web browser, downloadable from www.ghostery.com. A quick trip to the mobile site of eBay UK, for example, showed no less than 33 trackers, all keeping an eye on you. A Daily Express web page contained nearly 50 of them. There is probably nothing in the world that technology companies like Google, Amazon, Facebook and eBay want more than to hone an artificial intelligence that gets inside users’ minds, second-guessing what they want and what they might like to buy. Advertising opportunities abound and the name of the Internet game is ‘monetisation’, as industries scramble to profile you and grab a share of your disposable pounds, dollars and euros. If anyone is worried by how the Internet industry spies on web surfers then one solution is to use the Tor (‘The Onion Router’) web browser, which disguises your IP address and is downloadable
Tor is a web browser designed from the ground up to protect your privacy from www.torproject.org. Windows, Mac, Linux and Android versions are provided. After opening the Tor browser, you have to connect to the Tor network, which might take a minute or two. Using Tor to check our own EPE website hosted right here in Britain, the Tor ‘circuit’ (like Traceroute), displayed via the onion button, showed anonymous detours via several European countries. That’s all for this month’s Net Work. You can contact the author at
[email protected] or send comments for possible inclusion in Readout to
[email protected]
Electronics & Robotics for Makers TinyDuino
As powerful as the Arduino Uno but smaller than a 2 pence coin. Complete with a wide and growing range of TinyShields - where will your next project take you? All the power of the Arduino in a fraction of the space, great for building intelligence in to your projects.
STEMTera Breadboard A breadboard with built-in Arduino! The breadboard has a total of 41 I/O pins of which 9 provide PWM. Pin-to-pin compatible with Arduino UNO R3 shield. The bottom cover is Lego® compatible and will fit base plates and bricks - great for Robotics and Animatronics. Fully Arduino IDE compatible and built with strong ABS plastic and is available in a range of colours.
Edison Robot Edison is great for schools and hobbyists alike to teach kids robotics and programming on any computer, tablet or phone. Edison is a LEGO compatible robot which means your kids can let their imagination run wild. Why not make a remote control LEGO There's a lot that one Edison Robot can do, imagine what your kids can do with a team of them working together!
Supporting Education
Ghostery is a browser plug-in that highlights the ‘trackers’ that are monitoring your surfing activities
Everyday Practical Electronics, February 2017
Network – FEB 2017.indd 53
Supporting
www.eshop.icsat.co.uk
53
20/12/2016 16:00
Circuit Surgery Regular Clinic
by Ian Bell
Darlington relay switch
N
EW EPE Chat Zone user wolfie posted some questions about a circuit (see Fig.1) which uses a relay to switch a load depending on the light level sensed by a light-dependent resistor (LDR). He writes: ‘Hi all. I am a newbie when it comes to electronics and I’m trying to teach myself from some books I have. The trouble with books is if you don’t understand summat you can’t ask it! In one of my books there’s a little project at the end of each chapter. However, it doesn’t have much explanation as to how it works. I don’t need to actually build the project, but I want to understand what each part of it does. The first one looks very simple, but it leaves me with a number of questions. I understand that the LDR and the VR create a voltage divider that at some point turns the transistor on, which allows current to run through the relay and turn on whatever you want turning on. So, here’s my questions: 1. What’s the resistor doing, the 2.2kΩ one? What’s its purpose? Why two transistors, if they act 2. as switches why do we need two switches? 3. What’s that diode doing? Thanks in advance.’ Wolfie’s post was titled ‘First silly questions’, but the questions are far from silly, and as is often the case, produced helpful responses from other Chat Zone users. The basic answers are: 1) The 2.2kΩ resistor limits the base current into Q1 to a safe level. 2) A single transistor is unlikely to have sufficient current gain to switch the load from the current available for the LDR potential divider.
220kΩ
D1
Relay
+9V 2.2kΩ
+ –
Q1 Q2
LDR1
Fig.1. Chat Zone user wolfie’s schematic
54
Circuit Surgery – FEB 2017.indd 54
3) To prevent inductive kickback from damaging the transistor. In this article we will look at the circuit in more detail and examine the issues raised by the questions, with particular focus on transistor switching operation. In the Chat Zone thread, fellow EPE author Alan Winstanley pointed out the battery symbol is not correct – the symbol used represents a single cell (typically 1.2V to 1.5V, but it depends on the battery technology). A 9V battery contains multiple cells. A correct symbol is shown in Fig.2. + 9V
–
Fig.2. Correct 9V battery symbol Circuit operation The circuit operates as follows. First, as noted by wolfie, the LDR and variable resistor form a potential divider connected across the supply. Consider the LDR and variable resistor on their own, initially. The voltage at the junction between them will depend on the relative resistance of the two devices, which in turn depends on the light level and the variable resistance setting. With the LDR in darkness, its resistance will be very high (typically several million ohms), probably at least ten times larger than the variable resistor value. Thus, the voltage at the junction will be close to the supply voltage. When the LDR is exposed to bright light its resistance will drop significantly (to typically several thousand ohms), probably at least ten times smaller than the variable resistor value. Now, the voltage at the junction will be close to zero. If the light level changes from dark to light then the voltage will switch between something close to 9V to something close to 0V. For the transistors to conduct (and turn on the relay) their base-emitter voltages (VBE) must both be greater than about 0.65V, so the voltage at the base of Q1 in the circuit in Fig.1 needs to be above about 1.3V. With the typical LDR dark and light values just discussed, the
corresponding voltages will indeed be above and below 1.3V respectively. The variable resistor can be adjusted to set the exact light level at which the circuit switches. In idealised circumstances these dark/light conditions provide a clear signal to switch the transistors (and hence the relay) on and off. That is, if transistors were perfect voltage controlled switches, which did not require any input current then the situation would be straightforward. However, transistors require an input (base) current when conducting, so we have to work out if enough current will be available from the potential divider. Rough calculations It is often worth performing approximate calculations to get a feel for the situation in a circuit. Here we need some idea of the ratio of current into Q1’s base (the switch control input) to Q2’s collector current (the current through the load). In addition to the original circuit in Fig.1, for comparison purposes, we will also consider a single transistor, as shown in Fig.3. This is simplified to show just a transistor and load; plus, the various currents and voltages have been labelled. For the circuit in Fig.3, current ratio relates to the base and collector currents of the single transistor Q1. The ratio of collector current to base current is called the ‘current gain’ of the transistor (symbol β) – we can apply this idea to the Q1/ Q2 transistor pair as well as the single transistor. The worst case for supplying current to the transistor(s) when the LDR is dark (transistor(s) on) is when the variable resistance is set to its maximum value of 220kΩ. With a supply of 9V, Ohm’s law shows
RL
VBC
IC
+ 9V
IB Q1 VCE VBE
–
IE
Fig.3. Single-transistor switch
Everyday Practical Electronics, February 2017
16/12/2016 14:28
or reverse biased (off) so there are actually four different regions of operation for the transistor. These are shown in table 1. When using transistors in circuits it is important to make sure they are in the appropriate region of operation. When a single transistor is used as a switch it is usually switched between the saturation and cut-off regions. that maximum current through Table 1 – Bipolar transistor regions of operation Table 1: Bipolar transistor regions of operation a 220kΩ resistor is 9V/220k = 41µA. The actual voltage across Base-emitter Base-collector Region of operation Comment it will be a little lower, but junction bias junction bias this will do for a rough idea. A Forward Forward Saturation Switch ON typical 9V relay might have a coil resistance of 115Ω; so with Poor amplifier, specialist Forward Reverse Reverse Active 9V across it the current is 78mA. uses (This is a guess of course, as Reverse Forward Forward Active Good amplifier wolfie does not state what relay Reverse Reverse Cut-off Switch OFF is used, but it is sufficient for illustrative purposes). The ratio of controlled current In tothe cut-off transistor. With aand voltage drop flows of 0.2V switch. We can address the first region both also junctions in the transistor are reverse biased no current controlling current is 78mA/41µA, the dissipation in the transistor due question in this context. through the transistor (except some leakage current). Thus, a transistor-based switch will beto which is about 2000. Thus, a the load current would only be about off. TheRegions very low of current flow through the cut-off transistor very little switching power is transistor switch needs a current 16mW. ensures In morethat demanding operation dissipated in the transistor the switch is off; however, care must taken tovoltage ensuredrop that gain of about 2000 in this situation. applications the be current, A bipolar junctionwhen transistor contains Single transistors typically have the βs maximum power dissipation need careful not exceeded. In the case of circuits in collector-to-emitter two diode (PN) junctions,voltage this is(Vtrue CEmax) isand in the low hundreds, but the effective consideration. of Fig.3, both NPN and PNPcollector transistors; the voltage Fig.1 and the maximum to emitter is about 9V, which not a β is often much lower in switching From Fig.1 and Fig.3 it is clear that junctions are simply the switching opposite transistor. demanding specification for a discrete applications (more on this later). This most of the supply voltage will appear way round in the two types, requiring rough calculation indicates that a across the load if the transistor is opposite voltages for the same The saturation region is characterised by can a small drop between the collector and single transistor (as in Fig.3) would saturated. In saturation, the collectoroperation. The two junctions be voltage not have sufficient current gain emitter – voltage across a bipolar either forward biasedis(on) or reverse (called VCEmax), which typically around 0.1 to-emitter to 0.2V. In the saturation region both hence the use of two transistors junctions in transistor doesacross not it. vary with biased (off) sobiased, there so areeach actually four are forward junction will have about 0.6V For much example, wolfie’s circuit and the answer to the varying collector current, so we apply different regions of operation for the we might see VBE = 0.7V and VBC = 0.50. The collector to emitter saturation voltage (VCEs) is second question. a more or less constant voltage to the transistor. These are shown in table VBC in saturation, this case 0.2V. what we want. equal to1.theWhen difference VBE and load, in which is usually usingbetween transistors in circuits Darlington pair The forward active region is used it is important to make sure they are The two transistors in Fig.1 are for amplifiers; where normally we in the appropriate region of operation. connected in what is known as a would want to avoid saturation as it When a single transistor is used as a Darlington pair configuration. One would probably imply clipping of switch it is usually switched between transistor is used to directly drive the signal. The base-emitter junction the saturation and cut-off regions. another, resulting in a sort of ‘super will be forward biased with typically In the cut-off region both junctions transistor’ with a very high current around 0.6 to 0.7V across it (VBE); in the transistor are reverse biased and gain. The Darlington configuration but slightly lower than in saturation no current flows through the transistor can be made from either two NPN case. The reverse active region is not (except some leakage current). Thus, a transistors (as used in the circuit commonly used, but does have some transistor-based switch will be off. The in Fig.1, also see Fig.4) or two PNP applications. very low current flow through the cut-off transistors (see Fig.4). Darlington transistor ensures that very little power configurations are use in powerJunction characteristics is dissipated in the transistor when switching applications (as in Fig.1), Fig.5 shows typical current-againstthe switch is off; however, care must power amplifier output stages, voltage characteristics for the basebe taken to ensure that the maximum voltage regulators and some types of emitter and collector-emitter junctions collector-to-emitter voltage (VCEmax) is sensing applications – particularly in of a general-purpose switching not exceeded. In the case of circuits in optocouplers, where the Darlington transistor. The IBE curve (red) is the Fig.1 and Fig.3, the maximum collector arrangement can be used to increase base-emitter current and the IBC to emitter voltage is about 9V, which the gain of a phototransistor. They (blue) is the base-collector current. is not a demanding specification for a can also be used in the input and gain Both curves show the standard diode discrete switching transistor. stages of amplifiers. ‘switch on’ characterises, where The saturation region is characterised The Darlington pair behaves like the current starts to increase very by a small voltage drop between the a single transistor which requires significantly when the applied voltage collector and emitter (called VCEsat), twice the value of base-emitter voltage is increased about 0.6V to 0.7V. which is typically around 0.1 to 0.3V. (VBE) of a single transistor to switch The curves in Fig.5 are exponential, In the saturation region both junctions it on, and which has a current gain so the rate of increase rises as the are forward biased, so each junction approximately equal to the product applied voltage increases. Thus, small will have about 0.6V across it. For of the gains of the two individual increases in applied voltage can result example, we might see VBE = 0.7V and transistors (so potentially up to tens in very large current increase. These VBC = 0.50. The collector to emitter or even hundreds of thousands). This curves are the input currents, so the saturation voltage (VCEs) is equal to indicates that a Darlington pair should collector current will be larger still in the difference between VBE and VBC in be able to achieve the gain of around most cases. The total current in the saturation, in this case 0.2V. 2000 that we calculated above. Before transistor is the sum of these junction looking at use of the Darlington pair currents plus the collector current. High current in switching applications in more The curves in Fig.5 indicate why the A single transistor-based switch detail, it is worth looking at the 2.2kΩ resistor is needed in the circuit is usually configured so that the characteristics of a single transistor in Fig.1 (and would be in the circuit transistor is saturated when the switch in Fig.3 too). If the 2.2kΩ resistor was is on. The resulting low voltage drop not present and the variable resistor from collector to emitter means that C C was adjusted to its minimum value the power dissipation is not excessive, (effectively zero resistances) the 9V even for relatively high load currents. B B supply would be connected directly However, care must be taken to Q1 Q1 Q2 Q2 across the transistors’ inputs. Ignoring ensure that the maximum collector E E the details of the Darlington pair for current (ICmax) is not exceeded. Again, a) NPN Darlington b) PNP Darlington the moment, and just considering the current of 78mA discussed doing this with a single transistor above would not be a demanding Fig.4. The Darlington Configuration (Fig.3) we see that the graph in Fig.5 specification for a discrete switching
Everyday Practical Electronics, February 2017
Circuit Surgery – FEB 2017.indd 55
55
16/12/2016 14:28
junction of Q2 will be reverse biased. Thus Q2 is not in saturation. The previous figures were very approximate, a slightly more realistic set of values is: Q1: VBE = 0.65 V, VCE = 0.19 V, IB = 33 µA, IC = 400 µA, β = 12 Q2: VBE = 0.79 V, VCE = 0.84 V, IB = 433 µA, IC = 71 mA, β = βF 164.
Fig.5. Plot of base-emitter (IBE, red trace) and base-collector (IBC, blue trace) junction characteristics (applied voltage vs. current). The base-collector junction conducts at a lower voltage than the base-emitter junction. only covers voltages up to 1V. The steep increase even at 1V indicates that by VBE = 9V the transistor’s input current would be extremely large. In fact it would be so large that it would destroy the transistor due to excessive power dissipation. Note that this potential destruction is due to power dissipation from input current and voltage, not necessarily due to the load current, although that could play its part in the destructive scenario. This situation does not change significantly for the Darlington pair. Although the individual junction voltages would be smaller, with a 9V input, with no base resistor the power dissipation would still be more than sufficient to destroy the transistors. The 2.2kΩ resistor limits the maximum current into the base. Again, using a rough figure, this cannot be more than 9V/2.2kΩ, about 4mA – less in practice, because the base-emitter voltage(s) mean that the full 9V would not be dropped across the resistor. Forced beta Going back to the single transistor scenario (Fig.3), we can use Fig.5 for reference, we see that a 4mA total input (base) current to the single transistor would imply that the transistor is saturated with almost all of the 4mA base current flowing into the base-collector junction. As far as the input is concerned, this is a safe level (the power dissipation due to the input current and voltage is not excessive). As long as the load current is low enough, the transistor will not burn out. Also, assuming the 115Ω discussed above, the ratio of collector to base current would be about 78/4, that is, approximately 20 – significantly lower than the 100 or 200
56
Circuit Surgery – FEB 2017.indd 56
usually quoted as a typical transistor gain. The properties of a transistor in saturation are different from those in the active region of operation and we need to be careful about making familiar assumptions about transistor operation which really relate to the forward-active operation. An important characteristic of the transistor in the forward-active region is the already mentioned current gain β, or strictly speaking the ‘forward current gain’ βF. In the forward-active region the collector and base currents are related by the well know relationships: IC = βFIB and
IB = IC/βF
Values of βF will be given on transistor data sheets and are typically in the range 100 to 200. However, as we have just seen, these ‘standard’ β values do not apply in the saturation region. For a transistor in saturation the base current is greater than IC/βF. In fact the base current exceeding IC/βF can be regarded as a condition for saturation. The value of IC/IB in saturation is called the ‘forced beta’. Saturated Darlington It would be easy to assume that when a Darlington pair is used as switch that both transistors are in saturation, but the real situation is more complex. Referring to Fig.1, assuming both transistors are on, then the baseemitter voltages of both transistors will be approximately 0.65V. If we assume Q1 is in saturation with a VCE of about 0.2V then the voltage at the collector of Q2 must be equal to the VBE of Q2 plus the VCE of Q1, so it will be about 0.85V. This implies the VBC of Q2 will be about –0.2, so the base-collector
These figures correspond with the graphs in Fig.5 and the input and load currents (33µA and 71mA) are close to our earlier estimate of 41µA and 78mA. The overall current gain of the transistor pair is 12×164, about 2000, which matches the requirement discussed above. In general, a Darlington configuration prevents the second transistor from entering saturation, which helps keep the gain of the pair relatively high, but has the disadvantage that the voltage across the output transistor is larger than it would be for a single-transistor switch. This is important in power switching applications because it means greater dissipation due to the larger voltage drop across the device when it is on. However, for the circuit discussed here, the dissipation of about 60mW in Q2 is not likely to be of serious concern. Darlington package The Darlington configuration can be built using two individual transistors, but Darlington pairs in a single package are also available. A typical example is given in Fig.6, which shows the equivalent circuit of the TIP120. This devices includes a protection diode and a couple of resistors. The resistors act as pulldowns to make sure the transistor is off when required – this is particularly important if the drive circuit is high impedance when it is off. Another disadvantage of the Darlington pair is that it can be rather slow in switching – this is not likely to be an issue for the circuit in Fig.1, but may be of concern in high performance applications. The problem is due to the fact that the first transistor cannot switch the second one off quickly – it goes open, circuit leaving charge in the base of the second transistor, which takes time to shift. This problem is alleviated by connecting a C
B
R1 8kΩ
R2 120Ω E
Fig.6. Example Darlington power transistor internal circuitry. This is the TIP120 from the Fairchild datasheet (fairchildsemi.com)
Everyday Practical Electronics, February 2017
16/12/2016 14:29
resistor from the base of the second transistor to ground (as R2 is in the circuit in Fig.6). Another issue with the Darlington pair is that any leakage current in the first transistor will be amplified by the second, meaning that total leakage effects may be quite large. Again, the R2 (Fig.6) base resistor helps – it is selected to ensure that its voltage drop when the first transistor’s leakage current is flowing through it is such that the second transistor will not turn on.
Current mirrors for High-Side Current Measurement – errors in diagrams Unfortunately, some errors crept into a few of the figures in last month’s Circuit Surgery on the use of current mirrors for high-side current measurement. The problems were spotted by Chat Zone users bowden_p and james – ‘thank you’ to them for pointing it out. My original diagrams were fine, but I did not notice the errors in the proof copies so they made it to press. The correct diagrams are printed here. Corrected Fig.1 includes the missing base wiring for Q3 and Q4. Corrected Fig.2 and Fig.3 show the correct voltage polarity and current direction respectively for the sense resistor RS.
Protection diode Finally, in relation to wolfie’s third question, we should mention the need to protect the transistor from back emf from the relay coil. When current in an inductive load, such as a relay or solenoid coil is switched off, the magnetic field, which had been established by the supplied current collapses, inducing a voltage known as the ‘back emf’ or ‘inductive kickback’. The inductor stores energy in a magnetic field while the current is flowing through it, but returns the energy to the circuit when the current is switched off. For the circuit in Fig.1, the back emf appears as a positive voltage spike at the collector of the transistor. This may result in voltages large enough to damage or destroy the transistor (possibly hundreds of volts). The more rapid the change in current as the inductor is switched off, and the larger the inductor value, the greater the back emf generated. The usual method of preventing the back emf from causing problems is to place a diode (variously called a ‘freewheeling diode’, ‘flyback diode’ or ‘snubber diode’) across the inductor, as shown in Fig.1. The term ‘clamped inductive load’ is also used in this situation. This diode is reverse biased when the power-switching device is on, but is forward biased by the back emf; so the diode dissipates the power or
Corrected-CS1-Feb17 75mm x 1 COL
Looking to advertise? Contact
RS
IL
Input
To load Rm
Q1
Q2
RB
Q3
Q4
Vout
Ro
Corrected Fig.1. Ken Wood’s high-side current monitor circuit
IL V+
+
– RS
VS
Supply
Measurement circuit
Vo
Load
0V Gnd
Corrected Fig.2. High-side supply current measurement. VO is proportional to IL
Stewart Kearn on: V+
VS
Supply
Measurement circuit
Vo
Load
IL 0V Gnd
01202 880299 or email
Corrected-CS3-Feb17 42mm x 1 COL
stewart.kearn@ wimborne.co.uk
Everyday Practical Electronics, February 2017
Circuit Surgery – FEB 2017.indd 57
–
RS
+ Possible measurement circuit negative supply connections
Corrected Fig.3. Low-side supply current measurement. VO is proportional to IL
57
16/12/2016 14:33
AUDIO OUT
AUDIO OUT
L
R
By Jake Rothman
Totally derailed: powering amplifiers – Part 3
Stereo wiring layout and hum loops A stereo amplifier is just two mono amplifiers fed off the same power supply. However, there is an opportunity for an earth loop to occur (as shown in Fig.21a) because the two amplifier earths are joined at two points, the power supply and at the input. This loop can often give an earth buzz of 5 to 20mV on the speaker terminal. 5mV is enough to be heard with ones ear close to the speaker. The earths on the input sockets are normally connected together on the socket, pre-amplifier and signal source. Most stereo PCB-mount phono sockets have a single earth pin. The earth problem is avoided in professional amplifiers by the use of balanced inputs that don’t need an earth to pass the signal. For unbalanced inputs, a AO-Jan17-Fig.21 common trick is to use 2.2Ω to 22Ω 168mm x 1.5 COL ground-lift resistors between the signal grounds and the main ground point on the power supply. This was devised Toby-Dinsdale (Wireless World, Jan 1965) and also used in the ground-breaking Quad 303 power amplifier in 1969. The input shared ground is then connected
58
Audio Out (MP 1st & JR) – FEB 2017.indd 58
Input R Amp1
Earth joined in source – eg, CD player
Common earth point in power supply
Earth loop
Amp2 Input L
a)
+18V 14 Power amlifier eg, LM380 Input driver stage
2
Input R
7 Joined
+
by a thick single connection to the main ground point (Fig.21b). There is the possibility this resistor may increase distortion since it may affect operation of the feedback loop, but I have not seen any evidence for this. Another technique is to use a mirror image layout with the centre earth rail for the both left and right channels signal earths (Fig.21c) connected to the shared supply earth. Using the same transformer core with two separate secondaries and rectifiers provides complete earth isolation (Fig.22). I once saw a guitar amplifier with an intractable earth hum. I had a look at the PCB and saw the earth track running continuously all the way round the outside of the board. With a deft application of the side cutters, breaking the loop instantly cured the hum.
Output stage
LS1
3, 4, 5, 10, 11, 12
10Ω
Power amlifier eg, LM380
+
Mains ground The mains ground/earth is connected to the metalwork to prevent electric shock. It should also be connected to the amplifier earth. This has to be done via a ground-lift resistor to prevent an earth loop forming. This is typically a 1kΩ 0.5W device, with a 10nF ceramic RF bypass capacitor. It is convention to connect this to the input socket ground, since this is the defining point of 0V. In practice, it can be connected to the signal ground or dirty ground point with little difference in hum level. If there is any mains leakage current flowing, say from a high interwinding capacitance on the mains transformer, it would be best to connect it to the dirty ground. On amplifiers with a balanced input the earth plays no part in signal transmission and pin 1 is simply connected to the metalwork/mains earth.
Input L
LS2
Signal earth b)
10Ω Resistors break earth loop Star earth
Left input
R1
C1
D1 Common earth rail
Shared 0V
R1
C1
D1
Right input
c)
Distorted rails Another problem Fig.21 a) Wiring layout for a stereo amplifier, b) Using ground-lift with class AB am- resistors, c) alternative mirror image stereo amplifier layout (often plifiers is that the used for PCBs) rectified audio rides on top of the sawtooth hum waveform channels. Using the same secondary on the unregulated power supply, as but separate rectifiers and smoothshown in Fig.23. This causes a degree ing caps provides some isolation of of distorted crosstalk between both this signal – see Fig.24. Individual
Everyday Practical Electronics, February 2017
16/12/2016 14:40
Dual transformer (standard toroid)
+ Input L
Amp1
+ L
–
230V Mains input
the ‘cost-no-object’ fraternity, two separate mono amplifiers with individual power supplies, or monoblocks is the way to go.
A new test? One test I always do on stereo/mul+ ti-channel amplifiers and active loud+ Amp2 Input R speakers is to drive one output hard – into a load resistor and listen to any resulting noise on Fig.22. Inter-channel power rail and ground isolation provided by sep- the other outputs arate secondary windings on mains transformer. (Fig.25). I once sent an active speaker back because I could hear distorted bass harmonics in the tweeter output when the bass amplifier was clipped into a load resistor. A bit of track cutting and rerouting fixed it. Fig.26 shows the layout of a stereo power amplifier using the circuit from Audio Out September 2016. 10Ω ground-lift resistors have been inserted AO-Jan17-Fig.25 by cutting the ground track from the 48mm x 1 COL driver stage. Notice the noding on the main smoothing capacitor in Fig.27. A normal bridge rectifier is used. If schottFig.23. Oscillogram showing how audio suky diodes are used an additional volt is perimposes itself onto the ripple waveform on usually gained for a given transformer. the power supply. These rectifiers have to be discrete since decoupling capacitors for each am- they are not available in high current plifier fed by resistors from the main bridge versions – see Fig.28. smoothing capacitor also helps. A single transformer with separate Ripple current secondaries (Fig.22) provides almost One thing to watch out for, especially total inter-channel isolation, apart with class-A amplifiers, which draw a from a bit of voltage sag due to the large continuous current, is the ripple mutual primary resistance. If you are of current rating of the capacitor. It should be at least two times the DC current supAmp1 1N4502 plied. One way of 3A L measuring the ripAmp2 ple current is to put 230V + Mains 25V a clamp meter set to input + + the 2A AC range on 6A 4700µF 4700µF bridge 35V 35V N the capacitor lead. If you don’t have a true – a) 0V RMS meter, an approximation allow2.2Ω ing for the pulsed Amp1 + nature of the wave2200µF form is to multiply 2.2Ω the current reading From Amp2 rectifier by two. If the rated current is exceeded, + + the capacitor warms 2200µF 4700µF up, which results in an increase in 0V b) its ESR (equivalent Isolating distorted music signal on power supply series resistance) as it dries out. It then Fig.24. Providing separate rectifiers and smoothing capacitors gives gets hotter and the effective isolation of audio on the supply rails. 0V
Earths joined
Everyday Practical Electronics, February 2017
Audio Out (MP 1st & JR) – FEB 2017.indd 59
N
Signal generator
Input
Load resistor driven to full power
Input grounded Listen here
Fig.25. Testing dual-channel amplifiers to check for supply modulation.
Fig.26. Prototype of stereo audio amplifier using Taylor-Rothman amplifier modules (EPE, Sep 2016). I included 10Ω ground-lift resistors, which eliminated a hum-loop that put 7mV on the output.
Fig.27. Noding on a power supply capacitor. The lower left cable cluster contains the ground cables/stub; the upper left contains the power cables/stub.
Fig.28. If you use a schottky bridge rectifier it will have to be made from individual diodes.
process accelerates until the capacitor becomes an open circuit. If an old amplifier has developed a loud 100Hz hum it is usually the smoothing capacitors have dried out. It is convenient to check them in circuit by using an ESR meter, such as the peak ESR70, which I hope to review soon.
59
16/12/2016 14:41
are three identical Timer2 modules and are 8-bit timer and period registers, which are commonly used by the PWM modules. The timers are based on the clock oscillator chosen. As mentioned earlier, for most of the examples, we will be using the internal oscillator. There are three internal system clock sources, the 16MHz High-Frequency Internal Oscillator (HFINTSOC), the 500kHz (MFINTSOC) and the 32kHz Low-Frequency Internal Oscillator (LFINTSOC). Consider the flowchart in Fig.2. We start the timer, increment the timer every time there’s a rising edge on the clock and reset the timer once it’s reached its maximum value. Now it’s time to look at some code and see how this all comes together. Timer0 example Lesson 9 in the PICkit 3 Starter Kit User’s Guide covers an example using Timer0. It takes directly from Lesson 3: Rotate, which we covered back in October. Instead of using a delay function like __delay_ ms(500) to rotate around the four on-board LEDs, we will use Timer0. The problem with the delay function is that it uses a while loop for the entire time specified, and thus takes up all the processor’s time and power. By using the Timer0 module, we are offloading this counting elsewhere, so the processor is free to perform other tasks.
Start timer
Run timer
Clock rising edge?
No
Yes
Increment timer
Check for maximum timer value?
No
Yes
PnM3-Feb17 204mm x 1 COL Reset timer
Fig.2. Timer operation flowchart
void
while (1) { while (!INTCONbits.TMR0IF) continue; INTCONbits.T0IF = 0; LATC >> = 1; if (STATUSbits.C) LATCbits.LATC3 = 1; } } Fig.3 shows an accurate description of the code above. First we set the clock oscillator to 500kHz using the OSCCON special function register. Then we set Port C, which is connected to our LEDs, to outputs and set them to low output, ensuring they’re off to start with. Then we set our Option Register using the OPTION_REG register. This sets our prescaler rate to 1:256. A prescaler is a method to reduce a high frequency to a lower frequency by integer division. We’ll look at why shortly. In this case, the oscillator is 500kHz, the prescaler is 1:256, so Timer0 only increments once for each 256 rising edges of the clock. In effect, reducing our clock speed to 500,000 / 256 = 1953Hz. We’ll come back to this in a moment. In the while loop, we have a new control register INTCON and the Timer0 Overflow Interrupt Flag bit. The Interrupt Control Register (INTCON) controls various interrupts in the PIC. An interrupt is an event that is captured by the microcontroller, which ‘interrupts’ the current behaviour of the running code and does some task based on the event, before returning to normal operation. A button press is an example of an interrupt, which can be set up to turn on an LED every time the button is pressed. Instead of checking if the button is pressed, the interrupt controller will automatically check for you, which saves time and code. In this example, the event is the Timer0 reaching its maximum value. Since it’s an 8-bit timer, the maximum value it can hold is 2^8 = 256. As the prescaler is 1:256, the Timer0 will increment every 256 rising edges of the clock. Once the maximum value is reached in Timer0, the Timer0 Overflow Interrupt Flag bit (TMR0IF) is set to a ‘1’. Inside the while loop, we check to see if this flag is set and if it is, the flag gets reset. Then we right shift Port C, just like in Lesson 3: Rotate. Before the while loop is restarted we turn on the LED at Port C3 if the carry bit is set – STATUSbits.C What we’re really trying to do here is rotate the four LEDs, changing every half a second. The big question here is, how do get from a clock frequency of 500kHz to an LED flashing that we can actually see. This is where the prescaler comes into play.
Everyday Practical Electronics, February 2017
Pic n Mix (MP 1st) – FEB 2017.indd 61
main(void) { OSCCON = 0b00111000; TRISC = 0; LATC = 0; OPTION_REG = 0b00000111; LATCbits.LATC4 = 1;
Set Clock to 500kHz
Set Port C to outputs
Set Port C as low
Set prescaler to 1:256
Set Port C4 as high or ‘1’
While loop
Check if Timer0 interrupt flag is set
No
Yes
Clear Timer0 interrupt flag
Right shift Port C by 1
Check if Carry Bit in Status is set
No
Yes Set Port C3 as high or '1'
Fig.3. Timer0 example code flowchart!
61
16/12/2016 14:39
When the prescaler is equal to 1, Timer0 will increment at the same speed as the clock oscillator. If the prescaler is 256 and the maximum Timer0 value is 256, then we need 256 × 256 = 65536 rising clock edges before the interrupt flag is set. The period of the clock oscillator is the reciprocal of the frequency, which is 1/500,000Hz = 2µs. If we multiply the number of clock edges we need (65536) by the period (2µs), we calculate how often our LED will change, 65536 × 0.000002s = 0.131s, which is still faster than we want. We’re missing one final piece of the puzzle. We want the LED to change every half a second or 500ms. The code above is correct; however, we didn’t take into account the length of time for an instruction cycle. This is sometimes called a fetch-decodeexecute cycle, which is a fundamental aspect of the internal workings of the PIC microcontroller. When we write our code, the microcontroller must decode it to understand what it needs to do. First, the PIC fetches the next command from program memory
(eg, LATCbits.LATC3 = 1), then it must determine what this instruction means, and then execute the required actions. According to the datasheet, for the PIC16F1829, an instruction cycle clock is equal to FOSC/4. Thus, an instruction cycle (or period) is the reciprocal of the clock, which means the clock oscillator, which is 500kHz, is divided by four to handle each instruction inside the PIC. With this in mind, the effective clock oscillator period is now (1 / (500,000 / 4) = 8µs. Therefore the LEDs will rotate at 65536 × 0.000008s = 0.524s, which is close enough to half a second. The watchdog timer I said there are only three timers inside the PIC; however, I should add the watchdog timer. This is a separate timer, with a very useful function. When enabled, this timer must be reset periodically or it will reset the PIC microcontroller. It’s a safety mechanism to help if your software or hardware has gone awry and it can’t fix itself. I highly recommend
implementing a watchdog timer into any code you write and let the PIC save itself. Next month We’ve covered a few important and detailed topics in the last few months, including PWM, timers and debounce. Next month, I’d like to take a break and build a little project using our newfound skills. The project won’t involve the Low Pin Count Demo Board this time, but we’ll stick with the PIC16F1829 and use some Veroboard.
Not all of Mike’s technology tinkering and discussion makes it to print. You can follow the rest of it on Twitter at @MikePOKeeffe, up on EPE Chat Zone as mikepokeeffe and from his blog at mikepokeeffe.blogspot.com
CRICKLEWOOD ELECTRONICS Established 1981
Frustrated with your supplier? suppier? Visit our component packed website for a vast range of parts - old and new, many unavailable elsewhere! www.cricklewoodelectronics.com 1000’s OF PRICES REDUCED! 1000
JTAG Connector Plugs Directly into PCB!! No Header!
Alternatively phone us on 020 8452 0161 with your requirements.
No Brainer!
Our patented range of Plug-of-Nails™ spring-pin cables plug directly into a tiny footprint of pads and locating holes in your PCB, eliminating the need for a mating header. Save Cost & Space on Every PCB!! Solutions for: PIC . dsPIC . ARM . MSP430 . Atmel . Generic JTAG . Altera Xilinx . BDM . C2000 . SPY-BI-WIRE . SPI / IIC . Altium Mini-HDMI . & More
www.PlugOfNails.com
Tag-Connector footprints as small as 0.02 sq. inch (0.13 sq cm)
62
Pic n Mix (MP 1st) – FEB 2017.indd 62
Visit our Shop, Call or Buy online at:
www.cricklewoodelectronics.com
020 8452 0161
Visit our shop at: 40-42 Cricklewood Broadway London NW2 3ET
Everyday Practical Electronics, February 2017
16/12/2016 14:39
Development Tool of the Month! PIC32 Ethernet Starter Kit II
Part Number DM320004-2
Overview:
Key Features:
The PIC32 Ethernet Starter Kit II provides the easiest and lowest-cost method to experience 10/100 Ethernet development with PIC32 microcontrollers. Combined with Microchip’s free TCP/IP software, this kit gets your project running quickly. The PIC32 microcontroller has an available CAN 2.0b peripheral and USB host/device/OTG. This starter kit features a socket that can accommodate various 10/100 Ethernet transceiver (RJ-45) PHY Daughter Boards for prototyping and development and an expansion connector that enables the addition of Microchip’s PIC32 expansion boards or the creation of your own board.
USB-powered board Includes 10/100 Fast Ethernet LAN8740 PHY Daughter Board USB and Ethernet connectors, user switches and LEDs Integrated programmer/debugger Standard A to mini-B cable for debugger Standard A to micro-B cable for USB application development PIC32 running at 80 MHz with 512K Flash, 128K RAM, 8 channel DMA + 8 channel DMA dedicated to Ethernet, CAN and USB
Order Your PIC32 Ethernet Starter Kit II Today at: www.microchipdirect.com
microchip DIRECT The Microchip name and logo, PIC and MPLAB are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. All other trademarks mentioned herein are the property of their respective companies. © 2016 Microchip Technology Inc. All rights reserved. MEC2133Eng12/16
FEB 2017 Page 63.indd 1
15/12/2016 10:42
Max’s Beans
if (brightness ==
fadeAmount = -fa }
// wait for 30 mil
By Max The Magnificent
delay(30); }
Upload this sketch
successfully, the LED back off again. If you wiring:
Fig.3. It’s all done with mirrors... well, LEDs actually (http://bit.ly/2eNHRC5). My chums Bruce and Bob from Out of the Box Exhibits (http://bit.ly/2eNCYsQ) added the rays of coloured light coming out of the ball to reflect the light effects in our cave, and they also created the stone-look picture frame and pillar. Fig.1. Yours truly (left), Mike Mittlebeeler (right), and Caveman Diorama (center). Having fun with Stone Age LEDs As you may recall – probably for longer than you care to recall – I’ve been waffling on about creating a caveman diorama. This all started several years ago when I found and refurbished an old wooden television cabinet and decided I wanted to create a diorama inside it. I tried making the cave out of chicken wire and papier mâché, but all I ended up with was tangling myself up in chicken wire and covered in papier mâché. Then my wife introduced me to Mike Mittlebeeler, an ex-Apache helicopter pilot whose hobby is making model railways and military dioramas. For more than a year now, Mike and I have been meeting up in my office on Saturday mornings to work on the caveman diorama. A few weeks ago, although it’s not yet finished, we decided to enter it in a local modeling competition as a work in progress. When we arrived at the competition, we established a base station in the corner of the exhibition area, as seen in Fig.1. As an aside, the large image of the caveman holding the stone bowling ball in the background was created by CG artist Jeroen Cloosterman (http://bit. ly/2dUNlJP). Jeroen kindly gave us permission to use this image – the full-size version is truly spectacular
Fig.2. Home sweet home... ca. 10,0000 BC
if (brightn
fadeAmou } // wait for
Where does the space go? We’re working at a 1:32 scale, which means that a sixfoot-tall man would be 2.25-inches in height in our diorama. One thing we’ve discovered is that it’s incredibly easy to fill up a cave with ‘stuff.’ We don’t have the room to show close-up images of everything here, but I’ve included some highlights. Let’s start by considering the cave as a whole – See Fig.2. Towards the back of the scene we see the entrance to the cave. The mountains and sky are being presented on a flat-screen computer monitor about six inches behind the entrance. Currently this is just a still image, but in the fullness of time we intend to model the outside world using 3D software and generate this scene on the fly. This will allow us to do all sorts of things, like having a volcano erupt at noon each day, and having the weather in the diorama match the weather in the real world outside my office. In the middle of the cave in the foreground we have our fire (Fig.3). We’re really rather proud of this. At the bottom are 19 tri-coloured LEDs. Then we have a cone of crunched glass bound with clear epoxy, which provides myriad internal reflections and refractions. Twigs that have been burnt at the ends surround this. The whole effect is extremely realistic when the LEDs are randomly flickering away. On the left-hand side of the cave is a pool (of clear epoxy) with tiny fish in it. There’s also a small wooden rack with drying fish hanging from it. This is probably a good point to note that we have tri-coloured LEDs hidden all over the place, including about 30 at the bottom of the pool, which allow us to introduce a nice ripple effect. On the floor at the foot of the entrance we find a pile of logs. It was only after we’d glued these down that a friend pointed out that the ends were too smooth to have been cut with stone axes, and instead they appeared to have been cut with a chain saw. Fortunately, we have a time portal (Fig.4) to explain my presence sitting around the fire with the cavemen (when we get around to adding the figures as discussed below), so we added a chainsaw to the scene. Also, note the three wooden ladders – one located behind the logs and the other two near the floodlights. These are tied with white
delay(30) } Upload th
successfully back off aga wiring:
64 64 Everyday Practical Electronics, February 2017
Cool Beans (MP 1st & Max) – FEB 2017.indd 64
13/12/2016 06:10
end of the series. School of Architecture among others.
based in London. He teaches interaction design and prototyping at the REGULAR COLUMN: ARDUINO PROJECTS l 37 l 37 REGULAR COLUMN: ARDUINO PROJECTS Goldsmiths College and the Bartlett REGULAR COLUMN: ARDUINO PROJECTS l 37 supply and REGULAR COLUMN: ARDUINO PROJECTS l 37 if (brightness == 0 || brightness == 255) { your name, address l Make sure the correct pin numbers are being used. School of Architecture among others. email to the Editor at svetlanaj@ WINisTHE ‘ARDUINO FORWe DUMMIES’ BOOKleg fadeAmount = -fadeAmount ; l Check the LED correctly positioned, with long WIN THE ‘ARDUINO FOR aits DUMMIES’ BOOKl have couple of copies of 37 this REGULAR COLUMN: ARDUINO PROJECTS sjpbusinessmedia.com. Figure 2: Figure Layout 2: diagram WINdiagram THE ‘ARDUINO DUMMIES’ BY JOHN NUSSEY WIN THE ‘ARDUINO FOR DUMMIES’ BOOK Layout BY JOHN NUSSEY } connected byFOR a wire to pin 9BOOK and the short leg connected via please book to give away. To enter the project Figure 2: Layout diagram BY JOHN NUSSEY for be thedrawn project Thefor winner will at Figure 2: Layout diagram BY NUSSEY // wait for 30 milliseconds to see the dimming effect theJOHN resistor and a wire to GND. supply your name, address and Figure 2: Layout diagram for the project WIN THE FOR BOOK for the project John ‘ARDUINO Nussey a creative random and announced at the JohnisNussey is DUMMIES’ atechnologist creative technologist for the project l Check the connections the jumper wires delay(30); the code to on the breadboard. email to Ifthe Editor at svetlanaj@ Figure 2: Layout diagram We have a couple of copies of this book to give away. To enter please
}
end of the series.
John Nussey is aBY creative technologist JOHN NUSSEY in London. teaches John Nussey is abased creative technologist based inHe London. Heinteraction teaches interaction
or components are not connected using the correct rows in the transition the for the project based inbased London. He teaches interaction sjpbusinessmedia.com. design and prototyping at the in London. He teaches interaction design and prototyping at the images being l Bartlett will not work. Upload this sketch to the board, and if everything has uploadeddesign design andbreadboard, prototyping atthey the isat Johnprototyping Nussey aGoldsmiths creative technologist Goldsmiths College and the and the The will be drawn at College and winner the Bartlett
REGU REGULAR COLUMN:R displayed on College and the Bartlett successfully, from off to full brightness based inSchool London. He teaches interaction ofthe Architecture among others. Goldsmiths College and Bartlett ightness == 0 || brightness the == LED 255) fades { l Make sureand thethen correct Goldsmiths pin numbers are being School of Architecture amongand others. random announced at the REGULAR COLUM the timeused. porWI REGULAR COLUMN: ARDUINO PROJECTS l 37 School of Architecture among others. We have aWe couple of copies ofend this School of Architecture among others. More on this and other Arduino projects can be found in the back off again. If you don’t see any fading, double-check theis correctly design and prototyping at the Amount = -fadeAmount ; l Check the LED positioned, with its long leg have a couple of copies of this of the series.Figure tal’s screen, WIN THE ‘ARDUINO FO 2: Layout diagram BY a couple of copies of book tothis give away. Toaway. enter please We have aFor couple of copies of this connected by a wire toWe pinhave 9‘Arduino and thebut short leg connected via book to give To please Goldsmiths College and the Bartlett Dummies’ book by John Nussey. wiring: this part for the Figure project2: LayoutBY Figure 2:enter Layout diagram JOHN NUSSEY diagram WIN THE ‘ARDUINO WIN THE ‘ARDUINO FOR DUMMIES’ BOOK tobook give away. To enter please supply your name, address and to givethe away. To enter please for the project it for 30 milliseconds to see the dimming effect the resistor and a wirebook to GND. supply your name, address of dioraSchool of Architecture among others. Figure 2:and Layout diagramfor the project BY JOHN NUSSEY John Figure 2: Layout diagram BY JOHN NUSSEY your name, address and email to the Editor at svetlanaj@ your name, address and ma is still a for l Check the connectionssupply on thesupply breadboard. If the jumper wires y(30); John Nussey is a creative te email to the Editor at svetlanaj@ base We have a couple of copies of this the project for the project if (brightness == 0 || brightness ==Editor 255) {svetlanaj@ l Make sure the correct pin numbers are being used. toemail the work in progsjpbusinessmedia.com. to theat Editor at svetlanaj@ John Nussey is a creati or components are notemail connected using the correct rows in the based in London. He teache sjpbusinessmedia.com. desig book to give away. To enter please Nussey is a creative technologist l Check the LED is correctly positioned, with its long He leg fadeAmount = John -fadeAmount ; sjpbusinessmedia.com. (hence sjpbusinessmedia.com. The winner will be drawn at drawn based London. te breadboard, they will not work. l ress oad this sketch to the board, and if everything has uploaded design and in prototyping at th The winner will be at Golds supplyfact your name, address and based in London. He teachesthe interaction that connected by a wire to pin 9 and the short leg connected } The winner will be drawn at random and announced at the The winner will be drawn at design College and prototyping sfully, the LED fades from off to full brightness and then Goldsmiths andScho the random and announced at the design and prototyping at thewe email to the Editor at svetlanaj@ random andthe announced atdidn’t the for on 30this milliseconds to see dimming end of effect the series. random and announced atin the Goldsmiths College and other Arduino projects can be found the ff again. If you don’t see any fading, double-check the // waitMore of Architecture amon end of the series. the resistor and a wire to GND. School Weand h Goldsmiths College and the Bartlett have time to sjpbusinessmedia.com. end of series. end of the series. Fig.4. Max’s time portal School of Architecture l Check the connections on the breadboard. If the jumper delay(30); ‘Arduino For Dummies’ book bythe John Nussey. : We have a couple of copies booka the porSchool of Architecture amongpaint others. The winner will be drawn at We have a couple of co to give To enter or components are not connectedbook using theaway. correct rows } supp mount cotton thread that was dyed in tea (each knots We of havethese a couple of copies oftal this or and random announced at the if (brightness == 0 || brightness == 255) { l Make sure the correct numbers are being used. book toname, give away. To e supply your address if (brightness == || brightness ==board, 255) {and if everything l Make sure thepin correct pin numbers are being used. the screen for emai took me about seven minutes to 0tie). breadboard, they will not work. l Upload this sketch to the has uploaded book to give away. To enter please end of the series. if (brightness == 0have ||== brightness l Make the correct pin numbers are being fadeAmount === -fadeAmount lcompetiCheck the LED is correctly positioned, with its long if (brightness 0a||fadeAmount brightness == 255) {; LEDs l sure Make sure the correct pin numbers areused. being used.positioned, name, add to theyour Editor at svetlan = {-fadeAmount ;fades l Check the LED is correctly withleg its long legemailsupply the We also bunch of255) tri-coloured at the back sjpbu successfully, the LED from off to full brightness and then supply your name, address and fadeAmount = -fadeAmount l Check LED correctly positioned, with long leg }= -fadeAmount connected bypositioned, a wire toits 9 and the9short legshort connected via sjpbusinessmedia.com. fadeAmount ; l the Check theisLED is correctly with its long leg tion), so I’llconnected email to the Editor at sv of the tunnel located half way up theemail left-hand wall, } ; by apin wire to pin and the leg connected via w to thesee Editor svetlanaj@ on this and other Arduino projects can be found The in th back off again. If you don’t anyatfading, double-check the the short legMore } connected by a wire pinresistor 9toand via share that 155 of30the little scamps inconnected // another wait for 30 milliseconds to see the effect the a wire toconnected } along with by to aall wire pin 9resistor and theand short leg connected via sjpbusinessmedia.com The winner will be drawn at // wait for milliseconds to dimming seehidden the dimming effect theand aGND. wire to GND. rando if (brightness == 0 || brightness == 255) { sjpbusinessmedia.com. ‘Arduino For Dummies’ book wiring: Fig.5.pin More LEDs inbeing the tunnel and by theJohn Nussey. in al future the ceiling (Fig.5). In fullness of time, we’ll have athe l // wait for 30 milliseconds tobrightness seethe the dimming effect the resistor and a wire to GND. Check connections on the breadboard. If the jumper wait for 30delay(30); milliseconds to see the resistor and a wire to GND. if//(brightness == 0 || ==dimming 255) { effect Make sure the correct numbers are used. Theand winner will beend draw announced at tho lthe Check the connections on the breadboard. If thewires jumper wires delay(30); fadeAmount =monitor -fadeAmount ;random The winner will down be drawn at column. waterfall coming out of the tunnel and splashing sky is generated by a PC delay(30); l Check the connections on the breadboard. If the jumper wires or components are not connected using the correct rows in the } l Check the connections on the breadboard. If the jumper wires delay(30); random and announced endinof the series. } or components are not connected using the correct rows the l Check the LED is correctly positioned, with its long leg fadeAmount = -fadeAmount ; and announced at the } rows in the onto the rocks in this the sketch center of poolrandom below. } or are notbreadboard, connected using the correct they will not work. lshort Upload tosketch thethe board, if everything hascomponents uploaded orhas components are notaconnected using the correct rows the end of the series. linconnected breadboard, they will not work. Upload this to theand board, and if everything uploaded connected by wire toto pin 9 and the leg via }} end of portal the series. So much fun stuff do… Returning to the floodlights and the time at the // wait for 30 milliseconds to see the dimming eff UploadUpload this sketch to the board, andLED if everything has uploaded breadboard, they will notwill work. l successfully, the fades from off to full brightness and then breadboard, they not work. l this sketch to the board, and if everything has uploaded successfully, the LED fades from off to full brightness and then (brightness == || brightness ==to 255) l Mak the resistor andtime aifwire GND. // wait for 30 side milliseconds to see thecase dimming …and so little totodo it all in.0 We’ve still got get{the right-hand of the cave. In the of the effect floodlights, delay(30); successfully, the LED fades from off to full and then More on More this0and other Arduino projects be; found in found the back again. If again. you don’t see fading, the successfully, the LED fades from off brightness to If full brightness and then (brightness == || brightness 255) l sure the correct pin on this and Arduino projects can be in Make the back off you don’t see anydouble-check fading, double-check the ifon (brightness == {0can || == 255) { l fadeAmount === -fadeAmount l Chec up and running and add the waterfall, plus liftime Checkportal the connections theother breadboard. If brightness the jumper wires delay(30); which will beoff used to illuminate aany caveman standing on } by More on thison and other Arduino projects can be found in the back off again. you don’t anysee fading, double-check the ‘Arduino For Dummies’ book Nussey. wiring: More this other Arduino projects beJohn found in the back off If again. If yousee don’t any fading, double-check the ifand (brightness == 0 || brightness == 255) { main l Make sure the correc fadeAmount =‘Arduino -fadeAmount ;can l Check the LED is correctl For Dummies’ book by John Nussey. wiring: l fadeAmount = -fadeAmount ; a lot of other little fiddly details, but the thing is to } conn a ladder creating a cave painting, we’re running the powor components not connected using the correct rows in the if (brightness ==}0 || brightness == 255) { l Make sure ‘Arduino the correct pin numbers are beingare used. For Dummies’ book by John Nussey. wiring:wiring: sketch to the board, and if everything has ur ‘Arduino ForfadeAmount Dummies’ book by John Nussey. l Check theaLED cor = // -fadeAmount ;Upload this } add connected by wire is tothe pin the figures. We’re now thinking of modeling these } er, ground, and control signals up their legs. The 3D print wait for 30 milliseconds to see the dimming effect l Check LED is correctly positioned, with its long fadeAmount = -fadeAmount breadboard, they will leg not work. l Upload this; sketch to the board, and if everything hasthe uploaded a 30 program called Daz 3D (http://bit.ly/2f9SK0t) } for connected by a wire files for these were created by my chum, Steve Manley, successfully, the LED fades from off to full brightness and //using wait milliseconds to see the dimming effect the resistor and a wire to // wait l Chect delay(30); connected by a wire to pin 9 and the short leg connected via for 30 milliseconds to see the dimming effect } successfully, the LED fades from off to full brightness and then and 3D30 printing them, which means that we now in the UK (you can access a ZIP file containing the 3D delay(30); the resistor and aorwir // then wait for milliseconds to see the dimming effect l Check the connections on l delay(30); back off again. If you don’t see any fading, double-check t co } the resistor wire toMore GND.on this and other // wait for 30 milliseconds to see the don’t dimming effect projects found there in the simback off again. Iffiles you see any fading, double-check theand to learn how Arduino to} use Daz 3D. Ican tellbeyou… floodlight here http://bit.ly/2fwWsWa; and thea 3D Check the connection delay(30); } need orlcomponents are not co brea Upload this sketch to the board, and if everything has uploaded wiring: l CheckMeanwhile, the connections on the breadboard. If the jumper wires delay(30); ply aren’t enough hours in the day! Until next time, breadboard, ‘Arduino For Dummies’ book byand John Nussey. wiring: time portal files here http://bit.ly/2erJmoR). components are no } Upload this sketch successfully, to the board, if everything has uploaded they will not Upload sketch the board, and if everything has uploaded LED fades to from off to full brightness andorthen or components not connected theone! correct rows in the thethis } have ausing good another chum, Daniel Whiteley, has been workingareon breadboard, will Upload this sketch to the board, and if everything has uploaded successfully, the LED fades from off to full brightness and then successfully, thedon’t LEDsee fades off to full brightness and then they More o back off again. If you anyfrom fading, double-check the breadboard, they will not work. l Upload this sketch to the board, and if everything has uploaded successfully, the LED fades from off to full brightness and then back off again. If you don’t see any fading, double-check the wiring:
LAMBDA GENESYS LAMBDA GENESYS HP34401A HP33120A HP53131A HP53131A HP54600B IFR 2025 Marconi 2955B R&S APN62 Fluke/Philips PM3092 HP3325A HP3561A HP6032A HP6622A HP6624A HP6632B HP6644A HP6654A HP8341A HP83731A HP8484A HP8560A HP8560E HP8563A HP8566B HP8662A Marconi 2022E Marconi 2024 Marconi 2030 Marconi 2305 Marconi 2440 Marconi 2945 Marconi 2955 Marconi 2955A Marconi 6200 Marconi 6200A Marconi 6200B Marconi 6960B with
the LED from off toIf full and fading, then double-check More on this the and other Ardu backsuccessfully, off again. If you don’tfades see double-check the M backany offfading, again. youbrightness don’t see any ‘Arduin wiring: MoreFor on this and other back off again. If you don’t see any fading, double-check the ‘Arduino Dummies’ book wiring: ‘A wiring: More on this and other Arduino projects can be found in the ‘Arduino For Dummies’ wiring: ‘Arduino For Dummies’ book by John Nussey.
PSU GEN100-15 100V 15A Boxed As New PSU GEN50-30 50V 30A Digital Multimeter 6.5 digit Function Generator 100 microHZ-15MHZ Universal Counter 3GHZ Boxed unused Universal Counter 225MHZ Digital Oscilloscope 100MHZ 20MS/S Signal Generator 9kHz - 2.51GHZ Opt 04/11 Radio Communications Test Set Syn Function Generator 1HZ-260KHZ Oscilloscope 2+2 Channel 200MHZ Delay etc Synthesised Function Generator Dynamic Signal Analyser PSU 0-60V 0-50A 1000W PSU 0-20V 4A Twice or 0-50V 2A Twice PSU 4 Outputs PSU 0-20V 0-5A PSU 0-60V 3.5A PSU 0-60V 0-9A Synthesised Sweep Generator 10MHZ-20GHZ Synthesised Signal Generator 1-20GHZ Power Sensor 0.01-18GHZ 3nW-10uW Spectrum Analyser Synthesised 50HZ - 2.9GHZ Spectrum Analyser Synthesised 30HZ - 2.9GHZ Spectrum Analyser Synthesised 9KHZ-22GHZ Spectrum Analsyer 100HZ-22GHZ RF Generator 10KHZ - 1280MHZ Synthesised AM/FM Signal Generator 10KHZ-1.01GHZ Synthesised Signal Generator 9KHZ-2.4GHZ Synthesised Signal Generator 10KHZ-1.35GHZ Modulation Meter Counter 20GHZ Communications Test Set Various Options Radio Communications Test Set Radio Communications Test Set Microwave Test Set Microwave Test Set 10MHZ-20GHZ Microwave Test Set 6910 Power Meter
Everyday Practical Electronics, February 2017
Cool Beans (MP 1st & Max) – FEB 2017.indd 65
£325 £325 £275-£325 £260-£300 £500 £350 from £75 £900 £800 £195 £250 £195 £650 £750 £350 £350 £195 £400 £500 £2,000 £1,800 £75 £1,250 £1,750 £2,250 £1,200 £750 £325 £800 £750 £250 £295 £2,500 £595 £725 £1,500 £1,950 £2,300 £295
£450 Tektronix TDS3012 Oscilloscope 2 Channel 100MHZ 1.25GS/S www.electronicsworld.co.uk £350 Tektronix 2430A Oscilloscope Dual Trace 150MHZ 100MS/S £600 Tektronix 2465B Oscilloscope 4 Channel 400MHZ £40 Cirrus CL254 Sound Level Meter with Calibrator £195 Farnell AP60/50 PSU 0-60V 0-50A 1KW Switch Mode £500 Farnell H60/50 PSU 0-60V 0-50A www.electronicsworld.co.uk £45 Farnell B30/10 PSU 30V 10A Variable No Meters £75 Farnell B30/20 PSU 30V 20A Variable No Meters £75 Farnell XA35/2T PSU 0-35V 0-2A Twice Digital £45 Farnell LF1 Sine/sq Oscillator 10HZ-1MHZ £150 Racal 1991 Counter/Timer 160MHZ 9 Digit £295 Racal 2101 Counter 20GHZ LED £45 Racal 9300 True RMS Millivoltmeter 5HZ-20MHZ etc £75 Racal 9300B As 9300 £30 Black Star Orion Colour Bar Generator RGB & Video £60 Black Star 1325 Counter Timer 1.3GHZ £50 Ferrograph RTS2 Test Set £75 Fluke 97 Scopemeter 2 Channel 50MHZ 25MS/S £125 Fluke 99B Scopemeter 2 Channel 100MHZ 5GS/S £1,950 Gigatronics 7100 Synthesised Signal Generator 10MHZ-20GHZ www.electronicsworl £60 Panasonic VP7705A Wow & Flutter Meter £75 Panasonic VP8401B TV Signal Generator Multi Outputs £750 Pendulum CNT90 Timer Counter Analyser 20GHZ www.electronicsworld.co.uk £95 Seaward Nova PAT Tester www.electronicsworld.co.uk £65 Solartron 7150 6 1/2www.electronicsworld.co.uk Digit DMM True RMS IEEE www.electronicsworld.co.uk £75 Solartron 7150 Plus as 7150 plus Temp Measurement £60 Solatron 7075 DMM 7 1/2 Digit £600 Solatron 1253 Gain Phase Analyser 1mHZ-20KHZ £30 Tasakago TM035-2 PSU 0-35V 0-2A 2 Meters £160-£200 Thurlby PL320QMD PSU 0-30V 0-2A Twice Thurlby TG210 Function Generator 0.002-2MHZ TTL etc Kenwood Badged £65
STEWART OF READING
17A King Street, Mortimer, near Reading, RG7 3RS www.electronicsworld.co.uk Telephone: 0118 933 1111 Fax: 0118 9331275 USED ELECTRONIC TEST EQUIPMENT www.electronicsworld.co.uk Check website www.stewart-of-reading.co.uk
65
13/12/2016 04:19
FULL COLOUR COMPUTING BOOKS
WINDOWS 8.1 EXPLAINED
KINDLE FIRE HDX EXPLAINED
AN INTRODUCTION TO THE NEXUS 7
Windows 8.1 is the latest version of Microsoft’s operating system. It is installed on all new Windows Desktop. Laptop and X86 tablet computers and is also available as a free upgrade. Whether you choose to use the touch screen Tile interface or the mouse operated Desktop interface, a good working knowledge of the operating system is essential to get the most from your computer and this book will help you to do just that.
This book is written to help users get to grips, quickly and easily, with the amazing Kindle Fire HDX tablet. You will be guided through the configuration and use of the Kindle Fire HDXs facilities and functions. This book was written using the 7” HDX but it is also applicable to the 8.9” model.
This book is intended for the new user of the Nexus 7, although much of it will also apply to the Nexus 10. It is easy to understand being written in plain English and avoiding technical jargon wherever possible.
The book applies to Windows 8.1, Windows 8.1 Pro and the vast majority of Windows 8.1 Enterprise. Also parts of the book should be applicable to windows RT 8.1 which is built on the same foundation as Windows 8.1 but is a restricted version designed specifically for ARM tablets. Among the many topic covered are: An overview of the Tile Interface, Desktop, Taskbar, Tray Notification Area, Charms bar and running Apps; managing Windows settings, personalising your PC and creating User Accounts; using the Desktop File Explorer, SkyDive, Internet Explorer and the E-mail App; working with and organising digital photographs, using Media Player to play and store music and to burn CDs and installing Media Center to play DVDs; connecting to wireless networks, setting up a HomeGroup, sharing a printer and networked PCs; using mobility tools to keep your laptop running while away from home; accessibility features should you have dexterity or eyesight problems; keeping your computer healthy and backing up important files; And much more besides…..
180 Pages
Order code BP747
£10.99
Among the many topics covered are: An overview of the Kindle Fire HDX. Charging and setting up, connecting to a Wi-Fi network, registering the device and connecting to Social Networks; setting up and using the 1-Click Amazon account for buying and downloading books, music and other content that you have searched for. Explaining the use of the Carousel. Starting screen Apps. Web and Device settings and the Mayday facility; browsing the web with Silk Internet explorer, using Bookmarks and History, printing web pages, documents and messages; connecting to a server to send and receive email messages, using and saving attachments. Creating and organising your Contacts and Calendar appointements; using the Kindle Fire camera to take photos and videos. Watching TV, listening to music you bought, imported and from the radio. Using the X-ray feature with books and other media; Using the OfficeSuite to view your documents, upgrading to OfficeSuite Professional 7 to allow both viewing and creation of Word documents. Excel spreadsheets and PowerPoint presentations. And more besides... This book will help you acquire the skills needed to understand and make the most of your Kindle Fire HDX.
118 Pages
Order code BP743
COMPUTING WITH A LAPTOP FOR THE OLDER GENERATION R.A. Penfold
128 pages
120 pages
Order code BP703
118 Pages
Order code BP744
£8.99
£8.49
AN INTRODUCTION TO EXCEL SPREADSHEETS Jim Gatenby
AN INTRODUCTION TO WINDOWS VISTA P.R.M. Oliver and N. Kantarris
120 pages
Order code BP702
Even if you are a complete beginner, this book will help you to easily acquire the skills needed to understand and make the most of the Nexus 7.
£8.99
HOW TO FIX YOUR PC PROBLEMS R.A. Penfold Order code BP705 £8.49
Among the many useful topics covered are: An overview of the main features of the Nexus 7; setting up the Nexus 7; charging the battery; connecting to the Internet and signing up for Gmail; touch-screen operation and navigating around the various screens; installing Apps from the Google Play Store; setting a password and other precautions to keep your files safe; connecting accessories such as a USB Drive, mouse and keyboard; enjoying entertainment such as eBooks, games, music and videos; searching the Internet, including speaking in keywords; using e-mail, Skype and social networking; installing the free Google Drive app to save your documents in the cloud; using Google Docs free word processing and spreadsheet software; printing a document using Google Cloud Print, Exporting Nexus 7 files to laptop and desktop computers; and much more besides….
£8.49
18 pages
Order code BP701
£8.49
BOOK ORDER FORM Full name: ....................................................................................................................................... Address: .......................................................................................................................................... ......................................................................................................................................................... ......................................................................................................................................................... .............................................. Post code: ........................... Telephone No: .................................... Signature: ........................................................................................................................................
I enclose cheque/PO payable to DIRECT BOOK SERVICE for £ .............................................. Please charge my card £ ....................................... Card expiry date......................................... Card Number ....................................................................... Maestro Issue No.............................. Valid From Date ................ Card Security Code ................
(The last three digits on or just below the signature strip)
THE BASIC SOLDERING GUIDE HANDBOOK LEARN TO SOLDER SUCCESSFULLY! ALAN WINSTANLEY The No.1 resource to learn all the basic aspects of electronics soldering by hand. With more than 80 high quality colour photographs, this book explains the correct choice of soldering irons, solder, fluxes and tools. The techniques of how to solder and desolder electronic components are then explained in a clear, friendly and non-technical fashion so you’ll be soldering successfully in next to no time! The book also includes sections on Reflow Soldering and Desoldering Techniques, Potential Hazards and Useful Resources. Plus a Troubleshooting Guide. Also ideal for those approaching electronics from other industries, the Basic Soldering Guide Handbook is the best resource of its type, and thanks to its excellent colour photography and crystal clear text, the art of soldering can now be learned by everyone!
Please send book order codes: ....................................................................................................... .......................................................................................................................................................... Please continue on separate sheet of paper if necessary
Everyday Practical Electronics, February 2017
Books1 2 PAGES.indd 67
86 Pages
Order code AW1
£9.99
67
14/12/2016 13:26
Electronic Building Blocks By Julian Edgar
Quick and easy Construction
Great results on a low budget
Four-Channel Car Sound Amplifier Large complex projects are fun, but they take time and can be expensive. Sometimes you just want a quick result at low cost. That’s where this series of Electronic Building Blocks fits in. We use ‘cheap as chips’ components bought online to get you where you want to be... FAST! They represent the best value we can find in today’s electronics marketplace! Here’s a four-channel, car sound amplifier with a maximum output of 68W per channel. That’s more than enough – even with relatively inefficient car speakers – to give you plenty of volume and punchy bass. Even better, if you’re happy to do some of your own metalwork and you already have some hardware like fasteners and spacers, the cost is very low. Quality? Far better than the vast majority of similar car power amplifiers! Starting points The heart of the amplifier comprises four LM3886 ICs. This venerable audio amplifier IC is an oldie – but a goody. Each is capable of 68W into 4Ω at a maximum distortion of 0.1%.
This view shows the six switching transistors used by the power supply module. The eBay module is supplied complete with the insulating washers and pads for heatsink mounting. However, you need to supply your own board-mounting stand-offs.
68
EBB (MP 1st & JE) – FEB 2017.indd 68
However, rather than start with the bare ICs, we use two prebuilt, two-channel modules from eBay. Note that the selected modules require a ±28V DC supply, rather than the AC transformer supply that most of these modules are configured for. Therefore, when sourcing these modules, ensure they are exactly as pictured. You’ll pay about £10 for each of the two required modules. To find them, search under ‘Assembled LM3886TF Dual channel Stereo Audio Amplifier Board The completed four-channel, 12V amplifier – the power supply 68W+68W 4Ω 50W*2 module is on the left, and the two 2-channel amplifier modules on 8Ω’. (At the time of the right. When the lid is placed on top, it locates the fan above the writing, look for eBay amplifier modules. (A similar-sized vent hole to the fan is located item 172274154282.) under the power supply module.) Next up, you’ll need a power supply capable of driving ‘20-90oC DC 12V Thermostat Digital these modules. Previously, develop- Temperature Control Switch Temp ing such a supply would have been Controller New’, and costs a mere £2. expensive and time consuming – but (At the time of writing, look for eBay now one is available off the shelf. It’s item 152234681961.) called ‘1PC Switching boost Power Supply board 350W DC12V to Dual Wiring ±20-32V for auto’ and costs only The electronics aspect of building the about £18, including delivery. (At the amp is dead easy. The power supply time of writing, look for eBay item board input GND, K and 12V terminals are connected as follows – GND to 321406996228.) chassis ground, and the 12V terminal While the output of the power supply is ±32V as it arrives (the on-board pot directly to the positive of the car batallows adjustment), the LM3886 is tery. Use a high-current fuse in this bathappy with up to ±42V, so that’s fine. tery supply – eg, 20A. The K terminal I also chose to use a fan for heatsink requires 12V to switch on the power cooling and triggered it via another supply – normally it’s connected to the eBay module. This module is called ‘power aerial’ output of the head unit.
Everyday Practical Electronics, February 2017
13/12/2016 04:11
connected to the OUT terminal blocks (again observe correct polarity). And that’s it for wiring!
This tiny module triggers the cooling fan on the basis of the temperature selected with the DIP switches. In this case, the temperature for fan activation was set at 40oC. The remote temp probe is located between two of the LM3886 amplifier ICs on one of the heatsinks.
Only recently released, this power supply module generates ±32V DC from 12V DC and can be directly connected to the amplifier modules.
(Or, if you don’t have this, you could connect it to any ignition-switched 12V supply.) The power supply board’s output terminals (VCC+, GND and VCC–) are, respectively, connected to the (+), GND and (–) terminals of the two amplifier modules. The line level inputs from the head unit are connected to the IN amplifier module terminal blocks (observe correct polarity), and the speakers
Building You need to provide plenty of heatsink capacity – either by the use of substantial heatsinks, or by using smaller heatsinks but adding a fan. The majority of heat is generated by the four LM3886 modules – despite appearances, the power supply module heatsink requirements are more modest. This prebuilt stereo amplifier module is available on eBay I wanted a compact for just £10, with two of the modules needed for this amplifier. The module requires at least ± 28V DC to run and, box, so I made one from in use, plenty of cooling capacity (good heatsinks and/or aluminium sheet specifi- fan) is also required. cally to suit the required dimensions. The overall dimensions Obviously the type of housing you of the box were about 250 x 140 x place the components in is up to 75mm. Using 8mm-thick aluminium you – you could even use a discarded plate for two walls of the box formed car sound amplifier enclosure that the heatsinks. A salvaged 12V fan was incorporates its own heatsink. But placed in the top panel (and there is a remember, whatever approach you matching size hole in the bottom pan- take, you’ll need either quite subel). The temperature-sensing module, stantial heatsinks, or a fan – quite set to turn on at 40oC, triggers the fan. possibly both. The power supply module comes with the required insulating washers Results and collars for mounting the transis- The only financial outlay I had was for tors to the heatsink, while the amplifier the eBay amplifier and power supply modules uses plastic encapsulated ICs modules – so, £38. And for that money, and so do not require any extra insula- this is an unbeatable amplifier. The tion. To mount the boards, you’ll need sound is excellent – better than comto provide the insulated standoffs and mercial car sound amplifiers costing screws, washers and nuts. two or three times much, and so much Rather than place connectors for the better than the typical four-channel inputs and speakers on the box, I chose amplifier built into a head unit that to directly wire these connections it’s not even funny! to the boards. These leads were run Note – this amplifier is also approthrough rubber grommets that slide up priate for anywhere you need quality appropriate channels when the lid is four-channel sound and you’re limited screwed into place. to a 12V supply. That includes, boats, caravans and houses working off a low-voltage solar system. Next month In March’s issue we have something a little different – Five eBay essentials to stock up on. Intrigued? – then you definitely do not want to miss the next super Electronic Building Block article!
One of the requirements was that the amplifier be reasonably compact and light. The final item has a mass of 1.75kg and dimensions of 250 x 140 x 75mm.
Everyday Practical Electronics, February 2017
EBB (MP 1st & JE) – FEB 2017.indd 69
69
13/12/2016 04:11
PCB SERVICE
CHECK US OUT ON THE WEB
PROJECT TITLE
ORDER CODE
COST
16101141 05109131
£9.80 £12.00
07108151 18104141
£9.79 £20.83
03109151 03109152
£12.88
01110151 15108151 18107152
£12.88 £16.42 £5.36
01101161 19110151
£17.75 £16.42
16101161 04101161
£17.75 £7.60
SEPT ’16 Basic printed circuit boards for most recent EPE constructional projects are available from the PCB Service, see list. These are fabricated in glass fibre, and are drilled and roller tinned, but all holes are a standard size. They are not silkscreened, nor do they have solder resist. Double-sided boards are NOT plated through hole and will require ‘vias’ and some components soldering to both sides. NOTE: PCBs from the July 2013 issue with eight digit codes have silk screen overlays and, where applicable, are double-sided, plated through-hole, with solder masks, they are similar to the photos in the relevent project articles. All prices include VAT and postage and packing. Add £2 per board for airmail outside of Europe. Remittances should be sent to The PCB Service, Everyday Practical Electronics, Wimborne Publishing Ltd., 113 Lynwood Drive, Merley, Wimborne, Dorset BH21 1UU. Tel: 01202 880299; Fax 01202 843233; Email:
[email protected]. co.uk. On-line Shop: www.epemag.com. Cheques should be crossed and made payable to Everyday Practical Electronics (Payment in £ sterling only).
NOTE: While 95% of our boards are held in stock and are dispatched within seven days of receipt of order, please allow a maximum of 28 days for delivery – overseas readers allow extra if ordered by surface mail.
PROJECT TITLE
ORDER CODE
COST
OCT ’15
Digital Effects Processor For Guitars And Musical Instruments Courtesy LED Lights Delay For Cars Teach-In 2015 – Part 9
01110131 05109141 909
DEC ’15
TDR Dongle For Oscilloscopes High-Energy Multi-Spark CDI For Performance Cars
JAN ’16
Isolating High Voltage Probe For Oscilloscopes The Currawong – Part 3 – Remote Control Board
FEB ’16
Spark Energy Meter
– Main Board – Zener Diode Board – Calibrator Board
APRIL ’16
Appliance Insulation Tester – Front Panel Low Frequency Distortion Analyser
01111141 01111142 01111143 18112141
£47.20
19112141 19112142
£11.80 £16.40
04112141
£7.20
05112141
£11.80
04108141
£11.80
01111144
£6.95
05101151 05101152 05101153
£20.75
04103151 04103152 04104151
£11.80 £11.80 £7.50
JUNE ’16
Infrasound Snooper Audio Signal Injector and Tracer – Sheild Board – Demodulator Board Champion Preamp
JULY ’16
Driveway Monitor USB Charging Points
AUG ’16
– Detector Unit – Receiver Unit
Low-cost Resistance Reference USB Power Monitor
70
PCB Service.indd 70
04105151 04105152 04105153 04203151 04203152 04203153 18105151
Arduino-Based USB Electrocardiogram 100W Switchmode/Linear Bench Supply – Part 2
NOV ’16
Fingerprint Access Controller – Main Board – Switch Board
DEC ’16
Universal Loudspeaker Protector 9-Channel Infrared Remote Control Revised USB Charger
JAN ’17
High-performance Stereo Valve Preamplifier High Visibility 6-Digit LED Clock
FEB ’17
Solar MPPT Charger/Lighting Controller Turntable LED Strobe
* See NOTE left regarding PCBs with eight digit codes * Please check price and availability in the latest issue. A large number of older boards are listed on, and can be ordered from, our website.
Boards can only be supplied on a payment with order basis.
£24.75 £9.37
Back numbers or photocopies of articles are available if required – see the Back Issues page for details. WE DO NOT SUPPLY KITS OR COMPONENTS FOR OUR PROJECTS.
EPE SOFTWARE
Where available, software programs for EPE Projects can be downloaded free from the Library on our website, accessible via our home page at: www.epemag.com
PCB MASTERS
PCB masters for boards published from the March ’06 issue onwards are available in PDF format free to subscribers – email fay.kearn@wimborne. co.uk stating which masters you would like.
£7.50
MAY ’16
2-Channel Balanced Input Attenuator for Audio Analysers and Digital Scopes – Main Board – Front Panel – Rear Panel Appliance Earth Leakage Tester – Main Board – Insulation Board – Front Panel 4-Output Universal Voltage Regulator
OCT ’16
£16.40 £8.55 £10.70
NOV ’15
The Currawong – Part 1 – Main Board – Front Panel – Rear Panel 48V Dual Phantom Power Supply Programmable Mains Timer With Remote Switching – Main Board – Front Panel
LED Party Strobe Speedo Corrector
£16.40 £20.75 £16.40 £16.40 £7.50
04104151 04106151 04106153 04106152
£7.48 £9.64 £7.48 £5.36
01109121/22
£8.29
15105151 15105152 18107151
£11.80 £7.50 £5.00
04108151 04109121
£5.36 £12.00
EPE PRINTED CIRCUIT BOARD SERVICE Order Code Project Quantity Price .............................................. Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .............................................. Tel. No. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . I enclose payment of £ . . . . . . . . . . . . . . (cheque/PO in £ sterling only) to:
Everyday Practical Electronics
Card No. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Valid From . . . . . . . . . . . . . . Expiry Date . . . . . . . . . . . . Card Security No. . . . . . . . . Maestro Issue No. . . . . . . . Signature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Note: You can also order PCBs by phone, Fax or Email or via the Shop on our website on a secure server:
http://www.epemag.com
Everyday Practical Electronics, February 2017
14/12/2016 10:05
FOR THE HOME EXPERIMENTER & BUILDER Free delivery on UK orders over £25.00 Plus view our new extended range of Electronic & Hardware components
www.partridgeelectronics.co.uk
Dec 2016 issue on sale 3rd Nov 2016
If you want your advertisements to be seen by the largest readership at the most economical price our classified page offers excellent value. The rate for semi-display space is £10 (+VAT) per centimetre high, with a minimum height Just found more of 2·5cm. All semi-display adverts havevintage a widthelectronic of 5.5cm. The prepaid rate for classified adverts is 40p (+VAT) per components word (minimum 12 words). FOR THE RENOVATOR OR HOBBYIST All cheques, postal orders, etc., to be made payable to Everyday Practical Electronics. VAT must be added. & MERRY XMAS TIME Advertisements, together with remittance, should be sent to Everyday Practical Electronics Advertisements, 113 www.partridgeelectronics.co.uk Lynwood Drive, Merley, Wimborne, Dorset, BH21 1UU. Phone: 01202 880299. Fax: 01202 843233. Email:
[email protected]. For rates and information on display and classified advertising please contact our Jan 2017 issue Advertisement Manager, Stewart Kearn as above.
on sale 1st Dec 2016
BOWOOD ELECTRONICS LTD
Everyday Practical Electronics reaches more UK readers than any other UK monthly hobby electronics Suppliers of Electronic Components www.bowood-electronics.co.uk
magazine, our sales figures prove it.
We have been the leading monthly magazine in this market for the last twenty-seven years.
Unit 10, Boythorpe Business Park, Dock Walk, Chesterfield, Derbyshire S40 2QR. Sales: 01246 200 222 Send large letter stamp for Catalogue
BOWOOD ELECTRONICS LTD Suppliers of Electronic Components
Visit
www.bowood-electronics.co.uk
www.partridgeelectronics.co.uk
Unit 10, Boythorpe Business Park, Dock Walk, Chesterfield, Derbyshire S40 2QR. Sales: 01246 200 222 Send large letter stamp for Catalogue
WEARDALE ELECTRONICS FOR ELECTRONIC COMPONENTS & ELECTRICAL PARTS Etc. SEND YOUR WANTS LIST TO
[email protected] or BROWSE MY EBAY SHOP AT
http://stores.ebay.co.uk/ weardaleelectronics NO ORDER TOO SMALL – PERSONAL SERVICE
OUR NEW YEAR GRAND
HALF PRICE SPRING SALE OF ALL STOCK ELECTRONIC COMPONENTS CANTERBURY Feb 2017WINDINGS issue
UK manufacturer of toroidal transformers on sale(10VA 5th Jan 2017 to 3kVA) All transformers made to order. No design fees. No minimum order.
www.canterburywindings.co.uk
01227 450810
CCS INFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 CRICKLEWOOD ELECTRONICS . . . . . . . . . . . . . . . . . . . . . . . 62 ESR ELECTRONIC COMPONENTS . . . . . . . . . . . . . . . . . . . . . . 6 HAMMOND ELECTRONICS Ltd . . . . . . . . . . . . . . . . . . . . . . . 19 iCSAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 JPG ELECTRONICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 LABCENTER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Cover (iv) LASER BUSINESS SYSTEMS . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 MICROCHIP . . . . . . . . . . . . . . . . . . . . . . . . . Cover (iii), 10 & 63 PEAK ELECTRONIC DESIGN . . . . . . . . . . . . . . . . . . . . Cover (ii) PICO TECHNOLOGY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 POLABS D.O.O. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Everyday Practical Electronics, February 2017
EPE Classifieds_100144WP.indd 71
MISCELLANEOUS INSTRUMEX PLANS offers lab grade test equipment for the electronic hobbyist. InstrumexPlans.com PIC DEVELOPMENT KITS, DTMF kits and modules, CTCSS Encoder and Decoder/ Display kits. Visit www.cstech.co.uk VALVES AND ALLIED COMPONENTS IN STOCK. Phone for free list. Valves, books and magazines wanted. Geoff Davies (Radio), tel. 01788 574774. KITS, TOOLS, COMPONENTS. S.A.E. Catalogue. SIR-KIT ELECTRONICS, 52 Severn Road, Clacton, CO15 3RB, http:// sir-kit.webs.com
QUASAR ELECTRONICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2/3 STEWART OF READING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 TAG-CONNECT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 ADVERTISEMENT OFFICES: 113 LYNWOOD DRIVE, MERLEY, WIMBORNE, DORSET BH21 1UU PHONE: 01202 880299 FAX: 01202 843233 EMAIL:
[email protected] WEB: www.epemag.com
For editorial address and phone numbers see page 7
71
20/12/2016 17:28
Next Month
Content may be subject to change
Speech Timer For Contests & Debates
If you are involved in school or university debating contests you will be aware of the importance of a speech timer. It keeps meetings and events on time and also prevents individual speakers from droning on past their allotted time. This Timer has a large 3-digit display and a buzzer. Plus, it has a tiny infrared remote control.
Solar MPPT Charger & Lighting Controller – Part 2
Our new Solar MPPT Charger/Lighting Controller uses solar panels to charge a 12V or 24V battery and then works with LDR/PIR sensors to run 12V DC lighting or an inverter. Next month, we’ll show you how to build it and describe the setting-up procedure.
Arduino-Based Fridge Monitor and Data Logger
Keep tabs on your fridge with this temperature and humidity Monitor – the Data Logger will even let you know about midnight raids!
Meet the mighty Micromite – Part 2
The Micromite is an amazing device. A low-cost microcontroller programmed in a Microsoftcompatible version of BASIC with floating point, arrays and extensive string handling. In Part 2 we examine its powerful and flexible input/output and interfacing abilities.
PLUS!
All your favourite regular columns from Audio Out and Circuit Surgery to Electronic Building Blocks, PIC n’ Mix and Net Work.
MARCH ’17 ISSUE ON SALE 2 FEBRUARY 2017
Welcome to JPG Electronics Selling Electronics in Chesterfield for 29 Years Open Monday to Friday 9am to 5:30pm And Saturday 9:30am to 5pm • Aerials, Satellite Dishes & LCD Brackets • Audio Adaptors, Connectors & Leads • BT, Broadband, Network & USB Leads • Computer Memory, Hard Drives & Parts • DJ Equipment, Lighting & Supplies • Extensive Electronic Components - ICs, Project Boxes, Relays & Resistors • Raspberry Pi & Arduino Products • Replacement Laptop Power Supplies • Batteries, Fuses, Glue, Tools & Lots more...
Shaw’s Row
T: 01246 211 202 E:
[email protected] JPG Electronics, Shaw’s Row, Old Road, Chesterfield, S40 2RB W: www.jpgelectronics.com Britannia Inn
JPG Electronics Maison Mes Amis
Old H all Ro
ad
Old Road
Rose & Crown or tsw
Cha
Johnsons
d
oa th R
Morrisons
Sparks
Get the the answer answer you’ve you’ve been been Get the answer you’ve been Get looking for for looking for looking Can Can Get the answeranyone you’ve been Can anyone help help ? s Cs?? anyone me?help PIIC me? s P looking for me? PIC
Get the answer you’ve been Can Pro rob ble lem m P lookinganyone for help P roubrc so lem s?
PIC
me?
?
PICs
rall neera Geen G icss nlic ora ecntr treo G le n E s c le n E o tr a c hattic Ele cch chGaetneral
ics
Electron chat
l Generaic s Electron chat
Can anyone help me?
ing sourcin uw oft rcainregg? ft ssso o w a re? so ftw are ?
Problem sourcing software?
Problem sourcing software?
I Can Can IIhelp! Can help! I Canhelp! help!
I Can help!
Vist the EPE ChatZone Zone Vistthe theEPE EPE Chat Vist Chat Zone
Vist the EPE Chat Zone www.epemag.com www.epemag.com www.epemag.com www.epemag.com
Retail & Trade Welcome • Free Parking • Google St View Tour: S40 2RB Published on approximately the first Thursday of each month by Wimborne Publishing Ltd., 113 Lynwood Drive, Merley, Wimborne, Dorset BH21 1UU. Printed in England by Acorn Web Offset Ltd., Normanton, WF6 1TW. Distributed by Seymour, 86 Newman St., London W1T 3EX. Subscriptions INLAND: £23.50 (6 months); £43.00 (12 months); £79.50 (2 years). EUROPE: airmail service, £28.00 (6 months); £52.00 (12 months); £99.00 (2 years). REST OF THE WORLD: airmail service, £37.00 (6 months); £70.00 (12 months); £135.00 (2 years). Payments payable to “Everyday Practical Electronics’’, Subs Dept, Wimborne Publishing Ltd. Email:
[email protected]. EVERYDAY PRACTICAL ELECTRONICS is sold subject to the following conditions, namely that it shall not, without the written consent of the Publishers first having been given, be lent, resold, hired out or otherwise disposed of by way of Trade at more than the recommended selling price shown on the cover, and that it shall not be lent, resold, hired out or otherwise disposed of in a mutilated condition or in any unauthorised cover by way of Trade or affixed to or as part of any publication or advertising, literary or pictorial matter whatsoever.
CarryOver – FEB 2017.indd 72
19/12/2016 09:43
EMI Hardened Zero Drift Amplifiers Providing Excellent Precision in an Interference Environment
With the world expanding their wireless capabilities, the presence of Electromagnetic Interference (EMI) poses a greater challenge to circuit designers. EMI results in signal degradation by increasing DC errors and current consumption, along with introducing unwanted tones at the output. In addition to employing proper circuit/PCB design techniques, you can choose Microchip’s zero-drift amplifier’s integrated EMI protection to eliminate additional external components that increase system cost, design complexity and footprint. Why wait? “Harden” your design today using Microchip’s zero-drift operational amplifiers to increase performance, reduce cost and extend battery run time!
www.microchip.com/linear The Microchip name and logo and the Microchip logo are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. All other trademarks are the property of their registered owners. © 2016 Microchip Technology Inc. All rights reserved. DS20005671A. MEC2127Eng11/16
FEB 2017 Page IBC.indd 1
15/12/2016 10:40
DO YOU WANT THE BEST ELECTRONICS DESIGN SOFTWARE?
FEATURES • Schematic Capture • PCB Layout • Gridless Autorouting • 3D Visualization • M-CAD Integration • SPICE Simulation • MCU Co-simulation • Built in IDE • Visual Programming
Tel: +44 (0)1756 753440
Labcenter OCT 2016.indd 1
19/08/2016 13:59