Arduino PWM outputs and PWM controller questions.

Discussion in 'Embedded Systems and Microcontrollers' started by rigers, Feb 1, 2012.

  1. rigers

    Thread Starter New Member

    Jun 14, 2011
    20
    0
    Hello Everyone,

    I wanted to drive a couple of LEDs using PWM from an Arduino. However the Arduino pins provide 5V and I needed it at 3.3V. I read online about PWM controllers but not quite sure how they work and how they are controlled.
    Does anyone have any ideas how I could get 12 PWM signals at 3.3V using an Arduino? Also some info on PWM controllers would be appreciated.

    Thanks in advance!
     
  2. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,771
    971
    explain why you think you need 3.3V?
    Then explain EXACTLY what you are trying to do (including part numbers/specs for the LED's).
     
  3. rigers

    Thread Starter New Member

    Jun 14, 2011
    20
    0
    The specification sheet of the LED states a max voltage of 3.8V. Can I run them at 5V but limit the current at a safe level or is it neccessary to be 3.3V?
    LED Part number: HLMP-115.
     
  4. BSomer

    Member

    Dec 28, 2011
    433
    106
    You can run them on the 5 VDC outputs of the Arduino with the use of a current limiting resistor. However, if you are going to do more than one LED on an output you will have to use a transitor to switch the LED's on an off. This is due to the low current sinking/sourcing abilities of the outputs.
     
    rigers likes this.
  5. simo_x

    Member

    Dec 23, 2010
    200
    6
    And also depending on the Arduino source capability. Checkj the datasheet of the regulator mounted on the board to know the maximum souce current it can drive, or in addition, an external power supply can be used.

    Bye
     
    rigers likes this.
  6. rigers

    Thread Starter New Member

    Jun 14, 2011
    20
    0
    Each LED will have it's own pin and they won't be running at the same time (2 at a time max). So actually I'm going to use the Mega.

    I would still like to know if I could have a 3.3V PWM though, as a general knowledge I guess.

    Thank you!
     
  7. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,771
    971
    Led's are driven by current..NOT voltage. you basically just need to ensure your supply voltage is higher than the Vf of the LED (or group of LED's if in series). Anyone can power than LED with a 1000V supply if they wanted to.. The important part is the 20mA rating for the LED which you ensure the LED gets only that via a resistor (or via a constant current supply)
     
    rigers likes this.
  8. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,771
    971
    There is a VERY..VERY good chance that you don't need a mega either.. Maybe you should tell us EXACTLY what you are trying to do so you can learn the proper way to do it. (Charlieplexing/Multiplexing might be one solution)
     
  9. BSomer

    Member

    Dec 28, 2011
    433
    106
    There are arduino's out there that run on 3.3V only. So those would undoubtedly have the 3.3V pwm that you are looking for. As for the 5V versions I am uncertain. You can use the pwm pins to control any voltage level you want. Just use a transistor (BJT or FET) connected to the pin.
     
  10. rigers

    Thread Starter New Member

    Jun 14, 2011
    20
    0
    I have 12 LEDs in a ring. Each LED runs separately and one a time. I need to vary the intensity of the LEDs with PWM. The Mega has 14 PWM while the UNO only has 6. I am using a Arduino because I need to be able to control the LEDs with a computer and collect data. I have the interface almost ready.
     
  11. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,394
    1,606
    One thing never do is connect a LED directly to any voltage source without some sort of current limiting, such as a series resistor.

    ANYTHING is liable to happen, from the LED not lighting, being dim, lighting just fine, being too bright, LED & chip running hot, LED & chip burning out.

    Simon sez don't do that.
     
  12. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,394
    1,606
    Controlling the brightness of a LED using PWM is pretty simple. For a 5V logic output compute a nice value of resistor from:

    R = (Vdrive - Vled) / Iled

    Where Vdrive is the logic output voltage, Vled is the LED ON voltage, and Iled is the LED current when it is on. Make sure the micro can drive Iled.

    Set up like that, the LED is running at full current or full brightness for a pulse width of 100%. If you drop the pulse to 50% you get 50% of the current and a lesser brightness (I don't think brightness and current have a direct linear relationship).

    From what you've said 12 LEDs and 12 resistors should be all you need.
     
Loading...