Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PWM headlight control

Status
Not open for further replies.

91 XR7

Member
This is more of a brainstorming thread then anything as of yet

Why yes PWM headlight control, Found on a few newer cars, specially Canadians with the Daytime Running Lights engaged. I do believe the PWM is to prevent people from dropping in those cheap Plug and Play HID kits into cars with Halogen Projectors, so the car will play havoc on the "HID" system even with relays (I've heard people complain about "buzzing" relays).

NOW if one can measure the PWM of the power (or ground?) to the headlights to determine what frequency(?) the headlights are at for the DRL and for "full" power can one build a circuit that can translate that into a simple on / off output? with a Theoretical figures of the DRL frequency is 50% and "Full" is greater then 90%. So when signal is around the 50% rate the circuit can control a relay A (Too another DRL module or some other DRL setup) and when that same signal goes up to 90+% it'll control Relay B (To Give full battery voltage to the headlights)

Even thou most modern cars also control the alternator so you can be driving around with 12.4 volts at best instead of 13.4-14.4 **broken link removed**, but having the headlights going through a PWM setup isn't helping! Which is why i believe the headlights are dimmer on my '13 fusion then on the trade in '96 XR7, which had 13.3+ voltages constantly and no PWM nanny stuff :)

Thank You
 
A simple RC integrator would convert PWM duty cycle to a proportional voltage.
 
Hi fellow Canadian.
Did you notice that the Jeep trucks and Chrysler cars in Canada use high beams without dimming for daylight running lights? They blind oncoming drivers when it is cloudy and after sunset. They can be seen many miles (kms) away.
The designers know about it because they turn off the light on the side where there is a turn signal blinking so that it can be seen.
I think newer Kia and VW cars are also blinding people in the daytime.
I am not talking about HID bright blue lights.

I wonder why so many stupid people fail to turn on their headlights at night? They drive around with DRLs on the front and no lights at the rear. Sometimes they turn on their parking lights instead.
Also the stupid cars that do not turn on the headlights automatically when they are needed?
 
Frequency is still the same from 0+ PWM to 100-% PWM. Look at measuring ON time. Rising edge to falling edge. Want a thought? Use an OPTO Schmidt trigger and a PICAXE. www.picaxe.com

Sorry, Yah i guess Duty cycle would be the choice to use instead of Frequency. Well I'm going to be looking into this possible setup, I'm finding the Picaxe an interesting piece so far. NOW if i knew programing. Yah i Did Basic/Qbasic?) back in grade 8 but that was a couple of years ago o_O
 
A simple RC integrator would convert PWM duty cycle to a proportional voltage.

is it possible to link me to a schematic or more information? Since looking up RC integrator on Google seems to show, least in my eyes, a device that takes the on/off square way of a PWM and turns it into a saw wave?? Sorry if i'm not getting it, i'm still very much a beginner
 
./..
Even thou most modern cars also control the alternator so you can be driving around with 12.4 volts at best instead of 13.4-14.4 ...

What??? All cars that ever had an alternator "control the alternator" (since ~1965). The voltage measured at the battery terminals is >14.2V, wether the car has HIDs or not. If your car has only 12.4V, then let me guess, you have installed a 1000W stereo...
 
What??? All cars that ever had an alternator "control the alternator" (since ~1965). The voltage measured at the battery terminals is >14.2V, wether the car has HIDs or not. If your car has only 12.4V, then let me guess, you have installed a 1000W stereo...

Guess you haven't gotten the memo of what the cars in the last 10 years can do:p

Depending on the car itself and how it does it either by the ECM (Engine control module) or BCM (Body control module), or any other labeling the manufactures use for those two devices, will control the alternator in the terms of shutting it off (not charging) for better gas mileage or just for less drag on the engine itself.

There are alternators out there that will not charge unless it's getting a certain frequency or PWM duty cycle from an external device. Even with an built in voltage regulator!

But yes this feature sucks for those who have "large" systems in their cars! Luckily my car is all stock :)
 
Hi fellow Canadian.
I wonder why so many stupid people fail to turn on their headlights at night? They drive around with DRLs on the front and no lights at the rear. Sometimes they turn on their parking lights instead.

I know my older cars with DRL had used the high beams for that feature, but at a greatly reduced rate (low beams where way brighter) but I agree there are some cars out there where the difference between DRL and low beams are just minor. Then there is some cars i swear use the Turn-signal Bulbs (21W) and full power for DRLs! (Chrysler products come to mind, also some GMC products?)

Also this is my thought on the people who drive at night without their lights on. Go into nearly any modern car and turn the key on (or push the button) what happens to the instrument panel? It lights up like Fort Knox being broken into! Now add in DRLs and people will think their lights are on.

So in Canada at least car should come standard with automatic lights!! :)

Also trying to figure out why some people do what they do when they drive can end up just driving you batty!
 
Last edited:
is it possible to link me to a schematic or more information?
Here's a simulation of integrator function. The curves show the result for a 30% duty cycle and 90% duty cycle 12V PWM input respectively.
PWMtoVoltage.gif
 
Here's a simulation of integrator function. The curves show the result for a 30% duty cycle and 90% duty cycle 12V PWM input respectively.
View attachment 87894

Why thank you sir, like i said most results i seen online via google search seemed to result in a Saw-tooth like output. I've been playing around with the Picaxe software (love the drag and drop feature, perfect for dumb ass like me) now i need to see how i can set it up to notice a voltage into into one of the pins of the 08M2 chip.

Thank you again,
Also thank you to all again
 
