So, normally powered by a car socket and the light pattern is changed by what I assume is a 12 volt pulse from a second button on the plug. There are only 3 wires to the light.
Getting power on/off is easy - I'll use a relays - I'll need 5 (4 lights, 1 horn)
But what is the best way to get the pulse ability so I can change the light pattern? Another 5 relays?
That makes 10 relays run off 10 D pins. Is there an easier way or a way with less relays? Cos I'm going to run out of pins pretty quick. IS there some sort of multiplexer arrangement that makes sense?
One could speculate... but I won't. I agree with @xfpd we need more info. If you can't or don't know how to make a diagram on a computer or website, a hand drawn that you photograph and upload is fine. + the rest of what @xfpd wrote.
Drawing of idea uploaded - but the description still stands
The specifications of the car socket is irrelevant except that it obviously denotes the lights require 12 volt DC
"Light pattern" - also irrelevant as the light does this. There is no code. These are warning beacons designed to go on your car roof. Turn them on, they flash. Press the non latching button, they change their flashing pattern. See the 3 wires to the lights. 2 are power, but 1 is attached to the second, non latching button on the original plug (now removed). So I will need to send a "12 volt pulse" somehow which will move the pulse patter of the light on to it's next pattern.
"Three, is this AC" No - see above and the original description and the link of the actual item.
"Pulse" - See previous explanation
"Multiplexer - For what" - As explained - to potentially reduce the number of relays to turn all 4 lights on/off, the horn on/off and change the pattern of each light.
But - this is the crux of my question. How best to fill in the big question mark in my drawing and connect to Arduino to all of that.
You can use an MCP23017 MUX to control both the relays and the pulses. So you only need 2 pins for everything.
You can use optocouplers instead of relays for the pulse interface.
The common PC817 should work.
OK, now we're talking. Thanks for the suggestions.
Unless someone points out how stoopid I am, I'll use a CD74HC4067 16-Channel Analog Digital Multiplexer Module in front of a 10 Channel Relay Module Module
This uses only 4 pins on the ESP32 but gives me full control of 10 12volt outputs. This is perfect for 4 Lights on/off, 4 lights pulse pattern change and 1 horn on/off.
And I have heaps of pins left for the 2 LCD displays and all the buttons needed to control the race starts.
Now you need to start thinking how you will power everything. You don't want to wind up having to use many power supplies,18V, 12V, 5V and maybe more than one of each.
if by "patterns" & "pulse" you mean blinking your lights with specific period and frequency then you don't need any extra relays: you can use 5 ones you have. Just toggle them on and off.
May be using powerful MOSFET transistors is a better idea.
It needs 12 volts on the yellow wire. So I have grabbed a 10 channel relay. Gives me all I need.
The lights are turned on and off only a few times during the 5 minute start sequence of a race.
Press "Start" button - will turn on Orange light and toot horn
wait roughly 3 minutes then initiate 5 minute start sequence
At 5 minutes before the start - turn on Green tight and toot horn
At 4 minutes before start turn on Blue light and toot horn
At 1 minute before start turn off Blue light and toot horn
At 0 turn off Green light and long toot horn
30 seconds later - toot horn (signals "no more pumping" to the competitors)
If too many competitors are over the line early - hit a button that turns off all lights, turns on red and toots horn 3 times.
All this is pretty simple to code but does mean I need all 10 relays.
Yes, turning the lights off seems to reset the pattern sequence. TBH I might just leave them at their default first pattern. I'll see what it all looks like before deciding. But I have the relays if I need to change their patter each time.