0
\$\begingroup\$

I prefix this with I know virtually zero about electronics, sorry.

Preface

In an attempt to try and gain some basic knowledge and learn a lower level programming language (usually work with more abstracted languages) I'm working on a project to create a power folding mirror module with an Arduino.

My current progress is located here if anyone is interested.

It currently works. I listen to door lock CAN message and simulate ignition through an Arduino pin. Using a couple of relays it controls the mirrors.

However I can't seem to decipher ignition signals of from CAN messages so I need to take a 12V feed and bring it down to the safe 5V level my Arduino can work with.

I have an of the shelf offering which I have opened up and am trying to use as a reference to some of the circuitry and design.

Question

Based on my off the shelf offering I have traced the following circuit.

schematic

simulate this circuit – Schematic created using CircuitLab

It is my understanding that R1 and R2 make a voltage divider and bring the voltage down to about 4.5v. It is also my understanding that R3 will act as current limiting. I assume not for the benefit of the Arduino but more to protect anything I may have taken the original 12V feed from.

The part I'm having trouble deciphering is C1. Based on my attempted research i think this is acting as a smoothing capacitor.

How can I work out its rating? I have no equipment capable of measuring it. Are there any sort of generic default values such a component could be in this context?

Iv'e tried looking at the rules for calculating it and the various equations I've seen are just a little mind boggling (maths is a sticking point for me, which is odd being a programmer writing HR and payroll software.)

Thanks for any advise. This is the first question I've written in this domain so hopefully it is acceptable.

\$\endgroup\$
3
  • 3
    \$\begingroup\$ @winny and whover upvoted your comment: This is about a signal, not power. The Arduino needs to know when the ignition switch is turned off so it can activate a relay to make the rear view mirrors on a car fold in. The voltage divider is to provide a 5V signal from the ignition switch 12V. \$\endgroup\$
    – JRE
    May 9 '20 at 8:59
  • \$\begingroup\$ I upvoted both now! \$\endgroup\$
    – Andy aka
    May 9 '20 at 9:26
  • \$\begingroup\$ @JRE Sorry about that. \$\endgroup\$
    – winny
    May 9 '20 at 10:06
4
\$\begingroup\$

Do not use the voltage divider you've shown. A car environment is not the nice 12 V environment you assume. 'Load dump', where you switch off a large load like the headlights, can generate a short transient overvoltage, auto electronics makers allow +160 V for this. However in your circuit, R1 and R3 do limit the current that would flow into the protection diodes at the input of the Arduino in that event.

This is rather safer

schematic

simulate this circuit – Schematic created using CircuitLab

The capacitor value is rather nominal. It should be small enough so that it charges reasonably quickly, <1 second or so. It's there to protect against small spikes, and perhaps RF. It's less necessary when used with a zener, due to its low dynamic resistance, but it doesn't hurt to have it there.

\$\endgroup\$
4
  • \$\begingroup\$ Ok thanks, i will look into voltage regulation using zener diodes. Not too sure on ratings for diodes so will look into how they are rated (it at all) and how you came to the values chosen for the different components. Thanks. \$\endgroup\$
    – ste2425
    May 9 '20 at 11:30
  • \$\begingroup\$ sorry for the followup question but could you clarify how you came to the value of R1? My understanding is its current limiting to protect the diode from the avalanche effect (think thats the correct term, where the current suddenly increases). The equations iv'e found (R = Vin - Vz / Iz) for calculating R1 assume a fixed input voltage, but as youve said ours could vary considerably. I think I'm a ittle confused how this can behave correctly with such a varying Vin. If you wouldn't mind updating your answer with that information, I'd be very grateful. Thanks. \$\endgroup\$
    – ste2425
    May 9 '20 at 12:45
  • \$\begingroup\$ You can only use equations when you have a specification for what's needed. 10k is small enough to bias the zener on and get a logic '1' into the Arduino, it's large enough to survive a brief pulse to 160 V, even though that's an instantaneous power of 2.5 W, and to not let too much current through to the diode, 16 mA under those conditions. I thought you might ask about the -14 V? That's when you get a jump start, but connect the battery backwards! I'm in the mirror of your situation, I can just do electronics, but baulk at higher level software, give me assembler any day. \$\endgroup\$
    – Neil_UK
    May 9 '20 at 13:25
  • \$\begingroup\$ Ok, thanks for the clarification. This feels like the early days of my programming career where i would find a snippet of something and it would do the job i require. But then i spend the next two days attempting to understand the reason why it does the job! \$\endgroup\$
    – ste2425
    May 9 '20 at 14:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.