Adafruit Industries, Essential service and business: NYC – Executive Order 202.6 - Read more. Accepting essential orders - here's how.
0

Voltage Divider Board
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: Voltage Divider Board

by adafruit_support_bill on Thu Feb 16, 2017 2:22 pm

If you are just looking at on/off kinds of signals, you don't need to use an analog input. Digital inputs are much simpler. You don't need to worry about high and low thresholds. You just do a digitalRead() and get back a HIGH or a LOW. https://www.arduino.cc/en/Reference/digitalRead

https://learn.adafruit.com/adafruit-ard ... tal-inputs
https://learn.adafruit.com/adafruit-ard ... log-inputs

adafruit_support_bill
 
Posts: 76651
Joined: Sat Feb 07, 2009 10:11 am

Re: Voltage Divider Board

by kylefoster on Thu Feb 16, 2017 7:16 pm

Thanks again Bill,

I don't know if this is the right place for the question but since it's linked to this thread, I thought I'd start here.....

Here's the wiring for the 3 functions I'll be using. One of the bulbs houses dual filaments for running/brake lights.The other bulb is for the turn signal

Image

Up until now, the signals (controlled by 3 pins on the Arduino) have been controlled by simple buttons which used the common power/ground from the power supply so this is new territory for me.

Obviously I need to test all these with a multimeter but I'm not sure exactly how to use these wires. For example, do all three need seperate grounds or can they be shared? When it comes to a common ground, in order for the LEDs to have a reference, does this only concern the power supply & LED strips or do I somehow need to make the ground shared across all components of my LED matrix? For example, would there be one large ground to the LED matrix and then all that's needed is to send the positive wires into the Arduino (using the discussed voltage divider of course).

I hope it seems that I'm understanding this to some extent but thanks again for all your help,

Kyle

kylefoster
 
Posts: 82
Joined: Fri Jul 22, 2016 7:07 am

Re: Voltage Divider Board

by adafruit_support_bill on Thu Feb 16, 2017 8:11 pm

What kind of leds are you using?

adafruit_support_bill
 
Posts: 76651
Joined: Sat Feb 07, 2009 10:11 am

Re: Voltage Divider Board

by kylefoster on Fri Feb 17, 2017 5:09 am

I'm using WS2812b strips, here's my current setup:

Image

So I've soldered an additional power and ground wire to one of the strips which power the Arduino and gives a common ground. The prototype is fully functional including the buttons, I'm just not sure how to create the equivalent 'buttons' in the car. So there's 2 bulbs and one has 2 filaments which makes 3 total for brake, turn signals and running lights. I'm hoping to use the current wiring to each of the bulbs as my 3 signal inputs.

I'm struggling to get my head round the grounds for the signal inputs from the existing wiring in the car. I'm trying to work out in my head what the equivelant would be on my desktop setup. For example, my desktop power supply is now the 12V battery of course. Then based on my desktop setup, would I combine the ground from each bulb together and route that to the Arduino as I have with the buttons I'm using? Then it's just the 3 12V signal wires that need to be stepped down to 5V and into the Arduino just like my desktop setup? Here's an photo of my desktop setup:

Image

In this case, I was using on the the RF M4 receiver so I could test it from a distance. So there's 3 blue wires for the signals and common ground and power between the strips, Arduino and 'buttons'.

Thanks again,

Kyle

kylefoster
 
Posts: 82
Joined: Fri Jul 22, 2016 7:07 am

Re: Voltage Divider Board

by adafruit_support_bill on Fri Feb 17, 2017 9:02 am

Let's focus on one issue at a time. Get the inputs working before you start worrying about the outputs.

Code: Select all | TOGGLE FULL SIZE
The prototype is fully functional including the buttons, I'm just not sure how to create the equivalent 'buttons' in the car. So there's 2 bulbs and one has 2 filaments which makes 3 total for brake, turn signals and running lights. I'm hoping to use the current wiring to each of the bulbs as my 3 signal inputs.

Not entirely clear what you are trying to do here. You have a prototype with button inputs, and you want to replace the buttons with signals from the existing tail-light wiring?

adafruit_support_bill
 
Posts: 76651
Joined: Sat Feb 07, 2009 10:11 am

Re: Voltage Divider Board

by kylefoster on Fri Feb 17, 2017 10:46 am

Exactly bill,

I don't think I need to worry about the outputs. I've tested a few buck converters which are working. Powering the LEDs is no problem but yes, all I'm trying to achieve here is how to use the existing wiring for the arduino inputs

Many thanks, sorry for the poor explanation,

Kyle

kylefoster
 
Posts: 82
Joined: Fri Jul 22, 2016 7:07 am

Re: Voltage Divider Board

by adafruit_support_bill on Fri Feb 17, 2017 11:03 am

