GithubHelp home page GithubHelp logo

charithmadhuranga / automated-hydroponics Goto Github PK

View Code? Open in Web Editor NEW

This project forked from petcupaula/automated-hydroponics

0.0 0.0 0.0 3.26 MB

Automated home garden using hydroponics concepts

C++ 77.72% Python 22.28%

automated-hydroponics's Introduction

automated-hydroponics

Automated home garden using hydroponics concepts

Components

Schematics

Schematics

RPi setup

# Choose Menu > Preferences > Raspberry Pi Configuration
#>> Change pi password
#>> Change hostname to what you would like your RPi to be named.
#>> Enable SSH and VNC
# (A reboot will be needed after these changes)

# Camera setup
# RPi camera setup instructions: https://www.raspberrypi.org/documentation/configuration/camera.md

# Install a web interface for controlling the camera and doing timelapses
# Install instructions: https://elinux.org/RPi-Cam-Web-Interface

# Check to see if Arduino is seen
Should see /dev/ttyACM0
ls /dev/tty*

# Install Arduino IDE on RPi, though optional
sudo apt-get install arduino

# Install Arduino CLI
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=/usr/local/bin sh
# Might need to fiddle a bit on where it is installed

arduino-cli core update-index
arduino-cli board list

# Install platform core for board Arduino Uno/Mega
arduino-cli core install arduino:avr

# Clone this project
cd ~
git clone https://github.com/petcupaula/automated-hydroponics.git

# Install Arduino libraries
# You can search for libraries using: arduino-cli lib search DHT
arduino-cli lib install "DHT sensor library"
arduino-cli lib install "Adafruit AS7341"
arduino-cli lib install "OneWire"
# Libraries to be installed from zip files - files will go into  /home/pi/Arduino/libraries/
cd /home/pi/Arduino/libraries/
git clone https://github.com/DFRobot/GravityTDS.git

# Test compile and upload from cmd line:
cd ~/automated_hydroponics
arduino-cli compile --fqbn arduino:avr:uno arduino_hydroponics/arduino_hydroponics.ino 
arduino-cli upload -p /dev/ttyACM0 --fqbn arduino:avr:uno arduino_hydroponics

# To communicate between Arduino and Raspberry Pi via serial, there are 
# three scripts that can be used

# The `arduino_com.py` sends a message via serial to the Arduino, which in turn returns sensor data
python3 arduino_com.py

# The `mqtt_client.py` is an enhanced version of that, but sends the data to an MQTT broker. 
# (Note: certificates will be required that are not included in this repo)
# Path to certificates can be added in config.py (see config_template.py for what is expected)
python3 mqtt_client.py

# Install Adafruit IO for sending and receiving data from Adafruit IO's MQTT broker
sudo pip3 install adafruit-io
# To communicate with Adafruit IO, and subscribe to the `hydroponics feed`
python3 aio_client.py

# To ensure the aio_client.py (or mqtt_client.py) are run at Raspberry Pi reboot:
sudo nano /etc/rc.local
# Add the following line before the exit:
sudo bash -c '/usr/bin/python3 /home/pi/automated-hydroponics/aio_client.py > /home/pi/Desktop/log.txt 2>&1' &
# Test it by restarting the Raspberry Pi:
sudo reboot
# And after reconnecting check that the python script is running:
ps aux | grep python

# That is it.

Dashboard and command center

Example created in Adafruit IO:

AIO_dash

automated-hydroponics's People

Contributors

petcupaula avatar troels avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.