Software apps and online services

Story

A cellular connected asset tracker built on the Hologram Dash. Inspired by @benstr-hologram's GPS Asset Tracker, this tutorial takes it a step further by adding a temperature sensor, LEDs for feedback/debugging, and additional power management controls through the Hologram Dash class's deep sleep modes. What you'll have after following this tutorial is a field-ready solution for remote monitoring connected over Hologram's cellular network.

Features

Hourly GPS and Temperature readings sent to the Hologram Cloud

LEDs for signaling start-up, device state, and activity

Deep sleep power save through the Hologram Dash's firmware to minimize power consumption

Battery life indicator and alerts sent to the Hologram cloud

Ruby on Rails Web App for viewing your readings and device status

Hologram Cloud webhook for posting JSON messages

Waterproof enclosure for prolonged field use in the elements

Wired up and ready to go, the foam allows for a custom fit!

Hardware setup

Getting started requires these easy to set-up components arranged in the schematic you'll see below.

Hologram Dash: Hologram's turnkey cellular development board for single line cloud sends! Make sure the red Jumper is moved closer to the battery and microUSB port for proper activation of the Dash’s built-in battery management circuitry

LiPo Battery: 3.7V, 3000maH battery we used with our version was able to provide a few days worth of operation on a full charge. Feel free to plug in an even higher watt-hour battery for longer use.

Pelican 1120 Waterproof Case: Enclosure that fits the breadboards nicely with simple foam cutouts that allow for a snug fit. Case also has built in pressure valve that helps stabilize the temperature inside.

Follow the schematic attached in the picture to get your remote monitoring box wired up and ready for use on your windowsill, backporch, car, or anywhere the Pelican case will fit!

Wiring

Hologram Dash to GPS:

R12/+3.3V <> Vin

R02/GND <> GND (Worth checking that GND is set properly with a multimeter, have seen a jumped GND through the breadboard throw off the input voltage before)

Getting a GPS fix can be tricky depending on where the device is located and outdoor conditions. Therefore, the code has logic and counters in place so the device still sends back data about every hour as a heartbeat between deep sleep cycles, regardless of whether a GPS fix is locked in by the GPS module. This provides feedback that the Dash is still operational and a cell signal is available. The temperature, humidity, and battery life are also captured as additional diagnostics each hour. These counters and thresholds are all defined as constants in the sketch and can be tuned based on the interval and minimum time for GPS fix seeking you wish to setup for your device. Here’s a walkthrough of the values in the GitHub sketch:

GPS_SERIAL_SEND_TIME 30000 // The interval the device prints out the current GPS fix status, lat/long, and DHT sensor readings to serial output in milliseconds

MIN_FIRST_SEND_TIME 120000 // An assigned minimum time from start-up and waking allowed for the device to send a cloud message. This acts as a buffer between the Dash’s deep sleep waking and the cell modem re-establishing a connection

DASH_CLOUD_SLEEP_INTERVAL 50 // Minutes for each Dash deep sleep cycle after successfully sending a reading back to the Hologram cloud. Note that the difference between this value and GPS_CLOUD_SEND_TIME is the allowed length of time the GPS module is allowed to poll for satellites and attempt a GPS fix, in this case 10 minutes. This difference can be reduced for battery savings in situations where GPS satellites are easier to connect to from the module.

Devices: These store the device’s Hologram device ID and associated SIM ICCID# which you can find on the Hologram’s Device Dashboard in the screenshot below.

Device Readings: All associated sensor readings tied to that device.

In addition to all the included CRUD routes, a specific route for receiving data from the Hologram cloud as a JSON data message from the device is included in the GitHub repo which we will connect in the next section.

Hologram Webhook - Putting it all together

1. Create a new device in the web app with your Hologram Device ID and SIM # which can be found in the dashboard:

1 / 3 • a. Look-up your Device ID and SIM # on the Hologram Dashboard

2. In the Hologram device dashboard, create a new webhook that sends each data message as POST to the /create_devicereading_hologram route of the web app. Since the data is already in JSON format, we can put the entire decoded cloud message data through the shortcode <<decdata>> and the device ID through <<deviceid>>:

Setup the simple webhook and the webapp will parse the JSON to create a new device reading

3. Turn on the device and start monitoring your device out in the field!