Introduction: Using a LilyPad & Pressure Sensor to Monitor Bird Food Levels

In my house we have a parakeet, Henry. Because Henry only eats the meat of the seeds and not the shells, and he discards the shells back into his dish, it’s impossible to tell at a glance if he has enough food or if his dish is full empty shells. I created this project to use the LilyPad, a pressure sensor and an LED to indicate when the weight was low enough it needed to be refilled.

There are some great tutorials about how to use an Arduino pressure sensor to work with LilyPads and textiles. I had a hard time finding information on using one without a textile. This project fulfills a class requirement to solve a real-world problem with code.

Step 1: Assemble Materials

Lilypad Arduino
Lilypad battery pack
2 Coin cell batteries
1 LED
1 Force sensitive resistor
Alligator clips: 1 green, 2 black, 1 yellow, 1 red, 1 white
1 10k ohm resistor
1 220 ohm resistor

Step 2: Code

This code is modified from code found here: http://samsneatprojectblogcode.blogspot.com/2016/0...

Copy and paste this code into your Arduino window:

int pressurePin = A0;
int force;
int LEDpin = 12;
void setup() {
Serial.begin(9600);
pinMode(LEDpin, OUTPUT);
}
void loop() {
force = analogRead(pressurePin);
Serial.println(force);
if(force > 50)
{
digitalWrite(LEDpin, HIGH);
}

else
{
digitalWrite(LEDpin, LOW);
}
delay(100);
}

Step 3: Assembling Your Wires

Assemble your wires as shown in the photo. Need extra help? The video is an explanation I made for my professor. It will help explain the reasoning for the assembly.

Step 4: Installation

Now, install it! Although I chose to switch to a breadboard for my prototype it is not necessary. I was limited by space. If you have a better spot to place your set up I highly recommend keeping to the alligator clips.