6.2 Building the Solution
The hardware construction for this project closely matches the sensor approach we built for the Tweeting Bird Feeder project. We will once again call upon the Python language to script the server-centric interactions, but this script will also utilize several custom packages to interrogate popular web services offered by US-based courier companies like Federal Express (FedEx) and United Parcel Service (UPS). More specifically, we will:
-
Attach the force sensitive resistor to an available analog pin on the Arduino and identify a threshold value when weight is applied to the resistor.
-
Attach the XBee radio to the Arduino and transmit a message to another XBee radio attached to a computer when the threshold value of the force sensitive resistor has been exceeded.
-
When a threshold event has been received, pause execution for ten minutes to give the courier’s tracking systems an opportunity to update its records. Then iterate through a database table of known FedEx and UPS in-transit package tracking numbers. Query these numbers with FedEx and UPS web services to determine a delivery confirmation match.
-
If a match is identified, update the tracking number database table with a delivery confirmation and date/time stamp.
-
Send an email via Google’s Gmail SMTP mail gateway indicating the time of the threshold event and any packages that match the delivered status query. If no tracking number is matched, indicate such in the body of the email.
Now let’s begin by first assembling the package sensor hardware components, followed by the software to drive it.

Figure 19. The Package Delivery Detector wiring diagram