Programmable LED Controller - Page 1
Forum section: electronics / projects

author: DeltaSword
author_rank: Newbie
timestamp: October 30, 2014, 06:09:54 pm
content: Hi everyone,Okay so this is my first post in the forum, I’m looking for a bit of guidance really, I haven’t done electronics for a while and when I was at school I must admit to not paying total attention in class.So onto the project .......Building a new pc (dont worry im buying the motherboard not trying to make one) and basically I am looking for some programmable LEDs for back lighting and effects in the case.I have the basics down, ie sizing resistors for LEDs etc but I’m hoping to have different settings controlled by switches mounted in the caseSetting 1 (Default): Fixed light all LEDs onSetting 2: Flashing LEDs (Knight Rider Style) - Variable speed ??Brightness: Variable brightness in both settingsQuestions:1) Power will either be from a PC PSU (12v /5v/3.3V Outputs) or from a battery, any thoughts on PROs and CONs? A battery would be standalone but may need replacing and there would be no chance of damage to the PSU if wired in?2) Brightness Control - Will a potentiometer on the power supply be okay to control the brightness of LEDs or would it require a more complicated circuit?3)PICAXE - I am able to program code so would a programmable chip such as the PICAXE be an option as opposed to the hardware timed circuits I have come across that use 555 timers to achieve a similar effect (this would also allow me to control the speed of the flashes)?My primitive attempt at a schematic showing the basic concept:And an idea of the controls for the LEDsOn / Off switch is a toggle switchWhen Switch 1 (Std) is set (momentary contact) light all outputsWhen Switch 2 (Flash) is set (momentary contact) light first output, pause, light second output, pause, turn first input off ..... etcCould something like thishttp://www.picaxe.com/Hardware/Project-Boards/PICAXE-18-Project-Board/have the outputs wired to another circuit to allow the chip to be reprogrammed at any time from my PC, for example if I wanted to change the timing of the flashes or change the program altogether?If anyone is feeling particularly helpful i had a thought on the way home about possibly creating a soft controller (read computer program) to emulate the manual controls as well which i could really use some advice onHope you can helpDeltaSword

author: Wilksey
author_rank: Super Contributor
timestamp: October 30, 2014, 06:20:54 pm
content: You could PWM your transistor gates to get adjustable brightness, would make it controllable via the computer that way.You could hook the controller to a USB port, usually there are extra USB sockets on the MoBo for things like front USB ports etc, that way you could power the controller via USB if you wanted, the LED's could be connected via the transistor(s) to the PSU of the PC for the higher current draw.For a knight rider type effect you may have to drive the LED's individually, perhaps look at using a shift register or something?You could be "clever" if you detect USB enumeration you can disable to front panel controls and rely on PC communication to control the LED's, just thinking of contention of soft controls vs hard controls, unless you are planning on or the other rather than both?

author: DeltaSword
author_rank: Newbie
timestamp: October 30, 2014, 06:41:17 pm
content: Thanks for the REALLY quick reply ....... its been longer than i thought, had to re-read your post at least 5 times to get it straight in my headUSB does seem like the logical interface, however my grasp of electronics doesn't stretch quite far enough to understand controlling inputs / power from USB ( i assume you can get UB ports for mounting on circuits )Initially i was planning on hard controls as this seems easiest and wont involve USB interfaces and programming a software control, and then possibly upgrading or replacing the circuit to involve the software control.For the shift registers (i vaguely remember these from class) these are like logic gates (??) using timing clocks to control them (??)i was thinking of using a programmable chip that would loop through a sequence until interrupted by a different input switch (only because i remember using them at schoool)is there any benefit of using logic gates in a circuit over a programmable chip or visa versa ?think when im home at the weekend i may look to see if i can find my old textbooks

author: Wilksey
author_rank: Super Contributor
timestamp: October 30, 2014, 09:06:26 pm
content: Heh, I was at work, a tad boredYes, you can use whatever you want, you can use a programmable chip (I assume you mean microcontroller or CPLD?) to just continually run through a sequence.A shift register needs a clock, and the data needs to be latched, you typically have clock, data, latch and enable pins, you can cascade them which makes them quite powerful, look at the 74HC595 for more info.If you used a micro you can use a UART to USB bridge chip at a later stage (perhaps not FTDI after the recent fiasco! lol) to do the USB stuff.Personally I would use a CPLD or Micro over logic gates, these are still OK to use, but they can soon make your project quite sizeable, if you are more comfortable with pure logic gate chips then use them though.If you are not comfortable with programming a micro controller, take a look at FlowCode, it basically generates a program to write to the chip using a flow chart approach, very powerful and very easy to use.If you are going to use a micro I would suggest taking a look at the various options, I have seen FlowCode used on PIC's before quite successfully and the PICKIT 3 programmer is quite cheap, you can probably get a cheap starter kit if you look well enough, the Arduino is a very popular hobbyist platform which is quite easy to use, not 100% sure if the likes of FlowCode supports that though, the Arduino is typically C style syntax, programmed via USB, if you get a UNO or something then the bootloader acts as the programming interface essentially.Have fun looking!