Silicon ChipInstall USB Charging Points In Your Car - July 2015 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Generating your own electricity during blackouts
  4. Feature: Electronics & The Queensland Boat Show by Kevin Poulter
  5. Subscriptions
  6. Feature: The Pawsey Supercomputing Centre by Geoff Graham
  7. Project: Build a Driveway Monitor, Pt.1 by John Clarke
  8. Project: Install USB Charging Points In Your Car by Nicholas Vinen
  9. Product Showcase
  10. Project: Intelligent Charger for Nicad & NiMH Batteries by Peter Hayles
  11. Feature: The Bionic Eye: Artificial Vision, Pt.2 by Dr David Maddison
  12. Project: Ultra-LD Mk.4 200W RMS Power Amplifier: Preview by Nicholas Vinen
  13. Vintage Radio: Stromberg-Carlson’s 78T11/79T11 transistor set by Ian Batty
  14. PartShop
  15. Market Centre
  16. Notes & Errata
  17. Advertising Index
  18. Outer Back Cover

This is only a preview of the July 2015 issue of Silicon Chip.

You can view 35 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 "Build a Driveway Monitor, Pt.1":
  • Driveway Monitor detector/transmitter PCB [15105151] (AUD $10.00)
  • Driveway Monitor receiver PCB [15105152] (AUD $5.00)
  • PIC16F88-I/P programmed for the Driveway Monitor detector/transmitter [1510515C.HEX] (Programmed Microcontroller, AUD $15.00)
  • PIC12F675-I/P programmed for the Driveway Monitor receiver [1510515B.HEX] (Programmed Microcontroller, AUD $10.00)
  • Firmware (HEX) files and source code for the Driveway Monitor [1510515C/B.HEX] (Software, Free)
  • Driveway Monitor PCB patterns (PDF download) [15105151/15105152] (Free)
  • Driveway Monitor panel artwork (PDF download) (Free)
Articles in this series:
  • Build a Driveway Monitor, Pt.1 (July 2015)
  • Build a Driveway Monitor, Pt.1 (July 2015)
  • Build A Driveway Monitor, Pt.2 (August 2015)
  • Build A Driveway Monitor, Pt.2 (August 2015)
Items relevant to "Install USB Charging Points In Your Car":
  • Mini 12V USB Power Supply with Low-Battery Cut-out PCB [18107151/18107152] (AUD $2.50)
  • SMD parts for the Mini 12V USB Regulator (Component, AUD $10.00)
  • Mini 12V USB Power Supply PCB pattern (PDF download) [18107151] (Free)
Articles in this series:
  • Install USB Charging Points In Your Car (July 2015)
  • Install USB Charging Points In Your Car (July 2015)
  • USB Charger Regulator With Low-Battery Cut-Out (September 2015)
  • USB Charger Regulator With Low-Battery Cut-Out (September 2015)
Items relevant to "Intelligent Charger for Nicad & NiMH Batteries":
  • Intelligent Nicad/NiMH Charger panel artwork (PDF download) (Free)
Articles in this series:
  • The Bionic Eye: Artificial Vision Is Becoming A Reality, Pt.1 (June 2015)
  • The Bionic Eye: Artificial Vision Is Becoming A Reality, Pt.1 (June 2015)
  • The Bionic Eye: Artificial Vision, Pt.2 (July 2015)
  • The Bionic Eye: Artificial Vision, Pt.2 (July 2015)
Items relevant to "Ultra-LD Mk.4 200W RMS Power Amplifier: Preview":
  • Ultra-LD Mk.4 Amplifier PCB [01107151 RevC] (AUD $15.00)
  • Ultra-LD Mk3/Mk4 Amplifier Power Supply PCB [01109111] (AUD $15.00)
  • Ultra-LD Mk.4 Amplifier prototype PCB [01107151 RevB] (AUD $2.50)
  • 2 x HN3A51F + 1 x IMX8-7-F + 2 x BC846C transistors for the Ultra-LD Mk.4 Power Amplifier module (Component, AUD $5.00)
  • SA156 plastic bobbin (Component, AUD $1.00)
  • Ultra-LD Mk.3 Power Supply PCB pattern (PDF download) [01109111] (Free)
  • Ultra-LD Mk.4 Amplifier PCB pattern (PDF download) [01107151 RevC] (Free)
