1

What is the cheapest and best method to convert 12v(14)<->5V(3.3)? Need to connect Arduino to a car.

I need logical shifter not buck converter to connect Arduino to car 12v circuit. I would like to control electrical equipment of car by Arduino. For example, I want to connect input pin to heater, when heater is on from 12v circuit I get HIGH 12v signal which processes by Arduino, but like everyone knows, Arduino can handle only 5/3.3V. Then Arduino going to change state of equipment by connecting optocoupler/relay/transistor to button(of elect. equip.) and will act like physical press. P.P.S I know that more clever to hack and control by CAN bus. But not all eq. are connected to CAN bus and it`s a little bit risky but I'm working on it as well. I'm looking for best low cost solution. I have found it on ebay . Will it work like I want? Offer DIY solutions as well.

  • 1
    You're asking for an oxymoron there - "cheapest and best"? You can have the cheapest or you can have the best - which do you want? You can't have both. I think you mean "which is the best low-cost method" – Majenko Jan 23 '16 at 11:49
  • 2
    And what in the car are you trying to connect to? To do what? – Majenko Jan 23 '16 at 11:50
  • @Majenko, or something cost effective. Though, in this case it either works, or not. So any working low-cost method will do? But, this is more of a shopping question in this state. I believe anyone could/should make the call for himself when buying something. Your second point is spot on. – Paul Jan 23 '16 at 11:53
  • 2
    Use a car phone-charger. Especially if you plan to use it in a car, as the voltage in a car can fluctuate, and have huge spikes. – Gerben Jan 23 '16 at 15:59
  • It would help us to know if your goal is to power the Arduino or to condition signals from the car so that they can be read by the Arduino. Since you're asking about a "logic level converter" I'm assuming it is the later. This could be a good question, please come back and clarify / add more information. – dlu Jan 24 '16 at 19:49
2

Ok, so... I can see your question is a bit obscure, so I'll try to cover a generic approach.

  1. Power If you need to power the arduino, you can get a cheap car USB adapter. If you want a "solderable" solution, I'd avoid linear regulators (such as a 7805)and go with a cheap switching module. For low power applications I usually buy some modules called mini360 (for instance here is a link from aliexpress) which are cheap and ok for even some hundreds of milliamps. You FIRST turn the potentiometer to set the output voltage (checking with a multimeter) and THEN connect the arduino to it.

  2. Get status If you need to get the status of something (e.g. whether the lamp is on or off) you have to analyse the circuit. If you have to detect if either 12V or GND are applied, you can solve the problem with a voltage divider. But if the lamp is always connected to 12V and then the GND side is he controlled one then you will always force a (small) current inside it. If this is the case, maybe an optocoupler is the best solution. If the signal is a PWM maybe you need some filtering, if it is a digital wire maybe it is already at the correct voltage, .... You have to figure out what is the best solution for you

  3. Set status If you need to control something (e.g. turn on a light) your best bet is to use a 5V relay. There are plenty of them, even modules with the transistor and diode necessary to control them with an arduino.

Here are some ideas and rough schematics for the three points

schematic

simulate this circuit – Schematic created using CircuitLab

Just one very big WARNING: you have to carefully double check that the modification does not blow something up (for instance, you can make a short circuit if the body computer tryes to force a wire to 12V and you close the relay to ground). So... Be very careful, since what you do can break a lot of things, and if you are very lucky the bill can be only some couple of thousand dollars (I'll let you figure out what happens if you are not lucky enough)

| improve this answer | |
  • And... only after spending a lot of time I noticed that this question was from 2 years ago, and the reason why the question popped up is just because the OP did not accept an answer... – frarugi87 Mar 15 '18 at 10:43
1

Your safest option is to use an opto-isolator. Connect the LED side in parallel with the load with a suitable resistor, then the transistor side becomes, effectively, a button connected to the Arduino.

As far as the car is concerned you have just connected an LED. As far as the Arduino is concerned you have a button connecting to ground.

It provides complete isolation of the car's electrics from your Arduino.

| improve this answer | |
  • This is a good answer for a "logical shifter" as asked in the question. – Nick Gammon Sep 24 '16 at 2:08
0

Use LM7805 linear voltage regulator to regulate to 5 v , it's all about 2-4$, you need LM chip and 2 capacitors, that's all :) and if you need 3.3 just search for linear voltage regulator

| improve this answer | |
  • 1
    Don't forget a big-ass heat sink. Running from a car (up to 15V) you'll be dissipating a lot of heat. The 7805 is not a good choice for car use. Also he asked for "logic level converter" - though I don't think he knows what he wants ;) – Majenko Jan 23 '16 at 12:02
  • I think too :) but let's explain to man :) and it doesn't need a big heatsink if he is powering only arduino from 12 volts, but i don't even know why he asks for that, cuz it's integrated into arduino board, and if he looked how to build standalone atmega328 he would know what he has to use – Marko Mackic Jan 23 '16 at 12:11
  • Direct connection is not the best idea. During certain moments there may be huge voltage spikes. – Avamander Mar 28 '16 at 17:41
  • Well not really if he's connecting it to car's battery because a lot of addon devices operate on 7805 and i've never seen one that had problems with 7805 burning out or something :) it might be, but it's pretty rear :) – Marko Mackic Mar 28 '16 at 18:22
0

This might be what you need — a multi-channel level shifter with input and output voltage ranging from 3.3V to 18V: https://www.ezsbc.com/index.php/featured-products-list-home-page/ls2.html#.WqmSZ2aZNGU

It's no bi-directional: you'll need a couple of boards if you want inputs and outputs from an Arduino to 12V.

| improve this answer | |
-1

What are you trying to achieve?

It's simply unclear if you want to run the Arduino on 12v of the car battery. Or if you want to control the car-windows by hooking into them? Or if you want to read out your car using the arduino.

I'll go with the later since otherwise the question would be stated a little different.

Also, you're looking for something good/cheap. You don't tell what type of car you want to connect to.

But I think this might help you out: https://www.sparkfun.com/products/13262

25€ isn't that pricey, compared to the car you're fiddling with... So you should go with a little quality (also, you don't need them in batch?).

While a bit subjective, sparkfun could be considered a better vendor than most e-bay suppliers. Both in documentation and support. And in this case, their price isn't that bad. (I'm not affiliated with sparkfun, I actually never bought stuff of them, since e-bay works well for me. There may be hundreds of other good/better suppliers, but this one popped up first on google)

Also, "hacking" your car can have serious safety risks.

| improve this answer | |

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.