Use PWM signal as a trigger

Thread Starter

gdanthony

Joined Dec 13, 2023
7
Hello,

I'm hopeful there is someone who will be able to help me. I am not well versed in electronics, but can understand the basics and am fairly handy and can usually figure stuff out. I am able to solder and assemble circuits, but need some guidance so I don't damage my vehicle.

I installed an aftermarket stereo head unit into my car and am trying to get the night / day illumination feature to work correctly. The stereo has an illumination input wire that reacts to a 12V+ signal when the car's lights are on to set it's illumination to a lower level for night time use. The illumination wire that is used with the factory stereo uses a PWM signal to directly dim the lighting concurrently with the other interior lighting.

I'm looking for a way to use this PWM voltage to trigger the night mode of the aftermarket stereo without damaging my car. I don't know (and have no way of measuring) the PWM signal, but found some info online from a similar car that is probably very close to the signal that is used in my car. "The signal itself is an 80hz (12.5ms period) square wave, roughly 12v peak to peak (zero volts to ground low, actually between 10.5 and 12 volts to ground high, about what you'd expect). The minimum brightness setting corresponds to a high time of 1.04ms, or ~8.25% duty cycle. The 1 notch brightness setting corresponds to a high time of 2.64ms, or 21% duty cycle. The 2 notch brightness setting is a high time of 4.32ms, or 35% duty cycle. And so on: 3=5.92ms(47%), 4=7.6ms(60%), 5=9.36ms(75%), 6=10.9ms(87%) then 7 notches is actually max brightness at 100%."

Any ideas?
 

sghioto

Joined Dec 31, 2017
8,634
Try connecting the wire in the new stereo through a 100 ohm resistor to the PWM wire in the car.
Or this simple filter might work.
1702513565646.png
 
Last edited:

crutschow

Joined Mar 14, 2008
38,521
sghioto's circuit is basically insensitive to the PWM duty-cycle, so should give you 12Vdc out (less a diode drop) for any duty-cycle.
 
Last edited:

Thread Starter

gdanthony

Joined Dec 13, 2023
7
Try connecting the wire in the new stereo through a 100 ohm resistor to the PWM wire in the car.
Or this simple filter might work.
View attachment 309950
This won’t cause any damage to the vehicle? I had seen something similar when I was doing some googling and someone had cautioned that using a capacitor in this way might cause an issue with the circuit in the vehicle. Also what voltage of capacitor would I need? Would one like this do the job? https://www.digikey.ca/en/products/...-draloric-bc-components/MAL212315109E3/263184
 

WBahn

Joined Mar 31, 2012
32,871
Hello,

I'm hopeful there is someone who will be able to help me. I am not well versed in electronics, but can understand the basics and am fairly handy and can usually figure stuff out. I am able to solder and assemble circuits, but need some guidance so I don't damage my vehicle.

I installed an aftermarket stereo head unit into my car and am trying to get the night / day illumination feature to work correctly. The stereo has an illumination input wire that reacts to a 12V+ signal when the car's lights are on to set it's illumination to a lower level for night time use. The illumination wire that is used with the factory stereo uses a PWM signal to directly dim the lighting concurrently with the other interior lighting.

I'm looking for a way to use this PWM voltage to trigger the night mode of the aftermarket stereo without damaging my car. I don't know (and have no way of measuring) the PWM signal, but found some info online from a similar car that is probably very close to the signal that is used in my car. "The signal itself is an 80hz (12.5ms period) square wave, roughly 12v peak to peak (zero volts to ground low, actually between 10.5 and 12 volts to ground high, about what you'd expect). The minimum brightness setting corresponds to a high time of 1.04ms, or ~8.25% duty cycle. The 1 notch brightness setting corresponds to a high time of 2.64ms, or 21% duty cycle. The 2 notch brightness setting is a high time of 4.32ms, or 35% duty cycle. And so on: 3=5.92ms(47%), 4=7.6ms(60%), 5=9.36ms(75%), 6=10.9ms(87%) then 7 notches is actually max brightness at 100%."

Any ideas?
It sounds like you have a polarity issue, too.

If I'm reading our description correctly, the new stereo has two brightness levels and 12 V (or something close) causes it to go to the dim setting.

