Day 20: Automated Grow Lights

As part of the ongoing efforts to maintain the oxygen factories inside the Nebula Raider, it is essential to ensure that the plants receive adequate light for photosynthesis and have sufficient water. As a cadet, you are tasked with building an automated grow light system that adjusts the lighting based on the ambient light levels and monitors the water level. This system will help maintain optimal growing conditions for the plants, contributing to the crew’s oxygen supply.

Components Needed:

  • Raspberry Pi Pico WH Microcontroller
  • LDR (Light Dependent Resistor)
  • Water Level Sensor
  • SRD-05VDC-SL-C Power Relay
  • Grow light (or any suitable LED light)
  • Resistors
  • Breadboard
  • Jumper wires

Instructions:

Set Up the Circuit:

  1. Connect the LDR to an analog input pin on the Raspberry Pi Pico (e.g., GP26) using a voltage divider with a resistor.
  2. Connect the Water Level Sensor to another analog input pin on the Raspberry Pi Pico (e.g., GP27).
  3. Connect the relay module to a GPIO pin on the Raspberry Pi Pico (e.g., GP2) to control the grow light.
  4. Connect the grow light to the relay module, ensuring that the relay can safely handle the voltage and current required by the grow light.
  5. Use jumper wires to make all necessary connections on the breadboard, ensuring a secure and organized setup.

Write the Code:

Open your coding environment and write the following Python code to create the automated grow light and water level monitoring system:

Test the System:

  1. Upload the code to the Raspberry Pi Pico and run it.
  2. Test the LDR by varying the ambient light conditions and observing the light level readings.
  3. Test the water level sensor by inserting it into different water levels (low, medium, high) and observing the readings.
  4. Ensure the relay correctly turns the grow light on and off based on the ambient light levels.

Learning Outcomes:

  • Sensor Integration: Learn how to connect and use an LDR and water level sensor with the Raspberry Pi Pico to measure ambient light and water levels.
  • Automated Control: Understand how to automate the control of grow lights using a relay and light sensor.
  • Microcontroller Programming: Develop skills in writing code to integrate sensors and control output devices.

Extension Ideas:

  • Adjustable Threshold: Add buttons to allow the user to adjust the light level threshold for turning the grow lights on and off.
  • Data Logging: Implement data logging to record the light levels and grow light activity over time.
  • Remote Monitoring: Create a web interface to remotely monitor and control the grow lights and water levels.

By completing this project, you will have built an automated grow light and water monitoring system that ensures plants receive the optimal amount of light and water for healthy growth. This system will help maintain the oxygen factories inside the Nebula Raider, contributing to the crew’s well-being.

Post a comment

Leave a Comment

Your email address will not be published. Required fields are marked *