Sorry, Yah i guess Duty cycle would be the choice to use instead of Frequency.
Maybe you saw this defective PWM DC Motor Speed Control circuit on the web that changes the frequency instead of changing the duty cycle. It does not change the speed of the motor and it will not dim lights:
 

Attachments

  • bad PWM speed controller.png
    bad PWM speed controller.png
    8.4 KB · Views: 649
is it possible to link me to a schematic or more information? Since looking up RC integrator on Google seems to show, least in my eyes, a device that takes the on/off square way of a PWM and turns it into a saw wave??
You are correct.
Integrating a squarewave does cause the waveform to become a triangle waveform but the up and down motion is very small if the resulting RC lowpass filter has a low cutoff frequency.

If the squarewave is actually PWM pulses then the integrated waveform is a sawtooth.
 
You are correct.
Integrating a squarewave does cause the waveform to become a triangle waveform but the up and down motion is very small if the resulting RC lowpass filter has a low cutoff frequency.

If the squarewave is actually PWM pulses then the integrated waveform is a sawtooth.

But How would say a PicAxe 08m2 Preform with and input signal from a RC integrator (as if i knew how to get the Picaxe to register the RC integrator (or even a OPTO Schmitt triggers output) output as something)

Thanks
 
Last edited:
You would apply the output of the integrator, via a potential divider to bring the voltage down to within the range the IC can handle, to one of the analog input pins of the IC and use the IC to measure the voltage (which is proportional to the PWM duty cycle). Of course, you don't have to use an integrator to measure PWM duty cycle: you could use the potential divider to give PWM pulses within the IC range then measure pulse duration and frequency and do the maths.
 
Last edited:
Good question.

The secret is interrupts and timers. Take a look at this: https://www.picaxe.com/BASIC-Commands/Advanced-PICAXE-Configuration/settimer/

In reality, you just need to detect if th lamp is on, or the rising edges occur > some time apart (e.g. 80% duty cycle) I don't think you have to actually measure the duty cycle. Generally, not always, you need a nice clean fast rising signal, so an OPTO Schmidt trigger should work. It really doesn't matter much what voltage your detecting for the edge.
So, I think you can use something like the timer expired.

With both interrupts and timer interrupts, you could do more. e,g, count the on time as some increment of time. e.g. every 100 uS. It depends of the frequency of the PWM.
So, you would count the time between a rising and a falling edge.
 
Of course, you don't have to use an integrator to measure PWM duty cycle: you could use the potential divider to give PWM pulses within the IC range then measure pulse duration and frequency and do the maths.

Now this way seems to be a good choice, since even the Picaxe 08m2 can do Pulse In.

So maybe an OPTO Schmidt trigger to isolate the two circuits, then to a potential divider to lower the voltage to something more acceptable by the Picaxe and then use the Pulsin command to get a value of the PWM and use that to trigger the outputs? o_O YAH a whole new thing to learn:wideyed:

Yah i know what i'm doing :confused: :rolleyes:

Thank you again to all
 
I just picked one: https://www.fairchildsemi.com/ds/H1/H11L3M.pdf

Which looks could work, It will even work with a 3V supply if necessary. You have a 12 V car electrical source to get from which can be nasty to the voltage of the PICAXE< Linear Technology makes a particularly good IC for automotive electronics. For any testing you can use whatever comes with the kit. (120 V line powered).

It would be nice if you knew what kind of waveform your dealing with, so maybe a small DSO would be needed.

Your headlights might be powered by a low side driver or a high side driver, Both would work OK for the OPTO, It might have noise that you have to filter out and positive and negative spikes to remove. You don;t know exactly what your dealing with.

The OPTO keeps the 12 V system totally isolated from the 3V system. That won't happen in reality since your will be powering the processor with 12V, but it does say that you can easily use a ground referenced or a 12 referenced light waveform.
 
KISS:
Well building up a power regulator with Capacitors and a 7805 Voltage regulator should make a decent power supply for the Picaxe, thou 5V is the upper limit for their chips. I use this basic setup to run a 5V hall effect sensor that I use as a speed sensor to proved a signal to both the ECU and Electronic Speedometer and so far so good.

Now a DSO may be worth picking up, Something like this little one on Sparkfuns website? On the Headlight switching, i can ask around, or even get a schematic for the lighting system. But i would think it would be powered by the high side, I think it's mostly Japanese Vehicles that do negativity (Low side) switching. But doesn't mean current NA cars don't. But as you said a OPTO device should take care of that either way.

The Local DYI electronic store carries that one DSO, and to me for not much more then what it's priced at on Sparkfuns website, Also they only have the Picaxe 08M2 chip,which for least this circuit should work fine and dandy, only need one input and two separate outputs.
 
Last edited:
Here https://www.google.com/url?sa=t&rct...=wOvfu3-QPUnw69ZFPzq2WQ&bvm=bv.73231344,d.cWc is an article about automotive electrical systems.

Anyway, here https://www.linear.com/product/LT4363 is one of the Linear devices.

At a minimum I would protect with a bidirectional Transorb or TVA and a 1n5004 reversed bias diode. You have to use >=200 PIV in automotive,

It's easier to do a low side switch, so that's why I mentioned it. A Japanease car fused each bream. An older car had a thermal and I had a headligh short, so the headlights were blinking.

That scope measures duty cycle directly.

Happy reading. We are here if you need help. I have a PICAXE, but haven't played with it yet.
 
Status
Not open for further replies.

Latest threads

Back
Top