Setting up a BMP180 with the ClusterDuck Protocol
BMP180 is a great way to start learning how to integrate sensors with DuckLinks. The BMP180 are these really small sensors that collect temperature and pressure. It requires three steps: Soldering the BMP180 to a board and Uploading the firmware, and Collecting the data.
The BMP180 has four pin holes: VIN, GND, SDA, SLA. The VIN is the input voltage. This is where the power source goes into. GND is the ground. SDA stands for Serial DAta and SCL stands for Serial CLock. These are special pins used to transfer data. We can solder these BMP180s to both the Heltec ESP32 and TTGO T-Beams.
Soldering to the Heltec ESP32
The ESP32 board has many pins but only two of them correspond to the SDA and SCL. So we have to make sure we solder in the right places.
Uploading the Firmware
The next step is to upload the firmware from the ClusterDuck Protocol. (If you haven’t cloned the repo, check out our wiki on how to do that. [LINK]) We can get the BMP180 example by opening Arduino then File -> Examples -> ClusterDuck -> examples -> 3. Sensor-Examples -> BMP180Example.
That should open up the BMP180 example. Two things I like to change for preferences is the name of the Duck and the frequency we send the data. To change the name of the Duck, we go to line 37:
Replace MAMA0001 with a name of preference. The name has to be 8 characters long and inside quotes.
To change the frequency we send the data, we have to go to line 30:
const int INTERVAL_MS = 60000;
And replace the 60000 value with another value of preference. This value is in milliseconds, so right now it is sending data every 60 seconds. If we only need to take measurements every hour, we have to convert 1 hour into milliseconds (1 hr = 3600000 milliseconds).
Collecting the Data
There are two ways to get the data. One way is to register for the Duck Management System (DMS) or if you would like a local solution, you can make a DMS-lite.
So now we finished the set-up, we can deploy the Ducks and watch the data flow!
I have already deployed three Ducks named Gotham00, Central0, Mtrpolis, with BMP180s around my house. Each duck sent temperature and pressure reading every 30 minutes and I collected the data for about a week. These are the some data graphs I have created:
Hope you enjoyed this tutorial of integrating a BMP180 with a Duck. We will be doing more integration blogs. If there are any specific sensors you would like help with or have any questions and/or comments join our ClusterDuck Protocol community and give us a quack in Slack.