Controlling PMW to limit voltage output

Hi,

I need to limit the voltage output to be less the maximum 5volts or anywhere near it. My understanding of the coding for it is minimal, so any help guiding me towards the right direction would be appreciated.

What do you mean by "or anywhere near it".

PWM doesn't really decrease the voltage- it shifts very quickly between 0 and 5, giving the "illusion" of being lower than 5v, but it still does actually get to 5v, just "averages out" as something between 0 and 5.

You can drop voltage through a diode or two...

But you really ought to give more information- some of the boffins here will probably have some suggestions.

JimboZA: But you really ought to give more information- some of the boffins here will probably have some suggestions.

Another option is to use 2 resistors in a voltage divider configuration.

Another option is to use zener diodes. They come in 3.3, 3.6, 3.9, 4.3 and 4.7V, for 0.4W up to 5W (there are several other values, I am just liting those near your requirements).

If you want MORE than 4.5V, your only choices are zeners or voltage dividers.

for less than that, use schottky diodes (low voltage drop, usually below 0.5V ) or regular diodes (>=0.7V).

Eyedeal: Hi,

I need to limit the voltage output to be less the maximum 5volts or anywhere near it. My understanding of the coding for it is minimal, so any help guiding me towards the right direction would be appreciated.

Perhaps if you could show what you are attempting to wire and control with the PWM output pin it would be more apparent of the best method to get there is.

Lefty