Liquid Soap Level
![IMG_1872.jpg](/proxy/?url=https://content.instructables.com/FQ6/CZA9/LIOLQXYK/FQ6CZA9LIOLQXYK.jpg&filename=IMG_1872.jpg)
![IMG_1872.jpg](/proxy/?url=https://content.instructables.com/F9Q/KP0B/LIOLQXSR/F9QKP0BLIOLQXSR.jpg&filename=IMG_1872.jpg)
![IMG_1865.jpg](/proxy/?url=https://content.instructables.com/FX5/XI3D/LIOLQS6V/FX5XI3DLIOLQS6V.jpg&filename=IMG_1865.jpg)
![IMG_1798.jpg](/proxy/?url=https://content.instructables.com/FG4/FTNJ/LIOLQOVG/FG4FTNJLIOLQOVG.jpg&filename=IMG_1798.jpg)
![IMG_1792.jpg](/proxy/?url=https://content.instructables.com/FVT/YN0W/LIOLQOUS/FVTYN0WLIOLQOUS.jpg&filename=IMG_1792.jpg)
![IMG_1866.jpg](/proxy/?url=https://content.instructables.com/FGN/L634/LIOLQQYC/FGNL634LIOLQQYC.jpg&filename=IMG_1866.jpg)
![IMG_1867.jpg](/proxy/?url=https://content.instructables.com/F8V/P8KD/LIOLQQYD/F8VP8KDLIOLQQYD.jpg&filename=IMG_1867.jpg)
![IMG_1865.jpg](/proxy/?url=https://content.instructables.com/FZ0/2L5O/LIOLQQYE/FZ02L5OLIOLQQYE.jpg&filename=IMG_1865.jpg)
A liquid Soap Level Monitoring System is designed to monitor the liquid Soap level in a tank or reservoir. It utilizes the NodeMCU ESP-12F development board, which is equipped with the ESP8266 Wi-Fi module. The system uses ultrasonic sensors connected to the NodeMCU board to measure the distance between the liquid Soap surface and the sensor. By calculating the difference between the tank depth and the measured distance, the system determines the water level.
The NodeMCU ESP-12F connects to the Blynk platform using the Blynk library, allowing you to remotely monitor the water level from a mobile app or web dashboard. The Blynk app provides a graphical representation of the water level, displaying it as a percentage. Additionally, the system sends the liquid Soap level data to the serial monitor for debugging purposes.
NOTE: BATTERY IS OPTIONAL
Supplies
![IMG_1868.jpg](/proxy/?url=https://content.instructables.com/FI0/QKXI/LIOLQRJL/FI0QKXILIOLQRJL.jpg&filename=IMG_1868.jpg)
- NodeMCU ESP-12F: The development board is based on the ESP8266 Wi-Fi module.
- Ultrasonic Sensors: Used to measure the distance between the liquid Soap surface and the sensor.
- Blynk Platform: Enables remote monitoring and control of the water level via a mobile app or web dashboard.
Hardware Setup:
![IMG_0095.PNG](/proxy/?url=https://content.instructables.com/FIU/LOS8/LIOLQOUX/FIULOS8LIOLQOUX.png&filename=IMG_0095.PNG)
![IMG_1870.jpg](/proxy/?url=https://content.instructables.com/F03/1QG2/LIOLQSX6/F031QG2LIOLQSX6.jpg&filename=IMG_1870.jpg)
![IMG_1869.jpg](/proxy/?url=https://content.instructables.com/FA4/Q42D/LIOLQSY2/FA4Q42DLIOLQSY2.jpg&filename=IMG_1869.jpg)
![IMG_1871.jpg](/proxy/?url=https://content.instructables.com/F8K/E0G9/LIOLQSY3/F8KE0G9LIOLQSY3.jpg&filename=IMG_1871.jpg)
- Connect the trig pin of the ultrasonic sensor to D5 on the NodeMCU board.
- Connect the echo pin of the ultrasonic sensor to D6 on the NodeMCU board.
- Connect the VCC and GND pins of the ultrasonic sensor to the appropriate power and ground pins on the NodeMCU board.
Blynk Setup:
![Ekran Resmi 2023-06-11 22.41.12.png](/proxy/?url=https://content.instructables.com/FR6/XBF2/LIOLQT0N/FR6XBF2LIOLQT0N.png&filename=Ekran Resmi 2023-06-11 22.41.12.png)
![Ekran Resmi 2023-06-11 22.40.32.png](/proxy/?url=https://content.instructables.com/FBD/OGUC/LIOLQT0O/FBDOGUCLIOLQT0O.png&filename=Ekran Resmi 2023-06-11 22.40.32.png)
- Install the Blynk app on your smartphone or tablet.
- Create a new project in the Blynk app and note down the authentication token.
- Add a value display widget (e.g., Gauge) in the Blynk app to visualize the liquid Soap level percentage.
- Obtain the Blynk template ID and name for your project.
Code Upload
![Ekran Resmi 2023-06-11 22.42.04.png](/proxy/?url=https://content.instructables.com/FBJ/9F4C/LIOLQT5U/FBJ9F4CLIOLQT5U.png&filename=Ekran Resmi 2023-06-11 22.42.04.png)
![Ekran Resmi 2023-06-11 22.42.14.png](/proxy/?url=https://content.instructables.com/F31/92T5/LIOLQT6N/F3192T5LIOLQT6N.png&filename=Ekran Resmi 2023-06-11 22.42.14.png)
- Open the Arduino IDE and create a new sketch.
- Copy the provided code into the sketch.
- Replace the placeholder values with your Blynk authentication token, Wi-Fi SSID, and password.
- Upload the code to the NodeMCU board.
#define BLYNK_TEMPLATE_ID "TMPL6gKWFROIu"
#define BLYNK_TEMPLATE_NAME "liquid Soap level"
#define BLYNK_AUTH_TOKEN "ZcFjGkSK7qCg0JWFJm-3IziHy7uParIm"
#define BLYNK_PRINT Serial
#define trig D5
#define echo D6
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
BlynkTimer timer;
long tankDepth = 24;
char ssid[] = "Erdinc iphone (2)";
char pass[] = "12345678";
void waterLevel() {
digitalWrite(trig, LOW);
delayMicroseconds(2);
digitalWrite(trig, HIGH);
delayMicroseconds(10);
digitalWrite(trig, LOW);
long t = pulseIn(echo, HIGH);
long cm = t / 29 / 2;
double level = tankDepth - cm;
if (level > 0) {
long percentage = ((level / tankDepth)) * 100;
Blynk.virtualWrite(V0, percentage);
Serial.println(percentage);
}
else {
Blynk.virtualWrite(V0, 0);
}
}
void setup() {
pinMode(trig, OUTPUT);
pinMode(echo, INPUT);
Serial.begin(9600);
delay(100);
Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
timer.setInterval(10L, liquid Soap);
}
void loop() {
Blynk.run();
timer.run();
}
Testing
![IMG_0252.jpg](/proxy/?url=https://content.instructables.com/F6H/LM7R/LIOLQUDT/F6HLM7RLIOLQUDT.jpg&filename=IMG_0252.jpg)
![IMG_0253.jpg](/proxy/?url=https://content.instructables.com/F59/OWD0/LIOLQUJJ/F59OWD0LIOLQUJJ.jpg&filename=IMG_0253.jpg)
- Power up the NodeMCU board.
- Open the Serial Monitor in the Arduino IDE to view the debug messages.
- Launch the Blynk app on your smartphone or tablet.
- Connect the app to the project using the Blynk template ID.
- You should now be able to see the liquid Soap level percentage displayed on the Blynk app in real-time.