brightness controllere with pic

Discussion in 'The Projects Forum' started by kaznov, Oct 20, 2012.

  1. kaznov

    Thread Starter Member

    Mar 10, 2012
    Hi guys
    am considering designing an automatic brightness controller to control LED lights inside a room using PIC16F877A with PWM

    I have 2 quistions guys
    1- I read about PWM but i didnt really understande it well, is it just a pin in the chip that change the signal to impulse signal ? or is it a circuit that we have to build beside the microcontroller chip or what's going on haha

    2- are there any potential problems or something that I have to be aware of when am dealing with this microcontroller? becuase am considereing working with adruino board instead of pic microcontroller

    thanks a lot guys and lookn to hear all ur answers
  2. picgak

    New Member

    Oct 16, 2012
    16f877 have got 2 hardware pwm whose pulse width can be varied according to your requirements
    pic microcontroller if you keep the good supply voltage at 5v. there wont be any problem
  3. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    PWM just means during a certain time (pulse) you turn the output on (width) over and over. If the width is 50% of the pulse you have 50% power. If you do it fast enough the human eye misses the flash and sees a constant intensity. 30 to 200 Hz is typical.

    You need a micro that can sense the brightness (probably by reading a light dependent resistor or such using an internal analog to digital converter) and another pin to turn the LED on and off.

    That's 2 pins. *Every* microcontroller has 2 pins. Or more. So anything you pick can potentially do this (even if it lacks an internal analog to digital converter).

    If you already have a micro, use that.

    If you don't already have a micro, and are in the market for one, choose wisely.
  4. gehan_s

    Active Member

    Sep 17, 2012
    hi kaznov,

    with the PWM module in the PIC you will be switching the LEDs (probably using a transistor switch) on and off at a very high speed. you cannot identify whether the LEDs are on or off because it is switching at a higher frequency. the ON, OFF time of the LEDs will determine the brightness.

    instead of using a PIC you can generate the PWM using 555 timer (which is way more cheap)