Things used in this project
AT&T PubNub Environmental Monitor Station
This station can be build for something like 200 bucks, you could even build a fleet of them and deploy them at a moments notice to monitor for hazardous conditions, pollution, or industrial leaks. The unit uses the AT&T IoT starter kit which is a FRDM-K64F ARM microcontroller paired with an AVNET LTE shield. The unit is battery powered and solar charged so it is truly wireless. On top of that the setup can sip on your data plan so responsibly, so much so that you could probably feed a fleet of 30 of them for a month or two with only 1GB of data!
I split this project up into a lot of different videos that made sense to me, I communicate better in video versus typing anyway so...
Here is a list of the videos:
- Hardware/ building the rack
- AT&T IoT Starter kit
- MBED, Flow, and M2X
- MQ-135 Gas Detector
Project Overview video
Building The Rack
Here is a mostly complete bill of materials.
- Solar panel 12V around 15-30 watts
- Solar Regulator (SunSaver)
- Battery 12V 5-10AH
- Cellular antenna two of these
- MQ-135 gas detector
- Arduino Prototyping shield
- male to Male pin headers
- 12v-5v adapter (can use a usb car charger)
- 18 AWG wire for solar and general hookup
- Rain tight or water tight electrical enclosure (nema 4 box)
- Deep Slotted Strut 20'
- Shallow Slotted Strut 10'
- 4 1/2' strut straps (for weather sensors)
- 2 1" strut straps, for mounting the solar
- 1/4" spring nuts - 15
- Strut 90deg angle bracket
- 1/4'- 1-1/4 fender washers
- 1/4" bolts
- 1/4" Nuts
- 1/4" Locknuts
- Assorted "CGBs" for wire entry into the enclosure keeping it water tight
Getting Started with the AT&T IoT Starter Kit
There are some great guides, get ready to do some reading!
Guides, here are four of them:
- Online getting started guide https://starterkit.att.com/tutorials/starter-kit-guide
- With PubNub https://www.pubnub.com/blog/2016-11-16-pubnub-and-the-att-iot-starter-kit-an-introduction-to-integrating-pubnub-on-the-att-client/
- Lots of example projects and tutorials on Hackster https://www.hackster.io/ATT
- Avnet account to register your device and get guides and instructions www.cloudconnectkits.org
- Set up and activate your device, create a developer account https://starterkit.att.com/
- You will need to upgrade your cellular shield firmware https://starterkit.att.com/tutorials/cellular-shield-firmware-upgrade.
- Then upgrade the microcontroller firmware https://developer.mbed.org/handbook/ Firmware-FRDM-K64F
- Get a terminal client program like Cool Term http://freeware.the-meiers.org/ or Putty http://www.putty.org/
- Install the NXP K64F Windows Drivers https://developer.mbed.org/handbook/Windows-serial-configuration
- MBED account for programming the ARM microcontroller https://developer.mbed.org/
- If you are doing the tutorial you will also want these accounts
- AT&T M2X IoT cloud offerings https://m2x.att.com/
- AT&T cloud Node-Red logic and application engine https://flow.att.com/
- PubNub is an option for streaming data https://www.pubnub.com/
Getting Started with MBED, AT&T Flow, and AT&T M2X
Program up your Microcontroller to push data all the way into Flow and M2X.
In this example I push data from the Starter kit into Flow, then PubNub, this is how most people have done it for the Realtime AT&T IoT StarterKit challenge.
There is another way that pushes directly from the Starter Kit into PubNub bypassing Flow however there is a bug with the particular versions of mbed and mbed-rtos that makes the program compile but not run if you add analogIn. After a lot of troubleshooting I finally opened a ticket with PubNub who escalated to AT&T who escalated to AVNET. If I get a resolution I will publish an example using this particular library and bypass Flow.
AT&T Flow to PubNub
Set up AT&T flow to push data over to PubNub.
PubNub to PowerBI
Stream real-time data in from PubNub to PowerBI and create a real time dashboard.
PubNub to Freeboard.io
Stream real-time data in from PubNub to Freeboard.io and create a real time dashboard.
Learn More about the WeatherRack Weather sensors
Learn more about the MQ-135 Gas Detector Sensor
You can fork my MBED program and try it out for yourself. https://developer.mbed.org/users/fileark/code/ATT_PubNub_IoT_Hackster/
I have only modified from the ATT example a little bit. I only modified main.cpp to change the publish string, config_me.h for default config, and sensors.h to add my weather and air related items.
Please reach out if you have any questions and enjoy!
Example MBED ProgramC/C++
Did you replicate this project? Share it!I made one
Love this project? Think it could be improved? Tell us what you think!