Wi-fi Soil Moisture Sensor with ESPHome
2 min read
8 months ago
Published on Apr 21, 2024
This response is partially generated with the help of AI. It may contain inaccuracies.
Table of Contents
How to Make a Wi-Fi Soil Moisture Sensor with ESPHome
Materials Needed:
- ESP8266 or ESP32 microcontroller
- Capacitive soil moisture sensor
- Battery
- 3D printed enclosure
- Silicone
- Two-part epoxy
- Hot glue gun
- Home Assistant
Step 1: Design and 3D Print Enclosure
- Design a suitable enclosure using Fusion 3D software.
- 3D print the enclosure ensuring it fits all components securely.
Step 2: Calibrate Soil Moisture Sensor
- Connect the soil moisture sensor to the microcontroller.
- Calibrate the sensor by mapping the correct voltages between zero and 100.
- Test the sensor to ensure accurate readings.
Step 3: Assemble the Components
- Wire the battery with a voltage divider to measure battery voltage.
- Connect the sensor pins to the microcontroller.
- Secure all components inside the enclosure.
Step 4: Waterproofing
- Apply silicone around the top of the enclosure to create a gasket.
- Smooth out the silicone with a guitar pick for a better seal.
- Use two-part epoxy to secure the sensor into the bottom of the enclosure for waterproofing.
Step 5: Final Assembly
- Seal the enclosure tightly.
- Use hot glue to secure the internals in place.
- Ensure all components are securely in place before testing.
Step 6: Programming with ESPHome
- Set up Home Assistant with ESPHome integration.
- Configure the soil moisture sensor with the correct settings:
- Device class: moisture
- Unit of measurement: percentage
- Attenuation: 11
- Linear mapping: 0% at 1.45 volts, 100% at 2.821 volts
- Use the calibrate linear function to map the values accurately.
Step 7: Additional Settings
- Set up a sleep schedule for the sensor to conserve battery life.
- Monitor the battery voltage output for maintenance.
- Ensure the sensor updates regularly to keep track of soil moisture levels.
Step 8: Testing and Monitoring
- Install the sensor in the pot or plant that requires monitoring.
- Check the readings in Home Assistant to ensure the sensor is working correctly.
- Make adjustments as needed to improve accuracy.
By following these steps, you can create a Wi-Fi soil moisture sensor using ESPHome and monitor your plants' hydration levels effectively.