Smart Urban Garden

by Boateng in Circuits > Arduino

1028 Views, 11 Favorites, 0 Comments

Smart Urban Garden

Picture3.jpg
IMG-20240117-WA0047.jpg
SMART URBAN GARDEN
IMG-20240117-WA0092.jpg
IMG-20240117-WA0128.jpg
IMG-20240117-WA0042.jpg
IMG-20240117-WA0146.jpg
Picture4.jpg
Screenshot 2024-03-10 083441.png
Screenshot 2024-05-13 183657.png
Screenshot 2024-05-13 183713.png

This project was developed during my teaching sessions with students, where I voluntarily serve as a STEM and robotics instructor. Together, we built a smart urban garden that monitors key environmental factors like soil moisture, temperature, and light intensity using various sensors. Remote monitoring is achieved through the Arduino Cloud, allowing real-time tracking of garden conditions.

For the design and schematics, we used Tinkercad, an easy-to-use platform ideal for learning electronics and prototyping. The project not only taught students valuable STEM skills but also emphasized sustainability by creating a solution to optimize urban gardening.

project Objective

This project seeks to address a significant challenge in Ghana: the impact of illegal mining on food production. Illegal mining has severely degraded agricultural lands, threatening food security and environmental sustainability. To combat this, our initiative introduces smart urban gardens in cities, empowering residents to engage in sustainable food cultivation. By leveraging modern technology, these urban gardens help mitigate the environmental damage caused by illegal mining, while promoting food security and sustainability. This project aims to restore balance to the environment and empower urban communities to contribute to a healthier future for Ghana.


Integration of Advanced Technologies

   

1. Vertical Cultivation Structure: Our structure maximizes urban gardening efficiency by cleverly using vertical space, increasing crop yields, and adopting resource-efficient practices to reduce the environmental footprint. The design, carefully integrated into urban landscapes, aligns with modern sustainability principles for localized food production, enhancing aesthetic appeal.    

2. Automation System: The Automated Irrigation System is a sophisticated mechanism for precise plant hydration within our Smart Urban Gardening Initiative. Constantly monitoring soil moisture levels, the system activates a pump to commence irrigation when the soil reaches a predetermined dryness threshold. This intelligent approach ensures that our plants receive the optimal amount of water precisely when needed. This technological advancement exemplifies our commitment to efficient and healthy urban gardening practices, showcasing a conscientious use of water resources.    

3. Sustainable Waste Management: In addressing the complex challenge of waste management in urban environments, our project integrates liquid and solid waste recycling. A liquid kitchen waste filtration system ensures responsible handling for sustainable irrigation, while efficient composting repurposes solid kitchen waste into nutrient-rich compost. This dual strategy reflects our commitment to Eco-conscious urban agriculture in our smart initiative, reducing environmental impact, providing a reliable water source, and aligning with public health efforts by minimizing mosquito breeding grounds.

4.Fishpond Integration: Incorporating organic matter from the fishpond, our Smart Urban Gardening initiative maximizes plant growth by leveraging nutrient-rich fish waste as a natural fertilizer. This innovative approach not only enhances soil fertility, promotes beneficial microbial activity, and optimizes root development but also contributes to eco-friendly practices, reducing reliance on synthetic fertilizers and fostering a self-sustaining urban agricultural ecosystem.  

5. Capacitive soil moisture sensor: The capacitive soil moisture sensor plays a crucial role in our Smart Urban Gardening project by providing accurate and real-time data on soil moisture levels. This sensor utilizes the capacitance changes in the soil to determine its moisture content, allowing us to precisely monitor and control irrigation processes. This data-driven approach ensures optimal soil conditions for plant growth, promoting resource-efficient practices and contributing to increased crop yields in our sustainable urban agriculture initiative.

5. Temperature and Humidity Sensor: In the Smart Urban Gardening project, the integration of temperature and humidity sensors is crucial for maintaining optimal environmental conditions necessary for plant growth. The temperature sensor monitors ambient temperature, allowing precise regulation, especially in areas with varying outdoor temperatures. Simultaneously, the humidity sensor assesses and manages air moisture levels, essential for physiological plant processes. Leveraging data from these sensors enables us to implement timely interventions, ensuring consistently favorable conditions for plant growth in ever-changing environments. This dynamic responsiveness contributes to resilient and flourishing crops in our initiative.

