Hi guys,
I want to use a Picaxe 18X to control an RGB array (48 RGB leds with common anode). I want to be able to switch on-off each R, G and B channel independetly with 3 individual push-button switches and control the brightness (all channels at same time through common anode by PWM) using 2 individual push-button switches (one for increasing brightness and other to decrease).
Since my array will be drawing 960mA to 2880mA (each LED draws 20mA/color), I decided to use a Darlington transistor TIP125 to control the anode PWM and a TIP120 to control each RGB channel cathode.
So in the end I have designed the attached circuit to do the job and the following program to run the picaxe.
1º The TIP125/TIP120 are not drawing as much current as I wished (~3A for white color). I know that maybe that has to do with the resistor I am using at the base, nevertheless I need help on how can I calculate the right resistor for this transistor to be fully open (I didn't wanted to experiment different resistors in my prototype so that I didn't damage the picaxe or any other component..first I want to learn how can I calculate things to go right, then experiment..have read several stuff about this but still don't understand much what the TIP125/120 parameters mean and how can I use them to calculate the right resistor).
2º The values I am getting from Readadc are to low (they go from 0 to 23). My questions are: Is the push-button/resistors part of the circuit well done or is there something wrong about how I am doing it? Or on other hand, how can I calculate the right resistors so that I can get a better linear range of readadc (i.e. from 0 to 255, equally divided by the 6 push-button switches)? Also, I am getting a huge delay (about 1 sec) in response from when I press the button and the debug value in my computer/response in circuit. Is this normal? I've tried to increase the value to 500 or just remove the "pause" function but that didn't solve the problem (in fact, when removed, it started to be instable due to the bounce effect).
Well, I'm sorry if this was a big message, but I wanted to explain all in detail so that anyone could help me with this issues.All help will be appreciated. If I forgot any relevant info to solve the problems I'm having, please let me know.
Thank you!
Pfrogs
Ps: I don't understand much about electronics, I only do it as a hobby, so please be gentle if these questions are to basic
I want to use a Picaxe 18X to control an RGB array (48 RGB leds with common anode). I want to be able to switch on-off each R, G and B channel independetly with 3 individual push-button switches and control the brightness (all channels at same time through common anode by PWM) using 2 individual push-button switches (one for increasing brightness and other to decrease).
Since my array will be drawing 960mA to 2880mA (each LED draws 20mA/color), I decided to use a Darlington transistor TIP125 to control the anode PWM and a TIP120 to control each RGB channel cathode.
So in the end I have designed the attached circuit to do the job and the following program to run the picaxe.
I have tested it and two issues came up.init:
pwmout 3,64,255
b1 = 255
main:
readadc 0,b0
if b0 >= 36 and b0 < 72 then red_led
pause 50
if b0 >= 72 and b0 < 108 then green_led
pause 50
if b0 >= 108 and b0 < 144 then blue_led
pause 50
if b0 >= 144 and b0 < 180 then white_led
pause 50
if b0 >= 180 and b0 < 216 then dec_bright
pause 50
if b0 >= 216 and b0 < 255 then inc_bright
pause 50
goto main
red_led:
toggle 0
goto main
green_led:
toggle 1
goto main
blue_led:
toggle 2
goto main
white_led:
high 0,1,2
goto main
dec_bright:
if b1 = 0 then main
b1 = b1 - 5
pwmout 3,64,b1
goto main
inc_bright:
if b1 = 255 then main
b1 = b1 + 5
pwmout 3,64,b1
goto main
1º The TIP125/TIP120 are not drawing as much current as I wished (~3A for white color). I know that maybe that has to do with the resistor I am using at the base, nevertheless I need help on how can I calculate the right resistor for this transistor to be fully open (I didn't wanted to experiment different resistors in my prototype so that I didn't damage the picaxe or any other component..first I want to learn how can I calculate things to go right, then experiment..have read several stuff about this but still don't understand much what the TIP125/120 parameters mean and how can I use them to calculate the right resistor).
2º The values I am getting from Readadc are to low (they go from 0 to 23). My questions are: Is the push-button/resistors part of the circuit well done or is there something wrong about how I am doing it? Or on other hand, how can I calculate the right resistors so that I can get a better linear range of readadc (i.e. from 0 to 255, equally divided by the 6 push-button switches)? Also, I am getting a huge delay (about 1 sec) in response from when I press the button and the debug value in my computer/response in circuit. Is this normal? I've tried to increase the value to 500 or just remove the "pause" function but that didn't solve the problem (in fact, when removed, it started to be instable due to the bounce effect).
Well, I'm sorry if this was a big message, but I wanted to explain all in detail so that anyone could help me with this issues.All help will be appreciated. If I forgot any relevant info to solve the problems I'm having, please let me know.
Thank you!
Pfrogs
Ps: I don't understand much about electronics, I only do it as a hobby, so please be gentle if these questions are to basic
Attachments
-
72 KB Views: 83