Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info

Expected completion time of this lab: 

Excerpt

90 60 min

.

Table of Contents

Info

Unlike the other lab, the instructions of this lab are not step-by-step. They should rather be considered as a reference; your instructor will guide the work during this lab.

Goal

Tip
iconfalse
titleMinimal Viable Product

You are called in by a building manager who wants to turn his building into a "Smart Building".

She wants to deploy a number of low-power wireless motes around her building, connected to sensors and actuators. She wants to be able to dynamically (re)configure the interactions between the nodes. For now, she wants the following interactions:

  • if the temperature drops below 20C, the heater switches on; if it above 20C, the heater switches off.

    Info

    You will use an LED to reflect the state of the heating system.


  • when someone opens the exit door, the alarm sounds; it stops when the door is closed.

    Info

    You will use an buzzer to reflect the state of the alarm.


...

Tip
iconfalse
titleExtra points
  • Send out a Tweet is the door is open for more than 10s.

Cheatsheets

OAP

...

device

...

action

...

command

...

temperature

...

change period

...

0500 02 ff0105 010400007530
note: 00007530 corresponds to 30s

...

digital_out

...

switch high

...

0500 02 ff020302 000101
note: 02 corresponds to the LED

...

switch low

...

0500 02 ff020302 000100

...

digital_in

...

enable

...

0500 02 ff020200 000101
note: 00 corresponds to D0 (pin DP2)

...

disable

...

...

get

...

0500 01 ff020200

...

enable notifications

...

0500 02 ff020200 030101

...

analog_in

...

enable

...

0500 02 ff020400 000101
note: 00 corresponds to pin AI_0

...

disable

...

0500 02 ff020400 000100

...

get

...

0500 01 ff020400


Wiring up the reed switch


Tip

By convention, let's connect:

  • the tilt sensor to GPIO digital_in/D0 (DC9003 pin DP2)
  • the reed switch to GPIO digital_in/D1 (DC9003 pin S_MOSI)


Start by building the following circuit:

Gliffy
namecircuit_digital_in


Through {{APIExplorer}}Node-RED, communicate with your mote to:

  • enable the digital input

  • enable “on-change” notifications

Verify that you see notifications with different values.

Wiring up the buzzer

Tip

By convention, let's connect the buzzer to GPIO digital_out/D4 (DC9003 pin I_MOSI)

Start by building the following circuit:

Gliffy
namecircuit_buzzer

 

Through APIExplorer, communicate with your mote to switch the buzzer on/off.

MQTT

We will use the MQTT broker of HiveMQ, see http://www.hivemq.com/. All topic will start by "DustAcademy/".