Car 12V button inputs to an Arduino

Hi Guys,

I know this topic is quite widely covered here but I'm confusing myself between powering my project and reading voltages.

I've got some leds replacing my tail lights on my car, controlled by a Nano. There are 3 buttons/functions controlling the running lights, brake lights and turn signals.

These are all 12V signals as you can imagine and as far as I know, I need to step down and regulate these signals to 5V.

What's the best way to do this?

Would I use something like this?:

One for each input? Or am I misunderstanding the purpose of this product?

Hopefully I've some understanding of the relationship needed between the current wiring in the car and the Arduino?

Any advice would be greatly appreciated,

Kyle

kylefoster:
3 buttons/functions

A button is not a function. Did you mean signals?

kylefoster:
What's the best way to do this?

Voltage divider :wink: Be aware the "12V" of a car is close to 14-15V when the car is running and spikes can be higher. I think I would pick 220k and 390k or something.

kylefoster:
Or am I misunderstanding the purpose of this product?

That's to power something. But you barely need power.

kylefoster:
Hopefully I've some understanding of the relationship needed between the current wiring in the car and the Arduino?

Good filtering on the power supply :wink: Or grab a car charger :slight_smile:

For the input switches/signals, a [u]voltage divider[/u] (2 resistors) and a [u]protection diode[/u] to take care of any unexpected voltage spikes. (With the protection diode you can safely calculate your voltage divider for slightly-more than 5V out and the thing will be more tolerant of low battery voltage.)

I've got some leds replacing my tail lights on my car, controlled by a Nano.

Have you got that figured-out? You'll need a driver circuit because you can't power high-power LEDs (or a cluster of regular LEDs) directly from the Arduino.

Thanks for the advice guys,

I do mean signals! Going forward, I'm glad you clarified this so I know how to refer to this, thank you.

I didn't realise this could be so simple, using 2 resistors and a protection diode!

I've seen so many parts and boards that have confused me that I assumed this taks would be more complex.

I've always been confused between breakout boards that distribute power vs ones that deal with signals. What does this one do?:

Opto-isolator Breakout Board

If I were to use a board rather than just 2 resistors and a diode, is this the purpose of this board?

In terms of powering the bank of leds Doug, I'm currently using a mains powered 220V - 5V 20A power supply and the buttons controlling the LEDs are just on a breadboard. Obviously, the signals for the functions and powering the LEDs are 2 separate issues and I'm trying to tackle one at a time.

Hopefully I can use a 12V equivalent of my 'desktop' power supply to power the LEDs but I'm concentrating on the signals for now.

Thanks again guys, I think this is a step in the right direction?

Kyle

kylefoster:
If I were to use a board rather than just 2 resistors and a diode, is this the purpose of this board?

Although you could (but this board is designed for the other way around, controlling a higher voltage with a lower voltage) it's not very useful here. Opto isolation is needed when you want to keep the sources isolated. For example, 5V and mains. But here you already don't have multiple sources, all you have is the car battery. You need to step that down a bit to power the Arduino (tip, USB charger) but it's still the same source and it still uses the same GND. So opto isolation is not useful. So you don't need isolation, all you need is the voltage to be lower. And a voltage divider (with a diode) will just do that.

kylefoster:
Hopefully I can use a 12V equivalent of my 'desktop' power supply to power the LEDs but I'm concentrating on the signals for now.

Mehh, not really. Because the Arduino can't drive 12V directly and also it can drive a maximum of 40mA (@5V) so you need an interface for that. Tip, transistors. To be more precise, logic level MOSFETS.

Use the 12V signals into the gate of an NPN transistor, the transistor to pull down the Arduino input when 12V is present.