Things used in this project

Hardware components:
Cutout cortado grande
Punch Through LightBlue Bean
×1
R8326274 01
Raspberry Pi 2 Model B
×1
SeeedStudio Grove Moisture Sensor
×1
SeeedStudio 2xAA Battery Holder
×1
SeeedStudio 4 Pin Male Jumper to Grove Conversion Cable
×1

Schematics

Wiring Diagram
Diagram

Code

Bean CodePlain text
int sensorPin = A0;
int sensorValue = 0;

void setup() 
{
Serial.begin(9600);
}

void loop()
{
 sensorValue = analogRead(sensorPin);
 Serial.println(sensorValue);
 Bean.sleep(1000000000);
}
Node-RED CodePlain text
[{"id":"912350e5.6edcb","type":"bean","name":"Water Sensor Bean","uuid":"","connectiontype":"timeout","connectiontimeout":"2"},{"id":"5ec0d702.a13f28","type":"bean serial","name":"Bean Serial","bean":"912350e5.6edcb","newline":"\\n","bin":"false","out":"char","addchar":true,"x":302.5,"y":83,"z":"ab0aaa47.54f558","wires":[["5bc0a855.a43f58"]]},{"id":"5bc0a855.a43f58","type":"function","name":"moisture threshold","func":"context.previousMoisture = context.previousMoisture || 0;\nvar moisture = msg.payload;\n\nvar upperThreshold = 400;\n\n// Check if the new moisture is different from the previous\nif (context.previousMoisture != moisture){\n  // Check if moisture outside threshold\n\tif ( moisture >= upperThreshold){\n    // Compose alert email\n\t\tmsg.payload = \"Water detected! Current moisture is \" + (String(moisture)-upperThreshold) + \" above threshold.\";\n    return msg;\n\t}\n}","outputs":1,"valid":true,"x":505.5,"y":83,"z":"ab0aaa47.54f558","wires":[["918c428b.6e73c"]]},{"id":"6915426.f96eabc","type":"inject","name":"1 min interval","topic":"","payload":"!","payloadType":"string","repeat":"60","crontab":"","once":false,"x":143.5,"y":83,"z":"ab0aaa47.54f558","wires":[["5ec0d702.a13f28"]]},{"id":"918c428b.6e73c","type":"e-mail","server":"smtp.gmail.com","port":"465","name":"","dname":"Email","x":679.5,"y":83,"z":"ab0aaa47.54f558","wires":[]}]

Credits

Karel
Karel Kalthoff

happily building connected products at Punch Through Design

Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Web-controlled BoE-Shield Robot with the LightBlue Bean[+]
Intermediate
  • 829
  • 22

Full instructions

Have you ever wanted to control a robot from a web browser? Use the LightBlue Bean[+] (LBB[+]) to control a BoE-Shield Robot using BLE.

RadBit
Intermediate
  • 1,092
  • 19

FitBit-type Bluetooth radiation sensor for tracking radiation exposure (for working around X-rays in the hospital, or just life in general).

Handy BLE app / Bean Car
Intermediate
  • 4,177
  • 29

Work in progress

Remote control bean powered car driven with an iPhone running the Handy BLE app.

El Wire T-shirt: Connected to a LightBlue Bean
Intermediate
  • 275
  • 6

Work in progress

A custom Internet connected shirt using a LightBlue Bean to light up the shirt's El Wire graphics.

Data Pyrotechnics
Intermediate
  • 551
  • 7

Full instructions

What happens when you strap a LightBlue Bean to some fireworks?

Too Much IoT - Tweeting Pregnancy Test
Intermediate
  • 3,578
  • 17

Full instructions

A connected pregnancy test that tweets your results instantly, and text messages your mom. May also be used as a light switch.

Add projectSign up / Login