I am starting a project for controlling warning lights on my vehicle. Simply put I have a button panel in the vehicle that currently provides the 12v to each LED set. I have several relays serving the NO/NC for their respective LED duties in the back of the vehicle.
As I was getting deeper and deeper into the wiring I was thinking there has to be a better way. Somehow I made it to the world of Arduino and now I want to start with just replacing all the relays and moving all the wiring points to one place. Eventually, I want to get it to the point where I am able to control each individual LED pod via Arduino.
I saw a tutorial on how to get started but can't find it anymore. I am only finding momentary button setups when I will be using latching buttons. So, even just pointing me to the right spot would be sweet.
Equipment:
Mega 2560
16ch relay board for output
Resistors (a bunch of different sizes)
12v DC regulator (when the vehicle is running 14.3v is normal)
12v to 5/3.3v stepdown for input
so when your buttons are not momentary but latching and you connect your LED or a relay to the switch to get an ON or OFF - what should the Arduino do at all in your circuit?
It isn't a 1to1 it is a 1to many
To control different LEDs per whatever button/s are active.
Button A = LED 2,4,6
Button B = LED 1,3,5
Button C = LED 2,3,6
Button D = LED 1
and so on....
Every Button equals a different combination of lights.
I wouldn't use an Arduino in automotive environment without further knowledge how to protect the Arduino and the vehicle itself.
this matrix can be done without an Arduino, without c++ programming with a simple diode matrix also. I just show that code because it's an Arduino forum.
That is a good starting point, there is a good app note AN2689 by ST on automotive electronics. reading it will help you a lot.
Start with the protection at the power input. That can range from 0 to about 24V either polarity. Be sure to check the temperature requirements as to where you can put the arduino. That temperature will have a big impact on the drivers you use for the lights. I have used that style of relay boards and have been plagued by failure even though my resistive loads are less then 50% of the relay load rating. It keeps clicking but not conducting.
I have a voltage regulator that ensures a constant 12v. It is running on an aux 12v battery so there isn't repeat cycling of power. The aux battery is charged via the alternator with an automatic isolator to keep from draining the main battery when the vehicle is off. I have a switch that supplies power to the current 12v pushbuttons that I switch on/off at the start/end of work.
I am hot-blooded so during the summer the A/C is always on in the back half of the vehicle. I plan on putting the boards under the second-row seats where the HVAC blows out. In the winter the rear cabin is not heating. With no passengers, heated seats, and heated steering wheel my cabin target temp is never set higher than 65. The vehicle stays on while I am out of it.
Every trigger and/or connection to an OEM vehicle circuit has a diode to prevent power from feeding back into the vehicle. As an over-engineering caution, I even have them on paths that can't send power back into the vehicle.
After 3mo at this job, I have never had a set of LEDs active for more than 45min with the average being 15min. If I remember correctly with all the pods on I never crossed 2 AMPS and that includes sets that won't be part of this setup.
Thank you, that is a version of what I was looking for! TBI moment, never thought about the fact I had looked through the examples before.
Now one question I have now is since I have the stepdown from 12v to 3.3v. Do I still need to put the 10k resistor? I am going to assume I don't need the 220ohm resistor as it is going to the relay board?