A simple Internet of Things experiment, using an Arduino MKR1000 board to control two LEDs and monitor a potentiometer, via Blynk app.
Things used in this project
Story
A simple Internet of Things (IoT) experiment using an Arduino MKR1000 and Blynk. Watch the video below to see it in action, then follow the instructions to build your own!
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
- Arduino IDE (download here)
- Blynk mobile app
- Android (download here)
- iOS (download here)
- WiFi101 library (read how to install here)
- Blynk library (download here)
2. Set Up Blynk App ?
- Open Blynk app, login then create a new project. Choose device: Arduino MKR1000 with connection type: WiFi. Click Create button and you will receive Blynk Auth Token by email.
- On your project, add 2 button widget and a gauge. Set each widget as the picture below.
3. Schematics ??
- Connect your parts to Arduino MKR1000 as the following picture:
4. Sketch ?
- First, extract Blynk library then copy it to C:\…\Documents\Arduino\libraries.
- Open Arduino IDE then copy sketch below. Insert your WiFi SSID, WiFi password & Blynk Auth Token. Make sure you have chosen the right option for Board and Port under Tools menu. Upload it!
#define BLYNK_PRINT SerialUSB
#include <SPI.h>
#include <WiFi101.h>
#include <BlynkSimpleWiFiShield101.h>
char auth[] = "Blynk_Auth_Token";
char ssid[] = "Your_WiFi_Name";
char pass[] = "Your_WiFi_Password";
void setup(){
SerialUSB.begin(9600);
Blynk.begin(auth, ssid, pass);
}
void loop(){
Blynk.run();
}
5. Have Fun! ?
- After uploading done, make sure your Arduino MKR1000 and smartphone has a good internet connection. Click play button ▶️ on top right corner of your Blynk project, then you’re ready to go! Have fun!
Code
Source : Arduino MKR1000 & Blynk