Project

Build an IoT Notification Device with an Arduino UNO

June 23, 2017 by Don Wilcher

Enter the world of the Internet of Things by building your own IoT notification device.

The IoT world allows a variety of electronic devices to talk to each other over the airwaves. WiFi protocols like 802.11 b/g/n or BLE (Bluetooth Low Energy) allow these electronic devices to share data using either communication scheme. Wireless chipsets like the ESP8266 and the ESP32 allow easy IoT development and experimentation for makers and engineers. In this project series, you will explore IoT concepts using alternative wireless platforms for monitoring and by controlling a variety of electronic circuits and gadgets.

To kick off the project series, you will build an IoT notification device that sends an email message to your desktop PC, notebook computer, or mobile device (smartphone or tablet) when triggered by an external device. You will need an Arduino Uno, a littleBits cloudBit, an IoT mobile device app, and some common electronics components and supplies.

Parts Lists

 

Figure 1. The IoT notification device block diagram.

What's a littleBits cloudBit?

Before you proceed with the project build, here are some interesting technical facts about the littleBits WiFi module. The cloudBit module allows a variety of electronic devices and gadgets to easily connect to a home WiFi network. The IC technologies used on the tiny module’s PCB enable wireless connectivity for controlling and monitoring other littleBits modules.

Also, a hardware development kit (HDK) provides electrical circuit interfacing to non-littleBits modules as well. The cloudBit module’s system architecture consists of nine subcircuits.

 

Figure 2. The littleBits cloudBit: an alternative WiFi module for IoT concept development. Image courtesy of littleBits

 

The littleBits system architecture consists of the following:

  1. Power supply
  2. Setup (pushbutton switch)
  3. WiFi dongle (USB host adapter)
  4. Analog in
  5. Analog out
  6. μSD (micro SD)
  7. RGB LED (status)
  8. 512 MB DDR SDRAM (double data rate synchronous dynamic random-access memory)
  9. i.MX23 processor

 

Figure 3. Nine subcircuits make up the cloudBit system architecture.

 

The cloudBit’s WiFi radio is packaged inside of a USB adapter. Dynamode manufactures the radio (part number WL-700N-XS) which is an 802.11n/g compliant WiFi device. It’s operating frequency range is 2.4 to 2.4835 GHz. This range puts the USB adapter within the ISM (industrial, scientific, and medical) category of wireless devices. The Dynamode USB WiFi adapter conveniently operates from a single 5VDC source and consumes only 0.6W of power.

 

Figure 4. The cloudBit WiFi chipset is conveniently packaged into a USB adapter. Image courtesy of Dynamode

 

The WiFI Linux based software is stored on the μSD card located on the bottom side of the cloudBit printed circuit board. The RGB LED indicates the operational and setup status of the cloudBit. The cloudBit's setup button is a tiny momentary switch that allows you to initiate detection of and connection to the home network. The central component in this architecture is the i.MX23 processor from NXP.

In addition to processing external  I/O signals, the i.MX23 processor has an internal electronic subcircuit capable of performing wireless (WiFi) control activities.To aid the i.MX23 processor in performing these wireless control functions to handle the mass amount of WiFi data an external 512 MB DDR SDRAM chip is provided on the mini pcb. The WiFi data transfer rate of the DDR SDRAM is supported by16 address lines, 15 data lines, and 13 control lines. The analog I/O circuits allow signal conditioning and electrical wiring interfacing of the cloudBit to other littleBits electronic modules or developer-designed circuits.  

 

Figure 5. Components included in the cloudBit WiFi module. Image courtesy of littleBits

 

As you see, the cloudBit module provides an impressive amount of wireless technology within a small package. Now that you understand the architecture of the cloudBit, the next step in the project is to build the IoT hardware.

Building the IoT Notification Device

We will use an Arduino in conjunction with a simple additional circuit to generate a trigger for activating the cloudBit. The tactile switch can be programmed to operate the cloudBit to send one email or text message or in multiple successions. Once the cloudBit receives the trigger, it will send you an email over your home wireless network.

