-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathReadme.ino
59 lines (46 loc) · 1.92 KB
/
Readme.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Created by: Pablo Cruz Lemini
// 12 March 2021
//--------------Water Preassure Sensor-----------------------
/* Sketch reads values from a preassure sensor connected to the main waterline.
* It then sends the values through MQTT to a broker
* Read the Readme file first */
/* ----------Board Information-------------------------------
Code desinged to run on Wemos in pin D0
For runing in ESP8266 or ESP32 GPIO must be defined as input
- pinMode(water_pressure_pin, INPUT);
- 5V must be supplied to the sensor somehow
- EspMQTTClient.h can be used (se terrarium project)
*/
/* ------------Sensor Specifications:-------------------------
Sensor Name: SKU237545 Pressure Sensor
Sensor Material: Carbon Steel Alloy
Min Working Preassure: 0 MPa
Max Working Preassure: 1.2 MPa (12 Bar) (174.04 PSI)
Min Working Temperature: 0 Deg Celsius
Max Working Temperature: 85 Deg Celsius
Meassuring Error: 1.5%
Working Voltage: 5V DC
Working Current: <= 10mA
Min Output Voltage: 0.5V
Max Output Voltage: 4.5V */
/* -------------Possible Sensor Voltage Range:-----------------
Min Output Voltage: 0.5V
Max Output Voltage: 4.5V */
/* -------------Possible Analog Sensor Output Range:-----------
Analog RangeAnalog Inputs can range from 0 - 1023
GPIO Input Voltage can range from 0 -5V
Translating Analog Reading to Voltage:
Minimun Analog Reading = 0.5 * (1024/5) = 102.4
Maximum Analog Reading = 4.5 * (1024/5) = 921.6 */
/* Inspired from:
George Kontaxis, April 14 2016
https://www.youtube.com/watch?v=AB7zgnfkEi4&list=PLwm6E6nKSCtWRQHRxp0DhX25KauXjOZ3B&index=44
Ovens Garage, Apr 6, 2020
https://www.youtube.com/watch?v=UrqPxwsPWGk&t=660s
Akram Lab, May 16, 2020
https://www.youtube.com/watch?v=CH-Q3IIWlm4
Cambatronics Online, Apr 2, 2016
https://www.youtube.com/watch?v=WTa-A6_KFLw
Formula for converting ranges, March 25 2015
https://math.stackexchange.com/questions/1205733/how-to-convert-or-transform-from-one-range-to-another
*/