PWM to Analog Voltage

I'm a newb, but have relied on this forum for years and have great respect for many of you.

My question is in regards to converting a PWM signal to an analog voltage using a basic RC LPF.

My input is a 12VDC 100Hz signal that I would like to use to control a standard automotive cube relay (12V coil). My idea was to use an RC LPF to convert the PWM signal to a steady analog voltage that would control the relay coil.

Is this possible? And what R-C values would I need to make this work? I don't expect to get an output equal to the 12V input, but if I can get 8V-9V out, that should be enough to pull-in my relay coil.

Would appreciate some help. Thank you!

There's no reason why you wouldn't be able to get
12V with a 4.7uF /15V electrolytic cap and 4.7k resistor but there's no chance it would supply enough current to drive the relay so you would
have to use the steady state 12V to turn on a transistor or mosfet relay driver.
Google "relay driver" and add that circuit after theRC LPF. You might need to increase the cap to 10 uF but that should work. You can also use a CMOS chip like a CD4050BE to convert the 12V to a logic output. Check the datasheet to find out the output current. You can then use the logic High to drive the mosfet .

Hi,
What is the 12V 100Hz source, will it be able supply the current for the automotive relay.
How do you expect the PWM signal to control the relay, the relay can only be ON or OFF?

Tom... :slight_smile:

Tom - The 12V 100Hz source is from a controller module on a bus. It's original function is two-fold; it involved driving the high beam headlights of the bus by outputing an analog 12VDC signal that then drove an incandescent (halogen) bulb. During the daytime it's function changes to driving the DRL (day time running lamps). Therefore in order to get the decreased light output from the high beam halogen bulb, the signal changed to a PWM (100Hz) signal. I would like to convert this signal to a steady DC voltage (8-9 volts) in order to drive a 12V relay. To answer your question simply, yes there is enough current from the controller module to drive the 12V relay.

Raschemmal - Thank you for the information. I will look into the relay driver. Are you quite certain after the LPF that there would not be 500-750 mA available to drive the relay coil?

Raschemmal - Thank you for the information. I will look into the relay driver. Are you quite certain after the LPF that there would not be 500-750 mA available to drive the relay coil?

How can I answer that if you have not given us the DUTY CYCLE of the PWM.
100 Hz PWM could be 10%,20%,30%, or anything.

If it was designed to go from 100% to some lower value for halogen dimming , then is there is a possibility
that it could supply enough current if the cap was large enough, (33uF to 100uF, instead of 4.7uF to 10uF.
Remember , a cap is nothing more than an energy storage device.
If you need more energy, then you need more storage.
If you relay is going to be on constantly you will eventually discharge the cap which is why you need a relay driver because it is not subject to discharge. Think "basic electronics theory" when you are trying to solve an electronics problem. The most difficult problems I have faced, were solved with simple basic theory.

How about using a diode to charge the
capacitor to ~12V?
Herb

How about using a diode to charge the
capacitor to ~12V?

Charging the cap is not the problem.
The problem is that the relay current will drain if faster than you can charge it, without question.

Duty cycle of the 100Hz 12V signal is 60%.

I see the dilemma now. The relay coil would eventually drain the CAP. And yes. assuming the DRL lights are on for extended time periods (which is the case). I'll have a look into the relay drivers you mentioned and couple it with the RC LPF.

Appreciate the help. Now that you know the Duty Cycle, if you think of anything else I'm all ears.

Just this : 60%<100%
If the lights are on all the time that equates to 100% so it's only a matter of time (probably not long)
before the cap discharges.

You are missing the most important part the buffer. Take the capacitor voltage to the + input of a single supply rail to rail op amp. Then connect the output to the base of a NPN transistor capable of handling your current and dissipating the wattage. Connect the collector to the + supply. The output is the emitter of the transistor which is also connected to the - of the op amp via a 20K resistor. Depending on the parts you chose you may get less then a volt drop from the + supply. Depending on the opamp you may need to add a pull up resistor to the output of the op amp. The transistor is connected as an emitter follower circuit. If you want more then 5 volts out connect an additional 10K resistor from the - of the opamp to ground. The ratio of these resistors controls the gain.
Good Luck & Have Fun!
Gil

Seriously, if you have the time to write
such a long description you have the
time to draw a schematic with a ballpoint
pen and a blank sheet of printer paper
and photograph it with your phone snd upload
it.
The OP said he was a 'noob' but I don't
know if he meant forum newbie or
electronics noob but I personally wouldn't
expect him to be able follow your explanation
but even if he could I think a handdrawn
schematic isn't too much of a courtesy to ask.
You could have drawn it in less time than it
took you to describe it.
That's my take on it.
Also I don't see why he needs a rail to rail
op amp and if it were me I would just use
an LT1215 non-inverting amplfier or voltage follower to drive a transistor/mosfet relay driver circuit with a flyback diode across the relay coil, but that's just me.

This circuit took 10 seconds to look up using voltage follower with op amp, I assumed he/she would look it up as part of the learning process. This is a classic circuit been around for over 40 years and published in a lot of basic electronics books. As you probably do not know there are leakage currents on the inputs etc the feed back resistor minimizes the effects and protects the op amp the second changes the gain. Mine works will yours?

I don't see any link.

I can see now why you only have 7 karma points. (since June of 2015)

I assumed he/she would look it up as part of the learning process

And HOW might I ask would he do that since you failed to include the search keywords ?
You have an awful lot of time that could be more wisely spent by providing more information in your posts.

How hard is it to post a link to the circuit your talking about ?
You have a lot of knowledge but what good is that if the newbie can't understand your post ?

Mine works will yours?

(Really ? It's only relay )