Introduction: TfCD: Rapid Prototyping IoT Devices
Blynk.cc is an application and framework for simplifying IoT prototyping. It takes away the boilerplate code for sending and receiving data on the Arduino side, and entirely eliminates the development process of a phone side application (Williams, 2016). This allows hobbyists and small companies make IoT projects.
Using this framework you will have make your very own IoT thermometer for just a few dollars in about 10 minutes!
See if you can join more thermometers to the network, or even try to set up a Blynk notification (http://docs.blynk.cc/#widgets-notifications) to let you know if someone forgets to close the door or leaves the oven on. And above all, keep having fun!
Step 1: Prior Knowledge and Libraries
This instructable assumes that you already have and know the basics of the Arduino environment. Furthermore it relies on the following libraries:
https://github.com/jfturcot/SimpleTimer https://github.com/adafruit/Adafruit_Sensor https://github.com/adafruit/DHT-sensor-library https://github.com/blynkkk/blynk-library
Additionally, you need to install the ESP8266 core here: https://github.com/esp8266/Arduino#installing-with-boards-manager
Step 2: Getting the Hardware
The only hardware needed for this projects (besides a laptop for programming) is:-1 WeMos D1 Mini (https://goo.gl/XUKBJU)
-1 WeMos D1 Mini DHT22 shield (https://goo.gl/CRSSk8) -1 Android or Iphone that is able to run http://www.blynk.cc/getting-started/
Once you have ordered your D1 Mini and shield, it is a simple matter to solder them together and attached them
Step 3: Setting Up Blynks
Please follow the getting started tutorial for Blynk, found here: http://docs.blynk.cc/#getting-started-getting-started-with-the-blynk-app
From steps 1 to 4, selecting the ESP8266 as your hardware platform in step 3.
In our case, we want to see the real time temperature in the room, so instead of adding the button widget from step 5, add a graph widget and configure it so that the maximum number is 30 and the input is virtual pin 6 (see picture)
Step 4: Getting the Code on the WeMos D1 Mini
Kindly go to: https://github.com/womei/BlynkDHT/blob/master/BLYNKDHT22.ino and download the file to you computer and open it with the Arduino IDE. Once it is open, select the WeMos D1 Mini from the boards menu and be sure to select the correct serial port.Replace the auth variable with the token from your Blynk app (found when you go to project settings, the nut icon) and replace SSID with the name of your wifi network and pass with its password.
The rest of the code is fairly straightforward, it combines the Blynk.cc standard ESP8266 example (https://github.com/blynkkk/blynk-library/blob/master/examples/Boards_WiFi/ESP8266_Standalone/ESP8266_Standalone.ino) with the DHT library tester example: https://github.com/adafruit/DHT-sensor-library/blob/master/examples/DHTtester/DHTtester.ino
In short, it initiates both Blynk.cc and the DHT sensor, then reads the value of the sensor once every second using the timer library and updates Blynk with the corrosponding values/
Step 5: Putting It All Together and Testing
Upload the code to the WeMos D1 mini and check the serial monitor, if all goes well Blynk will print out that it is connected.
Run the Blynk project on your phone and you should see similar results to the picture.
The temperature usually does not varey that much, so be sure to test it by blowing hot or cold air on it, or taking it outside.
Step 6: Celebrate
Congratulations, if all went well you will have made your very own IoT thermometer for just a few dollars in about 10 minutes! See if you can join more thermometers to the network, or even try to set up a Blynk notification (http://docs.blynk.cc/#widgets-notifications) to let you know if someone forgets to close the door or leaves the oven on. And above all, keep having fun!