Shop OBEX P1 Docs P2 Docs Learn Events
PWM LED control — Parallax Forums

PWM LED control

alnajjar1alnajjar1 Posts: 110
edited 2010-08-23 13:44 in BASIC Stamp
I am using BS2 to dim an LED strip that uses 12V with maximum of 14W (about 1.1A). I have used the PWM on the BS2 quite a bit but wanted to know the best method to have the signal from the BS2 controlling the light intensity. I was thinking of using a Darlington Transistor like the TIP120 but wanted some feedback from the experts.

much appreciated.

Al

Comments

  • Peter KG6LSEPeter KG6LSE Posts: 1,383
    edited 2010-08-23 13:44
    can you switch the low side of your lights? . MOSFETs are Very good at switching .

    and are you using the PWM command or Pulseout . I have found the latter works better .

    http://www.flickr.com/photos/peterthethinker/4794741329/in/set-72157623214411145/
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    
    Part1 VAR WORD
    Part2 VAR WORD
    Part3 VAR WORD
    Part4 VAR WORD
    
    
    DO
    'READ POT
    HIGH 1
    PAUSE 1
    RCTIME 1,1, Part1
    'DO math
    Part2 = Part1 + 45
    Part3 = Part2 * 106
    Part4 = Part3 - 4876
    'DO out
    PULSOUT 10 , Part4
    
    DEBUG DEC part4 ,CR
    
    LOOP
    
Sign In or Register to comment.