Automated Monitoring with Raspberry Pi

by Marina Clark

Raspberry Pi

 

Apogee Connect for Raspberry Pi is a new application built to automate data collection from Apogee's Guardian monitors. It will store the collected data in a csv file so that it can be easily accessed and viewed by the user. It also gives users customization options such as start/stop time, logging interval, csv file location, etc. This provides a flexible way to automate data collection from Apogee Bluetooth sensors, making it ideal for researchers, growers, and engineers who need continuous environmental monitoring. And while dataloggers can cost hundreds or thousands of dollars, a simple Raspberry Pi can be purchased for under $50 USD. Apogee utilized this to make an affordable solution for automated datalogging.

 

There are two ways to use Apogee Connect:

  1. As a standalone command line application with straightforward commands for interacting with Apogee's Bluetooth sensors.
  2. As a Python module for those looking to implement the application’s functionality directly into their own Python script.

 

In addition to our Guardian monitors, this app can work with any of our µCache sensor packages. Use the application’s "manual collection mode" to ensure that the µCache is advertising before attempting to collect data. Stay tuned for future updates, including automatic collection for all Bluetooth sensors!

Apogee Guardian in a sunflower CEA microcachesuctiontank-3.jpg

POSSIBILITIES USING THE RPI APPLICATION

The value of the Raspberry Pi Apogee Connect application lies in its simplicity and versatility. Most commonly, people will use it with their Guardian in a greenhouse. Once it's up and running, the system automatically collects data without requiring you to remember to open the app on your phone when you want to track the sensors’ readings. You can simply check in on the data whenever you like, making it the perfect solution for passive monitoring. When you’re ready for data, it’s all there.

To take it a step further, Apogee Connect can integrate with your existing automation system. Use the Raspberry Pi to monitor real-time data and make immediate adjustments to conditions like light levels, temperature, humidity, or soil moisture. For instance, if the plants are receiving insufficient light, the system can reactively increase the light.

This takes the hands-off nature of datalogging and automation to the next level. Responsive system management makes projects more energy efficient by ensuring heating, cooling, lighting, watering, and humidifying only occur when necessary. Over time, continuously monitored data can be analyzed to program the system to predict energy needs and adjust in advance, avoiding inefficient spikes in energy consumption.

Apogee Connect for Raspberry Pi is made to scale effortlessly. It’s easy to connect multiple sensors to your Raspberry Pi, which allows you to simultaneously monitor data from various locations or positions. One user even explored using it on a conveyor belt system where the Raspberry Pi traveled with the items on the belt, collecting data from sensors stationed along the line.

Its flexibility makes Apogee Connect an invaluable tool for researchers, growers, and engineers looking to automate and optimize their environmental data collection.

 

QUICKSTART INSTRUCTIONS

Raspberry Pi general use documentation is available here: Raspberry Pi Documentation

Apogee Connect for Raspberry Pi Documentation: https://pypi.org/project/apogee-connect-rpi/ 

Below is a brief overview of installation and basic usage.


Installation

For simple installation, we recommend using an application called pipx. However, if you're comfortable setting up your own virtual environments, you can use pip, which should come pre-installed on your Raspberry Pi by default.

To install via pipx, run the following three commands in your terminal:

  1. sudo apt install pipx (you may need to restart the terminal after this command)
  1. pipx install apogee-connect-rpi
  1. pipx ensurepath

 

Basic Usage

Once you've installed the app, you will use the keyword "apogee" followed by a specific command to interact with it in the terminal. Here are some common commands you will likely use:

 

1. Scan for Nearby Sensors

To scan for nearby sensors and obtain the sensor's MAC address, which is needed to interact with it, use:

 

      apogee scan

 

This will display a list of all nearby Apogee Bluetooth sensors along with the MAC address and identifying information such as alias, serial number, and sensor type.

 

2. Start Collection

The "collect" command will be the command you will use to initiate collection with your greenhouse sensor. For example: 

      

apogee collect AA:BB:CC:DD:EE:FF (where AA:BB:CC:DD:EE:FF is the MAC address of the sensor) 

 

3. Stop Collection

When ready to stop data collection, simply use the following command:

      

      apogee stop AA:BB:CC:DD:EE:FF

 

You can add additional arguments to set a custom start/stop time, change the logging interval, set the location of the csv file for data collection, etc. Additional commands, examples, and available optional arguments are all included in the detailed documentation here: https://pypi.org/project/apogee-connect-rpi

 

Need help?

Contact us with feedback or questions at techsupport@apogeeinstruments.com. We would love to hear how you are using this application and your ideas for future features!