I have a resistance thermometer that outputs 4–20mA over 0–100°C. I can convert this to 1–5V with the use of a 250Ω resistor. My aim is to measure the voltage and scale it to the temperature and log it every 5 seconds to plot a graph. Would this be a project suitable for a beginner? Where do I start?

  • 1
    As the Pi has no analog inputs you are going to need an analog to digital converter (ADC). – Steve Robillard Sep 10 '17 at 18:48

I think this is an ideal project for starting up with RPi.

I would buy an Analog-to-Digital converter (ADC), which can sample your voltage, and transmit the value to your RPi via a digital line (typically SPI or I2C).

For starting, I would recommend an SPI bus compliant ADC chip. For example, the product below has a nice tutorial for getting started with it on RPi:


A similar chip from another reseller: https://www.sparkfun.com/products/8636

If you prefer I2C bus (again, with a detailed tutorial): search for ads1015 in Learn section on Adafruit

Periodic logging & plotting I would do with Python, since it's fast to learn and a lot of tutorials/support is available throughout the web (e.g. instructables).

Sorry, i had to remove my web-links beyond the first two, due to my fresh account.

  • Great....I can read the ADC values coming into the MCP3008 but could do with some guidance on the next step. I have wired up my temperature sensor into CH0 With a 1-5V signal. Can you suggest any links that will talk me through scaling the 1-5V to 0-150degC on Python? Regards Kris – Kris Sep 20 '17 at 13:06
  • I'm not sure I get your question right: do you want to accurately convert the captured voltage level to a correct temperature value? For this, the datasheet of the sensor should include necessary info. How do you see the converted values at this moment? Do you already use the MCP3008 from Python? – bureaucrat Sep 21 '17 at 13:22

Apologies for the delay....i was making things too complicated when all I had to do was use a simple equation we were taught in school many years ago. So, to convert my raw values to a temperature it was simply y = mx + c . If anyone would like to know further details let me know 👍


To convert 4-20mA values into read data values you will need readings at two known points, using these two points you will be able to calculate the slope (m). using this slope you will be able to calculate your real word readings at any given point of time. Here is an excellent article you can checkout https://ncd.io/how-to-convert-4-20ma-current-loop-to-voltage/

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.