Technology has made so many things much easier for people to accomplish today without ever interacting with another person: pay bills entirely online, make a doctors appointment from an app, even order food from a restaurant, but when you do need in-person assistance it can be frustrating to try and find someone to help.
One such scenario where this is very much the case is parking lots. When everything goes as expected, a lot needs next to no oversight: people park their cars, pay for their spaces from their phones or an automated kiosk, and get on with their day. But what happens when someone comes back to their car and discovers a flat tire or dead battery, bumps into another car while parking, or is stuck behind a double parked car? Now an attendant would be really helpful.
But with a small number of employees responsible for multiple large facilities, how would an offsite employee know someone needs assistance? Well, that seems like something we at Blues Wireless could solve with help from the Internet of Things.
Instead of hiring more people or setting up cameras to monitor parking lots, we built a simple cellular-connected "help request button" complete with a button for customers to request assistance, a flashing LED to acknowledge the request was sent, and a solar panel to keep the device's battery charged. One of the best parts of the solution is no host microcontroller is required to do all this, equaling big savings on hardware costs and battery life.
In this article, we'll walk through how you can build your own cellular, IoT help request device and set up SMS messaging to alert someone exactly when and where help is required.
Here's a quick video demoing the device at work.
Now, let's start by focusing on the hardware.
HardwareAs this help request device is designed to be placed in large parking lots or other facilities where Internet connectivity is not a guarantee and used by customers, it needs solve for two things: the ability to request help without Wi-Fi, and to let customers know their message has been sent.
NOTE: The hardware for this project requires that you have some soldering skills. Don't fret if you don't have a lot of experience, there are some excellent videos we'll recommend which will show you exactly what you need to know.
Notecard & Notecarrier A
Since Internet is not guaranteed where these devices will be located, we chose to use the Blues Wireless cellular Notecard LTE Cat-1, and the Notecarrier A.
The Notecard is a cellular GPS/GNSS-enabled device-to-cloud data-pump that comes preloaded with 500 MB of data and 10 years of cellular service (there's also a Wi-Fi Notecard available if cellular Internet isn't a requirement).
And the Notecarrier A is a prototyping board designed for quickly building battery-powered wireless applications. It comes with pre-soldered header pins, an onboard GNSS/GPS antenna, JST and Qwiic connectors, and a micro-USB power port for communicating with the Notecard when it's mounted in the center of the board.
Twidec button
To handle the "request assistance" portion of this project, we went with the Twidec Momentary Push Button switch with pre-soldered wires. This button is waterproof and works very well with the Notecarrier A, with some minor modifications that will be covered shortly.
A customer will be able to tap the button when they need assistance and it will initiate the request.
Sparkfun RGB LED NeoPixel
In addition to tapping the button to send request, we wanted to give customers a visual indication that their request was successfully sent, so we included a Sparkfun RGB LED NeoPixel light which will blink yellow to acknowledge the request and green when the request is delivered to the cloud.
LiPo battery &solar panel
And since these request devices will be in parking lots or other large structures and are designed to be low power, we decided to rely on a Lithium Ion polymer battery and solar panel to keep it running.
The Notecarrier A comes prebuilt with JST connectors for both LiPo batteries and solar panels, so as long as you choose a battery and solar panel like the ones linked to here with JST connectors, you should be able to plug them right into the Notecarrier.
Jumper Wires, breadboards, & break-away male headers
The final little bits and bobs you'll need to wire this hardware together are some male-to-male jumper wires, a solderless breadboard, and a small strip of break-away male headers.
Now that we've got our hardware pieces, it's time to put it all together.
Hardware Assembly
1. Use the Notecard and Notecarrier quickstart documentation available on the Blues Developer Experience site to assemble your Notecarrier A and Notecard - don't worry too much about the section connecting to the Notehub cloud just yet, we'll get to that in the next part of this tutorial.
2. Break off 3 male header pins and solder a strip (pins down) to each side of the Sparkfun LED breakout light.
This video from Adafruit provides a great example of how to solder male pins to a board like the one the LED comes in.
3. Cut a male jumper wire in half and use a wire stripper to strip at least 1/2" of coating off of both the ends of the jumper wire and each wire connected to the Twidec push button. Also snip off the soldered tip of the button's wires so the filaments are free floating.
4. Use the "Western Union" X-style of wire splicing to wrap the exposed jumper wires together with the Twidec wires and solder them together.
5. Add a short piece of heat shrink tubing to each wire before soldering the wires together. Solder the wires. After soldering is complete, slide the heat shrink down over the exposed wires and use a heat gun to shrink the wrap down to and protect the wires from the elements and electrical shorts. If heat shrink tubing is unavailable electrical tape can be substituted.
This video shows you how do all of this from wire splicing to heat shrinking afterwards.
6. Slide the LED into a breadboard.
7. Attach the Notecarrier A to the breadboard by plugging a jumper wire from the A's GND
pin to the -
bus on the breadboard.
8. Attach the Notecarrier A to the LED breakout by plugging jumper wires into its headers in the following configuration:
VIO
➡️V5
on LEDAUX2
➡️DI
on LED- Breadboard's
-
➡️GND
on LED
9. Attach the newly soldered button wires to the Notecarrier and breadboard:
- Red wire ➡️
AUX1
on the Notecarrier A - Black wire ➡️ breadboard's
-
bus
10. Plug the LiPo battery and solar panel into the Notecarrier A's JST connectors for each piece of hardware
11. Now it's time to configure the Notehub cloud and the Notecard!
Cloud SetupThis parking lot help request project is going to operate with the help of Notehub, a hosted cloud service designed to connect to Notecard devices and synchronize data. A big selling point is that Notecards know how to send data to Notehub right out of the box.All you have to do is create a Notehub account and a new Notehub project.
Create a newproject
Getting started with Notehub is straightforward.
1. Sign up for a free Notehub account, if you don't already have one.
2. Click the blue Create Project button in the top right corner of the screen.
3. Give the project a name such as "ParkingLotHelpRequest", and then click the Create Project button in the modal.
Once your project is created, copy the product UID down somewhere (com.blues.projectnamehere
): you'll need it to program the Notecard in the next section.
NOTE: If you'd like more detailed information about Notehub, you can see our Notehub Walkthrough docs here.
Optional Notehubconfiguration: grouping Notecard devices by fleet
Notehub has the option to store groups of devices by fleet, which is especially useful for organizing similar groups of devices and storing project settings that need to be shared and synchronized across devices.
For this project, you could group multiple devices together by something like "Lot Location" or "Garage Level" by updating a project's fleet name, and assigning devices to that fleet.
When a new project is created, Notehub makes an initial default fleet you can use as your starting point.
1. Inside your Notehub project, navigate to your fleet in the nav menu, and then click the Settings link.
2. Inside Settings, change the Fleet name input to something more useful (like "Lot L" or "Floor 3", for all devices in that particular area).
3. Then click on the Devices link to see all the devices associated with the Notehub project.
4. Double-click the device you're currently configuring.
5. Update the fleet that device is assigned to using the dropdown.
6. You can also rename the device from this page if you need to update its parking spot number in the same way.
Feel free to revisit this section after you've connected your first Notecard to your project.
With this done, your Notehub backend is fully configured, and you're ready to start setting up the Notecard.
Configure the NotecardThis is a "host-free" project because the Notecard itself can be configured with a few JSON commands to send notes to Notehub when the button is pressed. This may sound simple, but it's actually kind of a big deal.
Typically, a host microcontroller is needed to process logic like "when a button is tapped, something else (sending a note to Notehub, in this case) needs to happen." The fact that the Notecard can do this without a host means big savings in terms of necessary hardware and necessary power-usage for the device (microcontrollers tend to be resource intensive little guys).
Neo-monitor mode
The Notecard does this by using a special card.aux
mode called neo-monitor
mode. When it's configured to use neo-monitor mode, the Notecard knows that between 1 - 5 NeoPixel LEDs will be attached to the GPIO pin AUX2
on the Notecarrier, and that the AUX1
pin will act as a test button.
Primarily, this mode might be used for a technician to test and monitor Notecard activity, but it can also serve our purpose of acknowledging and confirming a customer's request for help has been sent and received by Notehub.
Choose your programming terminal
There are two main ways to program a standalone Notecard that will not be interacting with a host microcontroller:
1. The Notecard CLI: a downloadable CLI designed specifically for working with the Blues Notecard.
2. The Notecard Playground: an in-browser terminal that emulates much of the functionality of the Notecard CLI.
Both of these tools are accessible through the Blues Developer Experience site.
NOTE: If you do choose to use the in-browser terminal, you'll need to do so on a Chrome-based web browser like Chrome or Edge that supports the web serial API.
These instructions will assume the Notecard Playground is being used, but they will also work with very slight modifications if you choose to use the Notecard CLI instead.
1. Before you can configure your Notecard, you must set up a free Notehub.io account and create a project where the Notecard will send its data to. Follow the Notehub Walkthrough to sign up and create your first project if you haven't done so already. Copy the Project UID after creating it - you'll need it for the Notecard configuration script.
2. Plug the Notecarrier containing the Notecard into your computer with a USB-A to micro USB cable, and pair it via serial port in your browser by clicking the USBNotecard button in the Notecard Playground.
3. Copy the JSON file example below to a local .json
file on your machine.
4. Remove all the # comments describing what each command does, replace the product
and sn
placeholders in the script with your Notehub Project UID (copied earlier when you created the project) and preferred Notecard serial number (e.g. Lot G
or G14
- depending on how location specific you want your help request buttons to be), and resave the file. It will resemble the code snippet below when you're done.
{"req":"env.default","name":"parking_lot_help_request_config_script_version","text":"1.1.1"}
{"req":"hub.set","product":"com.your-company.your-name:your_product", "sn":"preferred_device_name_here"}
{"req":"hub.set","mode":"minimum","outbound":1440,"inbound":10080}
{"req":"card.aux","mode":"neo-monitor"}
{"req":"card.voltage","mode":"lipo"}
{"req":"card.motion.mode","stop":true}
5. Copy the JSON script and paste the whole file into the Notecard Playground's command line (it can accept multiple lines of JSON at once).
6. Hit enter. This executes each command on your connected Notecard, one at a time. When the setup completes, your Notecard's configuration is complete.
7. To confirm your Notecard is now attached to your project in Notehub, navigate to the project in the browser, click the Devices tab and see if your Notecard has appeared. If all goes according to plan, you'll see a device with the preferred name of your Notecard (provided by the setup script) under the Best ID column.
Use the Notecard CLIIf you'd like to use the Notecard CLI instead to upload your JSON config script:1. Download and install the Notecard CLI from the Blues Developer Experience site.2. Save your JSON config script locally as something likeparking-lot-help-request-config-script.json
and replace theproductUID
andsn
variables.3. Run the following command from your terminal:
$ notecard -setup parking-lot-help-request-config-script.json
Now click the button a few times and hopefully you'll see the LED light on the breadboard flash and the button press data similar to this screenshot below flowing into your own Notehub project.
A real time video of the help request button in action.
These are the types of events you should see in your Notehub project after pressing the button.
Once you have _button.qo
events in Notehub, it's time to set up our SMS alerts so parking lot attendants know that someone somewhere needs help.
Now that Notehub's receiving the button press notes, these events will need to be transformed and routed to Twilio to trigger SMS alerts to an attendant's phone.
NOTE: Although this project is using Twilio for SMS alerts, you can route your button presses to any service you'd like, and set up whatever sort of notification system you have in mind.
Follow the Twilio starter guide on the Blues Wireless Developer Experience site to go through the basics of setting up Twilio account, and a route from Notehub to Twilio, until you reach step 8.
Instead of selecting twilio.qo
files, you're going to want to route out _button.qo
events in the Filters section.
Then, you'll use JSONata (a lightweight query and transformation language for JSON) to filter down and format the data from a button event before sending it to Twilio.
Twilio expects very specific syntax, and you can add the JSONata expression right at the bottom of the new route page you're working in under the Data section.
Paste this JSONata into the Transform Data input, and replace the $from
and $to
values with your Twilio number ($from)
and your cell phone number to receive the SMS messages ($to
).
(
$from := "+1800XXXXXXX";
$to := "+1404XXXXXXX";
$best_device_id := best_id ? best_id : device;
$body :=
$join([
"Alert! ",
$best_device_id,
" requires assistance. Help requested at ",
$fromMillis(when * 1000,
"[M01]/[D01]/[Y0001] [h#1]:[m01][P]",
"-0400"),
" ET."
]);
$result := "&Body=" & $body & "&From=" & $from & "&To=" & $to & "&";
)
Save the newly create Twilio route, click your help request button and check that the SMS messages appear as expected.
Here's what a sample Twilio SMS message looks like.
All right, it's time to test this out and see how things are working.
Test it outBefore you go to the trouble of packaging all this hardware up into a nice, weatherproof case, let's make sure that it all works as expected.
Keep the phone handy where your SMS messages should be routing to, and click the "help request" button.
Looking pretty good!
Weatherproof it for real world testingOk, if you want to field test your help request button in a more real-world setting, you'll need an enclosure to secure all the various pieces and keep them safe from the elements.
Awclub ABS plastic junction box
For such a situation, we typically recommend a plastic junction box. They're relatively inexpensive, come in lots of different dimensions, are dust and waterproof, and can have holes drilled in to them for wires with standard power tools.
For this project, the 8" x 4.7" x 2.2" box was used.
Here's what to do with it.
1. Once you have your box, take a power drill and 1/4" drill bit to drill a pilot hole in the center of one of the short sides of the box (this will be where the request button will eventually go).
2. After drilling the pilot hole to keep the plastic case from cracking, use a 1/2" drill bit to drill a hole large enough for the button to fit in snugly.
3. Use an Xacto knife to clean up any loose bits of plastic around the hole's edges.
4. Unscrew the gasket and hex nut from the top of the button, thread the wires through the hole, and if the hole's the right size, the button head should sit snuggly. Re-screw the hex nut on the underside of the box to hold the button steady in place.
5. Now, reassemble the device inside of the plastic enclosure. Tape or glue everything down to keep the hardware secure. (Make sure the LED NeoPixel and solar panel are visible so the device can recharge itself and display to users the help request has been sent.)
6. Screw the plastic top on, tap the button to make sure everything works, and go forth and field test confidently.
That looks pretty darn good, and (in my opinion) I kind of like seeing the guts of this project, jumper wires and all.
Just like at the beginning of this article, here's a video of how the help request device should function.
ConclusionTechnology allows us to do a lot today without the assistance of others, but when customers do need help, being able to alert employees to the situation in a timely manner is critical.
With just a Blues Wireless Notecard and Notecarrier, a button, and an LED light you can have all the makings of a help request device, no major programming or host microcontroller required.
If you'd like to build this project yourself, you can:
- Review the full project README on GitHub,
- Pick up a Notecard and Notecarrier A from our shop,
- Share what you build on social and hit us up with questions on our forum.
Happy hacking!
P.S. This is one of a number of IoT application accelerators the team at Blues Wireless is building. Sign up for the newsletter if you want to get notified of new apps as they're released.
Comments