Articles in this series:
  • Ultra-LD Mk.4 200W RMS Power Amplifier: Preview (July 2015)
  • Ultra-LD Mk.4 200W RMS Power Amplifier: Preview (July 2015)
  • Ultra-LD Mk.4 200W RMS Power Amplifier, Pt.1 (August 2015)
  • Ultra-LD Mk.4 200W RMS Power Amplifier, Pt.1 (August 2015)
  • Ultra-LD Mk.4 200W RMS Power Amplifier, Pt.2 (September 2015)
  • Ultra-LD Mk.4 200W RMS Power Amplifier, Pt.2 (September 2015)
  • Ultra-LD Mk.4 Power Amplifier, Pt.3: 110W Version (October 2015)
  • Ultra-LD Mk.4 Power Amplifier, Pt.3: 110W Version (October 2015)

Purchase a printed copy of this issue for $10.00.

By NICHOLAS VINEN Fitting USB charging points to the car’s courtesy/reading lamp assembly makes it easy to power USB accessories such as dashcams, GPS satnav units and smartphones. Install USB charging points in your car New cars often have more than one USB socket for charging phones etc but older cars have none. This tiny PCB will let you add one or two USB sockets and the total charge current can be up to 2.5A, more than enough for phones, satnavs or dash cameras. E VEN IF YOUR CAR has a USB socket, it probably is not in the ideal spot. Many people want to use a dash camera or a GPS satnav and in each case this means an untidy USB cord dangling over the dash to the closest 12V accessory socket. Ideally though, you need a USB socket close to the accessory you are using, either somewhere on the instrument panel or close to the rear vision mirror, possibly built into the housing for the sunglasses holder. Another point is that people want 36  Silicon Chip a USB socket in their car which is powered all the time, even when the car is locked up at night. This would allow you to charge a phone at any time – very handy if your area has no power for days at a time or you are on a camping trip. So that is the main reason for this little project. It lets you tap into the car’s 12V courtesy light bus because that is always powered, ready to turn on the interior lamps whenever you open a door. The tiny PCB is small enough to be tucked up inside a typical reading lamp assembly located just behind the rear vision mirror. One or two USB sockets can then be fitted in cutouts made in this assembly, so that the accessories can be plugged in using standard USB cables. But that’s just the start of what this tiny PCB can be used for. There are many situations where you may want to efficiently derive 5V or 3.3V from a higher voltage at an amp or two. It uses just a handful of parts costing only a few dollars and a tiny (and thus siliconchip.com.au 100nF 12V INPUT + 50V X7R D1 SSA33L A 8 2 K – 100k CON1 K 6 7 TVS1 2x 10 µF 15V Vcc VIN REG1 RT8299A EN PGOOD GND 25V X5R BO O T SW FB 4 A 1 100nF 3 50V X7R L1 10 µH CON2a 1 2 3 4 OUT– 5 6.8k 1 2 3 4 16V X5R 1.3k RT8299A SC 20 1 5 MINI 12V USB POWER SUPPLY 8 VBUS D– D+ GND CON2b 2x 22 µF 100pF 50V COG 100Ω 2x USB TYPE A OUT+ VBUS D– D+ GND SSA33L, ZD1 K 4 1 A Fig.1: the circuit is based on an RT8299A switchmode step-down regulator (REG1). TVS1 protects the regulator from transient voltage spikes, while diode D1 provides reverse polarity protection. REG1 feeds two type-A USB sockets. cheap) PCB. The parts are almost all SMDs but most are easy to solder and you could probably build it in under an hour. Circuit description The circuit diagram is shown in Fig.1. It’s based on an RT8299A switchmode regulator IC from Richtek, a Taiwanese-based semiconductor manufacturer founded in 1998. They have released many low-cost, high-performance integrated switchmode regulator ICs and this is one of them – the data sheet is dated January 2014. The RT8299A is a 500kHz synchronous step-down regulator. It incorporates an oscillator, ramp generator, voltage reference, under-voltage lock- out circuit, error amplifier, compensation components, comparator, flipflop, Mosfet drivers, Mosfets and a current sense shunt/amplifier. Fig.2 shows its internal block diagram, taken from the data sheet. Before we get into the details of its operation, let’s have a quick look at how a “buck” or step-down switching regulator works. Fig.3 shows the general concept. Switch S1 is rapidly toggled and while we’re showing it as a mechanical switch it will normally be a Mosfet. While S1 is closed, current flows from the VIN + terminal, through S1, inductor L1 and into the load, while simultaneously charging up output filter capacitor C1. Note that when S1 initially closes, very little current flows as inductor L1 initially presents a high impedance. The current then ramps up in a linear fashion and builds up L1’s magnetic field. When S1 opens, L1’s magnetic field begins to collapse and the presence of the field means that current continues to flow into the load. This current must therefore come from ground, via diode D2 (labelled PATH 2). The current through L1 falls linearly as its magnetic field discharges and similarly, the voltage across C1 drops as this capacitor helps to supply some of the load current. S1 then closes again and the process repeats. The end result is that, depend- VIN EN 5k 3V Comparator 2V + Current Sense Amplifier - Ramp Generator + Regulator BOOT Oscillator 500kHz VCC FB PGOOD 300k R Q - + Error Amplifier PGOOD Generator Q Driver + Reference S 30pF 1pF PWM Comparator SW OC Limit Clamp GND Fig.2: block diagram of the RT8299A switchmode regulator. It incorporates an oscillator, a ramp generator, voltage reference, under-voltage lockout circuit, error amplifier, comparator, flipflop, Mosfet drivers, various Mosfets and a current sense shunt/amplifier siliconchip.com.au July 2015  37 SWITCH S1 INDUCTOR L1 + + iL PATH 1 VIN D2 PATH 2 C1 VOUT LOAD Fig.3: basic scheme for a switchmode buck converter. Voltage regulation is achieved by rapidly switching S1 and varying its duty cycle. The current flows via path 1 when S1 is closed and path 2 when it is open. In a practical circuit, S1 is replaced by a switching transistor or a Mosfet. ing on the switching duty cycle (ie, the proportion of the time that S1 is on), the voltage at VOUT is proportionally lower than that of VIN but depending on efficiency, the power drawn from VIN is similar to that delivered to VOUT, despite the different voltages. Thus a switchmode regulator is usually much more efficient than a linear regulator. Synchronous regulation Of course, no circuit is 100% efficient so the output power will be less than the input power. Ideally, we want to minimise this power loss. There are several sources of inefficiency in a buck regulator circuit. One is the DC resistance of the inductor, which typically consists of many turns of wire and like any other resistor, energy is lost as current flows through it. Similarly, at the sort of switching frequencies typically used to keep the output ripple voltage manageable, there can be some core loss in the inductor too. Another major source of inefficiency is the forward voltage of diode D2. Since D2 conducts more of the time at lower duty cycles, which are required when the output voltage is much lower than the input voltage, this loss can be quite significant under typical conditions. Usually a Schottky diode is used as these have a lower forward voltage however the loss due to D2 can still be significant. The RT8299A IC addresses both of these major inefficiencies. First, its relatively high 500kHz switching frequency means that only a low value is required for L1. In fact, the recommended value is just 2.2µH. This means fewer turns of wire, so the wire can be both thicker and shorter and thus the resistive losses are low. Then there is the fact that it is a “synchronous” regulator. This means that diode D2 is replaced with a second switching element (let’s call it S2) and this is driven synchronously with S1, ie, when S1 turns off, S2 immediately switches on. In the case of the RT8299A, S2 is another internal Mosfet. The advantage is that rather than the fixed voltage loss of a diode at Fig.4: expanded view of the output voltage with a 3.9Ω load (1.25A). The amplitude of the ripple and the size of the switching spikes are exaggerated by the lead inductance of the scope probe. As you can see, the output is close to 5V (4.9V) and the ripple voltage is very low at less than 5mV RMS with a frequency of 548kHz. 38  Silicon Chip high current (eg, 1V for a standard PN silicon diode or 0.5V for a Schottky diode), there is only the typical I2R Mosfet loss. The RT8299A’s internal Mosfets have a typical on-resistance of 0.1Ω so at 2.5A, the voltage loss is similar to that of a 3A Schottky diode (ie, around 0.5V). Most importantly, when the output current is lower, the I2R loss is significantly less. For example, when it’s delivering 1A, the I2R loss will be well under 0.1V (as the duty cycle of S2 is less than 100%). The internal low-side switch also means one less external component is required and PCB space is saved. The result of all this is that the efficiency is very good, up to 95% – see Fig.6. This means that even if you’re drawing the maximum specified current from the board, it will barely even get warm. Which is good if you’re going to tuck it away into a small space. Back to the circuit Now refer again to the full circuit of Fig.1. The operation of REG1 with respect to L1 was described above. Two paralleled 22µF SMD multilayer ceramic capacitors are used as the output filter; this combination has very low ESR (equivalent series resistance), keeping the output ripple voltage very low. Similarly, two 10µF ceramic capacitors are paralleled for input bypassing, to ensure that REG1 has a stable supply voltage. The 100pF capacitor and 100Ω resistor in series are a snubber from the switch node (pin 3 of REG1) to ground. This reduces the voltage slew rate at this pin when REG1’s internal Mosfets Fig.5: regulator output voltage with the load switching rapidly between 22Ω (220mA) and 3.3Ω (1.5A). As you can see, the load regulation is better than 75mV and recovery is quick (timebase is 10μs/div). Note that the regulator is operating in discontinuous mode before the load step. siliconchip.com.au Features & Specifications Wide input voltage range: 4-16V High efficiency: typically >90%, 0.5-2A Output voltage range: 0.8-15V (must be at least 2V below input) Output current: up to 2.5A Quiescent current: approximately 1mA Output ripple and noise: typically <5mV RMS <at> 1.2A (see Fig.4) Load regulation: ~150mV/A, 0-250mA; ~75mV/A, 250-2500mA Line regulation: <1mV/V Transient response: output stabilises within ~20μs for a ±1.2A load step (see Fig.5) Other features: no heatsinking necessary, soft start, short circuit protection, overcurrent protection, overheating protection, under-voltage lockout RT8299A Efficiency vs Load Current 100 Fig.6: the efficiency of the circuit is very good – up to 95% and above 85% for input voltages up to 12V and load currents greater than 150mA. 90 Efficiency (%) 80 70 60 50 VIN VIN VIN VIN = = = = 4.5V 5V 12V 23V 40 30 0 0.01 VOUT = 3.3V 0.1 1 10 Load Current (A) are being switched, reducing emitted radiation (ie, EMI). A transient voltage suppressor (TVS1) protects REG1 from brief highvoltage spikes which may occur on a vehicle 12V bus due to load dumps and so on. REG1 can withstand around 26V (normal operating maximum 24V) so TVS1 was chosen as it will clamp REG1’s supply to below 24V even if it has to dissipate up to 400W for around 10ms (ie, 16A). Its leakage current at normal automotive supply voltages (12-15V) is minimal. D1 provides reverse polarity protection, should the board be wired backwards. It’s a 3A Schottky diode so will have only a small effect on efficiency, with a forward voltage of less than 0.5V under typical conditions. There are two 100nF capacitors connected to REG1. One is from the switch node (pin 3) to one labelled “BOOT” (pin 1). This is charged up to 5V when pin 3 is low by REG1’s internal diode siliconchip.com.au MUSIC – AUDIO TRIGGERED RGB STRIPLIGHT Audio Triggered with IR Remote * Includes DC connector, a 5m Roll of RGB Striplight and a K354 Power Supply Kit MUSICRGB: $ 12W LED RING KIT/ POWER SUPPLY 15 for the package! 160mm Diam. Aluminium PCB, Great for Caravans, Boats and domestic Lighting. Employs 24 Pure White 0.5W LEDs, PRODUCES OVER 1000 LUMENS OF PURE WHITE LIGHT! Current Draw is 1.1A <at>12V, 0.55A<at>24V. One 12W RING KIT (K404): ...................$14 One 12W RING KIT PLUS ONE KC24Power Supply (K404P1): ................$16 Three 12W RING KITS (K404P2) ..............$36 Three 12W RING KITS PLUS THREE KC24 Power Supplies (K404P3) ..............$40 20 10 OATLEY ELECTRONICS JULY SPECIALS and then shoots up to VIN + 5V when the SW pin goes high. REG1 uses this as a gate drive voltage source for its internal upper Mosfet. The other 100nF capacitor, at pin 8 (VCC), is used to filter REG1’s internal 5V rail which is used for various purposes. It’s derived from VIN within REG1 via linear regulator circuitry. Feedback The feedback voltage to pin 5 of REG1 comes from a simple resistive divider comprising 6.8kΩ and 1.3kΩ resistors across the output. REG1 attempts to maintain this feedback voltage at 0.8V and since the division ratio is 6.8kΩ ÷ 1.3kΩ + 1 = 6.23, this gives an output voltage of 0.8V x 6.23 = 4.985V. In practice, due to various component tolerances, it will be in the range of 4.9-5.1V. If you want a different output voltage, change the 6.8kΩ resistor. You 18W SKYLIGHT 2 KIT This includes 3 large custom made oyster lights (350mm diam.) and one FS-272 solar panel. K401 Because of the $ size there are some shipping issues (Please For 3 large oyster lights ask for details). (18W) and one FS-272 125 solar panel SUPERBRIGHT LEDS 0.5W 10mm Info will be on Website. Available only in packs of 10 of each Colour: White, Red, Green, Blue and Amber. PACK OF 10: $ 4 MUCH MORE ON OUR WEBSITE: PO Box 139, ETTALONG BEACH NSW 2257 PH: (02) 4339 3429 or SMS 0428600036 for a callback For a firm shipping cost send an email with JULY as the subject, and include an address/order/tel. no. Send to: branko<at>oatleyelectronics July 2015  39 12V CON1 + − SCREW TERMINALS OR SIL HEADER FOR CON1 K TVS1 D1 K 10 µF 100nF 100k 1 L1 100Ω REG1 RT8299 100pF 100nF 10 µF 100 1.3k 6.8k 22 µF OUT+ 22 µF OUT– CON2 DUAL TYPE A USB SOCKET FOR CON2 (VERTICAL MOUNTING) calculate the new value in kilohms as: (VOUT x 1.625) - 1.3 and pick the nearest value. For example, 3.9kΩ will give an output close to 3.3V (actually 3.2V). In this case, USB connector(s) would not be fitted and the board would drive some other circuitry. The 100kΩ resistor from pin 6 (EN) to pin 2 (VIN) causes the regulator to switch on as soon as power is applied. Output connectors As shown in the circuit, two USB output connectors can be fitted to the PCB. The board has provision for a dual USB type-A vertical connector to be used. Alternatively, a single vertical type-A connector can be fitted in the same location, or a horizontal type-A connector (they have the same pin spacing). Which one you use depends on the particular way you are going to install the board. It’s also possible to fit off-board connectors via flying leads, which is what we had to do in the Honda Accord we fitted the prototype to, due to limited space in the reading lamp assembly. For other applications, you can simply run a figure-8 lead from the two pads provided on the board. This can be strapped to the blank area at the bottom of the PCB with a cable tie for strain relief. Normally, for a USB charger, the D+ and D- lines (green and white wires in the cable) are shorted together. This tells the connected device that it’s plugged into a charger rather than a computer, so it can immediately draw more than 100mA. With a computer, a device has to negotiate to draw more than this – but in our circuit there’s nothing to “talk” to the USB device. For the power input, you can either 40  Silicon Chip Fig.7: follow this layout diagram and the larger-than-life-size photo above to build the unit. Take care with the orientation of REG1, TVS1 and D1 – the latter two parts face in opposite directions. Note that the photo shows a prototype PCB assembly. fit a small terminal block, a pin header or just wire it up via flying leads. The flying leads will take up the least space, although we used a right-angle pin header to make installation easier. Construction The PCB overlay diagram is shown in Fig.7. Note that while we’re showing the PCB as a single-sided design (as indeed it is), the boards we supply are double-sided with a full ground plane on the underside. This should help reduce EMI and also slightly improve efficiency. As stated earlier, most of the components are SMDs. Only the connectors are through-hole parts. REG1 is in an 8-pin SOIC package which has a convenient 1.27mm pin spacing so it’s not hard to solder. Start the assembly of the PCB by fitting REG1. While an SOIC-8 package is generally easy to solder, this one has a thermal pad on the underside which is also supposed to be soldered to the board. To do this properly, you need to use a hot-air rework station. These are available from eBay sellers for around $50 (eg, search for “Atten 858d”). If you have one of these, simply apply some solder paste to each pad, place the IC on top, check its orientation carefully (pin 1 to upper left) and then heat the IC and its leads until the solder reflows. Be sure to continue heating it long enough for the solder on the thermal pad to melt also; you can usually see fumes from the flux escaping under the IC. While we recommend this method, it is possible to solder the chip by hand. To do this, first place a small amount of non-conductive (siliconebased) heatsink paste on the central pad and clean the residue off the other pads. That done, tin one of the eight remaining pads, carefully place the IC in position and reheat that pad while pressing down gently on the IC until its lead contacts the PCB. Once it’s in place, check the alignment, then solder the remaining seven pins and add some solder to that first pin to refresh the joint. Any solder bridges between pins can then be easily cleaned up using solder wick. Note that it’s best to avoid moving the IC by much during soldering, so that the heatsink paste is not spread around. Also, don’t clean the board using any solvents as these are likely to wash the paste away. One of the most common problems with soldering an IC like this is that it’s possible to get solder on a pin without it actually flowing onto the corresponding pad. As a result, it’s best to check all eight leads under a magnifying lamp to make sure the solder fillets are properly formed. With REG1 in place, L1 is next. This is a little tricky due to its high thermal inertia. There are various methods but the simplest is to treat it like a large chip component. This involves adding a fair bit of solder to one of the pads, enough that it’s visibly built up, then heating this solder while sliding L1 into place along the surface of the PCB. It’s easiest to do this while holding it with angled tweezers. As soon as L1 hits the solder, some of it will cool and solidify. You will have to hold the iron in place while L1 heats up and the solder will then re-melt. Once that happens, you can finish sliding L1 across into the correct position between the two pads. You can then flow solder onto the opposite pad. Note that it’s best to do this immediately before L1 cools down. Note also that it will take a little while to apply enough heat to form a good joint. Make sure a proper glossy solder fillet is formed. You will then need to go back and add some more solder and heat to the initial pad, until you get a similarly good fillet on that side; much of the flux will have boiled off during the initial soldering process. The rest of the components are much easier as they are substantially smaller but you can use the same basic idea of adding solder to one pad and then sliding the part into place. The only siliconchip.com.au remaining polarised components are D1 and ZD1; in each case the cathode (striped) side goes towards the nearest edge of the PCB. Don’t get any of the different value capacitors, resistors or diodes mixed up. The resistors will have printed value codes on the top but the other components are likely to be unmarked so you will have to remove them from their packaging one at a time and immediately solder them into the correct locations. Fitting CON1 &/or CON2 Finally, fit your choice of CON1 and CON2 in the usual manner. It isn’t strictly necessary but if using a horizontal socket for CON2, you may want to place some insulation over the unused set of pads near the edge of the board, to prevent the shell shorting to them. We say this is probably not necessary because those pads should be covered with solder mask on the top side of the board and so there’s unlikely to be enough exposed metal for the connector shell to touch. Note that soldering the retaining posts for CON2 may be a little tricky as there isn’t much “meat” on the pads, since they are pretty close to the edge. However, if you apply enough heat and flow a sufficient amount of solder into the mounting holes, it should adhere to the copper plating inside the holes and provide a good mechanical connection. When the PCB is finished, carefully check your work and then connect it to a source of 12V or it could even be initially powered from a 9V battery. Make sure you connect it with the correct polarity, otherwise nothing will work. Once powered, check that you have 5V (or very close to 5V) at the relevant points on the USB socket (on the back of the PCB). If that checks out OK, you are ready to install it. Fitting it in your car Depending on your application, it’s up to you how you wire up and secure the assembly. A short length of clear heatshrink tubing is a good way to encapsulate the board if it isn’t going to be held rigidly in place. But now we’re going to show you how we fitted in into a test car. The details for other cars will be different but the general principles should apply across many common models. First, most vehicles will have 12V siliconchip.com.au LED LAMP LED LAMP These two photos show the reading/courtesy light assembly after it had been removed from the car (top) and after it had been stripped down to its major sub-assemblies. The standard incandescent lamps should be changed to 12V LED lamps to reduce the overall power consumption (see text). power permanently available in the reading lamp assembly. If you wire the unit up to that power, the USB sockets will be constantly on. Of course, you could add a switch to turn it off when not needed (which may be easier than turning the connected devices on and off each time) but we didn’t bother. While the circuit only draws about 1mA by itself, you will need to switch any GPS navigation units or dash cameras on/off manually as they won’t be switched automatically with the ignition, as they are when powered from an accessory socket. And if you are going to install the PCB inside the reading/courtesy lamp assembly, we strongly suggest that you change the standard incandescent lamps to 12V LED fittings. This is desirable to reduce overall heat production inside the housing and also to reduce the overall current drain from the car’s 12V courtesy light bus. We had an article showing how to do this in the December 2013 issue – see www.siliconchip.com.au/Issue/2013/ December/Update+Your+Car’s+Inter ior+With+LED+Lighting Anyway, the first step to fitting the July 2015  41 black wires with a 2-way DuPont-style header plug on the other end (see photo on facing page). Installing USB sockets This view shows how the regulator PCB is connected to two USB sockets mounted on the vehicle’s switch plate. unit is to remove the light assembly. In our car, we first pushed in each reading lamp lens in turn, then slid a slim flat-bladed screwdriver wrapped in a cotton cloth under the edge and prised the clear plastic cover off (as described in the vehicle manual). This revealed the head of a retaining screw on each side. Removing the two screws required a large screwdriver and quite a bit of force – they were done up very tightly and we didn’t want to strip the heads. The whole lamp assembly then came down from the roof. We simply had to unplug two multi-way cables and the whole thing could be removed. To remove the brown plastic cover from the centre section, we used the same screwdriver to press in the four plastic tabs at top and bottom. The whole central assembly was then removed and four further clips had to be pressed in to separate this into two further sections, as shown in one of the photos. The lower black plastic section contains a PCB with a Mosfet to control the light dimming, the switch to control whether the courtesy lamp comes on when the doors are opened, a LED to illuminate the gear shift lever and a few other bits and pieces. Finding 12V power Since this module included the Mos­fet to control dimming, it seemed likely that there was a permanent source of 12V power connected to the 42  Silicon Chip 4 7 5.5 2.75 13.5 2 2 ALL DIMENSIONS IN MILLIMETRES Fig.9: the OUT+ (5V) and OUT(GND) pads on the PCB are connected to the USB sockets as shown here. Fig.8: use this diagram as a template for marking out the USB socket cut-outs. Note the notches on either side. 5V JOIN GND board. We examined the PCB for likely points where this might be connected (eg, the source tab of the Mosfet), then plugged the board back into the car’s electrical system and checked each point for continuity with the vehicle’s chassis via the exposed metal where the retaining screws had been. We got a reading of less than one ohm from one of these tracks to the chassis and made a note of its location as this was a good place to connect the USB power supply ground. We then switched the DMM into voltmeter mode, connected the black probe to chassis and probed other large tracks with the red probe. We quickly found a track which reliably gave us a reading of around 12.5V so we noted this also. It was then just a matter of scraping back a little of the solder mask on these two tracks and soldering some red and The next task was to fit sockets on the blank plastic plate between the two reading lamps. Ideally, we would have used a panel-mount USB socket but there simply wasn’t room. These also tend to be fairly expensive compared to normal PCB-mounting USB sockets. Instead, we decided to press a couple of regular vertical PCB-mounting sockets into service. The idea was to drill a series of holes in the panel, then use files to shape the holes into rectangular slots and secure the sockets in place with silicone sealant. This approach is workable but there are a few catches you need to be aware of. First, typical USB sockets are designed to mount behind a thin steel or aluminium plate and there are six spring-loaded clips arranged just behind the front of the socket which hold the USB plug in place using friction, so it doesn’t fall out. A thicker plastic panel can interfere with these springs and cause the insertion and retention force to be much higher than desirable. Similarly, you have to be careful when gluing the socket in to avoid glue getting inside the socket (as they typically aren’t sealed) and also to avoid gluing the springs in place! If you do this it will be virtually impossible to insert a USB plug and if you do somehow manage to do it, good luck getting it out! Ultimately, we came up with the following approach. First, we profiled the holes to leave a little extra clearance in the places where the springs sat to allow them to move. We then secured the socket in place using silicone sealant which, while very strong, is flexible enough to allow the springs to move in order to keep the insertion and retention forces to a more-or-less normal level. Cutting the holes First, decide where the sockets are to be fitted and keep in mind that there needs to be enough room behind the panel for them to project into, without the risk of shorting to anything conductive. Also, you need to leave enough room for the DC/DC converter PCB to fit. In our case, the logical place to mount the sockets was evidently insiliconchip.com.au Parts List 1 PCB, code 18107151, 16 x 51mm 1 4.7-10µH 2.5A RMS (3A saturation) 6x6mm SMD inductor, eg, NR6045T100M (L1) (element14 2289085, Digi-Key 587-2081-1-ND) 1 2-way mini terminal block or pin header (CON1) (optional) 1 dual stacked vertical type-A USB socket, through-hole mounting (CON2) (element14 1841169, Digi-Key ED2984ND) OR 2 vertical or horizontal type-A USB sockets, through-hole mounting (CON2) (element14 1696534/1654064, Digi-Key UE27AC54100-ND/ UE27AE54100-ND) 1 50mm length of 20mm-dia. heatshrink tubing The 2-pin header plug is connected via flying leads to the +12V and GND supply points inside the housing. tended to house three extra illuminated buttons or lamps which were not fitted to this vehicle. As a result, we had to cut away the plastic that would have held these devices in place to make room for the sockets. As luck would have it, this also left enough room to fit the regulator board just behind the sockets. You can see the modifications made to the black plastic frame in the accompanying photograph. We then marked out the socket locations on the brown plastic fascia and drilled three 5mm holes space slightly apart in each location. We then slowly filed these into a rectangular shape until the sockets fitted through and were held in place by friction – but only just. If the sockets fit too tightly, this will make it difficult to plug the cable in. We then used a small round file to make four small notches in each cutout, corresponding to the two pairs of spring clips on the top and bottom surfaces of the sockets. This gives the clips some room to expand when a plug is inserted. The notches are 6mm apart and only about half a millimetre deep – see Fig.8. Any deeper than this and they won’t be covered by the flange surround on the front face of the socket. We then pushed each socket into its corresponding hole and checked that it was possible to insert and remove a USB plug with a reasonable amount siliconchip.com.au of force. You will need to get a good hold onto the rear of the socket to test unplugging. We then applied silicone sealant around all the edges of the socket where it met the plastic panel and left it for 24 hours to set. Try to avoid pushing too much sealant into the spring clip holes and definitely avoid getting any on the solder tabs, especially since there is usually a large hole in the back of the socket. If you do get some silicone inside the front of the connector (ie, near the entry side), you can remove it carefully using the tip of a sharp hobby knife. Wiring it up Now for the final connections. As stated earlier, we connected a 2-pin header plug to the 12V and GND supply points inside our housing and if you haven’t already done something similar, do it now. This then plugs into the 2-pin header on the PCB. You will then need to solder wires to the rear of the USB sockets – use Fig.9 as a guide. The two central pins can simply be joined with a solder bridge or if you can’t get one to form, use a small piece of tinned wire (eg, a component lead off-cut). The 5V and GND pins of the two sockets are wired up to the outputs on the regulator PCB in parallel. We did this by running a separate pair of wires from each socket to the solder pads Semiconductors 1 RT8299AZSP 3A Switchmode Step-down regulator IC (REG1) (element14 2392669, Digi-Key 1028-1295-1-ND) 1 3A 30V Schottky diode, DO-214AC (D1) (element14 1843685, Digi-Key SK33ATPCT-ND) 1 SMAJ15A SMD 15V 400W TVS or equivalent (TVS1) (element14 1886343, Digi-Key SMAJ15ALFCT-ND) Capacitors 2 22µF 16V X5R/X7R SMD 3216/1206* 2 10µF 25V X5R/X7R SMD 3216/1206* 2 100nF 50V X7R SMD 3216/1206* 1 100pF 50V C0G/NP0 SMD 3216/1206* Resistors (SMD 3216/1206*, 1%, 0.25W) 1 100kΩ 1 1.3kΩ 1 6.8kΩ 1 100Ω * 2012/0805-size parts are also suitable on the board but you could run wires between the two sockets if you prefer. Be very careful to follow the pinout diagram of Fig.9 and observe the polarity of the output pads on Fig.7. July 2015  43 Pre-made Units The two USB sockets can be secured to the switch plate cover using neutral-cure silicone adhesive and wired as shown here. Note that two centre pins on each socket are shorted together with solder. You can measure how much current your USB devices are drawing using this Power Monitor – see text. Most USB devices won’t have reverse polarity protection and will probably be damaged if the sockets are wired up incorrectly! Once you’ve done that, you can slip a piece of heatshrink tubing over the DC/DC converter board and plug the 2-pin header in (be careful with polarity – see Fig.7) before shrinking the tubing down. It’s then simply a matter of reassembling the whole thing while tucking the regulator board away inside it. Plug the connectors back into the vehicle’s wiring harness and secure the lamp assembly in place in the vehicle. You can then plug a USB device with some sort of power indicator in to test it. We suggest something cheap! We used a card reader to verify that the USB power supply was working correctly on both sockets before plugging in our GPS unit and dashcam. Quiescent current/power draw The DC/DC converter board only draws around 1mA so, by itself, it will 44  Silicon Chip add only a negligible load to the battery, even when wired in permanently. However, be aware that anything you leave plugged into the sockets could draw significantly more than this and may flatten the vehicle battery if it isn’t driven for long periods. This could be true even if the device(s) plugged in are switched “off” – they may still be drawing current to keep their batteries topped up etc. The only way to know for sure is to measure it. You could use our USB Power Monitor, which was described in the December 2012 issue – see www.siliconchip.com.au/Issue/2012/ December/USB+Power+Monitor A complete kit is available from Jaycar, Cat. KC5516. This will allow you to measure how much current is drawn from the USB socket by any given device in various modes, including standby/off. Divide this current in two to get an idea of how much extra load it places on the vehicle’s battery. Let’s say, for example, that you have a GPS and a dashcam plugged in and you’ve measured their total current drain when switched off at 10mA. This means the load on the vehicle battery will be roughly 10mA ÷ 2 + 1mA (regulator quiescent current) = 6mA. Over 24 hours, that represents a drain of 0.006A x 24h = 0.144Ah. As a result, it will take several weeks to discharge a fully charged vehicle battery and thus such a load would be fine to leave connected, as long as If you don’t want to build your own, you can buy pre-made USB sockets that can be simply wired into a 12V automotive supply (eg, Jaycar PS2016, Altronics P0664/P0668/P0676). However, these are quite bulky and are designed to be fitted to or under the dash. As a result, they’re a lot less convenient to use for something like a dashcam and you will also have to rummage around behind the dash to connect them to the vehicle supply. the vehicle is driven regularly. A typical vehicle will draw maybe 30mA from the battery with the ignition switched off. So adding another 30mA will halve the time until the vehicle will no longer be able to turn the engine over. We would be reluctant to leave any load drawing more than this connected long-term. Fusing The regulator board will draw a little over 1A at maximum output. The vehicle’s reading lamp supply will be fused and a typical fuse would be 5A. Chances are this will have enough excess capacity to handle the added draw, but to be sure you will have to add up the wattages of the lamps on this circuit. You could change the fuse to a slightly higher-rated type if necessary. However, we had already replaced the vehicle’s reading lamps with LED assemblies (as described in the December 2013 issue). This will have reduced the interior light current by at least 1A, as we replaced multiple 3W incandescent lamps with LEDs SC drawing well under 1W. siliconchip.com.au