5.2 Building the Solution
Assembling the hardware to fit snuggly inside the feeder may require some ingenuity, especially if the bird feeder doesn’t offer much space inside the seed container. Before we start cramming electronics into the feeder, we first need to make sure our components work as expected.
-
We will start with the easy part of connecting the aluminum foil capacitive sensor to the Arduino and writing a function that will send a message to the serial window (and eventually the serial port of the attached XBee radio) when the sensor is triggered.
-
Next, we will hook up the photocell to the Arduino and write the code for it to react to changes in light.
-
Then we will pair the two XBee radios and transmit these events from the XBee radio attached to the Arduino to the other XBee radio tethered to a computer via an FTDI USB cable.
-
And finally, we will write a Python script that will capture the data into an SQLite database and format and transmit the messages to be posted on Twitter.
Once everything is working, we will compact the Arduino (preferably the Nano)+XBee+perch resistor+photocell assembly into a weatherized package, house it in the feeder, fill the feeder with seed, and go outside for a live field test.