So the first step for this project is to build the trigger circuit (it's simple; you can use a breadboard, as shown below).

 

Figure 6. The Arduino trigger circuit wiring diagram. It's a good idea to incorporate switch debouncing in either the hardware or the firmware.

 

Here is the schematic for the Arduino trigger circuit:

 

Figure 7. Schematic for the Arduino trigger circuit.

 

With the Arduino trigger circuit built, you are now ready to add the cloudBit module. You will use littleBits components to provide an electrical wiring interface between the Arduino trigger circuit and the cloudBit. The main electrical wiring interface component you will use is the proto-module. The proto-module provides three electrical connections: ground (gnd), signal (sig), and Vcc.

 

Figure 8. The proto-module's electrical signals. Image courtesy of littleBits

 

The following diagram shows all the connections needed to build the IoT notification device.

 

Figure 9. The complete IoT notification device electrical wiring diagram.

 

You can also see the various connections in this prototype that I built. Attached to the prototype is a smart logic probe that I designed to aid in the testing of the IoT notification device. The cloudBit is powered by the littleBits power adapter.

 

Figure 10. The author's prototype IoT notification device. The mounting plate provides support for the littleBits modules. The smart logic probe aids in testing the prototype.

 

You have now completed the electrical build of the IoT notification device. The next project step is to add the Arduino code for the trigger functionality.

Add the Arduino Code

In this project step, you will upload the code to the Arduino to make the IoT notification device operational. The code is a modification of the "Button" sketch that is included with the Arduino IDE. The modification adds a digital output for triggering the cloudBit. Pressing the pushbutton will turn on the LED and set pin D6 to logic high.

You can download the code using the button below, or you can copy and paste the following:


// constants won't change. They're used here to
// set pin numbers:
const int buttonPin = 5;     // the number of the pushbutton pin
const int ledPin =  13;      // the number of the LED pin
const int trig_out = 6;      // output pin to trigger cloudBit

// variables will change:
int buttonState = 0;         // variable for reading the pushbutton status

void setup() {
  // initialize the LED pin as an output:
  pinMode(ledPin, OUTPUT);
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT);
  // initialize the cloudBit trigger pin as an output:
  pinMode(trig_out, OUTPUT);
}

void loop() {
  // read the state of the pushbutton value:
  buttonState = digitalRead(buttonPin);

  // check if the pushbutton is pressed.
  // if it is, the buttonState is HIGH:
  if (buttonState == HIGH) {
    // turn LED on and trigger outpin:
    digitalWrite(ledPin, HIGH);
    digitalWrite(trig_out, HIGH);
  } else {
    // turn LED off and trigger outpin:
    digitalWrite(ledPin, LOW);
    digitalWrite(trig_out,LOW);
  }
}


Arduino_cloudBit_trigger.zip

 With the code uploaded to the Arduino, you are now ready to add the IFTTT applet to your prototype IoT notification device.

Adding the IFTTT Applet

You can use Facebook, Gmail, Instagram, and Twitter web services along with physical devices, such as microcontrollers, to provide triggers using pre-built IFTTT applets for the cloudBit. The IFTTT applets are free.The applet uses conditional statements as the operational foundation for the target service. The idea here is that you will use the littleBit applet to send an email message when the cloudBit is triggered by the Arduino.

 

Figure 11. An email message will be sent when the cloudBit is triggered by an Arduino.

 

In order to have your wireless home network detect the cloudBit, you must set it up properly.You will find instructions on the littleBits littleBits website for how to set up your cloudBit properly. Also, you must create an account with the free IFTTT applet service website in order to use the littleBits Trigger your Cloud module to send an email message. Provide an email address you want to use for this project while registering your account. Once registered, you can modify the applet using the settings feature. I modified the applet to use my alias MrD within the body of the email message for the cloudBit wireless transmission event.

 

Figure 12. Changing the body device name ("MrD") is conveniently done through the cloudBit applet’s ingredient settings.

 

Once the applet is properly configured, you are ready to test your IoT notification device.

Final Test

Pressing the pushbutton on the breadboard will cause your IoT notification device to send you an email message. The message will include the subject and body information you provided when setting up the applet.

 

Figure 13. Testing the prototype IoT notification device.

 

Here's the message sent by the cloudBit to my email address:

 

Figure 14. An email message sent by the cloudBit.

 

To see the IoT notification device in action, check out the video clip below.

You now have a functional IoT notification device. As you can imagine, this project opens a world of IoT applications using an Arduino, a littleBits cloudBit, other littleBits modules, and off-the-shelf electronic components. Experiment with the applets setting to display new email message information. Keep a small lab notebook to document your observations. In the next project installment, you will build a WiFi device capable of controlling a variety of electronic circuits and gadgets. You'll also be introduced to the littleBits cloud control website, which allows you to monitor and control your IoT prototypes.

Give this project a try for yourself! Get the BOM.

2 Comments
  • N
    nielz August 23, 2017

    good work,
    Excuse me I want to programe an arduino with spherical coordinates to modify electric pasket instead of hydrolic levers do you have the programme code.
    thank you

    Like. Reply
  • kelash February 16, 2018

    What is cost of this project

    Like. Reply