05 Jan

Bigger, Better and Brighter LED Display

IMG_6699 IMG_6696

Our previous post detailed the simple soil moisture sensor with an LCD display that has been keeping track of our plant’s watering needs at the Fairmount Water Works.  We decided the project could use a little more flair—plus, our original LCD display got a little wet.  Luckily, our new 16×32 LED Matrix has its own waterproof case. The setup uses an Arduino Uno ($25), a Grove base shield ($10), a Vegetronix VH400 soil moisture sensor ($37), and a 16×32 RBG LED matrix panel ($25). All of the electronics are safely tucked into a waterproof Pelican case.

We decided to display more information with our LED matrix.  Now, it will display the words “Water me!” when the soil moisture level falls below a voltage of 1.2, or “Don’t Water” when the moisture level is greater than 1.2 V. It then displays the voltage, followed by “Water Works,” and repeats.

We found that with RGB (red-blue-green) matrices like this one, certain colors require more power.  When using solely the power coming through the computer to the Arduino to power the matrix, we were limited to basic red, blue, and green colors.  Any other colors would be displayed as one of the tree.

We decided this was a little too boring, and experimented with supplying power from the wall directly to the matrix, in addition to the power coming from the wall to Arduino.  This got us very bright, vibrant colors. However, the LEDs were glitchy and flashing.  We think the matrix was getting just a little too much power, and it was distracting.  In the end, we stuck with the additional wall power, but used lower power colors.  This gave us the brightness we wanted, without all the flashing.

View the code after the jump.

#include <Adafruit_GFX.h> // Core graphics library
#include <RGBmatrixPanel.h> // Hardware-specific library

#define CLK 8 // MUST be on PORTB! (Use pin 11 on Mega)
#define LAT A3
#define OE 9
#define A A0
#define B A1
#define C A2
RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, false);

void setup() {

matrix.begin();
Serial.begin(9600);

}

void loop() {

int sensorValue = analogRead(A4);
float voltage = sensorValue * (5.0 / 1023.0);
Serial.println(voltage);
if (voltage < 1.2) {
matrix.setCursor(0,0);
matrix.setTextSize(1);
matrix.setTextColor(matrix.Color333(0,7,7));
matrix.print(“Water me!”);
}

else if (voltage > 1.2) {
matrix.setCursor(0,0);
matrix.setTextSize(1);
matrix.setTextColor(matrix.Color333(0,7,7));
matrix.print(“Don’twater”);
}
delay(9000);
matrix.fillScreen(matrix.Color333(0,0,0));

matrix.setCursor(5,4);
matrix.setTextSize(1);
matrix.setTextColor(matrix.Color333(0,0,7));
matrix.println(voltage);
delay(9000);

matrix.fillScreen(matrix.Color333(0,0,0));

matrix.setCursor(0,0);
matrix.setTextSize(1);
matrix.setTextColor(matrix.Color333(7,0,4));
matrix.print(“Fairmount”);
delay(3000);

matrix.fillScreen(matrix.Color333(0,0,0));

matrix.setCursor(0,0);
matrix.setTextSize(1);
matrix.setTextColor(matrix.Color333(7,0,4));
matrix.print(“WaterWorks”);
delay(9000);

matrix.fillScreen(matrix.Color333(0,0,0));

}

 

Leave a Reply

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