So you will need to build 3 resistor dividers as discussed above.
Connect all the grounds to the chassis or wiring harness ground.
Connect the positive legs of the dividers to the positive wires going to the bulbs.
Then test: Measure the center tap of the voltage divider when the bulb voltage goes HIGH and verify that it is in the range of the Arduino logic HIGH (3.3v-5v.)

Once you verify that the dividers are working as expected, you can connect them to the Arduino:
Connect the Arduino GND to the common ground for the dividers.
Connect the center taps of the dividers to the analog pins on the Arduino.

adafruit_support_bill
 
Posts: 76651
Joined: Sat Feb 07, 2009 10:11 am

Re: Voltage Divider Board

by kylefoster on Fri Feb 17, 2017 11:19 am

That's great Bill, that all makes sense.

My biggest question was what to do with the grounds. I'll start soldering the dividers.

What do you mean by the centre tap?

Thanks again,

Kyle

kylefoster
 
Posts: 82
Joined: Fri Jul 22, 2016 7:07 am

Re: Voltage Divider Board

by adafruit_support_bill on Fri Feb 17, 2017 11:22 am

What do you mean by the centre tap?

The middle of the divider - between the two resistors. Vout in the diagram below:

[img]
https://upload.wikimedia.org/wikipedia/ ... er.svg.png
[/img]

adafruit_support_bill
 
Posts: 76651
Joined: Sat Feb 07, 2009 10:11 am

Re: Voltage Divider Board

by kylefoster on Fri Feb 17, 2017 11:36 am

Thanks again

kylefoster
 
Posts: 82
Joined: Fri Jul 22, 2016 7:07 am

Re: Voltage Divider Board

by Richmccarty on Fri Feb 17, 2017 12:12 pm

Automotive electrical system can be very noisy and poorly regulated. I would use opto-isolators on all the inputs and outputs to electrically isolate the arduino. Also, use a single point ground connection to avoid ground loops

Richmccarty
 
Posts: 25
Joined: Fri Jan 27, 2017 1:11 pm

Re: Voltage Divider Board

by kylefoster on Wed Feb 22, 2017 6:54 am

Hi Rich, thanks for your input.

When you say 'use a single point ground' Do you mean run each of the 3 ground wires from the voltage dividers to a single point on the car?

What do you mean by ground loops?

You can see that I'm on a steep learning curve but thanks very much for you advice.

Kyle

kylefoster
 
Posts: 82
Joined: Fri Jul 22, 2016 7:07 am

Re: Voltage Divider Board

by kylefoster on Thu Feb 23, 2017 8:01 am

Hi Guys,

Thanks to all your help so far, I successfully tested a strip of LED's using the cars power and existing bulb wiring. Works a treat!

I'm taking baby steps with this so I only tested one function rather than testing all 3 (brake running lights and turn signals). This project is almost 100% through now and one of the last things I think I need to know is whether the input signal grounds can be piggy backed off of the main ground for the power supply?

I know I could simply try this theory but thought I'd ask first.

At the moment, the power supply comes direct from the battery (using a USB buck converter) and the LED's and Arduino share the ground and power. It sounds like a stupid question but can the signal wires also share that ground? I assume every ground wire on the car is simply an extension of the negative battery terminal or am I missing something?

At the moment, each bulb has it's own ground and power wire and I'd like to consolidate things as much as possible. One issue maybe that the current ground wires might be connected in series to other lights/functions etc but I'm also unsure of this. The car is very simple and old so there's really not many other functions that I'd need to consider if this was an issue.

Thanks again,

Kyle

kylefoster
 
Posts: 82
Joined: Fri Jul 22, 2016 7:07 am

Re: Voltage Divider Board

by adafruit_support_bill on Thu Feb 23, 2017 8:31 am

I generally like to run power and ground from the power supply to the strip first.. Then run power, ground and signal from the strip to the processor. That minimizes any ground-bounce on the signal reference between the processor and the first pixel.

adafruit_support_bill
 
Posts: 76651
Joined: Sat Feb 07, 2009 10:11 am

Re: Voltage Divider Board

by kylefoster on Thu Feb 23, 2017 11:24 am

Thanks Bill,

That's exactly what I've done so far based on your advice a while back. My questions is regarding the ground for the signals. I've drawn a diagram of my current setup:

Image

Btw, I understand the resistors aren't accurate ;). There's currently a ground wire for each signal input, one for each bulb. I was wondering if this proposed setup would work since all the ground wires return to the same mother ship:

Image

Do you think this would work? It would mean less connections if these grounds were consolidated onto a board and shared by the 'main' ground from the power supply. If this was a pcb, the only external connections would be 3 12V signal wires and main power and ground wires.

Many thanks,

kyle

kylefoster
 
Posts: 82
Joined: Fri Jul 22, 2016 7:07 am

Please be positive and constructive with your questions and comments.