-
Notifications
You must be signed in to change notification settings - Fork 7
Waterlevels
ADS1115 at adress 0x48 on I2C
directly connected to ads1115 measured 0-2,5v remove follwing jumpers:
- jp1 - adc2
- jp2 - adc1
- jp3 - adc4
- jp4 - adc3
3.3v -> Voltage divider with fixed 1k and the sensor value
set follwing jumpers:
- jp1 - adc2
- jp2 - adc1
- jp3 - adc4
- jp4 - adc3
In the meantime, you can read this tutorial
To read the values a Python3 script and Bottle webserver is served to transfer the data into Node-RED. Main reason for this is that we can use all cpu cores with it, while Node-RED itself uses only one core for now, as NodeJS is a single-core application. The measuring is time critical, so we had to care about the cpu usage. Of course you can call this data from other software too, the webserver uses port 8080. Check the "Pekaway Shunt + WaterLevel Python" flow in the Node-RED backend for further details. The script itself is located at ~/pekaway/ads_py/web1.py (with interpreter python3)
get requests on localhost:8080
-> gives level1 to level4 ADC values
In Node-RED the ADC values are scaled from 0-100. To configure the scaling we implemted two ways:
Method 1 -> set ohms
You know the correct ohm values of your sensor. Set it up to each channel. We then calculate then the approximate values (Only works for resistance sensors).
Method 2 -> full/empty
Works on capacative and resistance sensors
Example:
- Choose the value you want to set (e.g. level1full), fill up your tank. Press the calibrate button "set full"
- Choose the value you want to set (e.g. level1empty), empty your tank. Press the calibrate button "set empty"