- The 4-channel current source was made to control a high power RGBW LED for a microscope. It was inspired by a circuit published in Electronics Design News (EDN) as a design idea by John Guy in June 2008. I used cheap BCD thumb wheel switches (US$21 for 20 switches from ebay), a few resistors, LM 317 regulator IC's (from ebay), and a 12 Volt 4 A wall wart power supply.
- It is surprisingly precise (= repeatable) though it has an error of + 4%, the actual current delivered is approximately 4% more than the switch settings because of the resistor values I used. The BCD switches require 4 resistors for values from 0-9 instead of using 9 resistors for a normal decade switch.
- I built four of these simple current source modules to get a 4-channel current source. One channel for each LED in the 4 LED chip. I packaged it in a instrument case that I had on hand (used the same type of case for my variable bench power supply and the re-boxing of myATX modified power supply).
Step 1: Wiring the BCD Switches
- I would need 3 BCD switches ganged together to give me a 3 digit resolution current setting for each channel, from 1 mA to 999 mA. The first BCD switch would set currents from 100-900 mA, the second from 10-90 mA, and the third and last switch would set 1-9 mA. So, if I dialed in 999 on the three BCD switches, I would get 999 mA.BCD decade switches use a 4-bit BCD code to generate a number from 0-10. That is, I can use just four resistors with ratios of 1x, 2x, 4x, and 8x to generate resistance values of 0-9x. The resistor values were calculated from the current limit formula for LM317 IC. The Current (I in Amperes) = 1.25 / Resistor value in ohms for the circuit. So for the first switch (100-900 mA) for position 1 (=100 mA), I would need a value of 12.5 ohms to get 100 mA. The closest value I had was 12 ohms so I decided to use that.
- The table shows the resistor values I used (in the blue box), the calculated current, and the power rating for each resistor. The calculated error was +4%. If the switch was set to 100 mA the actual current would be 4% higher, 104 mA. If the switch was set to 1 mA, the actual current would be 1.04 mA. This was due to the resistor values. If I had used 12.5 ohm instead of 12 ohm I would have got less than 1% error. I did not have a 6, 60 or 600 ohm resistors so used 2.7 ohm + 3.3 ohm, 27 ohm + 33 ohm, and 270 ohm + 330 ohm in series. The wattage for all the resistors can be 1/4th watt, EXCEPT for the 1.5 ohm resistor (marked in red in the table) where you will need a 2 W or higher resistor. You could use eight 12-ohms 1/4 W resistors in parallel to get a value of 1.5 ohm 2 W. I did have four 1.5 ohm, 5 W resistors so I used these though they were 5% tolerance instead of 1% like the rest. The resistors were soldered onto the switches as shown.
- Each switch was tested with an ohm meter to make sure the values were close to the table. I had to resolder some of the resistors due to solder bridges. The switches were combined in the right order. The 100 mA switch was snapped together with the 10 mA and the two were then snapped together with the 1 mA switch.
- The common terminal of all three switches were joined together with a wire. And the free ends of the resistors for each switch were soldered together and then these were connected with other switches. The circuit diagarm may make it more clear.
- I then tested the combined 3 switches again with the ohm meter.
Step 2: Preparing the Case
- The step I dread the most. Cutting out holes in the aluminum panels for the instrument case that I have. I did a crude layout and drew this out directly on the aluminum panel.
- Drilled out the holes and cut out the square edges out with a dremel with cutting wheels. Did this for the front panel and for the back panel. You can see the remnants drawings of a project that I never started on (something for electrophoresis).
- The second image shows what the holes were for. I imported this image into Xara Xtreme drawing program, scaled the drawing to the correct size (the ruler in the photo helped) and then typed in the labels.
- Flipped the drawing and printed this out on a laser printer on regular paper.
- The lettering on the laser printed sheet was transferred with nail polish remover onto cleaned up aluminum panels (see the laser transfer instructable).
- The last image shows the aluminum panels after the laser transfer.
- The panels were 'painted' with acrylic varnish to seal the lettering in.
Step 3: Adding the Switches and Terminals and Starting the Wiring
- The wired BCD switches were stuffed in from the back and held to the panel with hot glue. I had made a mistake. The large resistor on the BCD switch was too big to slide the switches in from the front, I therefore had to expand the switch holes a bit and slide the switches in from the back.
- I added the screw terminal strip and IEC AC receptable to the back panel.
- The third image shows the overall wiring diagram for the unit.
- I added the DIN 8-pin connector to the front panel. Wired the 4 - negative terminals with black wire (this is difficult soldering due to the tight quarters).
- Then with solid-wire (22 gauge) wire from a CAT6 cable, I connected two wires to each of the 4 remaining terminals on the DIN socket for the adjustable output. One of these two wires was soldered to the terminal strip on the back panel. The other wire from the DIN socket was soldered to common pin of the BCD switch.
- An additional wire from the common pin from each BCD switch was used to connect to the ADJ terminal of the LM317 IC.
- The middle pin of the LM317s (V out) was soldered to the wire which connected the free end of all the resistors on each BCD switches.
- A wire was connected to the third pin on the LM317s (V in). The four Vin wires from the four LM317 were soldered together. These connected wires will later on be connected to the 12V + from the power supply.
Step 4: Adding the Heatsinks and Connecting the AC Parts Plus Attaching the LM317
- I went a bit overboard with the heat sinking. A small piece of aluminum from a shower door rail was cut into approx. 3 inch pieces (on a bandsaw). A hole was drilled for the LM317 to be fastened. The aluminum pieces were hot glued to the plastic case and then the front and back panels were slid in.
- The wired LM317 were attached to the heat sinks with a bit of heat sink paste and a screw, the AC wiring was connected. the negative (ground) wires were connected to the terminal strip on the back panel and to the negative wires from the DIN socket.
- Used the ohmmeter to check that everything looked OK.
Step 5: Adding the AC-DC Power Supply and Finishing the Box
- Removed the AC-DC power supply from its case (think it was for a scanner). Removed the AC socket that was attached to the power supply board by heating the AC pins inside the socket till the plastic around them melted and then slid the plastic off and soldered wires to the AC pins and to the power switch.
- The power supply has a green LED, was planning on cutting this off and adding a longer length of wires so that i can attach this LED to the front panel. Did not get around to doing this. Maybe in the future.
- Checked the polarity of the DC outputs with the multimeter and then soldered the positive wire to the Vin wires from the LM317s (blue wires in the second image). Connected the negative wire from the power supply to the negative wires from the DIN socket and the screw terminals.
- Glued an insulating piece of hardboard over the heat sinks to prevent them from shorting the power supply module. Then glued the power supply to this board.
- Finally checked everything again with an ohmmeter first and then with a voltmeter to track the AC voltage (had forgotten to add a fuse to the fuse holder!) and then the DC voltages.
- Used an LED to check if the current was actually varying.
- It works!
- Closed the case by adding the other half of the clamshell.
Step 6: Testing
Tested this with a high power LED with different currents.
Still have to check the actual current value.
Will add that information once I have done that.