TroubleshootingGravity

SKU-0257 Gravity water pressure sensor coding

userHead AnbarasuShanmugam 2022-06-09 15:26:40 425 Views1 Replies

 V = analogRead(0) * 5.00 / 1024;     //Sensor output voltage

  P = (V - OffSet) * 250;             //Calculate water pressure

 

Can anyone tell me what is that 250 value defines in this coding??

2022-06-12 16:46:31

The relation between voltage and pressure is shown in the picture:

https://dfimg.dfrobot.com/nobody/wiki/523137dc6f50feb019b55f25f80cb4df.png

The pressure and voltage are linear. The offset value is about 0.5V. So the slope is 1000(kpa)/4(V) = 250.

 

userHeadPic Youyou