270r Final Project
Proposal
Automated Indoor Garden - Raspberry Pi and Arduino
Overview
The goal of this project is to create an automated plant growing system. My project will contain six parts:
- Part One: I will connect the 64-LED matrix to the Arduino and program it to make it display the leaf logo.
- Part Two: Connect the temperature and humidity sensor to the Arduino using i2c communication.
- Part Three: Have the results of the sensor display on the LED-matrix.
- Part Four: Connect and communicate to the Analytical Surver Electrode, which is a Ph sensor, and the salinity sensor, which a friend created.
- Part Five: Display on the LED-matrix on a web page or Twitter through the Raspberry Pi.
- Part Six: Control a motor that dispenses water. (Unlikely, but would love to do this.)
My Plan
- Gather the necessary materials.
- Connect 64-LED matrix and write a sketch to control it.
- Learn i2c
- Link Raspberry Pi to Arduino
- Find the ids for the sensors for i2c
- Document progress by taking photos/videos and updating the wiki page.
The Project
Materials
- Raspberry Pi
- Arduino Mega 2560
- 64-LED Matrix display
- temperature and humidity sensor
- Ph sensor
- Salinity sensor
- Breadboard
- Wires
- ...
Part One: 64-LED Matrix
Implemented leaf logo on the 8x8 Matrix controlled by the Arduino. The sketch (program to control the Arduino) and a photo are below.
Here is the Fritzing Diagram:
Code
// LeafMatrix
// Wendy Joy
// Uses an Arduino to display a leaf graphic on an 8x8 Matrix
#include <LedControl.h>
int DIN 12;
int CS = 11;
int CLK = 10;
byte leaf[8] = {0x3B, 0x7C, 0xF6, 0xEE, 0xDE, 0xBC, 0xF8, 0x80};
LedControl lc=LedControl(DIN, CLK, CS, 0);
void setup() {
lc.shutdown (0, false);
lc.setIntensity (0, 15);
lc.clearDisplay(0);
}
void loop() {
printByte (leaf);
}
Part Two: Adding Temperature and Humidity Sensor
Implemented i2c where a Raspberry Pi is master and an Arduino is slave. The sketch (Arduino slave code) and Raspberry Pi code are below.
Part Three: Display Sensor on 64-LED
Part Four: Adding Ph and Salinity Sensors
Part Five: Output Web/Twitter and the 8x8 Matrix
Part Six: Water Dispensing
Progress Log
April 26th 2020: Implemented leaf logo on the 8x8 Matrix controlled by the Arduino.