6.Grow Light with LDR Sensor: Incorporating cutting-edge technology, our Smart Urban Gardening project features a Grow Light System equipped with an LDR (Light Dependent Resistor) sensor. This innovative system serves a crucial role in maintaining optimal conditions for plant development, particularly during weather fluctuations that may impact natural sunlight availability. The LDR sensor continuously measures the ambient light intensity in the environment. When it detects a decline in sunlight, especially during the seedling stage when plants are most vulnerable, the Grow Light System is activated. This ensures that the plants receive the necessary supplemental light for photosynthesis, promoting robust and healthy growth. By mimicking natural sunlight conditions, our Smart Grow Light System exemplifies our commitment to providing an environment where plants can thrive regardless of external factors. This technology showcases our dedication to leveraging advancements in agriculture for sustainable and efficient urban gardening practices.  

7. Elevator Accessibility: The incorporation of an elevator in our Smart Urban Gardening project is a strategic addition aimed at optimizing efficiency and accessibility within the vertical design of our tall building. This feature ensures convenient access to different levels of the gardening structure, facilitating the management and maintenance of crops, sensors, and other components. By providing easy vertical mobility, the elevator enhances the overall functionality of the system, making it more user-friendly and efficient for both maintenance and harvesting activities in our innovative urban agricultural approach.

8. Smoke Sensor: In the Smart Urban Gardening project, the smoke sensor is seamlessly integrated with an alarm system. This ensures quick response to fire incidents, minimizing potential damage through immediate alerts and intervention. The project prioritizes safety, employing advanced technology to create a secure environment for sustainable urban agriculture.  

9. Motion Sensor: Given the urban setting of our Smart Urban Gardening project, the motion sensor serves a dual purpose. Beyond detecting human intruders, it plays a crucial role in detecting and deterring animals. When activated, the motion sensor triggers alarms, effectively scaring away animals that might pose a threat to the garden. This proactive approach not only safeguards the project but also ensures the well-being of the cultivated crops, contributing to the overall success of the urban gardening initiative.  

10.Water Management: our Smart Urban Gardening initiative is designed to prevent water retention in the soil, ensuring an optimal balance of moisture for ideal plant growth. Through a meticulously engineered outlet system, excess water is efficiently drained, mitigating the risk of waterlogging. This precision in water management not only safeguards against soil overhydration but also maintains the essential moisture levels vital for the health and vigor of cultivated crops. In addition to this, our project incorporates advanced technology to monitor the water level in the irrigation tank, facilitating informed and efficient irrigation practices. This dual approach exemplifies our commitment to promoting a sustainable and thriving urban gardening environment.

11. Emergency Exit: The inclusion of emergency exits in our Smart Urban Gardening project is a paramount safety measure, meticulously designed to provide a secure evacuation route in scenarios such as fire outbreaks or instances of nonfunctional elevators. These exits are strategically positioned to ensure swift and efficient evacuation, enhancing overall safety protocols within the urban gardening facility. By prioritizing the well-being of occupants and personnel, the project aligns with stringent safety standards, demonstrating a commitment to proactive measures for emergency preparedness and response  


Supplies

Materials:

  1. Arduino Uno R4
  2. Soil Moisture Sensor
  3. DHT22 Sensor
  4. LDR (Light Dependent Resistor)
  5. Water Pump
  6. L298N Motor Driver
  7. Relay Module
  8. Red & Blue LED Lights
  9. Solar LED Lights
  10. Ultrasonic Sensor
  11. Jumper Wires
  12. Breadboard
  13. Power Supply (9V or 12V)
  14. PVC Pipe
  15. Water Tubing and Containers
  16. Connecting Wires
  17. Gas sensor

Tools:

  1. Soldering Iron
  2. Multimeter
  3. Screwdrivers
  4. Drilling Machine
  5. Jigsaw Electric Machine
  6. Glue Gun
  7. Glue Sticks

Software:

  1. Tinkercad
  2. Arduino IDE
  3. Arduino Cloud Account

Design & 3D Modeling Using Tinkercad

Screenshot 2024-05-13 181823.png
Screenshot 2024-03-10 083733.png
Screenshot 2024-03-10 084541.png

Creating the PVC Pipe Structure:

  1. We started by selecting the cylinder shape to represent the PVC pipes. We adjusted the dimensions to get the right height and diameter so the plants would have enough space and proper drainage.

Adding Planting Holes:

  1. Next, we added holes for planting. Using the hole function, we created openings along the sides of the cylinders, spacing them evenly. This way, each crop would have its spot to grow.

