Automotive Light Control

Im designing a system to use in custom cars, or for people who are dealing with re-wiring the electrical system in there vehicle. The idea is to have a small control box for the 4 corners of the vehicle, representing the 4 light clusters ie. High, Low, Indicator and Acc.

Each box be a slave, controlled via I2C or CAN-BUS (Im undecided at this point). The slaves will be programed all to function alike but will perform actions depending on there addressing (User definable via PC software). The Master (also an arduino box) will control the slaves depending on the inputs from the vehicles OEM switches (turn, brake, reverse, fog, park, etc.) and aux. inputs to allow for alternate affects definable by the user via PC Software.

My primary question is, there are traces that will be carrying 4 - 15 amps at times. My calculations for these traces (At about 2" long each) would be a width of about 8mm. Will that be sufficiant for this purpose?

High beam bulb is 60w
Low beam bulb is 55w
ACC Light bulb is ~50w
Indicator bulb is ~25w

ACC and High will NOT be able to turn on at the same time, High and Low will go out when Indicator is in use. High and Low both run on the same relay, FORCING them to be self Canceling (Lows run on Normaly Closed Pin, Highs run on Normaly Closed Pin)

Thanks for the help,

Light Control Relays.PNG

Nano Connections.PNG

2 feet aka 60cm traces on a simple PCB :o And what's drawing 15A? Maybe the common but that can be connected directly (or via a very short trace)

But trace width is all about what losses can you tolerate. And the don't only depend on width but also on thickness. That's something a manufacturer will provide. 1oz or 35um is common. And some use an extra tin layer on top of the trace to make the trace thicker. You can also mirror (and via stitch) a trace on the top and bottom of a PCB to get twice the width.

I like to use something like ElectroDroid to do some calculations about traces so it gives you an indication.

I2C to go around a car is a bad idea. It's designed as (like the name suggests) as inter-chip communication. So in the range of cm's. Something like CAN is designed for inter module communication and is more robust.

And why use relays? Why not go for a solid state design and use mosfets?

septillion:
2 feet aka 60cm traces on a simple PCB :o And what's drawing 15A? Maybe the common but that can be connected directly (or via a very short trace)

The trace from the relay to the header for the wireing connector will only be about 2" not 2'. The 15A will be at a time when there may be two or more lights running at the same time. Each light will draw no more then 7A, but I want a safety factor in there for when there are multiple lights lit. Even if for just a short time.

septillion:
But trace width is all about what losses can you tolerate. And the don't only depend on width but also on thickness. That's something a manufacturer will provide. 1oz or 35um is common. And some use an extra tin layer on top of the trace to make the trace thicker. You can also mirror (and via stitch) a trace on the top and bottom of a PCB to get twice the width.

Im looking into VIA's for two sided traces, thicker material, as well as bus bars.

septillion:
I like to use something like ElectroDroid to do some calculations about traces so it gives you an indication.

I will DEF look into this, it may help me over all in the long run.

septillion:
I2C to go around a car is a bad idea. It's designed as (like the name suggests) as inter-chip communication. So in the range of cm's. Something like CAN is designed for inter module communication and is more robust.

I was interested in I2C, CAN will be much more practical and probably more efficiant as well. Like I said i have not decided on the protocol yet. CAN will also give me the ability to link into existing CAN systems... In the future.

septillion:
And why use relays? Why not go for a solid state design and use mosfets?

Relays can give me the option for interchangability, while using sockets as well. HOW EVER... Solid state and mosfets are also on the table. As long as I can find cheap and reliable components that will handle the amperage, and meet the standard needed for use on the street. (i dont want them burning out, and rendering the system useless, and unrepairable.

Or at least this is my thinking... and Im not known for doing much of that... :slight_smile:

5cm sounds way more realistic :smiley:

A safety factor is indeed a very good choice. You have indeed high currents. A cold bulb has a resistance that can be <1ohm... That's 12A+ at start for 1 bulb. So I think a 15A relay is to small for two bulbs.

CAN is indeed a nice vehicle standard. But apart from knowing the basics I've never done anything with it. But way better choice then I2C.

A relay can indeed be easy to change if you socket it. But a relay is big and mechanical so vibration and switching will wear it out. A mosfet design can be compact, is probably cheaper and has no moving parts. Something like a IRLZ44 will be pretty easy to use (logic level) and can handle 50A with peaks of 200A so even a cold bulb or 2 isn't a problem.

Definitely go for MOSFETs. Then you can do PWM to dim the lights. And use CAN Bus, with proper transceiver chips.

For really high current traces, leave the entire trace completely uncovered by solder mask. This will take some effort as the default is to completely hide the traces under the mask. Then after you have soldered the components, lay a bare copper wire along the trace and completely flood it with solder. You can get several square millimeters cross section this way - good for 100A or maybe more.

How are you powering this thing? Your Nano can only just take 12V input and a car electrical system will exceed this. You need some good protection on all of the wires that enter your box. Someone (probably you) is going to hook this up to a battery backwards and your design should anticipate that event.

This is not intended to run two bulbs at a time. there will be one module per "Cluster" of lights. But... In the case that there is two bulbs firing up, this is where I wanted the extra "Umph" of the 7mm traces. Using a wire or bus bar was my first choise. This will reduce overall size for sure.

MOSFET as a great suggestion, and one I will go with. Its probably going to solve some of the issuse I would have faced in the future too, Such as heat, vibration, and over all "Cyclic use" Less wear and tear over all. And a smaller package.

According to the papers the Nano can regulate up to 20v. the cars electrical system will put an average of 13.8v, but shouldnt rise above 15v or drop below 8v. I would think it be safe, but a buffer, or primary regulator to bring it down (Or up) to a more managable voltage is an other great idea. As would be the use of a polarity safety circuit.

Feeding each module will be a bundle of 3-4 wires. A +12v, Gnd, SDA, and SCL. or +12v, Gnd, and CAN-BUS. One of the main purposes of this project is to limit the wiring and clean up an already messy system.

VA3WPN:
Im designing a system to use in custom cars, or for people who are dealing with re-wiring the electrical

Each box be a slave, controlled via I2C or CAN-BUS (Im undecided at this point). The slaves will be

Thanks for the help,

What sort of electrical system do the cars currently have.

Modern ones using can bus, - all you have to do is hack the can bus to control the lights i think, everything else is already there.

Hi, what is your electronics, programming, arduino, hardware experience?
bebbfe01f088042fd82c6f8a7e3688a7ace97bcd.png
The circuit to control the relays is not going to work, the aim is for coil current not to flow through the controller, in your circuit the coil current will.
Also how are you going to turn your headlights off, you can only select Hi or Low but not Off?

Google arduino relay drive circuit

Tom... :slight_smile:

This is ment to be electrical system independant. Like i state in the first post, its for custom cars where the electrical system has been removed, or modified. This is the situation that I am in, as my car is an early 80's car, so there is no CAN-BUS or any system remotely close.

This is just a get started diagram, not Ultra specific. I used a Java Circuit Simulator to put this much together. I have not done any isolation And here in North America you are requiered to have DRL's by law. Day time running lights. This was just specific to the lights them selves not the Power distribution. Power will be centraly controlled at the main controller much like most other cars.

I have extencive experiance with automotive electrical systems, how ever I am a hobbyist, and this arduino is an other hobby of mine that Im tring to integrate with the automotive stuff. As for Adruino programing, I have done some other projects, like a Ham Radio antenna Rotator controller. As for Hardware.. its limited to what an advanced Amature radio operator would have... As that is what I am. So I can hobble most things together one way or an other.

Im not sure if that was suppose to be a dig at me, but I honestly don't care if it was. But thanks anyways :slight_smile:

VA3WPN:
Im not sure if that was suppose to be a dig at me, but I honestly don't care if it was. But thanks anyways :slight_smile:

Not at all.

The can bus system seems to be a good answer for your application if i understand it correctly.
Not being a car person i am not sure i fully understand the application.

Thank you, I'm sorry about the first relay picture, i had been running it in the simulator, THAT is why the resistors are connected in the way they are, I had simply removed a switch between the ground and the relay. I'v changed it, as well as done one in MOSFETS.

  1. Again, there needs to be some re-working of the MOSFETS so as to allow the activation of the ACC Lamp (Fog Light) to drop the high back to low beam. And Yet an other modification to turn off both high and low when the indicator is activated. But I wish to use some creative programing within the arduino to manage this.

Im just at the very beggining stages of the design, and programing. Its a hobby, Im not a professional.. This is why it is a project, and not a prototype. Im sure someone will take the idea and run with it. But Im doing this out of my own interest.

thank you again for your input and guidance.

Hi,


PB3 will turn both HI and LOW on together, you will need an extra output to control both.

Google automotive high low side drivers

You will find that there are specifically designed solid state switch components designed for automotive applications.
I have attached a very informative app sheet on driving automotive type loads.

Tom........... :slight_smile:

TND384-D.PDF (1.02 MB)

TomGeorge:
Hi,


PB3 will turn both HI and LOW on together, you will need an extra output to control both.

Google automotive high low side drivers

You will find that there are specifically designed solid state switch components designed for automotive applications.
I have attached a very informative app sheet on driving automotive type loads.

Tom........... :slight_smile:

Thanks, but if you look closely, one is NPN and the other is PNP. So, applying the voltage to them this way will turn one on, and one off. I built this in a simulator, and it worked just as I thought it would have.

VA3WPN:
According to the papers the Nano can regulate up to 20v. the cars electrical system will put an average of 13.8v, but shouldnt rise above 15v or drop below 8v.

That 20V rating is a bit ambitious.Depending on the current being drawn from the Nano's voltage regulator, it might burn out the regulator in just a few seconds. Once you know what other peripherals are powered from the 5V, then you can work out the power being dissipated in the regulator and that lets you work out how hot it will get. I've toasted Arduino regulators with less than 12V input and less than half the nominal max current.

The voltage on the electrical system is also subject to much wider variations. You are thinking about an operating car. What about one with a flat battery getting a jump start from an idiot who connects the leads backwards? While I've never done that personally, I have jump started a car on 24V by accident. I have connected 12V backwards many times while bench-testing things like this. Look up best practices for automotive electrical protection. Remember every wire that enters or leaves your box must have protection against these voltages.

VA3WPN:
Thanks, but if you look closely, one is NPN and the other is PNP. So, applying the voltage to them this way will turn one on, and one off. I built this in a simulator, and it worked just as I thought it would have.

Then you have simulated something incorrectly. Consider the N-channel MOSFET (the normal one, used more commonly.) It will be "on" any time the gate voltage is sufficiently higher than the source voltage. Its drain is connected to the 13.8V rail. If it's on, then the source will be about the same voltage as the drain. You need more than 13.8V to turn it on fully.

In the real world, a 5V input on the gate will allow just enough current to flow to bring the source up to near 5V. The difference is called the "threshold voltage" which is different for every type of MOSFET but let's guess it's 2V. So the drain is at 13.8V, the source is at 2V and lots of current will flow. But since the 'output' is 2V, the desired lamp won't light. All the power is being dissipated inside the MOSFET. (Volts x Amps.) It will get very hot very quickly, causing it to stop working and set fire to anything flammable nearby.

Thank you all very much. This is exactly what I am here for, Project Guidance. I Figured I was on the right track using relays and transistors to keep it simple and easy. MOSFETS keep it solid state, but complicate things a little more. Maybe... More then likely beyond my knowledge... but that is okay.. I will learn MORE that way. I'm not claiming to be professional in any way. So thank you for ALL of the input so far.

So... back to the project. I am spending the next few hours to focus on MOSFETS that seem to be specific to this kind of project / purpose. I will have a revised MOSFET schematic later this evening... I hope. I'm also working on the program for the slaves... so maybe a snippet of that as well.

So, a long night, and Im still not 100%$ sure if iv got the right Components on the right side of the lamp. But here is what I have, and the code I have running it so far.

// the setup function runs once when you press reset or power the board
int lhigh = 13;
int llow = 12;
int lind = 11;
int laux = 10;
int ihigh = 9;
int iind = 8;
int iaux = 7;
int bhigh= 0;
int bind = 0;
int baux = 0;
int obhigh= 0;
int obind = 0;
int obaux = 0;
int highstate = 0;
int indstate = 0;
int auxstate = 0;
long lastDebounceTime = 0;  
long debounceDelay = 5;    
int rhigh;
int rind;
int raux;

void setup() {
  // initialize digital pin 13 as an output.
  pinMode(lhigh, OUTPUT);
  pinMode(llow, OUTPUT);
  pinMode(lind, OUTPUT);
  pinMode(laux, OUTPUT);
  pinMode(ihigh, INPUT);
  pinMode(iind, INPUT);
  pinMode(iaux, INPUT);
}

// the loop function runs over and over again forever
void loop() {
  
// High / Low beam light switch  
  rhigh = digitalRead(ihigh);
   if (rhigh != obhigh) {
      lastDebounceTime = millis();
      obhigh = rhigh;
   } 

   if ((millis() - lastDebounceTime) > debounceDelay) {
       if (bhigh != obhigh) {
           bhigh = obhigh;
           if (bhigh == HIGH) {
                 highstate = !highstate;
                 digitalWrite(lhigh, highstate);
                 digitalWrite(llow, !highstate);
           }
       }
   }

// Indicator light switch  
  rind = digitalRead(iind);
   if (rind != obind) {
      lastDebounceTime = millis();
      obind = rind;
   } 

   if ((millis() - lastDebounceTime) > debounceDelay) {
       if (bind != obind) {
           bind = obind;
           if (bind == HIGH) {
                 indstate = !indstate;
                 digitalWrite(lind, indstate);
           }
       }
   }

// Aux Light light switch  
  raux = digitalRead(iaux);
   if (raux != obaux) {
      lastDebounceTime = millis();
      obaux = raux;
   } 

   if ((millis() - lastDebounceTime) > debounceDelay) {
       if (baux != obaux) {
           baux = obaux;
           if (baux == HIGH) {
                 auxstate = !auxstate;
                 digitalWrite(laux, auxstate);
           }
       }
   }
}

That schematic is a good attempt. Next time use ground symbols and label your wires instead of dragging them all the way around the diagram.

Looks complex. If I was doing this, I would use an off-the-shelf chip like a BTS716G. That does all of the conversion to 12V and it claims to be virtually unkillable for normal automotive fault conditions.

For a really smart driver chip, look at MC17XSF500.

Hi,
I would agree with MorganS, there are some purpose made high side AUTOMOTIVE type drivers that would make your job so much easier.
Also check your diagram around T5, it looks like you have the gnd wire connected to all sorts of things there.

Please read the attachment.

Tom.... :slight_smile:

TND384-D.PDF (1.02 MB)