Silicon Chip12V Speed Controller/Lamp Dimmer - November 2008 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Electrolysis of water in cars is a fuel economy mirage
  4. Feature: Playing With The AirNav RadarBox by Ross Tester
  5. Review: Jaycar’s Sun-In-A-Box Solar Lighting Kit by Stan Swan
  6. Feature: 50 Years Of The Integrated Circuit by Ross Tester
  7. Feature: How Oxygen Sensors Work by John Clarke
  8. Project: 12V Speed Controller/Lamp Dimmer by Leo Simpson
  9. Project: USB Clock With LCD Readout, Pt.2 by Mauro Grassi
  10. Project: Wideband Air-Fuel Mixture Display Unit by John Clarke
  11. Project: IrDA Interface Board For The DSP Musicolour by Mauro Grassi
  12. Feature: Robot-Operated Clarinet by Silicon Chip
  13. Vintage Radio: Those Mysterious Antenna Coils & Loop Antennas by Rodney Champness
  14. Book Store
  15. Advertising Index
  16. Outer Back Cover

This is only a preview of the November 2008 issue of Silicon Chip.

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

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

Items relevant to "12V Speed Controller/Lamp Dimmer":
  • 12V Speed Controller/Lamp Dimmer PCB [05111081] (AUD $5.00)
  • 12V Speed Controller/Lamp Dimmer PCB pattern (PDF download) [05111081] (Free)
Items relevant to "USB Clock With LCD Readout, Pt.2":
  • PIC18F4550-I/PT programmed for the USB Clock (Programmed Microcontroller, AUD $20.00)
  • Firmware (HEX file), source code, software and driver for the USB Clock [0411008A.HEX] (Free)
  • USB Clock PCB pattern (PDF download) [04110081] (Free)
  • USB Clock front panel artwork (PDF download) (Free)
Articles in this series:
  • USB Clock With LCD Readout, Pt.1 (October 2008)
  • USB Clock With LCD Readout, Pt.1 (October 2008)
  • USB Clock With LCD Readout, Pt.2 (November 2008)
  • USB Clock With LCD Readout, Pt.2 (November 2008)
Items relevant to "Wideband Air-Fuel Mixture Display Unit":
  • PIC16F88-I/P programmed for the Wideband Oxygen Sensor Display [0531108A.HEX] (Programmed Microcontroller, AUD $15.00)
  • PIC16F88 firmware and source code for the Wideband Air-Fuel Mixture Display Unit [0531108A.HEX] (Software, Free)
  • Wideband Air-Fuel Mixture Display PCB pattern (PDF download) [05311081] (Free)
  • Wideband Air-Fuel Mixture Display front panel artwork (PDF download) (Free)
Items relevant to "IrDA Interface Board For The DSP Musicolour":
  • DSP Musicolour IrDA Interface PCB pattern (PDF download) [10111081] (Free)

Purchase a printed copy of this issue for $10.00.

