Internet Of Bees

Photo of gusgonnet

Made by gusgonnet / Garden / IoT

About the project

A cellular hive monitoring system

Items used in this project

Hardware components

Project Box 115mmx90mmx56mm 4.5 inches x 3.5 inches x 2.2 inches Project Box 115mmx90mmx56mm 4.5 inches x 3.5 inches x 2.2 inches x 1
Cable Gland, PG7 Cable Gland, PG7 x 2
Particle Argon Particle Argon x 1
Adafruit FeatherWing Tripler Mini Kit Adafruit FeatherWing Tripler Mini Kit x 1
Adafruit Waterproof DS18B20 Digital temperature sensor Adafruit Waterproof DS18B20 Digital temperature sensor x 1
Adafruit ADXL343 + ADT7410 Sensor FeatherWing Adafruit ADXL343 + ADT7410 Sensor FeatherWing x 1
Particle Boron Particle Boron x 1

Software apps and online services

Ubidots Ubidots
Telegram Telegram
Particle Workbench Particle Workbench

Story

FEATURES

This is a cellular-connected hive monitor that offers these features:

  • send an instant notification (email, SMS/text, or telegram message) if the hive is moved or knocked over
  • monitor the internal temperature of the hive
  • monitor the external temperature and humidity of the hive
  • low-cost cellular connectivity:

- LTE CAT-M1 if you are in North America

- 2G/3G in the rest of the world

- you can check coverage here

  • option of wifi connectivity (if there is wifi coverage where you intend to place the device)
  • battery operated
  • Ubidots charts
  • highly configurable

HARDWARE

Setup and solder your tripler, add the boron and the ADXL343+ADT7410.

You need to connect the int1 pin from the ADXL343 to A0 on the Boron. This will help detect movement or activity and wake up the Particle device (Boron or Argon) at the same time. See the yellow wire in the pic below. The green line will be connected with the tripler, so no connection to be done here.

Connect the DS18b20 to D9 on the Boron, plus 3v3 and GND. You can use a terminal block here. Don't forget a 4.7k resistor required as a pullup from the DATA to VCC (which can be 3v3 or 5V).

An early prototype of this project, not using the final hardware:

FIRMWARE

Please flash the firmware from the git repo onto the Particle device.

By default, the device will wake up every 4 hours and report the temperatures, humidity, and battery level.

If the battery is too low, the device will sleep for a long time.

If there is movement detected, the device will send an alert that can be routed to an email, or SMS, or a Telegram instant message, at your choice.

There is a section with settings you as a user can experiment, to suit the device to your needs:

// this is used to identify the device and beehive when it publishes to the cloud
#define BEEHIVE_LOCATION "bees1"

// this determines if the device will always be on.
// if commented out, the device will sleep and wake either:
// - on movement detected at any time
// - every NORMAL_SLEEP_CYCLE (4hs) to report periodically to the cloud
// #define ALWAYS_ONLINE

// if not always online, the device will sleep for this time. It reports status to the cloud every time it wakes up.
// units: MINUTES (example: 240 minutes => 4 hours)
#define NORMAL_SLEEP_CYCLE 240

// publish to ubidots every number of minutes
#define PUBLISH_TO_UBIDOTS 240

// webhook to send data to ubidots
// you can create this webhook as explained here:
// https://help.ubidots.com/en/articles/513304-connect-your-particle-device-to-ubidots-using-particle-webhooks
#define WEBHOOK_NAME "ubidotsbees"

// sleep if battery is low for some time
// units: MINUTES (example: 240 minutes => 4 hours)
#define LOW_BATTERY_SLEEP 240

// threshold in percentage
#define CRITICAL_BATTERY 20

// how often to read the sensors (always online devices only)
#define READ_SENSORS_SECONDS 5

// here you can configure what sensors you have connected
// #define USE_ADT7410 // temp sensor
#define USE_ADXL343 // accel sensor
#define USE_DS18B20 // temp sensor

// this defines the pin where you connected the DS18B20 temperature sensor
#define DS18B20_PIN D9

// this defines if the temperature is preferred in fahrenheit
// comment out for celsius
#define TEMP_IN_FAHRENHEIT true

// how long to wait for cloud connection when the device wakes up
// used in devices that sleep and wake every 4 hours (ALWAYS_ONLINE not defined)
#define WAIT_FOR_PARTICLE_CONNECT 15

SOFTWARE - Ubidots

The device will send data to Ubidots via a webhook,

Please configure it as explained in this article.

When you have the data in Ubidots, you can create a dashboard with the widgets you like. This is one example:

The ups and downs in the temperature you see in the middle of the graph are from the days I placed my test device right by the window when it got heated up by direct sunlight.

To configure email or SMS on movement, please create an Event on Ubidots based on the movement variable the device sends. When this variable is 1, the alert should be sent.

Example:

and:

If all goes according to plan, you will receive this email:

More info on how to set up events can be found here.

SOFTWARE - Telegram

If you want to receive instant notifications via Telegram, please follow this tutorial for creating your very own Telegram Bot.

The firmware is already configured to send the alert with this line:

publishQueue.publish("telegramWebhook", "Movement detected!", 60, PRIVATE, WITH_ACK);

Example of what you will receive:

HARDWARE - almost final

This is the first version that went into the field:

And once installed:

This is how the project looks like with a solar panel input (coming soon - it's under test now):

The purple feather contains a low-dropout regulator that will recharge the battery from a solar panel.

Need help?

If you require professional help with your projects, don't hesitate to write me a line at gusgonnet@gmail.com. Thank you!

Code

git repo

all the code is here

Clone the repo and load in Particle Workbench

Credits

Photo of gusgonnet

gusgonnet

If you need professional help with a project, contact me at gusgonnet@gmail.com

   

Leave your feedback...