LED PWM brightness control - transistor value and Piezo buzzer volum control

Status
Not open for further replies.

llrjt100

New Member
Hi,

I'm trying to build an LED brightness control and I'm basing it on the LED flasher at http://www.wrighthobbies.net/bots/lamp/index.htm.

I've looked at the schematic (http://www.wrighthobbies.net/bots/lamp/lampschem1.jpg), but there are no values given for transistor Q1 which is regulating the LED brightness by pulse width modulating the LED common ground of the Darlington transistor array.

I would be very grateful if someone could suggest a suitable value for Q1 and also which diodes D6-D10 I should use (are the diodes necessary). I'm using an Atmel AVR Mega16 which can source and sink 20mA. I can drive the ULN2003 from 5V or 12V.

I'm also trying to regulate the volume of a piezo buzzer - all I can think of at the moment is connecting the buzzer to the Mega16 via two different value resistors to control the PWM level, giving me two volume levels. Is there any more elegant way I can do this?

The piezo buzzer sounds fairly horrible - without going to a full blown sound synthesis IC, are there any other low cost methods I could use for generating a more pleasing beep?

Many thanks,
Richard
 
u can use general purpose diodes like 1N4148 for the diodes , and a transistor with some power handling capacity like BD139 for Q1-3
 
I would be grateful for any suggestions about a better way - I need to vary the brightness of the the three LEDs together, using a single PWM output from the microcontroller.
 
If you switch to a Micrel MIC5821 or MIC5841 (Allegro A6821 or A6841) you can feed the <OE> pin with an inverted PWM signal...

Good luck... Have fun... Regards, Mike
 

Attachments

  • PWM LED.JPG
    9.9 KB · Views: 927
PWM'ing the GND of the ULN2003A does seem to work nicely, without any ill effects - it does need diodes on the input lines though.

The Micrel or Allegro solution looks more elegant - I might give this a go as well.
 
llrjt100 said:
PWM'ing the GND of the ULN2003A does seem to work nicely, without any ill effects - it does need diodes on the input lines though.

The Micrel or Allegro solution looks more elegant - I might give this a go as well.

Why not PWM the supply line instead?, a FAR nicer solution!.
 
Nigel Goodwin said:
Why not PWM the supply line instead?, a FAR nicer solution!.

I've given this a go with the 2N2222 which I was using to switch the GND before but placing it to switch the +5v supply to the LEDs instead.

I've got three normal LEDs and the LED backlight for an LCD dispay. When I was PWM'ing the GND, I had a good brightness match between the normal LEDs and the LED backlight, but now I PWM'ing the supply, the LED backlight is too dim. Is this because the 2N2222 can't pass enough current? If so, could you suggest a transistor choice that would do the job - the LEDs are 20mA each and the LED backlight 140mA giving a total of 200mA.

Thanks,
Richard
 
Probably best to use a reasonably rated MOSFET instead, to avoid a voltage drop to the chip. The IRF530 should do it, something smaller might be more suitable though, look for low "rds on" figures.
 
Dr.EM said:
Probably best to use a reasonably rated MOSFET instead, to avoid a voltage drop to the chip. The IRF530 should do it, something smaller might be more suitable though, look for low "rds on" figures.

How about a BSP295 (maplin do these) with VDS = 50 V and ID = 1.8 A?
 

A 2N2222 is NPN, you should use a PNP for the much lower voltage drop in common-emitter mode, check my tutorial Hardware Extras at , the 'source' examples.
 
Nigel Goodwin said:
A 2N2222 is NPN, you should use a PNP for the much lower voltage drop in common-emitter mode, check my tutorial Hardware Extras at , the 'source' examples.

I've just had a read of your excellent tutorial and this has helped me understand what is going on - my background is software, not electronics (as you can see!), so well laid out tutorials like this help a great deal.

Many thanks,
Richard
 
LM317 using it as a current source on the LEDS power input one lm317 one small pot and vary the leds to your LEDS cost less then a buck total.
 
neon said:
LM317 using it as a current source on the LEDS power input one lm317 one small pot and vary the leds to your LEDS cost less then a buck total.
Why don't you tell our OP how he can control this circuit with his microcontroller.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…