Automotive and Arduino

I am using an Arduino to control a lot of LEDs. But I feel like there is something I'm not understanding that could damage my circuit and all my leds. I think its called load dump?
Because the Arduino being powered through my car cigarette lighter with a 5volt regulator.

I'm worried my car alternator might spike and toast my Arduino and LEDs. Is there something I should look in too for protecting my stuff? Or did I just miss read something along the line

Firefurter:
I am using an Arduino to control a lot of LEDs. But I feel like there is something I'm not understanding that could damage my circuit and all my leds. I think its called load dump?
Because the Arduino being powered through my car cigarette lighter with a 5volt regulator.

I'm worried my car alternator might spike and toast my Arduino and LEDs. Is there something I should look in too for protecting my stuff? Or did I just miss read something along the line

In an automotive environment, you definitely do have to look after ensuring power transients are managed - and not just load dumps. I've been pursuing exactly this goal. Latest topic on this is at the topic Automotive Human switching and power management. Happy to have you join us there. :slight_smile:

Cheers!
Dirk

Yeah I saw that after I posted this, Looked over it but it just got me little more lost >.<

Firefurter:
Yeah I saw that after I posted this, Looked over it but it just got me little more lost >.<

I hear you. Managing automotive power turned out to be far more challenging than I anticipated. There are 3 primary things to manage:

  • reverse polarity

  • under-voltage

  • over-voltage

  • Reverse polarity can be handled simply with a diode. There are nuances here though that can be explored - mostly that of voltage drop (which tends to be high) across diodes.

  • Under-voltage can be handled with a comparator or zener. I'm taking the latter approach.

  • Over-voltage is a little trickier; the voltage variances seen in automotive environments can be extreme (-28V to +120V). The negative voltage is handled as above. The 0 to +120 needs to be broken into parts which can be managed separately. A Transient Voltage Suppressor (TVS) can be used to filter out the extreme stuff (over 26V). The 0 to +26V which remains can be handled with a comparator or zener. I'm taking the latter approach with this also.
    My goal is to get +10 to +18V at up to 20A (actually, my approach may provide for an arbitrarily high current carrying capability). I've run into all sorts of issues and had to effectively start over and break down the project into much smaller chunks. Currently, I'm working on managing the 0 to +26V window which involves the 0 to +10V, +10 to +18V, and +18 to +26V stretches. That starts here. Currently, that conversation is at the "limit to a minimum of 10V" stage. Coming up is reverse polarity; I'll be exploring using a reversed p-channel MOSFET instead of a diode to minimize voltage drop. After that it will hopefully end with the +26 to +120V(?) stuff and voltage spikes.

NB There may be much simpler - or even single-chip - solutions if your current requirements are significantly lower (say, less than 5A).

Cheers!
Dirk

Firefurter:
Because the Arduino being powered through my car cigarette lighter with a 5volt regulator.

Then you are perfectly fine. Most 5V adaptors have pretty good protection. Of course there may be a fault or it's designed by an idiot but that is actually quite unlikely.

I heard little and friend told me while ago something like this might be enough to help the problem (if not drawn backwards) but to me it looks like just bunch parts stuck together.

If all you need powered is the Arduino, I agree with Morgan's comment.

Firefurter:
I heard little and friend told me while ago something like this might be enough to help the problem (if not drawn backwards) but to me it looks like just bunch parts stuck together.

It's not drawn "backwards". Roughly (from left to right):

  • D1 (diode) prevents reverse polarity
  • V1 (MOV) does gross limitation to 15V
  • D2 (zener) does finer grained limitation to 15V
  • C# (capacitor - all C items) mitigate spikes/decouple
  • 5V Regulator limits voltage to 5V
    If you're trying to power other things - particularly if at a different voltage, then other things may need to be considered.

Cheers!
Dirk

dephwyggl:
]D1 (diode) prevents reverse polarity

I thought a polarity protection diode went in series. If the battery's backwards won't that one just short straight across?

ardy_guy:
I thought a polarity protection diode went in series. If the battery's backwards won't that one just short straight across?

Ack! Quite right. D1 should be inline. (It just looked nice and symmetrical. :stuck_out_tongue: )

Thanks for the correction, Ardy. :slight_smile:

Cheers!
Dirk

I'm powering two things, the arduino off 5volts and my LEDs off the battery while the car is running. I don't think I could pull the power for my LEDs through D1. Because I saw you said about it being inline

dephwyggl:
Ack! Quite right. D1 should be inline.

So I go my LEDs hooked before the diode showed in photo3. Didn't fix D1 in the photo yet

The LEDs are on printed circuit board that hold 120 5mm blue LEDs. The leds are arranged so there is three in series with a resistor (see photo pcbforLEDs.png) The power each board should be using is 10.2volt and 800mA. I have total of 16 of these PCBs. So I totally need find a way to keep the LEDs safe as well since it going take alot of work to make to make the boards.

Firefurter, I appreciate what you're trying to do, but you won't get very far - and will likely burn out a lot of components - until you learn a bit more about electronics generally. For example, the first thing you need to do is determine exactly what your LED arrays require as far as voltage, current, and control is concerned; the way you have it drawn, your LED arrays are powered directly from the voltage source - without filtering, without regulation, etc. (They are unlikely to survive very long in an automotive environment this way.)

