HabiBot V1.0

HabiBot v1.0 is a simple, compact environmental sensor system powered by Arduino. It is designed to measure soil moisture, air temperature, humidity, and sound detection. It could be used by gardeners, Arduino tinkerers, or environmental science students to monitor basic ecological conditions and expand their Arduino skills.
I think what makes this project special is the interaction between users and between different components of the circuit:
- A membrane keypad module for user control and interaction
- An LCD for real-time sensor readings
- A potentiometer to change the contrast of the LCD screen
- Normal and RGB LEDS for visual feedback based on sensor thresholds
- A power module to allow the system to survive without a power supply from a laptop
Supplies













All the components needed for this project are listed below. Optional components will be bold
- Arduino board (recommended Arduino Mega 2560 for more pin spaces, as we have a lot of components to connect)
- DHT11 sensor (Both 3 and 4 pins are fine, but in this cas,e I use 4 pins because it's cheaper)
- Soil moisture sensor with amplifier
- Sound level sensor
- LCD screen (if your LCD has an I2C module, it will require less wiring; if not, it's fine. In this case, I useone without an I2C because it's cheaper)
- Power module
- Red LED and 2 RGB LEDs
- 8 of 220 Ω resistors
- 10k potentiometer
- 39 Male-to-male jumper wires (around that number, depends on how you wiring)
- 10 Female-to-male jumper wires or (6 Female-to-Female jumper wires)
- Breadboard
LCD and Potentiometer Wiring (for LCD Without I2C)


The table above provides the LCD wiring. As you can see, we have 2 LCD pins that need to connect to a 5V source (VDD and A) and 2 LCD pins for the GND source (VSS and K). Most Arduino boards only have one 5V source and 2–3 GND sources. In our case, many other components also need to use a 5V source and GND. Therefore, for every connection to the 5V source, we will connect to the positive (+) rail of the breadboard, and connections to the GND source will be connected to the negative (–) rail of the breadboard.
- You also have to download the library LiquidCrystal.h from Arduino in order to be able to program this component.
The reason I chose pins 22 to 27 for (RS, E, D4–D7) is that I want the LCD wiring to be in the same section on the Arduino Mega board for easier debugging later (if the system does not work). You can assign them to any digital pins you like, but remember to update them in the code (I provide the code in the final section).
For the potentiometer, the upper leg will be connected to V0, and the two lower legs—one will be connected to the positive rail and the other to the negative rail. You can see from the figure.
Connect Power Module


The purpose of a power module in Arduino projects is to provide a stable external power supply to your circuit when you're not using USB power from a computer. However, there is a big note. In the picture above, the way the module places on breadboard makes you feel that both sides (+ and - on each side) of the breadboard will have power from the module. However, it is not the case. Only the bottom side (where it has black port) will be provided with power. If you want the upside to be powered, you must have 2 wires connect the + from left side to the + from right side (same thing with - rail).
You can see in the wiring picture, I have red jumper wire goes from + rail from 1 end to the other end. Same thing with - rail.
Temperature and Humidity Sensor Wiring (DHT11 Sensor)

I include the picture above the wiring diagram for both the 3 pins and 4 pins DHT11 sensor. Remember:
- In order to be able to program with this sensor, you have to download DHT.h library from Arduino
- For VCC and GND, I just connect to the (+) and (-) rail of the breadboard.
- For Data pin, in this case, I connect to Digital pin 12 on Arduino Mega. You can connect to any Digital pin you want, just remember to update the code in the section below.
Soil Moisture Sensor Wiring


If you have Female-to-Female jumper wires, you only need 6 of them and it will make your life much easier. For soil moisture, the order of the 2 pins go to the 2-pin side of the amplifier does not matter that much. However, for an amplifier, the wiring diagram is below:
- A0 can be connected to A0 pin on Arduino Mega.
- D0 can be connected to Digital pin 8 on Arduino Mega.
- VCC and GND can be connected to the (+) and (-) rail of the breadboard.
If you don't have Female-to-Female jumper wires, you can use Female-to-Male jumper wires and connect them like in the 2nd pic of this step.
Sound Sensor Wiring

I include the picture above the wiring diagram for Sound sensor. Remember:
- For VCC and GND, I just connect to the (+) and (-) rail of the breadboard.
- For D0 pin, in this case, I connect to Digital pin 3 on Arduino Mega. You can connect to any Digital pin you want, just remember to update the code in the section below.
- For A0 pin, I connect to A8 pin on Arduino Mega.
Before using the sound sensor properly, you have to use a small screwdriver to twist the yellow small screw and keep talking near the sensor until you see it blink whenever you talk to the microphone. Use the test code attached in this step to test your sensor
Downloads
LED Wiring and RGB LED Wiring




Above is the wiring table for 2 RGB and a Red LEDs. You can definitely change the pins to your convenience. Just remember to adjust that in the code for the below section.
- 1 RGB LED will be used for DHT11 sensor threshold. The other will be used for soil moisture sensor threshold.
- The Red LED
- As you can see, I tried to put all the LEDs to one side of the board just to make it easier for user to see the threshold signal.
- Remember, every signal leg of LED (like leg that code for color), you have to connect with 220 Ω resistor before go to Arduino board
Keypad Module Wiring


This is the membrane keyboard I used for this project. The wiring diagram is above, you can refer to that to determine the position of digital pins for the component. It does not matter that much but you have to change it in the code in step 8. The component has 8 pins connection in total from 1-8
- Pin 1 to Digital pin 31
- Pin 2 to Digital pin 33
- Pin 3 to Digital pin 35
- Pin 4 to Digital pin 37
- Pin 5 to Digital pin 39
- Pin 6 to Digital pin 41
- Pin 7 to Digital pin 43
- Pin 8 to Digital pin 45
Code
Below is the code for the circuit. It divides into clear section for each component of the system. Remember to change the pins no if you end up wiring different.
- I already have the code to include the libraries necessary for each component already in the code but you still have to download libraries.
Downloads
Testing and Finalizing

Here is the picture of the completed circuit system. The video below is the testing of that system. As you can see:
- The keypad will allow to switch from soil moisture to temperature and humidity reading if you press 2 (press 1 to switch back to soil reading).
- Both the RGB LEDs will change colors if the soil moisture sensor and temperature/ humidity sensor readings exceed certain value (as predefined in the code).
- The red LED will blink whenever you speak to the speaker of sound sensor.