Serial Addressable RGB PWM LED Driver using PIC16F628A

RC Servo driver

Overview

Ever since I made the serial controlled RGB LED PWM driver I’ve had many requests for an addressable driver.  Well I’ve finally got round to producing one.  The code is now completed and tested and the prototype boards are fully working.

The design process behind this project was to enable anyone with a bit of electronics knowledge to build an array of cheap RGB LED drivers that they can control from a PC without having to spend lots of money on expensive hardware, software etc. I specifically didn’t want to go down the DMX512 route as there are hundreds of commercially available products out there; if you need DMX512 you probably won’t be trying to build RGB controllers on the cheap (however, if you do check out this site for a DMX512 RGB LED).  The hardware for this project is designed around standard readily available parts and the serial interface uses a standard PC serial port and protocols.  You should be able to put together a single controller and get it hooked up to a PC for under £10 (assuming you have a PC)

I originally wrote the code to run on a 16F88 but subsequently converted it to run on a 16F690 as these are about 30% cheaper.  The ‘690 also has 2 extra I/O pins one of which has been used to enable the full version of the code to drive either common anode or common cathode 7-segment displays on the control panel.  I’ve  also taken the code for the free RGB PWM driver and ported it to the PIC 16F628A / 627A. Code and schematic can be found on this page.

The serial packet protocol is completely open so anyone can write their own software to control the drivers.  It is described in detail on its own page here.

RC Servo driver

During development I had an enquiry asking if the PWM output could control a servo.  I thought about this and came up with a three channel RC type servo driver that operates using the same serial control protocol. This makes it possible to put RGB Drivers and Servo drivers on the same serial bus and control them with a common command set.  Using the same algorithm that controls fading on the RGB driver, the three servos can be made to move at different speeds from one position to another autonomously.

I’ve deliberately kept the Microcontroller board separate from any LED driver electronics because the type of LEDs it could be used to drive, from low power 5mm LEDs to high power 3 watt star LEDs, are wide ranging and the potential applications enormous.  For the same reason, the control panel display on the full version is also optional and separated from the main MC board since it might be useful to some, while not to others.

While I primarily expect people to use a PC to send the control data to the drivers, there is a lot of potential for stand-alone controllers and interfaces using low-speed infrared or 433Mhz RF transceivers. In fact that’s one of the reasons for providing operation at bit rates down to 1200bps.

As time permits I’m am working on additional LED driver circuits and looking at PCB layouts as well as the PC software side of things and I’ll be making it available on this page.

If anyone can help out with PC software to share with other enthusiasts please contact me as I’m really struggling to find time to do all the work.

Update: Feburary 2008

I had intended to make two versions of the code available; a basic free version and a full feature version. I’ve given up on that so now the full feature version is available to download for free.

Description

The RGB Serial Addressable Driver (SAD) generates 3 x 8-bit PWM outputs at a frequency of ~100Hz. The PWM outputs can be jumper selected to either active high or active low to suit different LED driver circuits.

The Servo Serial Addressable Driver provides three servo channel outputs with a 1-2mS pulse width refreshing at between ~16 and 19mS.

The SAD receives data over a standard RS232 serial interface like that found on a Personal Computer. Data is sent to the SAD in 7 byte packets which contain either data or commands.

The operation of the serial control protocol is a two step process.

1. data is sent to the SAD which latches it but doesn’t do anything else with it.
2. a command is then sent to the SAD telling it to transfer the data to the outputs

This allows different data to be sent to many drivers while enabling changes to the PWM output to be initiated across the SADs simultaneously. For example you might send 10 different colours to ten SADs, then sending a single transfer command to the broadcast address, the ten SADs all update their respective outputs with the new colour at the same time. Any SADs receiving the transfer command that haven’t been sent any new data ignore it.

 

Read more: Serial Addressable RGB PWM LED Driver using PIC16F628A

Leave a Comment

Your email address will not be published. Required fields are marked *