Build a cloud-ready temperature sensor with the Arduino Uno and the IBM Watson IoT Platform

Part 2: Write the sketch and connect to the IBM Watson IoT Platform

by Kyle Brown



Overview

In Part 1 of this four-part tutorial series, I discussed the design of a project for monitoring temperatures in my wiring closet, built by using the Arduino Uno and the Virtuabotix DHT11 temperature sensor. I showed the construction of the circuit for the project and walked you through the installation of the Arduino IDE and how to test out each of the individual components of the project with different Arduino sample sketches. You’re now ready to see the design of the sketch that ties the IoT project into the cloud and the steps to enable monitoring of realtime temperature and humidity data remotely. However, first I need to discuss the protocol that you’ll use to communicate with the IBM IoT Foundation: MQTT.

What is MQTT?

MQTT (formerly Message Queueing Telemetry Transport) is a lightweight, fast communications protocol designed for the Internet of Things. It has its origins at IBM (where it was originally developed by Andy Stanford-Clark), and it has since been submitted to Organization for the Advancement of Structured Information Standards (OASIS) for standardization, where the current version of the protocol standard is version 3.1. The MQTT V3.1 Protocol Specification specification states that its purpose is to be a “lightweight broker-based publish/subscribe messaging protocol designed to be open, simple, lightweight and easy to implement.” In the time since its introduction, the “easy to implement” part has certainly proven to be true, as several different libraries implementing MQTT clients have been developed. You can find links to nearly all of them at the Eclipse Paho project page.

MQTT is perfect for use in embedded devices because it:

  • Is asynchronous, with multiple different levels of quality of service, which is important in cases where Internet connections are unreliable.
  • Sends short, tight messages that make it handy for low-bandwidth situations.
  • Doesn’t require much software to implement a client, which makes it great for devices like the Arduino with limited memory.

MQTT is the protocol that the IBM IoT Foundation QuickStart is designed to take input on.

Resources

Learn
MQTT V3.1 Protocol Specification: Read the latest version of the MQTT specification.
IBM Internet of Things Foundation: Try out the IBM IoT Foundation and sign up for the beta program.
Arduino: Visit the Arduino website.
“Bluemix and the Internet of Things” (Ryan Baxter, developerWorks, July 2014): Find out how IBM Bluemix and the IBM IoT Foundation can work together.

Get products and technologies
MQTT client for Arduino: Click the GutHub link to download the client.
Mosquitto: Download the Mosquitto broker.
Eclipse Paho Project: Download MQTT clients.

Learn more

Goto Original
Goto Part1

저작자 표시 동일 조건 변경 허락
신고
블로그 이미지

밤소 MidnightCow

위즈네트 칩(W5300, W5200, W7100, W7500) 개발자

Twitter Connector

by Nearbus


Overview

This project consists of an Internet configurable clock that sends ON / OFF messages through Twitter to the NearBus connector. The NearBus connector forwards these messages to the Arduino Ethernet board (through Internet) who Turns On and Turns Off a power switch allowing in this way to control the light sequence form any place with a simple browser.

Note: It is important to remark that Twitter in contrast to its traditional use (as message platform) in this case is used as a "text transport channel" to carry the pseudo RESTful string (like to the http protocol). 

Component

To implement this project you will need:

  • 1 Arduino Ethernet Board
  • Power Relay (5Vdc coil - 110/220Vac 5Amp power side)
  • transistor BC548C (or equivalent)
  • 1 Diode 1N4148 (or equivalent)
  • Resistor ( 2 KOhm 1/4 W)
  • Ethernet Internet connection (with a RJ45 cable)
  • Difficulty Level: Low-Medium

Schematic


How to operate

  • STEP 1 - Setup a New NearBus Account
  • STEP 2 - Activate the Twitter Channel in NearBus
  • STEP 3 - Accept the NearBus Twitter Request
  • STEP 4 - Create a New IFTTT task
  • STEP 5 - Check the Twitter Messages
  • STEP 6 - Connect the Power Circuit

How to use Nearbus

Refer to http://nearbus.net/wiki/index.php?title=Help.


Learn More

Goto original source


저작자 표시 동일 조건 변경 허락
신고
블로그 이미지

밤소 MidnightCow

위즈네트 칩(W5300, W5200, W7100, W7500) 개발자

Power Meter

by Nearbus


Overview

This project show how to control Arduino Ethernet board with IoT cloud service - NearBus - and smart phone. You can turn on/off the heat and measure the current amount of the heat.


Component

To implement this App Note you will need:

  • 1 Arduino Ethernet Board
  • 1 Arduino Grove Shield
  • 1 Arduino Relay Shield
  • 1 Current Transformer
  • 1 Resistive Power Load - (aprox. 500W)

http://wiznetmuseum.com/wp/wp-content/uploads/2015/09/nearbus_power.png


Javasript & Smart phone & Xivley

You can show the logging data on smart phone by using javascript and Xively service.
For more detail, refer to http://nearbus.net/wiki/index.php?title=Power_Monitor


How to use Nearbus

Refer to http://nearbus.net/wiki/index.php?title=Help.


Goto original source


저작자 표시 동일 조건 변경 허락
신고
블로그 이미지

밤소 MidnightCow

위즈네트 칩(W5300, W5200, W7100, W7500) 개발자

Xively Temperature Controller

by Nearbus


Overview

This project is intended to show how to implement a simple Temperature Control System using the X-Controller NearBus feature.
The system works under the NearBus paradigm, this means that every sensed signal will be transmitted to the Cloud for its processing.
No processing is accomplished in the remote device that works in a transparent way, controlling the sensors and actuators through the NearBios functions.


Component

The system is composed by three main components:

  • The power switch: Arduino Ethernet/WiFi board + Relay driver
  • The temperature sensor: Arduino Ethernet/WiFi + temperature sensor ( LM35 lineal IC)
  • The NearBus X-Controller: An special NearBus feature that allows to interconnect remote devices using the Xively Cloud Infraestructure

How to operate

The temperature sensor is sampled each 2000 ms for example (a configurable value) and feed it to a proportional controller (with hysteresis to avoid a flapping output). The controller compare the sensed signal with its internal setting and decides to turn on or off the electrical heater in order to maintain the room’s temperature as near as possible to the configured value.


How to use Nearbus

Refer to http://nearbus.net/wiki/index.php?title=Help.


Goto original source


저작자 표시 동일 조건 변경 허락
신고
블로그 이미지

밤소 MidnightCow

위즈네트 칩(W5300, W5200, W7100, W7500) 개발자