Project tutorial
Arduino MKR1000 & Thinger

Arduino MKR1000 & Thinger © GPL3+

A simple Internet of Things experiment, using an Arduino MKR1000 board to control two LEDs and monitor a potentiometer, via Thinger.io.

  • 471 views
  • 0 comments
  • 3 respects

Components and supplies

Apps and online services

About this project

A simple IoT (Internet of Things) experiment using an Arduino MKR1000 and the Thinger IoT platform. Watch the video below to see it in action, then follow the instructions to build your own!

Arduino MKR1000 & Thinger

1. What You Need 🎁

To build this project, you will need the following items:

  • 1 Arduino MKR1000 board
  • 2 LEDs
  • 1 potentiometer
  • 1 breadboard
  • Some jumper wires

2. Set Up Virtual Device on Thinger πŸ“±

  • First, you have to sign up or login to Thinger.io. Then create a virtual device: click Devices menu, and click +Add Device button. Fill out the forms: Device ID, Device description & Device credentials, then click Add Device.

3. Schematics πŸ”§πŸ”¨

  • Connect your parts to Arduino MKR1000 as the following picture:

4. Sketch πŸ“‹

  • Make sure the WiFi101 & Thinger library are installed. Open Arduino IDE then copy the sketch below. Insert your Thinger username, Device ID, Device Credentials, WiFi name and WiFi password. Make sure you have chosen the right option for Board and Port under Tools menu. Upload it!
#define _DISABLE_TLS_
#include <WiFi101.h>
#include <ThingerWifi101.h>
#define USERNAME "your_thinger_username" 
#define DEV_ID "your_device_id" 
#define DEV_CRED "your_device_credential" 
#define SSID "your_wifi_name" 
#define SSID_PASSWORD "your_wifi_password" 
ThingerWifi101 thing(USERNAME, DEV_ID, DEV_CRED);
void setup() {    
    pinMode(0, OUTPUT);    
    thing.add_wifi(SSID, SSID_PASSWORD);    
    thing["led"] << digitalPin(0);    
    thing["led2"] << analogPin(1);    
    thing["pot"] >> outputValue(analogRead(A0));
}
void loop() {    
    thing.handle();
}

5. Set Up Dashboard on Thinger πŸ“±

  • Go to Dashboards menu & click +Add Dashboard button. Then fill out the forms: Dashboard Id, Dashboard name & Dashboard description, then click Add Dashboard button.
  • Go to your dashboard, then create widgets to control and/or monitor your device. On your dashboard click +Add Widget& feel free to use any Thinger's widgets. On this project, I use:
  • On/Off State (to control my LED on/off),
  • Slider (to control the brightness of my LED),
  • Donut Chart (show my potentiometer value as a gauge), and
  • Time Series Chart (show my potentiometer value as a bar graph).

6. Have Fun! 😎

  • After everything is done, make sure your Arduino MKR1000 has a good internet connection. On your Thinger's dashboard you can control your LEDs and monitor your potentiometer value! Have fun!

Lintang Wisesa πŸ’Œ lintangwisesa@ymail.com

Facebook | Twitter | Google+ | Youtube | GitHub | Hackste

Code

Arduino MKR1000 & ThingerC/C++
#define _DISABLE_TLS_
#include <WiFi101.h>
#include <ThingerWifi101.h>

#define USERNAME "your_thinger_username"    // Thinger username
#define DEV_ID "your_device_id"             // Thinger device ID
#define DEV_CRED "your_device_credential"   // Thinger device credential

#define SSID "your_wifi_name"               // wifi SSID
#define SSID_PASSWORD "your_wifi_password"  // wifi password

ThingerWifi101 thing(USERNAME, DEV_ID, DEV_CRED);

void setup() {
    pinMode(0, OUTPUT);
    thing.add_wifi(SSID, SSID_PASSWORD);
    thing["led"] << digitalPin(0);
    thing["led2"] << analogPin(1);
    thing["pot"] >> outputValue(analogRead(A0));
}

void loop() {
    thing.handle();
}

Comments

Similar projects you might like

Arduino MKR1000 & Blynk

Project tutorial by Lintang Wisesa

  • 1,466 views
  • 0 comments
  • 3 respects

Arduino MKR1000 & Favoriot

Project tutorial by Lintang Wisesa

  • 577 views
  • 0 comments
  • 3 respects

Home Automation with Arduino MKR1000 and Windows 10

Project tutorial by Ioannis Kydonis

  • 10,495 views
  • 1 comment
  • 34 respects

Christmas Tree Water Level via Cayenne and MKR1000

Project showcase by Ian Zahn

  • 2,486 views
  • 0 comments
  • 6 respects

Send MKR1000 Data to Google Sheets

Project tutorial by Stephen Borsay

  • 14,859 views
  • 29 comments
  • 40 respects

Arduino MKR1000 Weather Station

Project tutorial by Tadeas Dvoracek

  • 10,090 views
  • 4 comments
  • 26 respects
Add projectSign up / Login