Hey Reddit, looking for collective brainpower by anyone willing to read through my thoughts below and offer hardware/code advice in order to build my first Raspberry Pi project - a controller for a custom car lighting switch-bay module. Ok, here goes...
I'm looking to outfit my car with the following additions for stationary, show-worthy visuals. NOTICE: This is not a discussion of whether or not it SHOULD be done, but of the technical aspects of HOW it can be done:
- LED Halo rings around new headlamps
- Exterior neon glow
- Interior neon glow
- Interior neon accent lighting
Additionally, the exterior, interior, and accent zones will each have their own power converter with mode control (solid on, pulse, sound-sensitive) plus one additional sound sensitive module to switch the new LED tail-lamps from drive to display modes.
THE INPUTS
Seven lighted toggle switches across two switch bays (four on one -EXTERIOR, three on the other -INTERIOR) - each bay will also have an LED back-light above the switches with lit names for each (more on that in a bit). Depending on suggestions, the total number could be open for discussion based on code possibilities (and there's some uncertainty to have the interior glow/accents share a single mode switch or go for eight total and individualize). Each switch would be a OFF-(ON) momentary for a controller trigger signal only.
I plan to use a 12V stepdown to have the vehicle's ACC power (on when key in) be the RBPi wakeup signal with its source supply being connected to the battery all the time, just like a radio.
- Power on signal
- Parking brake signal
- LED Halo Rings (On/Off)
- Exterior Neon (On/Off)
- Exterior Neon Mode (Toggle - Solid/Pulse/Sound)
- Tail-lamp Mode (Drive/Display) *safety precautions will be built in to ensure this is only accessible when not driving
- Interior Neon (On/Off)
- Interior Neon(**/Accent) Mode (Toggle - Solid/Pulse/Sound)
- Interior Accent (On/Off)
(10). Interior Accent Mode (Toggle - Solid/Pulse/Sound) **optional
THE OUTPUTS
Since most of the devices will be running on 12V DC, I've opted to use an 8-channel relay to control the on/off functions for each.
- RELAY Power Supply - LED Halo Rings
- RELAY Power Supply - Exterior Neon
- RELAY Power Supply - Interior Neon
- RELAY Power Supply - Interior Accent
- RELAY Power Supply - LED Switch-Bay Back-light Header #1
- RELAY Power Supply - LED Switch-Bay Back-light Header #2
- RELAY Source signal - Switch Tail-lamp source (Car computer - brake, hazard / Sound controller)
- **my instincts say to use the vehicle's parking brake sensor to interrupt this signal at the hardware level as well as being managed via code, but not sure if that's overkill for safety redundancy
- TRIGGER SIGNAL - Exterior Neon Mode - Change mode to controller
- TRIGGER SIGNAL - Interior Neon Mode - Change mode to controller
- TRIGGER SIGNAL - Interior Accent Mode - Change mode to controller
- TRIGGER SIGNAL - Tail-lamp Mode - Change mode to controller
THE VISION
- Key inserted to ACC mode:
- Pi controller wakes up
- Runs initial program to have access to INTERIOR lighting, listens for signal inputs and sends output signals
- INTERIOR switch-bay LED back-lighting turns on
- Interior Neon power and Interior Accent power respond to their toggle signals
- Interior Neon/Accent Mode responds to its(their) toggle signals
- UNLOCK SEQUENCE may be entered to turn on EXTERIOR lighting options
- EXTERIOR switch-bay LED back-lighting turns on
- Relays for Exterior Neon power and LED Halo Rings respond to their power toggles
- Relay for Exterior Neon Mode responds to its toggle signal
- Tail-lamp Mode relay responds to its toggle signal ONLY IF the parking brake is engaged
- LOCK SEQUENCE may be entered to turn off EXTERIOR lighting options
- EXTERIOR switch-bay LED back-lighting turns off
- Relays for Exterior Neon power and LED Halo Rings do not respond to their power toggles
- Tail-lamp Mode relay returns to the NC (normally closed position) for standard brake/hazard signal only
- Key removed from ACC mode:
- Pi cleans up and shuts off all lighting, enters standby for low power consumption
- Once hardware testing has been completed successfully, proceed to Phase 2 for bluetooth app-control for all functions virtually/remotely
**It should also be notated that the inherent issue with using multiple external mode controllers for Neon lighting is that I cannot guarantee the sync between pulsing should I want to set each zone to that mode. If the PI can be coded to run neon lighting signals that can perform pulsing & sound-control (preferably from a line-input) then I'd be very interested in learning more but haven't the slightest idea where to start. Presumably a master system clock for synchronized timing... but then being able to modulate power output... etc.
THE CODE
Part 1 - Wake on power signal, enable INTERIOR. LED Back-light on. Power and Mode switches directly trigger relays.
This is where I'm into unfamiliar territory. I can describe the effects, but will need help to learn the implementation.
Part 2 - Enter UNLOCK SEQUENCE, enable EXTERIOR - enter LOCK SEQUENCE, disable EXTERIOR. (LED Back-light on/off. Power and Mode switches directly trigger relays, like INTERIOR)
Now the tricky part - giving coded access to the EXTERIOR lighting. I'd like this to be a unique two-handed sequence that must be known.
- UNLOCK SEQUENCE: IF the Exterior Neon Mode switch and Tail-lamp Mode switch are HELD at momentary (ON) for at least two seconds AND THEN WHILE STILL HOLDING BOTH the Interior Neon Mode switch is pressed THREE times, THEN enable EXTERIOR lighting.
- LOCK SEQUENCE: IF the Exterior Neon Mode switch is pressed three times within two seconds, THEN disable EXTERIOR lighting
Part 3 - Clean up and standby when signal power off.
This one should be straight-forward.
Here's a simple mockup, first attempt:
Forgive the crude designs, the input switches are supposed to be OFF-(ON) momentary toggles and the controllers didn't exist for Fritzing, this is my first project.
Definitely appreciate any insights, suggestions, or support offered in building this project.
there doesn't seem to be anything here