new toys: rain sensor, LCD

For this week, I wanted to make a plant interface which could tell you if the plant needed water. (I have a soft spot for this “Internet of Plants” future…)

Screen Shot 2017-10-11 at 12.53.13 AM.png

Here are all the parts at play. Note that it doesn’t work (yet.)


I definitely upped the ante on myself this week! This post will mainly be about my process and struggles.

I spent most of my time playing around with these two new sensors….

This lovely rain sensor:

… and this very finnicky 16×2 liquid crystal display (LCD):


The rain sensor was a breeze. ✅

I plugged it in, and used tutorial code, and it was working right away.


I learned that the sensor works by adding or decreasing resistance, caused by the increased conductivity of water on the sensor.

The mean threshold was around 250 when the sensor was dry, and open to the air.
When I put it in soil, the mean threshold dropped to 150. I reprogrammed the threshold value…

Screen Shot 2017-10-11 at 1.03.02 AM.png

LCD struggles though… ⛔️💢❌😵

For the LCD— I must have spent 4 hours just wiring, re-wiring, (“How about soldering just a little more?”) and just trying to get this thing to work.

In fact, I had TWO of the LCD screens, and I tried different wirings with both.

First, this one, which uses a 220 ohm resistor and a 10k ohm potentiometer.


Then this one, which doesn’t use a potentiometer and places the 220 ohm resistor differently.

I tested both LCD wirings…

1. At first, I followed the fritz diagram from (The LED switches are part of a “YES,” “NO,” question-answering interface which I didn’t finish. An earlier idea).


2. Next, on a separate board, I tried the setup from Hacktronics. This layout (I think) applies the resistor on the initial ground pin (VS) than on the 15th pin (which controls backlighting.)


Turns out, LCD pins are sensitive.

I bought a new LCD, and I tried again, with wiring layout #1. Still, most of the time, the LCD displayed nothing at all.

The process definitely gave me a better idea of how the LCD works. Things would start working in bits and pieces, as I made small changes.

I started making progress when I soldered pins 15 and 16 (which control the backlight.)

Screen Shot 2017-10-11 at 1.12.17 AM.png

After the backlight was on, then I finally got the bright white boxes to appear by fixing pins 1 & 2…

….then, by fixing the white pins (RS + F), I finally got “hello world” to show!

Er, for 10 seconds. The programmed “hello world” stopped working right after I cleaned up the wiring, and subsequently, for the rest of the night, it looked like this:



A couple more findings:

  • I found out that the PWR and GND jumpers worked on the right-hand side of the breadboard, or with PWR on right, GND on left. Both on left did NOT work.
  • Even just touching the board next to the LCD would cause enough disturbance to clear the screen.


All the resources and code I used can be found here:


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s