Dante21
Posts: 1
Joined: Sat Oct 13, 2018 5:57 am

How do I read exact analog voltage?

Sat Oct 13, 2018 6:09 am

Hey Guys, I need some help. I make a Project with the pi for School but I got a Problem. I Need to read the exact analog voltage from a Sensor, that is connected to the Pi. It measures the Pressure that is forced to it so I Need the exact voltage that is given to the GPIO.

Thanks for your help

pcmanbob
Posts: 4460
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: How do I read exact analog voltage?

Sat Oct 13, 2018 5:24 pm

To measure voltage you need to connect an analogue to digital converter to your pi.

Do a search for mcp3008 and how to connect it to your pi.
Remember we want information.......................no information no help
The use of crystal balls & mind reading is not supported

B.Goode
Posts: 6533
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: How do I read exact analog voltage?

Sat Oct 13, 2018 6:08 pm

Something you might need to note for your project write-up is that there are some analogue values that can not be represented 'exactly' by a digital computer system.

But the word 'School' can mean different things in the education systems of various countries around the world, so that comment itself could be more advanced than you might be expected to deal with.

drgeoff
Posts: 8605
Joined: Wed Jan 25, 2012 6:39 pm

Re: How do I read exact analog voltage?

Sat Oct 13, 2018 6:33 pm

@Dante21

Just as you would not use a 30 cm ruler to measure the distance between London and Paris or to measure the diameter of a human hair, you will need to know what range of voltages to expect from your sensor. For any particular A to D converter you may need to amplify small voltages or attenuate large ones to match what the A to D can handle.

User avatar
TimG
Posts: 255
Joined: Tue Apr 03, 2012 12:15 am
Location: Switzerland

Re: How do I read exact analog voltage?

Sat Oct 13, 2018 7:25 pm

Take a look at the Pimoroni Automation pHAT

Image

boyoh
Posts: 1175
Joined: Fri Nov 23, 2012 3:30 pm
Location: Selby. North Yorkshire .UK

Re: How do I read exact analog voltage?

Tue Oct 16, 2018 10:22 pm

Pressure switches some times use 4 / 20 ma / 0/5v 0/10v out /put signals.

If using 4 /20ma out/put, this can be converted to a voltage by using a

4 / 20ma current loop, This is don by passing the 4 / 20me through a resistor

Then measure the voltage drop across the resistor, The Voltage drop will

Be directly proportional to the current flowing through the resistor.

Use Ohms Law to find resistor Might be around 250r
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

Return to “Advanced users”