Hotwire
Posts: 4
Joined: Thu Feb 11, 2016 10:42 am

Car Light Control

Thu Feb 11, 2016 10:59 am

So, Im working on a project to integrate a raspberry pi using either CAN bus or I2C / TWI as a light controller. There are 16 possible lights to control. 17 of you count the 3rd brake light, but Iv omitted that for simplicity. The reasoning is two fold. First is to eliminate the GIANT bundles of wires that are coursing up and down the car, making it easier to hid them and simplifying the installation / troubleshooting. Second is for customization. For instance, maybe I want the headlight to dim or turn off on the side that the indicator is active, or I want to make the fog lights turn off when the highs are activated. Heck, maybe I want them to flash on and off like a strobe or some sort of circus ride when in park. Any ways, Using the raspberry pi also makes it simple to integrate with the engine management system I will be using (MegaSquirt 3), to have a custom dashboard and maybe even some entertainment.

I have not yet decided on the method, either CAN or I2C. So Im looking for someones experience, or input on either or. As well as some insight into my idea or deconstruction of it. Attached is a basic idea of the layout and features. Iv labeled the main components, the rest should be fairly straight forward.

- The Red lines are the Relay 12v + high amperage wire,
- Black is the 12v - high amperage wire,
- Orange is the 5v + for I2C or CAN Ground
- Green and yellow are the SDA/SDL or CAN High / CAN Low
Auto Light Control.gif
Hotwire's Car Light Control
Auto Light Control.gif (25.5 KiB) Viewed 2341 times
I think bringing it all down to just a 5 wire run will make life and customization SOOO Much easier. Thank you for your input and any creative / constructive criticism.

scotty101
Posts: 3670
Joined: Fri Jun 08, 2012 6:03 pm

Re: Car Light Control

Thu Feb 11, 2016 3:25 pm

This is very similar to what is happening in modern aircraft. The cable bundles in aircraft are much larger though and you can make significant weight savings.

With lighting in a car, I'm not sure their weight/cost/complexity balance would indicate that your solution was a better one than running direct wires.

(Remember than most cars use the chassis as the GND Return.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

Hotwire
Posts: 4
Joined: Thu Feb 11, 2016 10:42 am

Re: Car Light Control

Thu Feb 11, 2016 4:58 pm

Right, this is a theoretical design lay out. I will use chassis grounds. So i can eliminate the grounds thks way. Leaving me with a 4 wire twi/i2c or 3 wire CAN bus system. The gains are valued in the ability to hide the wire bundles for cleaner installations. 3 wires is easier to chase for diagnostics. And lastly, if i wish to add onto the system \ modify \ customize its WAY easier to just tap into the 3 wire bundle the. To chase wiring back and forth. This is my logic.

Hotwire
Posts: 4
Joined: Thu Feb 11, 2016 10:42 am

Re: Car Light Control

Wed Feb 17, 2016 11:59 pm

Some more light on this little project,

after more research and planning, I think that each slave will be a custom arduino board to handle the I2C and a controller for the relays for the lighting. I have looked and I can source appropriatly sized relays, and will integrate a breaker system within each controller to act as the fusable link incase of an issue. All of this should be able to be scaled down to smaller then a pack of smokes and only about 3/4" thick.

Each slave will have :

I2C Inputs / outputs :
- 12 v
- Gnd
- SDA
- SCL[/list]

Control Outputs:
- HI (High Beam / Brake Light)
- LO (Lo Beam / Running Light)
- BL (Turn Indicator)
- ACC (Fog Light / Reverse)
- AO (Always On ie. City light)
- 5 Ground connections[/list]

This arrangment will keep the system happy, and simple, but give me most versitile application for each corner of the car. Allow for easy programing of the boxes, as each will have the general programing, just needing the I2C number edited to confrom to where it is located according to the RasPI program.

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: Car Light Control

Tue Feb 23, 2016 8:41 pm

Doing your own lighting controls can be rife with pitfalls. On modern cars things like lamp current for headlights, brake lights, parking lights and running lights are monitored. On Eurospec cars, fog lamp current is also monitored on some vehicles. That means that the instant wires are cut, error codes or lighting system failure indicators start complaining. If the headlight monitoring system says a headlight is out, the car may not pass your state's safety and emissions test regardless if it is actually working. These same issues usually crop up when incandescent lights or HID lights are replaced with LEDs.

Good luck.
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

Hotwire
Posts: 4
Joined: Thu Feb 11, 2016 10:42 am

Re: Car Light Control

Tue Feb 23, 2016 9:54 pm

My Province is BC (Brittish Columbia), and the saftey requierments are pretty solid, like your suggesting. but there is a "Hot Rod" clause, that allows the car to pass a BASIC set of rules, as its a modified car. But I totaly understand your thinking. My system is completely independant from any of the other cars systems, and is NOT intended to be a plug and play with them either, although Im sure it can be made to be.

The system is going to be made to suit the current draws of the associated bulbs, and is going to be fused / breakered to boot. I intend for this to be used in completly custom electrical systems, but integratable with what ever controls and lighting systems that are in place. So, incondesant or LED wont matter, and using a configurable input for the controls will make it easy to integrate and program.

Or at least this is my vision. So far, I have preliminaries done, Im going to build one I2C / Arduino slave box in the next few weeks, and program a Raspberry Pi 2 to controll that Slave box. One thing at a time though. Luckily I have a wiring harness and bulbs from a cars lighting system that I can use as a testbed for any current or draw issues.

Return to “Interfacing (DSI, CSI, I2C, etc.)”