Designing the Water Delivery System:

  1. After that, we modeled the water delivery tubes using the same cylinder shape. We laid these out parallel to the PVC pipes, making sure they’d deliver water efficiently to all the plants.

Layout and Assembly:

  1. Then we arranged everything together in a way that maximized space. It was important to ensure we could easily access the plants for maintenance, watering, and harvesting.

Finalizing the Design:

  1. Finally, we reviewed the whole design to ensure everything was aligned and functional. We made some tweaks to dimensions and positions to get it just right.

Using the Design for Construction:

  1. Once we were satisfied with the design, we saved our Tinkercad project. This would serve as our visual guide when we built the physical garden.


Building the Smart Urban Garden

IMG-20240105-WA0020.jpg
IMG-20230711-WA0037.jpg
IMG-20240111-WA0038.jpg
IMG-20240107-WA0024.jpg
IMG-20230709-WA0048.jpg
IMG-20240111-WA0032.jpg
IMG-20240111-WA0035.jpg
WhatsApp Image 2024-01-08 at 15.18.00_fd6b465c.jpg
IMG-20240111-WA0033.jpg
IMG-20240111-WA0046.jpg

Now that we had our design ready in Tinkercad, it was time to bring the Smart Urban Garden to life using wood and locoboard. Here’s how we went about it:

  1. Gathering Materials:
  2. We collected all the necessary materials, including wood for the frame, locoboard for the planting structure, and PVC pipes for the water delivery system. We also made sure to have all the tools ready, like the jigsaw, drilling machine, and glue gun.
  3. Constructing the Frame:
  4. We started by cutting the wood into appropriate lengths to create a sturdy frame. This frame would support the entire garden structure, ensuring it was stable and durable. We used screws and wood glue to secure the joints for extra strength.
  5. Covering the Pillars:
  6. To enhance the overall appearance and provide a better finish, we used locoboard to cover the pillars in the structure. This not only made the garden look more polished but also added an extra layer of durability.
  7. Assembling the Planting Structure:
  8. Next, we moved on to the locoboard. We cut the locoboard into sections that matched our Tinkercad design, ensuring we had enough space for all the planting holes.
  9. We then attached these sections to the wooden frame, creating a solid base for the PVC pipes.
  10. Installing the PVC Pipes:
  11. With the base ready, we positioned the PVC pipes as per our design. We made sure they were securely fixed to the loco-board and that the planting holes were aligned properly for easy access.
  12. We used connectors to join the PVC pipes where necessary, ensuring a continuous flow for the water delivery system.
  13. Setting Up the Water Delivery System:
  14. After the PVC pipes were in place, we connected the water delivery tubes. We ensured they were laid out in a way that would evenly distribute water to all the planting holes.
  15. Final Touches:
  16. Finally, we checked all connections, ensuring everything was secure and functional. We also made any adjustments needed to align with our initial design.
  17. Testing the System:
  18. Before we officially called it done, we ran a quick test of the water delivery system. This was crucial to ensure everything worked as intended and that water was reaching all the plants.


Building the Elevator for Vertical Farming

IMG_20230801_185742.jpg

Recognizing the need to optimize space and promote efficient farming, we decided to implement a vertical farming system in our Smart Urban Garden. To facilitate this, we constructed an elevator system to easily access different planting levels. Here’s how we approached it:

  1. Designing the Elevator:
  2. We started by sketching a design for the elevator that would allow us to transport plants and materials between different levels of the garden. The elevator needed to be compact yet sturdy enough to handle the weight of soil and plants.
  3. Gathering Materials:
  4. We collected the necessary materials, which included:
  5. A strong pulley system for lifting.
  6. Wooden boards for the elevator platform.
  7. Metal brackets for added support.
  8. Rope or strong cables for the lifting mechanism.
  9. Ultrasonic sensor for floor detection.
  10. Push buttons for floor selection.
  11. Constructing the Elevator Frame:
  12. We built a frame using wood to support the elevator. This frame was designed to fit within the vertical space of the garden, allowing for smooth operation as the elevator moved up and down.
  13. Building the Elevator Platform:
  14. Next, we created the elevator platform using wooden boards, ensuring it was large enough to hold multiple pots of plants or gardening tools. We reinforced the platform with metal brackets to enhance its stability.
  15. Installing the Pulley System:
  16. We installed a pulley system at the top of the elevator shaft. This was crucial for lifting the platform smoothly and safely. We carefully threaded the rope through the pulleys, ensuring everything was properly aligned to minimize friction.
  17. Integrating the Ultrasonic Sensor:
  18. To detect the floors accurately, we installed an ultrasonic sensor at the top of the elevator. This sensor allowed us to measure the distance from the elevator to each floor, ensuring precise stopping and preventing overshooting.
  19. Adding Push Buttons:
  20. We installed buttons at each floor and on the elevator platform itself. These buttons were designed to signal the elevator to move to the selected floor. Each button was connected to the Arduino for easy control.
  21. Connecting the Elevator to the Frame:
  22. The elevator platform was attached to the frame with hooks that allowed it to move up and down freely. We ensured that the connection points were secure to prevent any wobbling during operation.
  23. Testing the Elevator:
  24. After assembling the elevator, we conducted several test runs to ensure it operated smoothly. We loaded the platform with weight to simulate real use and checked for any issues during movement.
  25. Final Adjustments:
  26. Based on the test runs, we made any necessary adjustments to improve the elevator's functionality. This included tightening connections, ensuring smooth pulley movement, and refining the lifting mechanism.


