Skip to content

JMTamayo/oasis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Oasis 🪴

Because your plants deserve better than 'oops, I forgot to water you'

This prototype allows monitoring of plant humidity, temperature and relative air humidity. It was developed as a hobby, applying knowledge of circuits, microcontrollers, sensors, actuators and software development.

The microcontroller publishes the measured values to an MQTT server, which can be accessed from a web interface, mobile app, desktop app or any other device that supports MQTT. The values are published as follows:

  • Schema: /oasis/<device-id>/<topic>
  • Topics:
    • air-temperature: Air temperature [°C].
    • air-humidity: Air humidity [%].
    • soil-moisture-1: Soil moisture [%: 0% (wet) - 100% (dry)].
    • soil-moisture-2: Soil moisture [%: 0% (wet) - 100% (dry)].
    • average-soil-moisture: Average soil moisture [%: 0% (wet) - 100% (dry)], calculated as the average of the two sensors.
    • geolocation: Geolocation of the device, obtained from the network access point [JSON format].
    • error: Error message, published when the microcontroller fails to read the sensors [String].

The device can be controlled by sending the following commands to the MQTT server:

  • Schema: /oasis/<device-id>/<command>
  • Commands:
    • ping: Ping the device, the response is a pong message.
    • restart-device: Restart the device.
    • set-sampling-time: Set the sampling time [ms].
    • get-sampling-time: Get the sampling time [ms].
    • set-measurements-publication-time: Set the measurements publication time [ms].
    • get-measurements-publication-time: Get the measurements publication time [ms].
    • get-pending-time-for-measurements-publication: Get the pending time for measurements publication [ms].

Prototype

Prototype
Figure 1. Oasis prototype, featuring sensors and a display for plant monitoring..

⚙️ Hardware:

The prototype is composed by the following hardware elements:

  • DEVKIT-ESP32-30PIN-CH340: Development board for ESP32 with 30 pins and integrated WiFi module (1 UND).
  • DHT22-ECO: Temperature and humidity sensor (1 UND).
  • SEN0193: A capacitive soil moisture sensor (2 UND).
  • SR602: Infrared motion sensor (1 UND).
  • OLED-0.96-AM-AZ-SSD1306: Display for plant monitoring (1 UND).
  • S-10-5: With a 5V output and a 2A maximum current capacity (1 UND).
  • RP-220R/1/4W: 220Ω 1/4W Precision Resistor (1 UND).
  • BOB-12009: Bidirectional Logic Level Converter (1 UND).
  • LED-5-B-D: Diffused LED for standard lighting or indication applications (1 UND).
  • CA-PODER: 1.5m Round Power Cable (1 UND).
  • PCB-BOARD: PCB board for the prototype (1 UND).
  • Cables and connectors for circuit assembly.
  • Wooden board 20cm x 20cm and screws for fixing the elements.

💻 Software:

The software was developed using the following tools:

  • Cursor IDE: A powerful AI-powered code editor.
  • PlatformIO: Cross-platform build system for embedded system projects.
  • C++: Programming language for the firmware.

The firmware was developed using the microcontroller's two cores. The first core manages the connection to the Wi-Fi service and the MQTT server, and obtains geolocation information from the network access point. The second core reads sensor data and displays the values ​​on the integrated display. The two cores communicate using a task queuing system.

When a message is received from the MQTT server on any of the subscribed topics, the integrated LED flashes to indicate that the device is receiving messages correctly.

The integrated display shows the status of the Wi-Fi and MQTT server connections, as well as the values ​​measured by the sensors, whose sampling time can be adjusted. If the motion sensor does not detect movement, the display will turn off to save power. When it detects movement, it automatically turns on.

⚡ Electrical Design:

The prototype schematic is shown in the following figure. It was designed using Autodesk Fusion 360 software with a student license.

Schematic
Figure 2. Schematic diagram of the prototype's electrical circuit.

Contributing

We welcome contributions to this project. Here are some ways you can contribute:

  • 🐛 Bug Reports: If you find a bug, please create an issue detailing the problem, the steps to reproduce it, and the expected behavior.
  • 💡 Feature Requests: If you have an idea for a new feature or an enhancement to an existing one, please create an issue describing your idea.
  • 🚀 Pull Requests: If you've fixed a bug or implemented a new feature, we'd love to see your work! Please submit a pull request. Make sure your code follows the existing style and all tests pass.
  • 💬 Recommendations: If you have any recommendations for improvements, please share them in the issues section.

Thank you for your interest in improving Oasis! 🌱💛

About

Oasis: Because your plants deserve better than 'oops, I forgot to water you'.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors