3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Designing a Multi Node LED PWM Lamp

Step 312F609 Development Board

12F609 Development Board
«
  • Kemper Chip Example.jpg
  • Image4.jpg
  • Dev Schematic.jpg
  • DSCN3590.JPG
  • DSCN3589.JPG
  • DSCN3624.JPG
  • DSC_1485.jpg
  • DSC_1488.jpg
  • Ramping LED.jpg
  • H-Bridge Block Diagram.jpg
  • last photo ←
»
OK, fresh off bench testing, I am ready to try another board spin.

In this board design, I really wanted to try the idea of sending power and communication over the same two wires. If comm errors were ignored, only two wires would be required. That is just down right cool! While sending communications over the power wires is cool, it is not required. All the lamps can be connected together on a single comm wire if desired. This would mean each lamp would require three wires with a fourth optional feedback status wire. See diagram below.

Power and communication can be combined using a simple H-Bridge. The H-Bridge can drive big currents without any problem. Many, high current LEDs, could be strung together on only two wires. The polarity of the DC power to the lamps can be switched very quickly with the H-Bridge. So, each lamp uses a full wave bridge to rectify the switching DC back into normal DC power. One of the micro pins connects to the raw incoming switching DC power so that the comm signal can be detected. A current limiting resistor protects the digital input on the micro. Inside the micro input pin, the raw switching DC voltage is clamped using the micro's internal camp diodes - the switching DC is clamped (zero to Vcc volts) by these diodes.

The full wave bridge which is rectifying the incoming power generates two diode drops. The two diode drops from the bridge is simply overcome by adjusting up the H-Bridge supply voltage. A six-volt H-Bridge voltage provides a nice five-volt supply at the micro. Individual limiting resistors are then used to trim the current through each LED. This power / comm schema seems to work very well.

I also wanted to try adding transistor outputs between the micro and the LEDs. During bench testing, if the 12F609 is pushed to hard (too much current in its output path) it will flicker all the outputs. The max current for the entire chip according to the datasheet that the 12F609 can support is 90mA, total. Well, that is not gonna work! I just might need much more current than that. Adding transistors gives me capability of 100mA per LED. The diode bridge is rated at 400mA so 100mA per LED capability just fits. There is a downside; the transistors cost 10 cents, each. At least the transistors I picked have built in resistors - the Digikey part number is MMUN2211LT1OSCT-ND. With the transistors in place, there is NO flickering of the LEDs. For production lamps I think the transistors won't be required if "normal" 20mA LEDs are used.

The development board designed in this step is just for testing and development. The board could be much smaller if smaller resistors were used. Eliminating the transistors would save a bunch of board space too. The in-circuit programming port could also be removed for production boards. The main point of the development board is just to prove out the power/comm scheme.

In fact, after receiving the boards, I discovered there is a problem with the layout of the board. The full wave bridge chip has a goofy pinout. I had to cut two traces and add two jumper wires to the bottom of each board. In addition, the traces to the LEDs and connector are just too thin. Oh well, live and learn. Will not be the first time I goofed a new board layout.

I had eight boards made using BatchPCB. They have the best prices but they are sooooo sloooow. It took weeks to the get the boards back. Still, if your price sensitive, BatchPCB is the only way to go. However, I am going to switch back to AP Circuits - they are super fast. I just wish they had a cheaper way to ship the boards out of Canada. AP Circuits dings me 25 bucks in shipping for each order. That hurts if I am only buying 75 bucks worth of boards.

It took me two days to solder up the eight little boards. It took another day to figure out that pull-up resistor R6 (see schematic) was messing with me. I guess the resistor R6 is just not needed. I was worried after reading the datasheet and it indicated there are no internal micro pull-ups on this input pin. In my design, the pin is actively driven all the time anyway so a pull-up is not really needed after all.

To send commands to the board I used simple 9600-baud messages from a Python program. The raw RS232 coming out of the PC is converted into TTL using a MAX232 chip. The RS232 TTL signal goes to the H-Bridge control input. The RS232 TTL also goes through an inverter gate in a 74HC04 chip. The inverted RS232 then goes to the other H-Bridge control input. So, with no RS232 traffic, the H-Bridge outputs 6 volts. For each bit on the RS232, the H-Bridge flips the polarity to -6 volts for as long as the RS232 bit lasts. See the block diagram pics below. The Python program is also attached.

For the LEDs, I bought a bunch from http://besthongkong.com. They had bright 120 degree LEDs in red/green/blue/white. Remember, the LEDs I used are only for testing. I bought a 100 of each color. Here are the numbers for the LEDs I used:

Blue: 350mcd / 18 cents / 3.32V @ 20mA
Green: 1500mcd / 22 cents / 3.06V @ 20mA
White: 1500mcd / 25 cents / 3.55V @ 20mA
Red: 350mcd / 17 cents / 2.00V @ 20mA

Using these four LEDs to populate the lamp, they add up to cost as much as the micro at 82 cents! Ouch.

« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
54
Followers
16
Author:jimk3038(www.ph-elec.com)
Founder of Powerhouse Electronics. For more info goto: www.ph-elec.com