First Steps in IoT

From Arduino.cc ()

Solving a Frustration at Home with Sigfox

Over this past weekend I had an opportunity to develop my first IoT solution.

Problem Statement:

We have a prepaid electricity meter at home, and often we overshoot our consumption predictions. When the electricity went out one evening recently, plunging us all into darkness, I knew I’d found my first IoT project!

Necessity being the mother of invention …

PoC Definition

My PoC definition was: Build an IoT solution that monitors the electricity meter and detects when the ‘electricity running low’ LED comes on. When it does send an email to my wife alerting her to buy more electricity (being married to an accountant means I can’t be trusted to pay the bills … but that’s a whole other article).

Equipment

  1. MKRFOX1200
  2. u.fl to SMA cable (and a spare wifi antenna)
  3. USB A to micro-USB B cable
  4. Photosensitive Sensor Module
  5. Battery Pack (not needed yet)
  6. 3 x F-F Jumper Cables

I chose Sigfox as the Low Power WAN for this project because some friends mentioned Sigfox to me and I wanted to experiment with it. I could have used a WiFi-enabled board but I wanted to explore the LPWAN technology, and Sigfox specifically (there is also LoRa).

I went with the MKRFOX1200 board from Arduino because it had the shortest delivery lead time online. But any Sigfox-compatible board would work.

I also bought a Photosensitive Sensor Module to sense when the ‘low electricity warning’ LED came on. a simpler photoresistor would work, but my local electronics store only had the board in stock.

Setup: MKRFOX1200, ufl-SMA pigtail and wifi antenna, Photosensitive Sensor Module PCB

The pins in use are: GRND (Ground), VCC (Power) and A1 for the signal (orange jumper above)

Sigfox Configuration

Once you unwrap your device you need to register it at Sigfox as a development kit, and configure a Callback function to send an email when a message is received by the Sigfox backend.

There are a few tutorials out there for this bit so I’m not going to repeat those, and I want to publish asap (I might come back and edit this with the individual steps)

Code

You’ll need to download the Arduino IDE and install the relevant libraries, again there are some resources out there already that explain this setup.

Here’s the code I used:

Minimum Viable Product

Once I uploaded the sketch to the board, and then shone a torch on the Photoresistor I got the following test results:

Serial Monitor Output within the Arduino IDE

Looking at the Sigfox backend I saw the message come through:

Sigfox Backend — Message

And then checking my email inbox I found this:

Email from Sigfox

I’m over the moon that it worked so easily!

Next Steps

Next I’m going to work on an enclosure so I can hang the ‘meter-magic-5000’ onto our electricity meter and then set it to watch for the ‘low electricity warning’ LED to come on, oh, and then chuckle when my wife gets an email from ‘the house’.

I’m also going to try to use Sleep mode to put the board to sleep between events, and then wake the board when the sensor trips.

… and I’m already thinking about how to read the digits from the LCD display on the electricity meter every hour and send the reading via email. But that’s going to need a camera module … actually I have one of those for my Raspberry PI, just need to figure out a light source for the camera …

I’ll update this post with my progress as I go.

BR, Andrew

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

4 Steps To Start And Become A Great Developer (Golden Rules That You Wanna Steal)

Color Widgets vs Widget World — Which widget app is the best?

While Loops in Python

Why Is The M1 Chip So Fast?

Computational Law Diary: Lollies, Decision Tables, and What “Hamilton” Teaches Us About…

The words “The Search Space” over a 3d model of a complicated spherical structure.

Common Interview Mistakes

Measuring Site Reliability Maturity

Aurora Debuts FirstLight Lidar

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Andrew Jabbitt

Andrew Jabbitt

More from Medium

The Archer — Paulo Coelho- Review

The Way of Power — Niall of the Nine Hostages — The King’s Journey

How I learned to play Fortnite

Cloning of Expedia Website