Goal: Using IKEA's new greenhouse, build an experiment kit for my son's classroom where they can measure temperature and humidity (with the built in sensors), control the operation of a small fan to adjust the environment and publish/graph the data to the Blynk platform with Sparkfun's Blynk Board (ESP8266).
(from https://learn.sparkfun.com/tutorials/getting-started-with-the-sparkfun-blynk-board)
Download Blynk App
Blynk App – The Blynk smartphone app comes in two flavors: iOS and Android. Before going any further, download the app to your smart device.
Local Internet-Connected Wireless (Wi-Fi) Network – The Blynk Board is equipped with Wi-Fi support, and should be able to connect to most home wireless networks: 2.4GHz Wi-Fi networks, that are either open (no password) or protected with WPA, WPA-2, or WEP authentication.
Note that the Blynk Board cannot connect the 5GHz band of a dual-band Wi-Fi router. If your Wi-Fi router has two visible options, like HOME-AB12-2.4
and HOME-AB12-5
, connect the Blynk Board to the “2.4” option.
Once you’ve gathered all of the materials from above, it’s time to power up the Blynk Board! Grab your USB Cable, plug one end into a computer or USB wall adapter, and plug the other into the Blynk Board.
You should immediately see the small, red “PWR” LED illuminate, followed shortly thereafter by a random-looking blinking of the large, RGB LED.
Identifying Your Blynk BoardWhile the Blynk Board’s RGB blinking may look random at first, it will follow a repeating pattern – a unique sequence of four colors including either red, green, blue, purple, or yellow, with a long stop in between. This color-code will help identify your board, just in case you’re not the only one in town setting up a Blynk Board.
Four characters matching that color code will be added to the name of your Blynk Board. For example, if the RGB LED is blinking a pattern of blue, green, red, green..
…the Blynk Board name will be BlynkMe-BGRG.
The table below documents which color matches which character.
Color Blynk Name Character
Red R
Green G
Blue B
Purple P
Yellow Y
RGB Status CodesDuring setup, the RGB LED on the Blynk Board will be your indicator to it's state. The board uses this multi-colored LED to indicate all sorts of status modes. If you’re ever unclear of what the RGB color-code means, consult the table below:
In order to connect the Blynk Board to your local Wi-Fi network – and the Blynk app – you’ll need to send it a few pieces of information, including the name and password of your Wi-Fi network. This is a process called provisioning.
Provisioning?
In the provisioning process, we'll use a smartphone, laptop, or computer to connect to directly (over Wi-Fi) to the Blynk Board. Once connected, your smart-device will send the necessary data and tell the Blynk Board to go connect to your Internet-connected wireless network and Blynk.
The Blynk Board is initially configured to operate as a Wi-Fi access point (abbreviated "AP", kind of like a router). A smartphone or Wi-Fi-enabled computer can briefly connect to the Blynk Board, and, using either the Blynk app or a browser, send all of the necessary information over to it. After the Blynk Board receives that info, it'll transition from AP to Wi-Fi device and connect to your Wi-Fi network.
The Blynk Board has plenty of backup provisioning options, but the easiest method is through the Blynk app. Both iOS and Android versions of the Blynk app support Blynk Board provisioning. All you’ll need is the Blynk QR-Code Card, included with your Blynk Board.
The setup process in each OS looks and feels a little different.
----------------------------
iOS ProvisioningIf you haven’t already, download the Blynk App from the App store. Then open it, create an account and log in.
If you already have the Blynk app installed on your phone, make sure it’s updated to the latest release!
Scan the Blynk Board QR CodeClick the QR-code icon in the top-right corner of the Blynk app.
Then scan your phone camera over the QR code on your Blynk Board card. Blynk should pop up a new screen – congrats, you’ve got some new Blynk energy to play with!
From the “Congrats!” page, hit Set Up New Device, read through the "Pre-Flight Checklist", and – as long as your Blynk Board is powered up and blinking the unique color code – hit Continue.
Read through the "Connect to Device" screen, and hit Open Wi-Fi Settings to swap over to your iDevice’s Wi-Fi settings.
You may have to wait a few seconds for your device to scan for networks, but you should eventually see a Wi-Fi network named BlynkMe-CCCC. If that color code matches your Blynk Board’s pattern, select that network.
The connecting process may take up to a minute to complete – eventually, though, you should see a checkmark next to the BlynkMe network. The Blynk Board will begin to blink purple – faster than before – when a device has connected to it.
The Blynk app may (or may not) pop up a notification indicating it has sensed a connection to a BlynkMe network. If so, hit open. If the notification isn’t popping up, but you have a checkmark next to the BlynkMe network, hit Back to Blynk in the upper-left corner.
Connect the Blynk Board to Wi-Fi/BlynkOn the next screen, enter the name and password of your Wi-Fi network. While typing the password, hit the eye icon (eyecon?) if you want/need to show your password.
After typing both your network name and password in exactly (both fields are case-sensitive, and be careful not to add any spaces at the end), hit continue.Monitor the Blynk Board's RGB LED
While it connects to Wi-Fi and Blynk, the Blynk Board will use the RGB LED to keep you informed on its progress.
After hitting "Continue", your Blynk Board should begin to blink blue, which indicates it’s attempting to connect to your Wi-Fi network. This process usually takes around 10 seconds, but if it still hasn’t connected after 30 seconds, it will give up and go back to setup mode.
If the provisioning process isn't going as planned – whether it's failing to connect to Wi-Fi or Blynk – try cycling power to your Blynk Board (unplug and re-plug the USB cable in), and starting from the beginning.
If you're still not having any luck provisioning through the app, you may have to use an alternative provisioning process.
After the Blynk Board successfully connects to your Wi-Fi network, it will establish a connection with the Blynk Cloud. During this process, it will blink a soft, Blynk-colored green.
Finally, after a successful Blynk cloud connection, you should see the “Finished!” page. The RGB should be smoothly fading in-and-out. If so, click Done and Blynk will take you to a fresh Blynk Board project.
If you had trouble provisioning your Blynk Board, try giving the whole process one more shot. Cycle power to your Blynk Board, by unplugging it and plugging it back in. Then try again from step 1.
If you're still not having any luck, consult the Troubleshooting section of this tutorial.
------------------------------
Android ProvisioningIf you haven’t already, download the Blynk App from the Google Play store. Then open it, create an account and log in.
Or, if you already have the Blynk app installed on your phone, make sure it’s updated to the latest release!
Scan the Blynk Board QR CodeClick the QR-code icon in the top-right corner of the Blynk app (or the bigger icon on the main screen).
Then scan your phone over the QR code on your Blynk Board card. Blynk should pop up a new screen – congrats, you’ve got some new Blynk energy to play with!
From the “Congrats!” page, hit Set Up New Device, read through the Pre-flight checklist and – as long as your Blynk Board is powered up and blinking the unique color code – hit Continue.
This next page is where you’ll select your Blynk Board. Scroll through the device list and select a network named BlynkMe-CCCC (one may already be selected). Make sure that color code suffix matches your Blynk Board’s RGB LED blinking.
Hit Continue. The app should attempt to connect to your Blynk Board. After a few seconds you should see the Blynk Board’s RGB LED blink purple – faster than before – and the app should present you with a “Connected to BlynkMe” page.
From there hit Continue to proceed to the Wi-Fi provisioning.
Connect the Blynk Board to Wi-Fi/BlynkOn the next screen, select your Wi-Fi network from the scroll bar. Then enter your network’s password.
After both network and password are correctly entered (both fields are case-sensitive! be careful not to add any spaces at the end), hit continue.
Monitor the Blynk Board's RGB LEDWhile it connects to Wi-Fi and Blynk, the Blynk Board will use the RGB LED to keep you informed on its progress.
Your Blynk Board will begin to blink blue, which indicates it’s attempting to connect to your Wi-Fi network. This process usually takes around 10 seconds, if it still hasn’t connected after 30 seconds, it will give up and go back to setup mode.
If the provisioning process isn't going as planned – whether it's failing to connect to Wi-Fi or Blynk – try cycling power to your Blynk Board (unplug and re-plug the USB cable in), and starting from the beginning.
If you're still not having any luck provisioning through the app, you may have to use an alternative provisioning process.
After the Blynk Board successfully connects to your Wi-Fi network, it will establish a connection with the Blynk Cloud. During this process it will blink a soft, Blynk-colored green.
After a successful Blynk cloud connection, you should see the “Finished!” page. And the RGB should be smoothly fading in-and-out.
From there, click Done and Blynk will take you to a fresh Blynk Board project.
If you had trouble provisioning your Blynk Board, try giving the whole process one more shot. Cycle power to your Blynk Board, by unplugging it and plugging it back in. Then try again from step 1.
If you're still not having any luck, consult the Troubleshooting section of this tutorial.
-----------------------------------------
TroubleshootingIf, for any reason, you can’t successfully provision the Blynk Board through the Blynk app, you have a few alternatives. But first, you’ll need to create a new Blynk project.
Creating a Blynk ProjectEach of the alternative provisioning methods below will require a Blynk project to be previously created. The new Blynk project will be assigned a Blynk auth token – a 32-character, unique string, which connects the Blynk Board to your Blynk project. That’s what we’re after in this process.
Follow these steps to create a new Blynk project and get a new auth token:
Create a Blynk ProjectOpen the Blynk app, and log in if you haven’t. Make sure your phone is connected to an Internet-connected Wi-Fi network. On the Blynk main page, select Create new project.
Create a new Blynk Project by tapping “Create New Project” on the Blynk main page.
Configure the Blynk ProjectOn the next page, select SparkFun Blynk Board under the “Hardware Model” list. You can give the project any name you please – the provisioning process sets it to “BlynkMe”.
Configure a new project: name it, and set the board type to “SparkFun Blynk Board.”
Do not hit Create Project yet!
Email and Copy the Auth TokenDepending on which alternative provisioning option you choose, you’ll either need the auth token copied to your phone’s clipboard, or sitting in your email inbox. Might as well do both while we’re here!
Tap the E-Mail button to send the auth token to your Blynk-connected email account. Then tap the Auth token itself to copy the string to your phone’s clipboard. The phone should pop up a notification confirming that the token was copied.
Create ProjectFinally, with the token emailed and copied, click Create or Create Project. You should be brought to a new, blank project – perfect for now!
Step 2: Wire Blynk & Circulation FanThe attached code was uploaded to the Blynk Board, and then an interface was built in Blynk. Virtual pins assignments are listed below, but are also visible in the image of the interface. You can set the displays to update as often as you wish, or set them to 'push' for updates every minute. Note that you must add the email widget in order to receive email alerts.
- V9: Temperature in Fahrenheit (float)
- V10: Humidity (float)
- V13: Fan State (on/off)
Comments