1

I'm very new to this. I found this tutorial.

But it don't explain how to read voltages higher than Arduino 5V. I have connected a 100K ohm resistor to positive and 10K ohm to negative of my 24V power supply.

I need some guidance for writing the code for this specific ADC, please.

ElectronSurf
  • 814
  • 4
  • 17
  • 43
BIGsmall
  • 25
  • 1
  • 7

1 Answers1

0

As KIIV mentioned you need to do the math:

Use this online voltage divider calculator to calculate your maximum input.

  • Keep in mind you shouldn't exceed Arduino 5V.
  • Use a multimeter to measure the resistors actual resistance.
  • Do the math for your example assuming R1 is exactly 100K and R2 10K you have to multiple the voltage by 11.
  • remember any error is going to multiple by 11 too, so make sure the first reading is accurate/stable.

ADS1115 is actually 15bit which will give you resolution of 32768, with default PGA setting you get: 6.144 / 32768 = 0.0001875V per bit.

Voltage = (your ADC reading) * 0.0001875V;
Voltage = Voltage * 11;

Take a look at This question/answer to see how I did reduced Arduino ADC noise, some steps can be done for ADS1115 as well.

ElectronSurf
  • 814
  • 4
  • 17
  • 43