Connecting Various Sensors to the Arduino Uno R4

IMG_2613.jpeg
IMG-20240117-WA0124.jpg
  1. Gathering Required Components:
  2. DHT22 Sensor: For monitoring temperature and humidity.
  3. Ultrasonic Sensor: To detect the distance between the elevator and the floors.
  4. Soil Moisture Sensor: To check the moisture level in the planting pots.
  5. Light Sensor (LDR): To monitor ambient light levels.
  6. Motion Sensor (PIR): To detect movement around the garden.
  7. Gas Sensor ( MQ-7): To monitor gas levels (such as methane and propane) in the environment.
  8. LCD Display (20x4): To show real-time data from the sensors.
  9. Additionally, we ensured we had enough connection wires and jumper cables for all the connections.
  10. Preparing the Arduino Uno R4:
  11. We placed the Arduino Uno R4 on a stable surface, ensuring easy access to its pins for wiring.
  12. Connecting the DHT22 Sensor:
  13. VCC Pin: Connected to the 5V pin on the Arduino.
  14. GND Pin: Connected to the GND pin on the Arduino.
  15. DATA Pin: Connected to Digital Pin 2 on the Arduino.
  16. We made sure the connections were secure to prevent any disconnections during operation.
  17. Connecting the Ultrasonic Sensor:
  18. VCC Pin: Connected to the 5V pin on the Arduino.
  19. GND Pin: Connected to the GND pin on the Arduino.
  20. Trig Pin: Connected to Digital Pin 3 on the Arduino.
  21. Echo Pin: Connected to Digital Pin 4 on the Arduino.
  22. We ensured the ultrasonic sensor was placed in a position where it could accurately detect the elevator’s height.
  23. Connecting the Soil Moisture Sensor:
  24. VCC Pin: Connected to the 5V pin on the Arduino.
  25. GND Pin: Connected to the GND pin on the Arduino.
  26. Analog Output Pin: Connected to Analog Pin A0 on the Arduino.
  27. This sensor was placed in the soil to provide real-time moisture readings.
  28. Connecting the Light Sensor (LDR):
  29. One Terminal: Connected to 5V.
  30. Other Terminal: Connected to Analog Pin A1 and also connected to a resistor that goes to GND.
  31. This configuration allowed us to measure the light intensity in the garden.
  32. Connecting the Motion Sensor (PIR):
  33. VCC Pin: Connected to the 5V pin on the Arduino.
  34. GND Pin: Connected to the GND pin on the Arduino.
  35. OUT Pin: Connected to Digital Pin 5 on the Arduino.
  36. The motion sensor was positioned to monitor the area around the garden for any movement.
  37. Connecting the Gas Sensor:
  38. VCC Pin: Connected to the 5V pin on the Arduino.
  39. GND Pin: Connected to the GND pin on the Arduino.
  40. Analog Output Pin: Connected to Analog Pin A2 on the Arduino.
  41. The gas sensor was installed in a location where it could detect any harmful gases that might affect the plants or environment.

9.Connecting the LCD Display with I2C Module:

  1. VCC Pin: Connected to the 5V pin on the Arduino.
  2. GND Pin: Connected to the GND pin on the Arduino.
  3. SDA Pin: Connected to Analog Pin A4 on the Arduino.
  4. SCL Pin: Connected to Analog Pin A5 on the Arduino.


