Voltage Step Down on Signal Wire

Hi Guys,

I have been doing a project for some time on and off and I have had it tested and working...ish.

The reason the ish comes into it is because the signal wire wasn't carring the intended resistance due to using a voltage divider in order to reduce the 12V incoming voltage to 5V.

As your aware I need 3.3-5V on the signal wire with a 10K grounding resistor in order to prevent rogue signals from triggering the input. Initially I used a 10K resistor and 5K via 2 10K resistors in parallel (all I had at the time). But because this is being used in an automotive application, because the path of least resistance between the signal wire and ground is 5K, this was insufficient for the signal grounding.

To make matters worse, this is an automotive application and I need a 50W load resistor (6ohm) between 12V and ground in order to prevent a bulb out warning presenting its self on the dashboard. This meant that the resistance on the signal wire dropped to 3.33K, but I believe it still had 4V on it if my math is correct (I haven't measured it).

See 'Old Voltage Divider' attachment to see how this circuit looks, is my output calculation correct in this circuit?

So I have came up with a different voltage divider setup based on the same math above which will give me 4.3V on the output with 10K to ground. This utilises a 27K resistor and 15K resistor voltage divider instead. See 'New Voltage Divider' to see how this circuit looks in comparison.

If the math is incorrect for the first one then inevitably the second will be too. But if you could please point me in the right direction id very much appreciate it!

Cheers :slight_smile:

old voltage divider.PNG

new voltage divider.PNG

The second one is fine - the slight over voltage is no an issue due to the 27k resistor protecting it.

What you may need to reduce noise sensitivity is a small capacitor to ground on the pin, 1nF or so,
although having the Arduino and voltage divider in a shielded box may be sufficient.

Is this going to an Arduino analog pin or to a digital pin? If digital you could use an opto-isolator
as an alternative.

Thanks very much for clarifying my calculations, much appreciated :slight_smile: I was a little concerned my voltage calcs would be off but that's brilliant.

They are going in the tail lights to make 'dynamic' signals like a lot of modern cars have. I wasn't going to put them in a shielded box as such as they are going to be inside the tail lamp housings.

Now if I read this correctly:

As your aware I need 3.3-5V on the signal wire with a 10K grounding resistor in order to prevent rogue signals from triggering the input. Initially I used a 10K resistor and 5K via 2 10K resistors in parallel (all I had at the time). But because this is being used in an automotive application, because the path of least resistance between the signal wire and ground is 5K, this was insufficient for the signal grounding.

At your input pin you have a 10K resistor going to ground and since the pin input impedance is very high we can pretty much figure that remains 10K. Now you are placing a divider in parallel with that 10K resistor to ground? Just for example if you parallel two 10K your Rtotal is 5K. So if you make a 5K, 10K divider either 5K or 10K will be in parallel with the 10K you already have to ground on your input pin. That what you have? A drawing would be nice. :slight_smile:

Ron

Hey Ron, check my drawings in the attachments. You will see my voltage divider circuits and the upper most wire is what goes to the input on the arduino.

OK, I see what is going on. Yeah, with 12 volts applied your Vout of the divider will be about 4.28 volts. Never saw the attachments initially, bad on me.

Ron

No problem Ron thanks very much for clarifying :slight_smile: I was concerned that I may have muddled something up but I believe that I should get 4ish volts and retain the 10k to earth. Thanks very much, parts on order

its been a number of months since ive dabbled with this project due to Covid-19, however I have managed to install all the permanent wiring into the car and its mostly working now. I am hoping you guys can help me identify where my issue may be.

So when the car is at 12V the lighting is working exactly as intended, no rogue flashes, no bulb out warnings... basically exactly as intended, however this changes slightly when the car is running.

So I dont seem to get any rogue signals, so no unintended activations etc. But, when the blinker/indicator/turn signals activate they seem to get a double or triple pulse rather than a single one. The voltage is quite stable at 14.5V, which means I should be getting aprox 5.2V on the input pin... could this be why? I see it works by referencing the board voltage which is a steady 5V, so if its going above and below 5V could this be the double blink or has anyone got a better idea?

Must the input to ground resistor be 10K or can it be made safer by being higher?

Thanks :slight_smile:

You are probably just seeing contact bounce. "Software debounce" is a good search term to look for approachs and libraries.

Hi Mark, why would this happen only when the voltage is higher?

I have done a bit more reading and looking at the video I took. I notice it only ever does a double pulse and I think I might have found out why but wanted to ask if this is right before I go on making more modifications.

So Basically I realised that it actually only ever double pulses when its wrong but occasionally it only does a single flash which is how its meant to work. When looking online I found that the Arduino checks the voltage on the pin against the power supply voltage which in my case is fixed at more or less 5V. But... my calculations above mean that when the car is running, its feeding 5.18V onto the input pin so is it possible that the Arduino is seeing the voltage rise and then the fall? I have created a little timing graph to try and better explain my wording. The red line is at 5V and I am thinking its seeing both sides of the 14.5V line as a input trigger where as the blue line never goes above the 5V and therefore only sees a single trigger.

I hope what I have said is understandable and hopefully correct thinking. If so I am thinking of changing the 27K resistor to a 30K to bring the voltage on the pin from 5.18V to 4.83V

Double Flash Timing Graph.PNG

Arkious:
Hi Mark, why would this happen only when the voltage is higher?

Don't worry about it, relay contacts bounce some random number of times that's of no consequence, just
be sure to debounce the signal before using it.

I totally understand what your saying Mark, but my only concern is the fact they do not bounce when running on purely battery power rather than alternator power. If I had the same outcome in either situation I would have no doubt that its bouncing as your saying.

My software is not currently written to be able to include de-bounce logic as it will interfere with strobe delay timers etc as it scans the entire program for interruptions.

Is my theory correct about going over the board voltage correct?

Hi,

Arkious:
Hi Guys,

I have been doing a project for some time on and off and I have had it tested and working...ish.

The reason the ish comes into it is because the signal wire wasn't carring the intended resistance due to using a voltage divider in order to reduce the 12V incoming voltage to 5V.

As your aware I need 3.3-5V on the signal wire with a 10K grounding resistor in order to prevent rogue signals from triggering the input.

We are not aware as we do not know your hardware.
Can you tell us your project and post a schematic please?
You have got ground of the vehicle and gnd of your controller connected at the negative terminal of the battery?
Where in the car are you getting the 12V to supply the controller?
What is the controller?
Thanks.. Tom... :slight_smile:

hey tom

I am supplying 5V to the controller via a 12v to 5V 3A inverter that is permanently live directly from the positive rail in the car.

The 12V signals are what would have lit the lamps, but they go through the voltage dividers in order to bring the voltage to a level that the Arduino Nano can handle.

The project works perfectly on battery power at 12V but when the car is running, the voltage raises to 14.5V and as I have said above the voltage that hits the inputs of the Arduino is approx 5.18V.

My concern is that because this is higher than the Arduinos supply voltage of 5V, that it sees it as a double hit, one on the rise of the voltage and one on the fall. This doesnt happen on battery power because the voltage on the input is less than 5V.

Does this make sense? See my graph on post #9 for visual reference. I am only presuming this is the case from what ive read briefly online.

Thanks :slight_smile:

Arkious:
My software is not currently written to be able to include de-bounce logic as it will interfere with strobe delay timers etc as it scans the entire program for interruptions.

That doesn't make sense. A properly written debounce routine has almost zero latency, only the time taken for a few CPU cycles. The only limitation is bandwidth, since the debouncing limits the number of transitions that can be recorded in a certain time frame.

my program scans every cycle where it adds a count of 1 LED to the total each time. I don't believe a debounce will work with my software because of this.

I am guessing my logic is incorrect about an input above the board supply being read as zero since no body has spoken about it?

Arkious:
hey tom

I am supplying 5V to the controller via a 12v to 5V 3A inverter that is permanently live directly from the positive rail in the car.

The 12V signals are what would have lit the lamps, but they go through the voltage dividers in order to bring the voltage to a level that the Arduino Nano can handle.

The project works perfectly on battery power at 12V but when the car is running, the voltage raises to 14.5V and as I have said above the voltage that hits the inputs of the Arduino is approx 5.18V.

My concern is that because this is higher than the Arduinos supply voltage of 5V, that it sees it as a double hit, one on the rise of the voltage and one on the fall. This doesnt happen on battery power because the voltage on the input is less than 5V.

Does this make sense? See my graph on post #9 for visual reference. I am only presuming this is the case from what ive read briefly online.

Thanks :slight_smile:

Re calculate your potential divider for 14.5V, the little difference between that and 12V at the output of the divider will still be a logic HIGH.
You will find a voltage greater than 3.0V on a digital input will register as a logic HIGH.
Tom... :slight_smile:

Morning Tom,

I was going to switch out my 27K - 15K divider setup for a 30K - 15K divider setup.

This will drop the voltage to just below 5V with a 14.5V input, thus removing my theory about an input greater than the board voltage being seen as a low signal.

thanks again