Hi guys,
I would like to read a variable analog value from 2.5v to 7.5v on my arduino.
Which ADC should I use for this voltage range?
I would need a digital resolution of 255.
Thank you
Kind regards
Hi guys,
I would like to read a variable analog value from 2.5v to 7.5v on my arduino.
Which ADC should I use for this voltage range?
I would need a digital resolution of 255.
Thank you
Kind regards
BTW, if it is a 3 or 4 input IC, even better because I actually need to read 3 analog sources.
Arduino has 6 ADC pins but max voltage is 5 volts, you could use voltage dividers to get your 7.5V down below 5V, Arduino ADC resolution is 10 bit (0 - 1023), what kind of input device do you have?
I have a device the is sending a position reading to a range of voltage from 2.5v (when min) down to 7.5v (When max), just like a potentiometer. As I know that the arduino can only read from 0v to 5v, I would need to "convert" these reading voltages to a range accepted by the arduino.
So, my question is how to do it??
Hi,
You will need to use a potential divider to get the 7.5V to 5V for the arduino.
The arduino AtoD is 0-1023 so it should still cover your 0-255 resolution.
What is your electronics, programming, arduino, hardware experience?
What is the application, are you going to control something with it or provide an output to a display/indicator.
Tom....
Hi Tom,
I would like to read that voltage information and display it on an LCD in a graph style.
My experience is about "beginner" to "medium" range, depending on what we are talking about... In this particular case, I have never had the need to work with dividers so, for this matter I am definitely a beginner, thats why I am asking for help.
Have you tried the search bar on these forums with "resistor divider"?
Yes I have but I haven't got what I am looking for or, in the best case, it is done with a bunch of resistors... as I need to do it in a smallest possible PCB with 3 analog inputs, I prefer to use a single 3 way IC to do the job instead of a bench of resistors... if that is possible, of course...
BTW, I am the type of guy that spend hours if not days searching things on the internet and I don't ask to people very often unless I don't find what I need, as you can notice, I am registered for quite long time with a very few post, that means that generally I find what I need without asking questions, if I am asking thats because I didn't found...
Just another thing, one of the main goals of this forum is to SHARE knowledge asking and answering, not answering with some type of sentence like (have you ever looked for that?)
If you know how to do it, share, if you don't or if you don't want to share, just stay quiet.
Thats my opinion, sorry if I was rude...
You can get 4 resistor array in a single 1206 package - that's pretty small...
More seriously 0805 or 1206 sized resistors can be hand soldered onto stripboard even,
and be quite compact, and 1/8W through hole resistors mounted vertically are compact
too.
You won't get any ADC capable of reading 7.5V without providing a voltage supply at
or above 7.5V, that extra supply alone takes more space than any resistor array.
The more information you provide up-front about what you really want to do the better,
otherwise we can only guess what you are doing - the xyproblem again. You never
mentioned anything about board area in your initial post, yet that was one of your
requirements it turns out...
Well, thank you for your help!!!
I'll take the suggestion from MarkT and use some resistances.
I made the calcs and I'll use a 15k as R1 and a 30K as R2 to get precisely 5v out from the 7.5v... From the 2.5v I am getting 1,6...v instead of 0v but thats not an issue, I'll put the code to do remaining calcs to get the right values.
Thank you once again!!!
giantpt:
I'll put the code to do remaining calcs to get the right values.
You're not getting any higher values... The ADC is 10 bit, all you want is 8 bit.
(when using the 5V as ref, please mind all the stuff said about 5V ref only being a nice ref if you power it via the barrel jack and not loading the 5V.) 1,6V give you a adc reading of 1,6V x 1024 / 5 = 327. So converting the ADC readings (1,6V tot 5V) / real reading (2,5 to 7,5V) to a range of 0 to 255
int reading = analogRead(pin);
reading -= 327;
reading = map(reading, 0, 1023 - 327, 0, 255);
Yes I have but I haven't got what I am looking for or, in the best case, it is done with a bunch of resistors... as I need to do it in a smallest possible PCB with 3 analog inputs, I prefer to use a single 3 way IC to do the job instead of a bench of resistors... if that is possible, of course...
You could use a quad op-amp... But, you still need at least 2 resistors per channel.
Consider using the internal 1.1V ref. It'll be more accurate and stable. Could use a 1/10 ratio divider to get a 0.25-0.75V signal for 233-698 ADC count which is almost 9-bit resolution. Then use the map function to get your 0-255 range. This would also leave room for overvoltage protection.
Stupid me, I could have done all in map
int reading = map(analogRead(pin), 327, 1023, 0, 255);
The 1,1V is indeed a bit more stable if you power it from USB or another source or load the 5V. Getting a 1/10 divider only isn't that easy with E12. But it all boils down to a right map().
Thank all for your help... My problem is solved and working well!!
Cheers