Hi,
I'm new to picaxe and would like some comments on my first "real" project.
What I would like to do is controll the brightness of some led-clusters with an infrared remote controller.
The led-clusters all have 24 leds in 8 (was 6) groups each with a 220 ohm resistor
in series and driven at 12V. I will have 8 of these clusters.
My idea is now:
connect each of these clusters to an output of an ULN2803 and connect all inputs
of that to a pwm output of a picaxe 08M2.
With the attached program each cluster will source 80mA at highest connected
directly to 12V it sources 100mA.
My question is now: will it be ok to use the ULN2803 or will it be better to
use a MOSFET and if so which would you suggest?
Thanks for comments and suggestions.
Regards
Stefan
I'm new to picaxe and would like some comments on my first "real" project.
What I would like to do is controll the brightness of some led-clusters with an infrared remote controller.
The led-clusters all have 24 leds in 8 (was 6) groups each with a 220 ohm resistor
in series and driven at 12V. I will have 8 of these clusters.
My idea is now:
connect each of these clusters to an output of an ULN2803 and connect all inputs
of that to a pwm output of a picaxe 08M2.
With the attached program each cluster will source 80mA at highest connected
directly to 12V it sources 100mA.
Code:
#no_data
#picaxe 08m2
Symbol IRSense = c.1
Symbol InfraRED = b9
Symbol incdec = 50
Symbol per = b8
per = 249
w0 = 500
pwmout 2,per,w0
pause 1000
main:
if w0 > 1000 then
let w0 = 1000
endif
Irin [100, main],IrSense, InfraRED
select case InfraRED
case 0 to 9
w0 = InfraRED + 1 * 100
pwmout 2, per, w0
case 16
gosub brighter
case 17
gosub darker
case 21
pwmout 2,off
case 76
let w0 = 500
pwmout 2,off
case 77
let w0 = 500
pwmout 2,per,w0
endselect
goto main
brighter:
let w0 = w0 + incdec
if w0 > 1000 then
w0 = 1000
endif
pwmout 2,per,w0
return
darker:
let w0 = w0 - incdec
if w0 > 1000 then
'w0 = 1000
pwmout 2, off
else
pwmout 2,per,w0
endif
return
use a MOSFET and if so which would you suggest?
Thanks for comments and suggestions.
Regards
Stefan
Attachments
-
28.5 KB Views: 27
-
28 KB Views: 29
Last edited: