Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

27 channel PWM with a 16F88

Status
Not open for further replies.
Hi Pete I would love to be able to create the projects that you made I am new to programming and would like a little help
I use 16f628a to flash some leds what would I need to add to my code to make the leds fade out and fade in I believe its called PWM
yours john
 
Hi Pete:
Smart work my friend. Well done!
Here is a new challenge for you expanding on your 27 chan:
Why not push the 16f628a chip to its limits and use additional ra6 and ra7 in your multiplexing. Same 6 chan PMW, expand on your multiplexing with 5 mosfets.
If the refresh rate permits you can convert this project into a 45 channel rgb pwm.
The pcb will be a bowl of noodle but can be done with multi-layer pcb.

Your thoughts?

Rom
 
Last edited:
36 Channel Expansion...

Hey Gang:

I was able to implement a 36 channel version. Program works great. I will post once I have a board made.

It is 12 channel x 3, multiplexed, which gives you 12 channels of RGB. Interesting enough after testing the volts and amps and limits of the PIC, this is the maximum number of channels you can direct drive the LED's with from PIC. Anything above this will need driver Mosfets on the driver side as well or PIC will fail.

I also found a clever way of expanding even more. This is accomplished by using 12 channels from PIC (Rbo-Ra3) and use Ra6 and Ra7 as control bits for 4017 clock and reset. This can be exanded to 12 Channels for RGB from PIC x 10 Channels sinks from 4017, multiplexing 120 RGB LEDs, or equivalent of 360 channels. The challenge will be how fast the refresh rate would be while LEDs give out smooth color without flickering.

Cheers.
Rom
 

Attachments

  • Aurora12-Silk.pdf
    52.4 KB · Views: 251
  • AURORA12-Bottom.pdf
    45.2 KB · Views: 188
  • AURORA12-Top.pdf
    42.9 KB · Views: 239
  • Aurora12-Schematic.pdf
    106.8 KB · Views: 294
Last edited:
48 Channel (16 RGB)

For those of you who want to play around to create a code below you will find PCB layout and schematics for 16 LED RGB Board. Just make sure your voltage regulator can produce enough juice and perhaps has a heat sink!

Cheers.
 

Attachments

  • Aurora16-Schematic.pdf
    113.7 KB · Views: 286
  • AURORA16-Silk.pdf
    49.7 KB · Views: 175
  • AURORA16-Bottom.pdf
    48.6 KB · Views: 250
  • AURORA16-Top.pdf
    46.6 KB · Views: 172
I also found a clever way of expanding even more. This is accomplished by using 12 channels from PIC (Rbo-Ra3) and use Ra6 and Ra7 as control bits for 4017 clock and reset.
A very logical extension of Pete's design. Good work!

This can be exanded to 12 Channels for RGB from PIC x 10 Channels sinks from 4017, multiplexing 120 RGB LEDs, or equivalent of 360 channels.
Isn't that 40 RGB LEDs or 120 channels?

The challenge will be how fast the refresh rate would be while LEDs give out smooth color without flickering.
Yep, that's a good challenge. Best I could do at present for that 10*12 matrix with an 8-MHz clock would be 8-bit PWM (256 levels per LED) with a 195-Hz refresh rate (and a whopping 5120-usec frame rate).

Regards, Mike
 
Mike:
You are absolutely correct sir. It is 12x 10 = 120 channels /3 (RGB) = 40 RGB Modules
I had that right in my original post and went back and changed it for some odd reason.

I am done with 12-channel version and half way thru with 16 channel version.
Using 4017 makes it tons easier to multiplex without tracking too much as when to fire what port at what time. You reset it, do your thing and then clock it when you are ready. You just Reset, clock, clock, clock. (wrote subroutine calls for clock and reset).

I believe you can lower your refresh rate to 70-80 without flickering. I post my findings.
Mike if you lower the number of levels (256) on each LED you can spread those bits around for more channels. When you go above 128 the difference in color is not substantial! (i.e.: 128 red + 64 Green would have more or less the same effect as 256 red + 128 Green)

Cheers.
 
12 Module RGB Driver (12X3=36 Channels)