12V Speed Controller OR 12V Lamp Dimmer YOU CCHHOOOSE By LEO SIMPSON This handy circuit can be used as a speed controller for a 12V motor rated up to 5A (continuous) or as a dimmer for a 12V halogen or standard incandescent lamp rated up to 50W. It varies the power to the load (motor or lamp) using pulse width modulation (PWM) at a pulse frequency of around 220Hz. S ILICON CHIP has produced a number of DC speed controllers over the years, the most recent being our high-power 24V 40A design featured in the March & April 2008 issues. Another very popular design is our 12V/24V 20A design featured in the June 1997 issue and we have also featured a number of reversible 12V designs. For many applications though, most of these designs are over-kill and a much simpler circuit will suffice. Which is why we are presenting this basic design which uses a 7555 timer IC, a Mosfet and not much else. Being a simple design, it does not monitor motor back-EMF to provide improved speed regulation and nor does it have any fancy overload protection apart 30  Silicon Chip from a fuse. However, it is a very efficient circuit and the kit cost is quite low. There are many applications for this circuit which will all be based on 12V motors, fans or lamps. You can use it in cars, boats, and recreational vehicles, in model boats and model railways and so on. Want to control a 12V fan in a car, caravan or computer? This circuit will do it for you. Halogen lamps While the circuit can dim 12V halogen lamps, we should point out that dimming halogen lamps is very wasteful. In situations where you need dimmable 12V lamps, you will be much better off substituting 12V LED lamps which are now readily available in standard bayonet, miniature Edison screw (MES) and MR16 halogen bases. Not only are these LED replacement lamps much more efficient than halogen lamps, they do not get anywhere near as hot and will also last a great deal longer. By the way, you can also use this circuit to control motors with higher current ratings, say up to 10A, but we add the proviso that if the motor is likely to be pulling currents at up to its maximum over long periods, then you may have to fit a bigger heatsink to the Mosfet. Normally such bigger motors will not pull their rated currents in most applications and the fact that you are using this circuit to reduce the speed (why else would you use it?) means that the current drain will siliconchip.com.au D1 100Ω K 5 7 A 8 4 IC1 7555 D3, D4: 1N4148 3 2 6 A B K E D4 D3 1 B C D3,D4: 1N4148 SC 2008 E C A 10 µF 25V D2 K MUR1560 +12V 100nF 10Ω Q2 BC327 ZD2 16V 1W 220nF B E +12V TP GND Q1 BC337 D G K GND FUSE1 7.5A A A K VR1 100k BC327, BC337 C A 1N4004 ZD1 12V 1W 10 µF 16V 100nF 10nF K S OUT Q3 MTP3055 MTP3055 A MUR1560 MBR20100CT D D1, ZD1, ZD2 A K G K 12V SPEED CONTROLLER/DIMMER D S K A A K A Fig.1: the circuit uses a 7555 timer (IC1) to generate variable width pulses at about 210Hz. This drives Mosfet Q3 (via transistors Q1 & Q2) to control the speed of a motor or to dim an incandescent lamp. automatically be reduced. For most applications though, fit the specified 7.5A fuse. If you want higher current, fit a 10A fuse and use higher current leads to connect the unit to the battery and to the load. Circuit description The PWM control circuit is shown in Fig.1 and as already noted, it is based on a 7555 timer IC and a Mosfet. The timer is wired in an unusual way, with the normal timing components connected to pins 2, 6 & 7 omitted and substituted by a 100kΩ trimpot and two diodes which connect from the output at pin 3 to the timing inputs at pins 2 & 6. A 220nF capacitor from pins 2 & 6 to 0V completes the timing circuit while a 10nF capacitor is connected from pin 5 to 12V. In this configuration the 7555 can be regarded as an astable oscillator based on a comparator. Instead of the timing capacitor being charged from the positive supply and discharged by pin 7, the 220nF capacitor is charged and discharged from pin 3 via diodes D3 & D4 and the 100kΩ trimpot. It works like this: when power is first applied, pins 2 & 6 will be low and pin 3 will be high. The 220nF capacitor will then be charged from pin 3 via diode D3 and the resistance between the cathode (K) of diode D3 and the wiper of potentiometer VR1. When the voltage across the capacitor reaches 0.66Vcc (ie, about 7V), the output at pin 3 goes low and the capacitor will then be discharged via diode D4 and the resistance between diode D4’s anode and VR1’s wiper. When the capacitor voltage drops to 0.33Vcc (ie, about 3.4V), the output at pin 3 goes high again and the 220nF capacitor will now be charged again, as before. This cycle then continues until power is removed from the circuit. Parts List 1 PC board, code 05111081, 79 x 47mm 2 2-way PC-mount screw terminals 1 TO-220 mini heatsink, 19 x 19 x 10mm 2 M205 PC fuse clips 1 7.5A M205 fast blow fuse 1 M3 x 6mm screw 1M3 z 10mm screw 2 M3 nuts 1 50mm length of 0.8mm tinned copper wire (link) 1 100kΩ horizontal trimpot (VR1) OR siliconchip.com.au 1 100kΩ linear potentiometer 1 1mm PC stake (for TP GND) Semiconductors 1 7555 timer (IC1) 1 BC337 NPN transistor (Q1) 1 BC327 PNP transistor (Q2) 1 MTP3055 or higher rated Mosfet (Q3) 1 12V 1W zener diode (ZD1) 1 16V 1W zener diode (ZD2) 1 1N4004 1A diode (D1) 1 MUR1560 (or equivalent) 15A 600V fast recovery diode (D2) 2 1N4148 diodes (D3,D4) Capacitors 2 10μF 16V PC electrolytics 1 220nF MKT polyester (code 224 or 220n) 2 100nF MKT polyester (code 104 or 100n) 1 10nF MKT polyester (code 103 or 10n) Resistors (0.25W, 1%) 1 100Ω 1 10Ω November 2008  31 Fig.2: this scope grab shows the operation of the 7555 timer when producing a pulse waveform (green trace) with a duty cycle of 50%. The yellow trace shows the charge/discharge waveform across the timing capacitor. 100Ω K 10nF 12V VR1 100k 220nF 100nF D4 D3 ZD2 K K A A D1 A 21+ G D S TP GND Q3 MTP 3055 A BC337 Q1 K +12V IN TUPTUO MWP 100nF K 18011150 D2 MUR 1560 +12V OUT TUO DNG A 16V ZD1 A 10 µF 10Ω 1 IC1 7555 1N 4148 10 µF + 1N 4148 + K Fig.3: this scope grab shows operation of the 7555 when producing a pulse waveform with a low duty cycle (16.7%). Note the different slopes of the capacitor charge/ discharge waveform (yellow trace). GND OUT BC327 Q2 FUSE1 7.5A Fig.6: install the parts on the PC board as shown on this wiring diagram. Note that the board caters for both single and dual-diode packages for D2 (ie, one diode is shorted if a dual diode is used). The prototype was assembled on an older version of the board and is slightly different in appearance to the final version shown in Fig.6. Resistor Colour Codes Value 4-Band Code (1%) 5-Band Code (1%) 100Ω 10Ω brown black brown brown brown black black brown brown black black black brown brown black black gold brown 32  Silicon Chip If the wiper of VR1 is centred, the charge and discharge times for the timing capacitor will be equal and the output at pin 3 will be a square wave or in other words, its duty cycle will be 50%, ie, 50% high and 50% low. The operation of the 7555 timer is illustrated in the scope shots of Figs.2, 3 & 4. In each case, the top trace (yellow) shows the charging and discharging of the capacitor while the lower trace (green) shows the pulse output from pin 3. In the scope grab of Fig.2, we show the circuit producing a square wave, with equal charge and discharge times for the capacitor. This is shown by the yellow trace which is a typical triangle waveform. In Fig.3, we show the circuit producing a pulse waveform with a short (17%) duty cycle which means that most of the time, the output at pin 3 of IC1 is low. Then in Fig.4, we show the circuit with trimpot VR1 set fully clockwise to produce a waveform which has a 100% duty cycle. In this case, the capacitor charging waveform is a classic sawtooth, with a slow charging ramp and a very sudden (almost instantaneous) discharge time. The resultant waveform at pin 3 looks pretty much like a straight line but it actually has extremely short negative excursions corresponding to the negative slopes of the capacitor waveform. OK, so now we know how the 7555 siliconchip.com.au Fig.4: when adjusted for full power to the load (ie, 100% duty cycle), the timing capacitor waveform (yellow trace) is a classic sawtooth with slow charge and very steep discharge slopes. operates. Its output at pin 3 is buffered by a complementary buffer stage comprising transistors Q1 & Q2 (emitter followers) and these drive the gate of the Mosfet Q3 via a 10Ω resistor. The Mosfet then drives the load which is connected between the +12V supply and the Mosfet’s drain terminal. Diode D2 clamps the spike voltages which occur each time the Mosfet turns off, when driving an inductive load such as a permanent magnet motor. The adjacent 10μF and 100nF capacitors across the 12V supply are there to reduce the amount of radiated interference produced by the connecting leads to the battery and to the motor. In fact, you can gauge the amount of interference the circuit produces in an AM radio. Just bring the radio Fig.5: this scope waveform shows the voltage delivered to a resistive load such as an incandescent lamp or heat element. In this case, the pulse duty cycle has been adjusted to about 30%. close to the circuit or its leads and tune between stations. You will hear the angry buzz produced by the pulse waveform. Move the radio away by a metre or so and the interference should be non-existent when tuned to an AM station. Power for the circuit is derived from the incoming 12V supply via diode D1 and the 100Ω resistor. Zener diode ZD1 provides basic supply regulation while the 100nF and 10μF capacitors provide a degree of filtering. Building it The PWM control circuit is built on a small PC board measuring 79 x 47mm and coded 05111081. If it comes in a kit it is likely to have corner cut-outs so that it fits into a standard plastic zippy box measuring 82 x 53 x 32mm. Actually, this kit is almost identical to the “Nitrous Oxide Fuel Mixture Controller” project developed for our Performance Electronics for Cars book but the kit for that project has now been discontinued. The PC board presented here has had a few changes made to it, mainly involving component spacing, diode D2 and the 4-way terminal block. In addition, the tracks to diode D3 have been altered so that this diode now faces the same way as D4. Note that the unit pictured in this article was assembled on the old version of the PC board (ie, the one used for the Nitrous Oxide Fuel Mixture Controller), so these changes aren’t shown in the photos. Just follow the parts layout diagram (Fig.6) to build the unit and all will be well. +12V SPEED CONTROLLER PC BOARD 18011150 + + 21+ TUPTUO MWP WIPER +12V TUO DNG 1N 4148 1N 4148 TP GND +12V OUT MOTOR Fig.7: here’s how to wire the unit to control the speed of a 12V DC motor rated up to 5A (or the brightness of a 12V lamp). Trimpot VR1 sets the motor speed (or brightness) and can be replaced with a 100kΩ potentiometer to provide variable control. siliconchip.com.au November 2008  33 Fig.6: this is the voltage waveform across a motor running at a relatively low speed setting. The hash between “on” pulses is due to the motor back-EMF and the interference produced by the brushes. When assembling the PC board, make sure you insert the polarised components the right way around. These parts include the 7555 timer IC, the transistors, diodes, zener diodes and the electrolytic capacitors. Fit all the small components first, followed by the fast recovery diode (D2), the fuse clips, Mosfet and the 4-way terminal block. When fitting the two fuse clips, make sure you put them in the right way around so that their little retaining lugs end up at each end of the fuse, when it is inserted. Note also that we have made provision for two different fast recovery diodes for D2, either a 2-lead SOD-59 type such as MUR1560 or BY229 or a twin-diode 3-lead TO220 type such as the MBR20100CT type. In the case of the 3-lead type, there are actually two 10A diodes in the package but one of them is shorted out when the device is soldered in place. Fig.7: this is the voltage waveform across a motor running at close to full speed (ie, a high duty-cycle pulse output). Once again, the hash from the brushes (shown between pulses) is very evident. When installing diode, crank the leads at right angles so that they go through the board and the hole in the mounting lug lines up with the 3mm hole in the PC board. Before the diode is soldered in place, bolt it to the board with an M3 screw and nut. Do not solder the diode and then tighten the screw and nut otherwise you will stress the diode package and it will fail prematurely. Similarly, when mounting the Mosfet, crank its leads to suit the board and mount it with a mini U-shaped heatsink. It is secured to the board with an M3 screw and nut and then its leads can be soldered. Finally, fit the 4-way connector and the board is finished. Testing Before connecting the battery, carefully check your work against the circuit and the PC board wiring diagram (Fig.6). Make sure that every compo- nent is installed exactly as shown. Next, connect a low wattage 12V lamp to the +12V and OUT terminals and apply 12V DC from a battery or mains-operated 10A DC power supply. You should be able to vary the brightness from fully on to completely off with the trimpot. If you are happy with that, you can then install the board in its final position. By the way, if you want to fit a full size potentiometer (with knob) as a variable control instead of using a trimpot on the board, it is quite simple. Just connect the three wires from the pot instead of the trimpot and make sure that the centre (wiper) wire from the pot goes to the wiper connection on the PC board. Finally, if you want to reduce the pulse frequency, perhaps to make the whine in the motor less audible, change the 220nF capacitor to a larger SC value, say 270nF or 330nF. Looking for real performance? • • • • From the publis hers of Learn how engine management systems work 160 PAGES Build projects to control nitrous, fuel injection and turbo boost systems 23 CHAPTE RS Switch devices on and off on the basis of signal frequency, temperature and voltage Build test instruments to check fuel injector duty cycle, fuel mixtures and brake & temperature Mail order prices: Aust. $A22.50 (incl. GST & P&P); Overseas $A26.00 via airmail. Order by phoning (02) 9939 3295 & quoting your credit card number; or fax the details to (02) 9939 2648; or mail your order with cheque or credit card details to Silicon Chip Publications, PO Box 139, Collaroy, NSW 2097. 34  Silicon Chip Intelligent turbo timer I SBN 0958522 94 -4 TURBO BO OST & nitrous fuel cont 9 78095 8 5229 46 $19.80 (inc GST) NZ $22.00 (inc GST) rollers How engin e management works siliconchip.com.au