See More Rays

Helping plants see the light.

BeginnerShowcase (no instructions)13 hours338
See More Rays

Things used in this project

Hardware components

Seeed - Grove - Moisture Sensor
×1
Grove - Light Sensor
Seeed Grove - Light Sensor
×1
Grove Starter Kit for LaunchPad
Seeed Grove Starter Kit for LaunchPad
×1
Seeed- Grove Base Booster Pack
×1
EK-TM4C123GXL TM4C Tiva LaunchPad
Texas Instruments EK-TM4C123GXL TM4C Tiva LaunchPad
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
High Brightness LED, White
High Brightness LED, White
×1

Software apps and online services

Energia
Texas Instruments Energia
tinkercad

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)

Story

Read more

Custom parts and enclosures

Box

CAD file to 3D print box

Schematics

Main circuitry

Grove modules

The Grove light sensor and moisture sensor modules were connected to a Booster Pack that was then connected to the Launchpad. However, Fritzing doesn't support the Booster Pack, so this schematic is just of the Grove modules we used.

Code

ledBlink

C/C++
Main code to change respective LED according to light/moisture level
// ledBlink - main code for See More Rays

// Define pin numbers for each LED
// 1 is moisture (LED farther from launchpad)
// 2 is light (LED close to launchpad)

// Red is too low, green is optimal

// Define pins
#define RED1 17 
#define GREEN1 15 
#define BLUE1 14 

#define RED2 19 
#define GREEN2 18 
#define BLUE2 11 

// Grove module pins
int sensorPinMoisture = 23; //J5
int sensorPinLight = 26; //J8
int sensorValueMoisture = 0;
int sensorValueLight = 0;


void setup() {
 // Initialization for LEDs
 pinMode(RED1, OUTPUT);
 pinMode(GREEN1, OUTPUT);
 pinMode(BLUE1, OUTPUT);

 pinMode(RED2, OUTPUT);
 pinMode(GREEN2, OUTPUT);
 pinMode(BLUE2, OUTPUT);
 
 digitalWrite(RED1, HIGH);
 digitalWrite(GREEN1, HIGH);
 digitalWrite(BLUE1, HIGH);

 digitalWrite(RED2, HIGH);
 digitalWrite(GREEN2, HIGH);
 digitalWrite(BLUE2, HIGH);
}


void loop() {  
  // Get readings
  sensorValueMoisture = analogRead(sensorPinMoisture);
  sensorValueLight = analogRead(sensorPinLight);

  // Check moisture
  if(sensorValueMoisture < 1620) {
   // Turn on Red1
   digitalWrite(RED1, LOW);
   digitalWrite(GREEN1, HIGH);
   digitalWrite(BLUE1, HIGH);
  } else {
   // Turn on Green1
   digitalWrite(RED1, HIGH);
   digitalWrite(GREEN1, LOW);
   digitalWrite(BLUE1, HIGH);
  }
  
  // Check light
  if(sensorValueLight < 2000) {
    // Turn on Red2
   digitalWrite(RED2, LOW);
   digitalWrite(GREEN2, HIGH);
   digitalWrite(BLUE2, HIGH);
  } else {
    // Turn on Green2
   digitalWrite(RED2, HIGH);
   digitalWrite(GREEN2, LOW);
   digitalWrite(BLUE2, HIGH);
  }
   delay(500);
   
}

Credits

Timothy Goh

Timothy Goh

1 project • 0 followers
Seung Hun Jang

Seung Hun Jang

1 project • 0 followers
Namita Davey

Namita Davey

1 project • 0 followers
Colin King

Colin King

1 project • 0 followers
David Yi

David Yi

1 project • 0 followers

Comments