1
\$\begingroup\$

I'm trying to control my headlights with my Arduino and a LDR. For this I will use the Arduino as a middle man between the lights switch and the actual lights. The switch has three positions OFF / DAYTIME LIGHTS / HEADLIGHTS. The switch itself is a potentiometer and has 3 cables: 12V, GND and the signal one. The Arduino then would read which setting is chosen in the switch, decide what to to do, and send the signal thru this cable.

The problem comes here. The Arduino, as far as I know, can only handle <= 5V. So how am I supposed to read the switch, and then send a signal back to the car? (I suppose that these signals would be around 12V or so).

Sorry if I'm not explaining so well. Not very experienced in electronics.

EDIT

I have measured the voltages across the three cables (WHITE/GREEN/BLACK), assuming black as ground.

When engine is off:

White = 23-25V

When engine is on:

  • Switch == off

White = 28.5V

Green = 30.3V

  • Switch = daylights

White = 0V Green = 30.3V

  • Switch = headlights

White and green = 0V

From this I wouldn't know what to do. Thought the switch worked like a potentiometer but I think I am wrong.

Also I am trying to find a logic answer of why both white and green have 0V when the lights are switched on.

EDIT 2

Front Back

I found the part online, and its name is "WELLS SW6250", a combination switch. I thought that, because of the white and green cables going 0V when the lights are turned off, that there might be another cable coming from the square part of the knob, where there are other connections.

\$\endgroup\$
  • 1
    \$\begingroup\$ Does the potentiometer have three voltage outputs on its signal wire: 0V, 6V and 12V? \$\endgroup\$ – Ed King Jul 30 '18 at 23:11
  • \$\begingroup\$ Relays are a frequent choice for controlling car parts. \$\endgroup\$ – immibis Jul 30 '18 at 23:40
  • \$\begingroup\$ @EdKing In a question like that one would expect ironic quotes around "potentiometer" \$\endgroup\$ – Maple Jul 31 '18 at 16:35
  • 1
    \$\begingroup\$ Whatever design you come up with, it would be best to make it fail-safe so that if the Arduinio goes wrong then you still have control of the headlights. You do not want to be heading towards a sharp bend in the road with no street lights at night when the headlamps go off. \$\endgroup\$ – Andrew Morton Aug 1 '18 at 14:43
  • \$\begingroup\$ @AndrewMorton yeah I had it in mind. I thought of a switch that, when turned off, letting the 2 signal wires follow their normal paths to the car. \$\endgroup\$ – Francisco Aguilera Aug 1 '18 at 15:06
0
\$\begingroup\$

The situation may be a little more complex than you imagine.
Since your switch (potentiometer) is an input device to the car ECU to set intent, you would need to disconnect the signal wire from the ECU so you can read the switch position. Then you need to generate a voltage into the ECU to provide control from the Arduino.

It's highly likely that the switch is NOT on a regulated power supply, so the voltage may vary from say 10 V (starting) through almost 15 V (charging). This will be coped with by the ECU (it knows what the battery voltage is). There may also be fault sensing to discern if the switch has failed, so the current sourced or sunk from the ECU may be important.

You can deal with the high input voltage with a simple resistive divider, though it's worth having overvoltage protection.

Perhaps something like this:

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.