It would help if you understood a bit better how and what the Arduino can do with hardware. For example, you show 8 pins controlling your LED arrays. Depending on the specific Arduino you're using, you may have very few options remaining to actual signal ("tell") the Arduino what you want done with the pins to which your LED arrays are attached. Also, the way you drew your diagram is not going to help you understand what you're attempting to do. Maybe take a look at (simpler) example circuits on controlling LEDs directly, as well as controlling external loads (like you've attempted to draw) with Arduinos. This site's search and Google are your friends. :slight_smile:

Cheers!
DIrk

I see I forgot a resistor between my transistor and output of my Arduino. Also I've ran these LEDs for hours on my bench power supply to test them, never had any problems. I'm not going lie don't know few of the words you're talking about like filtering and regulation. I just know what I've done so far hasn't damaged my stuff. Could you please tell me what I'm doing wrong in this photo maybe?

Also here an example of a code I'm using as well

const int patternCount = 2;

int P13=13; //P# is output pin number being used on the arduino
int P12=12;
int buttonPin=2;
static unsigned long lastButtonTime = 0;

void setup() {
  pinMode(P13,OUTPUT);
  pinMode(P12,OUTPUT);
  pinMode(buttonPin,INPUT);
  
}

void loop()
    { 
    static int pattern = 0;  
//  If the button is down and the last time it went down was more than 1/10th second ago.
   if (digitalRead(buttonPin) && (millis() - lastButtonTime) > 100)
    
        {
        lastButtonTime = millis();
        
        pattern = (pattern + 1) % patternCount;
        
        }
    
    switch (pattern)
        {
      
   case 1:
   digitalWrite(P13,HIGH);  
   delay(200); 
   digitalWrite(P13,LOW);  
   delay(200); 
   digitalWrite(P12,HIGH);
   delay(200);
   digitalWrite(P12,LOW);
   delay(200); //end of pattern 1
   break;
   
   case 2:
   digitalWrite(P13,HIGH);  
   delay(100); 
   digitalWrite(P13,LOW);  
   delay(500); 
   digitalWrite(P12,HIGH);   
   delay(100);
   digitalWrite(P12,LOW); //end of pattern 2
   break;
      }
    }

Leds are directly to battery? Try to protect at least put zener,diode and surge... Transistor can handle current? Then it can be OK...but leaving base open of a transistor inside a car env can give you residual light. Code doesn't look much optimized but if you only manage those LEDs it is ok I think!! Why don't you count rpm as well? Now that you have a computer running pattern in LEDs I mean...

That does not resemble what you said earlier:

Firefurter:
The LEDs are on printed circuit board that hold 120 5mm blue LEDs. The leds are arranged so there is three in series with a resistor (see photo pcbforLEDs.png) The power each board should be using is 10.2volt and 800mA. I have total of 16 of these PCBs.

Figure out what you'll actually be using and get a schematic that reflects exactly that. (According to this, you'll need something other than 14.5V to feed them, and total power will be north of 180W.)

I'll reiterate what oswe said: You will need some kind of filtering and regulation. A "car battery" is not just a battery; it's the battery, the alternator, and everything vibration, corrosion, cranking, poor connections, etc. a car throws at its electrical system; a 14.5V power supply on a bench is not the same thing. I've outlined what's needed to provide reasonably clean power in an automotive environment. If you insist on continuing on this path, you may get things to work. For a while. I wouldn't bet on it, though.

As for the sketch, it'll likely do something with the array you have attached to pin 13. Not sure why you have code for pin 12 though, and I don't see anything attached to pin 2 to signal the Arduino.

NB I'd suggest get the hardware figured out. Then maybe re-broach the software thing in a more appropriate area.

Cheers!
Dirk

dephwyggl:
Ack! Quite right. D1 should be inline. (It just looked nice and symmetrical. :stuck_out_tongue: )

Thanks for the correction, Ardy. :slight_smile:

Cheers!
Dirk

Here's a correction to the correction: D1 isn't a reverse-polarity protection diode. It is a transient undervoltage clipping diode. It clips all negative voltage spikes to -0.7V or so, keeping them from damaging the circuits from negative voltage spikes coming from the alternator on the 12V battery feed. As shown, the circuit in discussion doesn't have a reverse-polarity protection diode. Leave D1 as it is, but add a reverse-polarity diode in series too.

Notice that D1 and D2 (the zener) work together. They each clip negative voltages to ~-0.7V, but the 15V Zener also clips positive voltage spikes down to only 15V. I wonder if D1 is needed at all actually, on second thought, since D2 will clip negative voltages down to -0.7V or so by itself anyway. See the "Zener Diode Clipping" section of the link below, for instance.

See more examples here: Diode Clipping Circuits and Diode Clipper

panther3001:
Here's a correction to the correction: D1 isn't a reverse-polarity protection diode. It is a transient undervoltage clipping diode. It clips all negative voltage spikes to -0.7V or so, keeping them from damaging the circuits from negative voltage spikes coming from the alternator on the 12V battery feed. As shown, the circuit in discussion doesn't have a reverse-polarity protection diode. Leave D1 as it is, but add a reverse-polarity diode in series too.

Notice that D1 and D2 (the zener) work together. They each clip negative voltages to ~-0.7V, but the 15V Zener also clips positive voltage spikes down to only 15V. I wonder if D1 is needed at all actually, on second thought, since D2 will clip negative voltages down to -0.7V or so by itself anyway. See the "Zener Diode Clipping" section of the link below, for instance.

Sounds to me like you talked yourself into having D1 be re-positioned to provide reverse polarity protection. (I don't see the need for 2 diodes clipping the -.7V stuff either.)

Cheers!
Dirk

Agreed. Sounds good to me.