Overview:
We began our process hoping to notify the plant owner in some way when and how to care for their plant. Our goal is to translate complex information outputs from the plants to simple light visualizations that humans can easily understand. This smart planter uses an Arduino and various sensors to improve the relationship between plants and their caretakers.
Soil Moisture Sensor— Brightness control
Soil moisture sensor monitors the soil moisture level and notifies the user when the soil is dry and the plant needs to be watered. The sensor directly affects the brightness of the NeoPixel lights. When the soil moisture level drops below a certain level, the sensor will “turn on” the flash function to make the NeoPixel flash. The flashing NeoPixel Light is designed to better capture caretakers attention to remind them to water their plant.
Temperature and Humidity Sensor— Color and light visuals control
The Temperature and Humidity sensor monitors the room temperature and humidity level in the atmosphere. Based on the data input, the sensor then determines the color output of the NeoPixels. In normal room temperature, the Neopixel will display a natural light pattern (yellow-ish). However, it also responds differently when the room temperature is too hot and the Neopixels will display cooler colors ( blue and aqua). If the room is too cold, the Neopixels will display warmer colors (red and orange). This function is designed with the intention that the planter provides visual comforters for the caretaker in an uncomfortable environment. (Too hot or too cold)
Capacitive Sensor— Motion control
The capacitive sensor mainly monitors the proximity of the caretaker to the planter. When the caretaker is close to the planter, the Neopixel light speeds up the current light animation to make it more lively. This function is designed to make the planter truly interactive and bring the plant to life by communicating back to the user and acknowledging the presence of the caretaker.
The Design and Making of the Physical Planter:
The base and shell of dama is made from an Elm tree. The wood was acquired at Second Use, a local salvage shop, and was cut and glued to make a cube. After drying, the cube was rounded to become a cylinder and mounted on a lathe. The interior and exterior were both done on the lathe and was later sanded, cut, and finished. The lights are projected through ¼” cast acrylic that has been sanded to give a cloudy appearance and diffuse the light.
Process Photo:
Planter with all sensor and Arduino installed.
Making the planter
laser cut acrylic
sanding the acrylic
Hero Shot
Hero Shot
Libraries Used:
#include <FastLED.h> // this is the library for LED lights
#include <dht.h> // this is the library for DHT Temperature and Humidity Sensor
#include <CapacitiveSensor.h> // this is the library for Capcitive sensing.
Code:
// this is the set up for the LED
#include <FastLED.h>
#define LED_PIN 6 //digital read number
#define NUM_LEDS 10 // number of LEDS
#define BRIGHTNESS 200 // brightness from 0-256
#define LED_TYPE WS2811
#define COLOR_ORDER GRB
CRGB leds[NUM_LEDS];
#define UPDATES_PER_SECOND 50
CRGBPalette16 currentPalette;
TBlendType currentBlending;
extern CRGBPalette16 myRedWhiteBluePalette;
extern const TProgmemPalette16 myRedWhiteBluePalette_p PROGMEM;
//this the set up is for temperature and humidity sensor
#include <dht.h>
#define dht_apin A0
dht DHT;
// this is the set up is for soil moisture sensor
const int AirValue = 582; //you need to replace this value with Value_1
const int WaterValue = 333; //you need to replace this value with Value_2
int intervals = (AirValue - WaterValue)/3;
int soilMoistureValue = 0;
// this is the set up for cap sensor
#include <CapacitiveSensor.h>
CapacitiveSensor cs_7_8 = CapacitiveSensor(7,8); //10M Resistor between pins x and y
unsigned long csSum;
int speedS = 2;
//-------------------------------------------------------------------------------
void setup() {
Serial.begin(9600); // open serial port, set the baud rate to 9600 bps
delay( 3000 ); // power-up safety delay
FastLED.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
FastLED.setBrightness( BRIGHTNESS );
}
void FillLEDsFromPaletteColors( uint8_t colorIndex)
{
uint8_t brightness = 200;
for( int i = 0; i < NUM_LEDS; i++) {
leds[i] = ColorFromPalette( currentPalette, colorIndex, brightness, currentBlending);
colorIndex += 3;
}
}
//----------------------------------------
void loop() {
//this section is for the LED light
currentBlending = LINEARBLEND; //cause the light to fade.
CRGB yellow = CHSV( 60,255, 255);
//CRGB green = CHSV( HUE_GREEN, 255, 255);
CRGB black = CRGB::Black;
CRGB orange = CHSV(70,255,200);
CRGB red = CHSV(35,255,200);
CRGB redish = CHSV(45,255,200);
CRGB blue = CHSV(130,255,200);
CRGB aqua = CHSV(118,255,200);
//
currentPalette = CRGBPalette16( orange, orange, black, black,
yellow, yellow, black, black,
orange, orange, black, black,
yellow, yellow, black, black );
//declare the sensors
DHT.read11(dht_apin);
soilMoistureValue = analogRead(A1); //put Sensor insert into soil
// this is to check if the sensor works or not
DHT.read11(dht_apin);
// Serial.print(DHT.humidity);
// Serial.print("% ");
// Serial.print( DHT.temperature);
// Serial.println("C ");
// //delay(500);
// for temperature and humidity of the lamp.
if ( DHT.humidity > 75 || DHT.temperature > 30) {
// insert LED color function
currentPalette = CRGBPalette16( blue, blue, black, black,
aqua, aqua, black, black,
blue, blue, black, black,
aqua, aqua, black, black );
static uint8_t startIndex = 0;
startIndex = startIndex + speedS ; /* motion speed */
FillLEDsFromPaletteColors(startIndex);
FastLED.delay(3000/ UPDATES_PER_SECOND);
}
else if (DHT.humidity < 45 || DHT.temperature < 15 ) {
currentPalette = CRGBPalette16( red, red, black, black,
redish, redish, black, black,
red, red, black, black,
redish, redish, black, black );
static uint8_t startIndex = 0;
startIndex = startIndex + speedS; /* motion speed */
FillLEDsFromPaletteColors(startIndex);
FastLED.delay(3000 / UPDATES_PER_SECOND);
}
else {
currentPalette = CRGBPalette16( orange, orange, black, black,
yellow, yellow, black, black,
orange, orange, black, black,
yellow, yellow, black, black );
static uint8_t startIndex = 0;
startIndex = startIndex + speedS; /* motion speed */
FillLEDsFromPaletteColors(startIndex);
FastLED.delay(3000 / UPDATES_PER_SECOND);
}
//for soil misoture sensors
if(soilMoistureValue > WaterValue && soilMoistureValue < (WaterValue + intervals))
{
// This means the plant is VERY WET, so the LED will be really bright for a sec
FastLED.setBrightness(255);
}
else if(soilMoistureValue > (WaterValue + intervals) && soilMoistureValue < (AirValue - intervals))
{
// ths means the soil is Wet, so the LED is normal bright.
FastLED.setBrightness(200);
}
else
{
//This means the soil is DRY, so the LED will flash to reminder the user to water the plant.
FastLED.setBrightness(150);
FastLED.show();
delay(150);
FastLED.setBrightness(50);
FastLED.show();
delay(150);
}
CSread();
FastLED.show();
}
void CSread() {
long cs = cs_7_8.capacitiveSensor(100); //a: Sensor resolution is set to 80
if (cs > 100) { //b: Arbitrary number
csSum += cs;
if (csSum >= 20000) //c: This value is the threshold, a High value means it takes longer to trigger
{
speedS = 12;
//if (csSum > 0) { csSum = 0; } //Reset
//cs_7_8.reset_CS_AutoCal(); //Stops readings
}
} else {
csSum = 0; //Timeout caused by bad readings
speedS = 2;
}
}
//---------------------------------------------------------------
No comments:
Post a Comment