Here is a driver board I have been working on. This board allows you to use those RGB strip boards you have around. It is designed to accomodate 12V boards with R,G,B,+ up to 36 LED's per board (12 RGB circuits per strip board). Or equivalent of 300mA max draw per board. With this board you are no longer limited to one LED. Use a 12 Volts Regulated source and your imagination. I wonder what has a 12V battery? hmmm...

This board allows for about 500mA per channel which means it can easily drive a 36 LED board per channel. The PCB traces have been calculated for fail safe and overheating. I still recommend the traces to be coated with heavy solder for extra protection. The type of CMOS I recommend is N-Chan with at least 5A Drain current. (More is preferred). There are many good ones out there. Use the ones with minimum "On Resistor" for best results.

Here are the calculations:
12V-12" RGB 36 LED Board
4 x 3 = 12 Circuits
12 Cir. x 25mA/Cir. = 300mA per Board
300mA / 3 = 100mA per Colors (R,G,B)
One Channel ties 4 Reds, or 4 Greens, or 4 Blues
Therefore 100 x 4 = 400mA per Channel draw against 500mA per designed specs. check

***Remember this is designed for 12Volts, +, R, G, B. The polarity of the LED's have been changed and the RGB boards are rated 12v with appropriate resistors. If you connect LED's directly to this it will make for a one-time-use flash for a camera! (i.e.: burn out before you can blink)
 

Attachments

  • 12 CHAN RGB DRIVER CMOS (RGB+) Silk.pdf
    34.3 KB · Views: 215
  • 12 CHAN RGB DRIVER CMOS (RGB+) Copper.pdf
    46.6 KB · Views: 183
Last edited:
36 Channel RGB+ Driver Board - 12V (A/C - D/C)

Here is an improvement on my last post. This is a driver mother board that has been beefed up. The board has not been tested. I will post new updates if I find any flaws.
I often run out of memory space because of the complex codes I put on my PIC's. I thought to myself why not create a bank of plug-in boards that has different effects that can be selected. While at it why not have several effects on each board and be able to tap into each board and each program individually!

Description:
There are two types of board in this post.
1- Smaller plug-in boards
2- Mother Board Driver
Since the smaller plug-in boards are obvious, I will focus on the description of the mother board.
To your top left you will find the feed to the board which could be a/c or d/c 12V. This feed is then washed, filtered and then regulated to produce 12V-DC feeds to Driving MOSFETS for RGB+ Boards. Below it you will find 5V-Regulator and supporting caps and below that you have 4017 decade counter for the multiplxing of channels. On top across the board you will find all the N-Chan MOSFET (15A, 50V, TO220AB) driving the output ports. Bottom center you will find a simple debounce 12-channel board select for master clear of each module board selecting each board via the "Board" switch (top right). With each press of BOARD switch PIC is advanced to the next port triggering another module board. In the center of the mother board you will find a bank of 12 board plug-in ports for 12 Driver module Boards. RA4 of all boards are connected together. A single module board is selected via "Prog" switch connected to RA4. On each individual module the code can be written such that with a push of PROG bottom Ra4 is grounded hence can fetch specific program on that module board or can change speed as desired.
I am open to feedbacks and suggestions...play-on playas!
 

Attachments

  • 15 Chan Driver Module - Bottom.pdf
    29.3 KB · Views: 189
  • 15 Chan Driver Module - Silk.pdf
    23.4 KB · Views: 182
  • 12 CHAN RGB+ Silk.pdf
    555 KB · Views: 257
  • 12 CHAN RGB+ Top.pdf
    167.1 KB · Views: 205
  • 12 CHAN RGB+ Bottom.pdf
    86.4 KB · Views: 166
Last edited:
Hi Geko,
I appreciate that you shared your code.
I am a noob but I was able to download and get this running on a pic 16F628a tht I use.
It works great and you are right...it is mesmerizing!!!
So I am trying to understand the code ..but first I have to understand some terms like transfer, spread, and angle...then I can try to figure out how each led is being controlled.
I'm sure you are busy, but I'd appreciate if you could take a moment to either explain to me a little more detail about your code or point me in the right direction to figure it out.


Thanks.

Best regards,
Ken
 
Status
Not open for further replies.

Latest threads

Back
Top