10.Checking Connections:

  1. After all sensors were connected, we double-checked each connection to ensure there were no loose wires or incorrect placements.
  2. We labeled the wires if necessary to keep track of connections for troubleshooting in the future.

11.Testing the Sensors:

  1. We uploaded a basic sketch to the Arduino to read values from each sensor. This allowed us to verify that each sensor was functioning correctly and providing accurate data.

With all sensors successfully connected to the Arduino Uno R4, we enabled our Smart Urban Garden to collect essential environmental data, facilitating better decision-making for plant care and resource management!

Setting Up Arduino IoT Cloud for IoT Monitoring

Screenshot 2024-05-12 225245.png
Screenshot 2024-05-12 204444.png
Screenshot 2024-05-12 224336.png
Screenshot 2024-05-12 224350.png
Screenshot 2024-05-12 224405.png
Screenshot 2024-05-12 224452.png
  1. Creating an Arduino IoT Cloud Account:
  2. We started by visiting the Arduino IoT Cloud website and creating an account if we didn’t already have one. This involved providing a valid email address and setting up a password.
  3. Creating a New Thing:
  4. Once logged in, we clicked on “Create a Thing” to set up a new project. We named it “Smart Urban Garden” for easy identification.
  5. Adding Variables:
  6. In the Thing’s dashboard, we defined the variables we wanted to monitor:
  7. Temperature: For readings from the DHT22 sensor.
  8. Humidity: For readings from the DHT22 sensor.
  9. Soil Moisture: For readings from the soil moisture sensor.
  10. Light Intensity: For readings from the light sensor (LDR).
  11. Grow Light Status: To monitor whether the grow light is on or off.
  12. Sun Intensity: For readings from the sensor measuring sunlight.
  13. Pump Status: To indicate whether the irrigation pump is active or not.

We ensured the appropriate data types were set for each variable, such as float for temperature, humidity, soil moisture, light intensity, and sun intensity, and boolean for grow light status and pump status.

  1. Generating the Arduino Cloud Sketch:
  2. After adding the variables, things properties code were generated which provided us with a basic sketch that included necessary library imports and setup functions for our defined variables.
  3. Connecting the Arduino Uno R4:
  4. We opened the generated sketch .
  5. We installed any required libraries as prompted , ensuring compatibility with the Arduino IoT Cloud.
  6. Uploading the Code:
  7. We replaced the placeholder values in the sketch with our specific Wi-Fi credentials (SSID and password) to allow the Arduino to connect to the internet.
  8. We uploaded the code to the Arduino Uno R4. Once uploaded, the board connected to the Arduino IoT Cloud.
  9. Monitoring Data:
  10. After successfully uploading the code, we returned to the Arduino IoT Cloud dashboard.
  11. We opened the “Monitor” section for our Thing to view real-time data from the connected sensors. We could see the readings updating as the sensors detected changes in their respective environments.
  12. Creating a Dashboard:
  13. We proceeded to create a custom dashboard to visualize the sensor data. We added widgets for each variable, such as graphs for temperature, humidity, soil moisture, light intensity, and sun intensity, as well as status indicators for the grow light and pump.
  14. This dashboard allowed us to monitor the health and status of our Smart Urban Garden from anywhere using our mobile devices or computers.

With the Arduino IoT Cloud set up, we enabled seamless remote monitoring of our urban garden, allowing for timely interventions based on real-time data and enhancing our overall gardening efficiency!

Conclusion

IMG-20231013-WA0005.jpg
IMG-20231013-WA0013.jpg
IMG-20240117-WA0125.jpg
IMG-20240117-WA0126.jpg
IMG-20231114-WA0052.jpg
IMG-20240117-WA0141.jpg
IMG-20240117-WA0143.jpg
IMG-20240117-WA0144.jpg

The Smart Urban Garden project successfully combines innovative design with technology to address the challenges of urban food production. By utilizing Arduino IoT Cloud, we have created a robust monitoring system that tracks essential environmental parameters, including temperature, humidity, soil moisture, light intensity, and sun intensity. The integration of sensors and a user-friendly dashboard allows us to make informed decisions and optimize growing conditions for our crops.

Furthermore, the project's vertical farming approach not only maximizes space but also contributes to sustainable practices in urban agriculture. This initiative not only empowers urban residents to engage in food cultivation but also promotes environmental consciousness by demonstrating the potential of technology in agriculture. Through this project, we hope to inspire others to explore sustainable solutions and contribute to a healthier, greener future for our communities.