This is a transducer pressure sensor used for Fuel / Gas / Oil / Liquid / Water and Air. A pressure sensor is a device that express the force from expanding, usually acts a transducer that generates a signal as a function of the pressure. Pressure sensor are commonly used for control and monitoring and also be used to indirectly measuring other variables such as fluid, liquid, gas flows, speed, water level, and altitude. This device is alternatively named pressure transducers, pressure transmitters, pressure senders, pressure indicators, piezometers, manometers. As an example to this project we will going to build a valve with LCD display to see the value comes from the sensor and process and controlled by our microcontroller. This sensor is running on 5v VDC at ≤10 mA, pressure range to 0 ~ 1.2 MPa at 2.4MPa Max > Note: 3.0 MPa will damage the sensor.
Required Components
- Arduino Microcontroller, NodeMCU, Teensy Board, TeensyDuino, ESP8266 12, 12E, ESP8266 NodeMCU, ESPDuino, ATMEGA328 16/12, ATMEGA32u4 16/8/ MHz, ESP8266, ATMEGA250 16 MHz, ATSAM3x8E, ATSAM21D, ATTINY85 16/8 MHz (Note: The Diagram below is using NANO. (please refer to the respective pin-outs)
- Pressure Sensor
- 16×2 TWI/i2C LCD Display Panel
- Push Button / Reset Button
- 10k Resistor
Wiring Guide / Diagram
Source Code
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 60 |
/* 14CORE Test Code for: Pressure Valve. www.14core.com .:+osysso++:` `+yhs/-` `-+s+` `:/+++++++++` .:/++ooo++/-` .ooooooooooo+: :///////////- `odh/` `:y+` /ddhsooooooo+ /hddhsooooydddh sdddoooooosdddy` `////////////` -hds` `sy. +ddy` .ddd: sddy.dddo +ddd- .-----------` `hds :sssss/ -ossssso-yy` `hdd: oddy `ddd/oddd:......+dddo .++++++++++++ +dd` :sdddh` :ydddddddo +y/ .ddd+........ `hddy:.....:yddy.hdddddddddddy+. ```````````` ydy .hddd/+hdddhydddh/.+yo /hdddddddddd. :shddddddddhs/`+ddd:````-yddy- :ooooooooooo+ odh` sdddooyyyyyhddddyy.sy+ ` `......... ``.... ....` ```...` ` `` `` ` -dd+`::::` .:::- /yy. -oos+:-oos+--oos+: /o `+y o/: o:+/ h:`yos /+-`/+/+ s:y/y. /dd/ `+yy: +//+ +/:+ +/:+ -. `/ -:o.:/:`//+- + +:- :`-+:`://: +`o`+. -yds. `/yys- .`-.. .``` ```` .`` ` ` ``` ``-..` ` :ydy/.`````.-/oyhs: `+++oo+oo+:.+-++/-/ooo+o +:o/oo///:+/ .:oyhhhhhhhso:` `. ``` */ #include <Wire.h> #include <LiquidCrystal_I2C.h> //Download the library below LiquidCrystal_I2C lcd(0x3F,16,2); //Set 0x27 if your using different i2c address (20,4 if your using 20/4 LCD) void setup() { Serial.begin(9600); delay(100); Wire.begin(2,14); lcd.init(); lcd.backlight(); // initialize serial communications at 9600 bps: Serial.begin(9600); lcd.setCursor(0,0); lcd.print("14CORE | PRESSURE VALVE"); lcd.setCursor(0,1); lcd.print(">Initializing..."); delay(4000); lcd.clear(); lcd.setCursor(0,0); lcd.print("14CORE | PRESSURE VALVE"); } void loop() { float rawvalue = analogRead(0); // read the sensor voltage int pressureval = ((rawvalue-95)/204)*50; //Equation lcd.setCursor (0,1); lcd.print (pressureval); lcd.print ("PSI"); Serial.print("RAW VALUE > "); Serial.println(rawvalue); Serial.print("PRESSURE VALUE > "); Serial.println(pressureval); delay (1000); } |
Downloads
Download LCD Screen 16×2 | 20×4 i2c Display Code Libraries | Zip
I will do this to display some cool stuff. Also, shared this article. Keep posting more articles like this. Amazing content, I liked it. Thank you !!!