Pages: [1]   Go Down
Author Topic: Is 12V to 5V conversion possible while maintaining ratios?  (Read 235 times)
0 Members and 1 Guest are viewing this topic.
Long Island, NY
Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm not quite sure how to explain what I'm looking for, but I'l try anyway.

The Arduino (UNO's) analog input can convert an analog signal into a digital signal. However, I see that it's limitation is that it's anywhere from 0-5V.

3.5V is 70% of 5V, therefore the digital equivalent would be somewhere close to 716 (in a range of 0 to 1023).
The 70% equivalent to 12V would be 8.4V. If I were able to map 12V to 5V the digital equivalent would also be 716.

Is it possible to or is there a device that can convert a 0-12V input to 0-5V input so that it's usable to the arduino? There is something I would like the Arduino to measure but it varies between 0V and 12V.

I hope I've explained myself well enough.
Thanks in advance!

-Miguel
Logged

Offline Offline
Faraday Member
**
Karma: 92
Posts: 5371
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The Arduino (UNO's) analog input can convert an analog signal into a digital signal  

Really ? Why don't you post some code demonstrating how you would do this ?


Quote
is there a device that can convert a 0-12V input to 0-5V input so that it's usable to the arduino? 
http://www.fairchildsemi.com/ds/CD/CD4049UBC.pdf (Output voltage level determined by Vcc voltage used. Any input can tolerate +12V input. In other words, if you want to convert 5V to 12V, connect Vcc to 12V. If you want to convert 12V to 5V, connect Vcc to 5V.
« Last Edit: August 17, 2014, 07:41:04 pm by raschemmel » Logged

Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,
DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Long Island, NY
Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The Arduino (UNO's) analog input can convert an analog signal into a digital signal 

Really ? Why don't you post some code demonstrating how you would do this ?

It's a built in function:http://arduino.cc/en/Tutorial/AnalogInput

Also, I meant to say "value" instead of signal. My apologies.
« Last Edit: August 17, 2014, 07:42:38 pm by LockDots » Logged

Offline Offline
Faraday Member
**
Karma: 92
Posts: 5371
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote

ha , ha , ha,
No kidding ? That's why it's called an Analog to Digital Converter.  What you are talking about might require a different approach. Your objective does not appear to be a digital count value in the range 0-1023. If it were , you wouldn't be posting for this question. Your objective " appears" to be to convert a CMOS digital signal to a TTL digital signal.

http://en.wikipedia.org/wiki/CMOS 

http://en.wikipedia.org/wiki/Transistor%E2%80%93transistor_logic 

However, it may be something altogether different. Let's just say that if you want to convert any positive (or negative) voltage to either
TTL or CMOS, the most common device to do that would be a comparator.

http://en.wikipedia.org/wiki/Comparator   

There are specialized ICs for this function, but an op amp can perform this function as well .
If you have any comparator ics or op amp ics you can use those. Otherwise, if you are going to purchase something to do it then it makes more sense to purchase the ic that was specifically designed to do this, ergo the CD4050
http://www.fairchildsemi.com/ds/CD/CD4049UBC.pdf 

Logged

Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,
DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Offline Offline
Faraday Member
**
Karma: 92
Posts: 5371
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
 Is it possible to or is there a device that can convert a 0-12V input to 0-5V input so that it's usable to the arduino? There is something I would like the Arduino to measure but it varies between 0V and 12V.  

Asking a question about a specific solution using "vague"  or cryptic wording like :
Quote
 There is something I would like the Arduino to measure but it varies between 0V and 12V.  
is not going to help much. Is there some reason why you can't tell us what it is you want to measure ? You want us to help you but you are omitting something we need to know. Is that intentional or unintentional ?
Logged

Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,
DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Long Island, NY
Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote

ha , ha , ha,
No kidding ? That's why it's called an Analog to Digital Converter.  What you are talking about might require a different approach. Your objective does not appear to be a digital count value in the range 0-1023. If it were , you wouldn't be posting for this question.

I can't tell if you're trying to come off rude or not, but keep in mind that I'm at your mercy and coming here for help, not to be belittled. And yes, I believe I am looking to assign a digital count value in the range 0-1023, but applied to 12V instead of 5V levels.

Quote
  Is it possible to or is there a device that can convert a 0-12V input to 0-5V input so that it's usable to the arduino? There is something I would like the Arduino to measure but it varies between 0V and 12V. 

Asking a question about a specific solution using "vague"  or cryptic wording like :
Quote
  There is something I would like the Arduino to measure but it varies between 0V and 12V.   
is not going to help much. Is there some reason why you can't tell us what it is you want to measure ? You want us to help you but you are omitting something we need to know. Is that intentional or unintentional ?

I'm sorry, I was just trying to keep it simple.

Automotive stereos with Steering Wheel Control (SWC) capability typically operate in one of two major "styles" or "methods". There is the older style typically referred to as "Analog" in which a resistor network or voltage divider is created between the steering wheel's buttons and slip ring. This different voltage or resistance value is passed on to the radio via a wired connection. The radio then "interprets" the different voltage/resistance values as commands. The "Digital" style typically uses CAN-BUS communication which is typically serial data communication using +/-5V or +/-12V pulses.

I did a little research and found out that my car uses "analog" SWC. I'm not sure yet whether it rests at 5V (preferable) or 12V. If it rests at 12V I would like to be able to read the voltage it's pulled down to and store it to memory so that I can then use these voltage levels as triggers for independent outputs.

I can get into more detail about the outputs if you'd like, but I think it's irrelevant to the first portion of my task at hand.
Logged

Melbourne. Australia
Online Online
God Member
*****
Karma: 27
Posts: 862
Freelance software and hardware development based in Melbourne Australia
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Surely you just need a voltage divider .i.e 2 resistors in series, with the midpoint connected to the Analog input

See https://en.wikipedia.org/wiki/Voltage_divider

Logged

Offline Offline
Faraday Member
**
Karma: 92
Posts: 5371
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No I wasn't try to be rude or belittle you but you clearly stated here:

Quote
Is it possible to or is there a device that can convert a 0-12V input to 0-5V input so that it's usable to the arduino?] Is it possible to or is there a device that can convert a 0-12V input to 0-5V input so that it's usable to the arduino?  

which means you are interested in converting some signal to 0's or 1's. This is what the above question is saying . If that is not what you want and you have multiple states (in order to be BINARY , it MUST be TWO STATES and ONLY TWO STATES. (0 AND 1).
State your intentions:
DIGITAL BINARY , or MULTIPLE STATES.
Logged

Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,
DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Long Island, NY
Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No I wasn't try to be rude or belittle you but you clearly stated here:

Quote
Is it possible to or is there a device that can convert a 0-12V input to 0-5V input so that it's usable to the arduino?] Is it possible to or is there a device that can convert a 0-12V input to 0-5V input so that it's usable to the arduino? 

which means you are interested in converting some signal to 0's or 1's. This is what the above question is saying . If that is not what you want and you have multiple states (in order to be BINARY , it MUST be TWO STATES and ONLY TWO STATES. (0 AND 1).
State your intentions:
DIGITAL BINARY , or MULTIPLE STATES.

The Arduino can take an analog input from 0-5V and assign it a digital count value between 0-1023. I would like it to be able to do this with an input from 0-12V. I'm not sure if this means that I'm looking for digital binary or multiple states honestly.
Logged

Offline Offline
Faraday Member
**
Karma: 92
Posts: 5371
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
 And yes, I believe I am looking to assign a digital count value in the range 0-1023, but applied to 12V instead of 5V  

Then what you are calling a  12V to 5V converter,  is the voltage divider mentioned in last post by RogerClark.
The values you need are 5.6 k ohm and 4.2 k ohm with the 5.6 k ohm resistor connected to the 12 signal and the 4.2 k resistor connected to ground. The point where the two resistors connect is where you obtain  your analog 0 to 5 V output.


FYI, after the fact, for future reference. the question you were asking here :
Quote
 Is it possible to or is there a device that can convert a 0-12V input to 0-5V input so that it's usable to the arduino? There is something I would like the Arduino to measure but it varies between 0V and 12V.
 

can be correctly stated as follows:
Quote
I would like to scale a 12V analog signal down to 5V. How do I do that ?
(hence the name "voltage divider ")
« Last Edit: August 17, 2014, 08:42:27 pm by raschemmel » Logged

Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,
DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Long Island, NY
Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
  And yes, I believe I am looking to assign a digital count value in the range 0-1023, but applied to 12V instead of 5V 

Then what you are calling a  12V to 5V converter,  is the voltage divider mentioned in last post by RogerClark.
The values you need are 5.6 k ohm and 4.2 k ohm with the 5.6 k ohm resistor connected to the 12 signal and the 4.2 k resistor connected to ground. The point where the two resistors connect is where you obtain  your analog 0 to 5 V output.


FYI, after the fact, for future reference. the question you were asking here :
Quote
  Is it possible to or is there a device that can convert a 0-12V input to 0-5V input so that it's usable to the arduino? There is something I would like the Arduino to measure but it varies between 0V and 12V.
 

can be correctly stated as follows:
Quote
I would like to scale a 12V analog signal down to 5V. How do I do that ?
(hence the name "voltage divider ")

That is a much simpler way to state what I was looking for. I'm sorry for being so misleading or confusing smiley-confuse, and thank for clearing that up for me smiley.

Surely you just need a voltage divider .i.e 2 resistors in series, with the midpoint connected to the Analog input

See https://en.wikipedia.org/wiki/Voltage_divider



I don't know why I completely forgot about this....the first thing I learned in EET. Shame on me.

Thanks again guys, I really appreciate the help! smiley-lol
Logged

Offline Offline
Faraday Member
**
Karma: 92
Posts: 5371
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You know what they say about "if you give a man a fish , etc , If you teach him how to fish , etc.
 
The Voltage Divider formula is:
Vout= Vin*R2/(R1+R2) | (where) R2 is the resistor across which the output is taken (see RogerClarks diagram)
Logged

Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,
DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

NSW Australia
Offline Offline
Faraday Member
**
Karma: 84
Posts: 3447
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You know what they say about "if you give a man a fish , etc , If you teach him how to fish , etc.
Someone quoted - and I think it was here:
"Give a man a gun, he can rob a bank. Give a man a bank, he can rob a country!"

Logged

Canada
Offline Offline
Sr. Member
****
Karma: 13
Posts: 424
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Someone quoted - and I think it was here:
"Give a man a gun, he can rob a bank. Give a man a bank, he can rob a country!"
Unfortunately, here in Canada, we now know what happens when you give a man a country!
Logged

Electricity is really just organized lightning - George Carlin

Pages: [1]   Go Up
Jump to: