Intro: Email Me When Home Supplies Are Low
Sometimes, we forget simple but essential things with our busy lifestyle. Being a small thing doesn’t mean that it’s not important in our lives. You might be a coffee lover or a sweets lover. No matter who you are, you feel uncomfortable when you run out of the essential supplies at your home or even your office. This might make your whole day down.
Hence, a method or a system is much needed to remind us when our supplies are running low. This helps us to maintain our lives in a good manner without any obstacles. From my experience, I’m usually running out of A4 sheets as they are a vital part of my university studies. Most of the times, I notice this on Monday morning right before the lecture starts and I have to borrow some from my friends.
To avoid this, I have planned to build a device to alert me when my stationery is low. As I had the second thought of implementing this system to maintain the amount of the essential household items, I built a prototype circuit which can be used at home as well as at working places.
I planned to build this as a pocket sized portable device. Further, this device can be placed outside a transparent liquid container to detect the liquid level inside. Therefore, you can carry this anywhere and use it on a wide range of supplies according to its less space consuming and convenience of setting up properties.
Step 1: Briefing
There are two main tasks that this device can perform.
- Measure weight
- Detect liquid level
Most of the times we can identify the amount remaining of our supplies by its weight or its liquid level. Therefore, I have included an option to calibrate the device to set the threshold values and it will automatically inform us by flashing a red LED when our supplies are getting lower than the given value. Using the selector switch you can select the method: weight measuring or the liquid measuring.
When our supplies are low usually we go shopping or we order them from online stores. This device automatically sends an email when our supplies are low. So, you don’t have to come home, check the status of supplies and go shopping. Let’s see how this device is built.
Step 2: Components
Collect following components.
- NodeMCU (ESP8266)
- RGB LED
- Force Sensitive Resistor
- Sharp IR
- 2 X SPDT switch
- 22k Resistor
- 100Ohm Resistor
ESP8266 board (NodeMCU) is acting as the central processing unit as well as the WiFi communicating system.
Force sensitive resistor (FSR) is used to measure weights and the Sharp IR sensor is used to detect liquid levels. In Force Sensitive Resistor, the resistance between the tracks reduces when the sensor is pressed. Therefore, the total weight to be measured is applied to the Force Sensitive Resistor.
Step 3: Detect Liquid Levels
Sharp IR sensor is mainly used to measure distances. However, using its method of measuring the distance, I have implemented a way to use this as a liquid level detector. The main advantage of this is, we can detect liquid level from outside of the container only if the container is transparent.
An RGB LED is used to notify the status of the supplies and to give notifications to the user in the calibration process.
One switch is used to select the weight measuring mode or the liquid level detection mode and another switch is used to calibrate high and low levels in the selected mode.
Step 4: Getting Started With NodeMCU
NodeMCU is a platform for developers as well as for those who are not familiar with electronics. Basically, it contains the ESP8266 module. As most people are familiar with Arduino programming, I will show you how to program the NodeMCU using the Arduino IDE. Open the Arduino IDE.
- Go to Tools > Board > Boards Manager.
- Select the ESP8266 from the list and install “esp8266 platform”.
- Go to Tools > Board and select NodeMCU 1.0 and select the correct COM port of your NodeMCU after connecting it to the computer.
Now you can program the NodeMCU using the Arduino IDE
Step 5: Making the Circuit
Follow the schematic of the circuit. I have used a vero board to solder the components together. Try to make it as small as possible to reduce the size of the device. The switch inside the box is the mode selection switch and the other one close to the LED is the calibration switch.
Step 6: Enclosure
As the enclosure, I found an old box with a suitable size. After placing the circuit board inside, the force sensitive resistor is placed at the bottom and stick a piece of Styrofoam to apply the pressure when the lid is closed. To make this a portable device, I have soldered a 9v battery clip to the Vin pin and Ground pin, so that no external power is needed.
Step 7: Basic Configuration
Let's try to do something using our device. Here, I will show you how to use the device under the weight measuring mode. Use the "Email Notifier" code, in the attached code files. From this code, the device will automatically send you an email when your supplies are low. I suggest to use this code if you preferred to go shopping by yourself. Before uploading the code, change following things.
SSID and the Password of your WiFi network.
Receiver's email address, subject and the Email body.
Set the login details of your email address in Gsender.h file.
Here, you have to enter the Email address and the password in the base64. Use this Base 64 Converter .
Step 8: Calibration
Now we have to set the threshold values for the device. Let's take a coffee bottle. Keep it on the device and set the switch to calibration mode. You can notice the flashing blue LED. Now reduce the weight of the bottle to set the minimum weight and add weight to the bottle to set the maximum weight. Set the switch to threshold position. Here you can check whether your device is calibrated correctly. If the weight is within the limit, the green bulb flashes and if it's below the limit, the red bulb flashes.
After setting the calibration switch to the off position, the LED will turn off. Now the device is monitoring the weight of your coffee bottle. If the weight is low, the device flashes the red LED and send an email. The LED will remain flashing until you refill the coffee bottle.
Step 9: How It Works
Following video shows how our device works. Sorry for the low video quality.
This is how it works in liquid level detection mode.
Step 10: Finalizing
Though I mentioned this as a home supplies monitor, this can be used in most places including your office, school, workshop etc. Usually, I don't like big devices which are used only for one specific task. Hence, I made this as small as possible to monitor almost your every type of supply. Following are the advantages of this device.
Easy to build - Minimum number of components makes it easy even for non-technical people
Low cost - You can build several devices rather than building just one.
Pocket sized and lightweight - You can carry and setup this anywhere easily.
Battery powered (Optional) - No need to connect lengthy wires to supply power.
Can be used for almost every supply monitoring.
Several Modes available according to user preferences.
Liquid levels can be detected from outside - As you don't want any dirt in your milk or coffee.
Never run out of your supplies again with this handy device.Try to build this and comment here if there are any questions. I'm waiting to help you. Thank you for reading.