But the car provides a PWM signal that steps up the brightness starting from a low (average) voltage to the max brightness when the signal is at the full 12 V.

Please verify if this interpretation is correct and, if not, please clarify.
 

Thread Starter

gdanthony

Joined Dec 13, 2023
7
It sounds like you have a polarity issue, too.

If I'm reading our description correctly, the new stereo has two brightness levels and 12 V (or something close) causes it to go to the dim setting.

But the car provides a PWM signal that steps up the brightness starting from a low (average) voltage to the max brightness when the signal is at the full 12 V.

Please verify if this interpretation is correct and, if not, please clarify.
This is correct, the new stereo will change to the dim setting when it senses some level of voltage (approximately 12V I assume) on the illumination wire. I don’t think there is a polarity issue as the PWM signal is positive and that is what the new stereo is expecting. What happens now is that when the lights are turned on, the display on the new stereo flashes between the two brightness settings. If I lower the brightness of the dash lights, the flashing occurs more quickly. I assume that this is the PWM pulses that are being seen as both 0V and 12V intermittently.
 

crutschow

Joined Mar 14, 2008
38,521
But the car provides a PWM signal that steps up the brightness starting from a low (average) voltage to the max brightness when the signal is at the full 12 V.
Yes.
But the PWM peak-detect signal in post #2 means there will be a 12Vdc signal sent to the stereo, independent of the PWM duty-cycle.
 

WBahn

Joined Mar 31, 2012
32,871
Yes.
But the PWM peak-detect signal in post #2 means there will be a 12Vdc signal sent to the stereo, independent of the PWM duty-cycle.
There has to be some kind of bleed current to let the capacitor voltage fall when the 12 V is removed (or is at a sufficiently low duty cycle). The polarity problem still remains.
 

WBahn

Joined Mar 31, 2012
32,871
That would be the load from the stereo input, but an added resistor to ground would insure that.
That's the second time you've mentioned that, without stating where you think that problem occurs.
I stated it the first time I mentioned it.

It sounds like you have a polarity issue, too.

If I'm reading our description correctly, the new stereo has two brightness levels and 12 V (or something close) causes it to go to the dim setting.

But the car provides a PWM signal that steps up the brightness starting from a low (average) voltage to the max brightness when the signal is at the full 12 V.

Please verify if this interpretation is correct and, if not, please clarify.
The TS confirmed that this interpretation was correct.

The new stereo is DIM when the control signal is 12 V.

The car provides a PWM signal that goes to 12 V in order to make the stereo display BRIGHT. To DIM the display, it needs a voltage that is near 0 V.
 

Thread Starter

gdanthony

Joined Dec 13, 2023
7
I see that there is some confusion with my scenario. I just need a 12V signal to set the new stereo into "night mode". I think the circuit that sghioto suggested will work for what I need as it will provide a 12V signal when the car's interior lights are on. I just would like to ensure that using a capacitor in this way won't cause any problems to the vehicles electronics (a current spike while the capacitor is charging?). Also, I need to know what type of capacitor would be best to use in this circuit and what specifications are needed (voltage rating, etc.).
 

Thread Starter

gdanthony

Joined Dec 13, 2023
7
10uf electrolytic capacitor rated at 25 volts or higher should suffice.
Thank you. One other question, will this generate much heat? If I solder the diode and capacitor together and put them inside some heat shrink tubing will I run into any problems?
 
Last edited:

crutschow

Joined Mar 14, 2008
38,521
I just would like to ensure that using a capacitor in this way won't cause any problems to the vehicles electronics (a current spike while the capacitor is charging?).
Adding a 100Ω resistor in series with the diode will eliminate that as a concern.
will this generate much heat? If I solder the diode and capacitor together and put them inside some heat shrink tubing will I run into any problems?
It will generate negligible heat.
No problem with putting them inside shrink tubing.
 

Thread Starter

gdanthony

Joined Dec 13, 2023
7
Adding a 100Ω resistor in series with the diode will eliminate that as a concern.
It will generate negligible heat.
No problem with putting them inside shrink tubing.
Perfect, thanks. Should the resistor be before the diode or after? And what wattage of resistor should I look for?
 
Top