IoT Projects Made Simple — How to Connect Your Project to the Internet
One of the most popular questions we get from circuito.io users is How to Connect Projects to the Internet. Connecting physical devices to the Internet, or the Internet of things (IoT), allows users to monitor and control their devices over the internet.
Up until a couple of years ago, connecting devices and projects to the internet was not so simple. Wifi modules such as Xbee were quite expensive and not very intuitive. Then came ESP8266 — a game-changer in the world of IoT projects. With IoT, you can get constant updates and alerts from sensors in your project. You can also activate your devices directly from a mobile phone or computer. Once your project is connected to the internet, there’s a whole new world — or Internet — of things you can do!
Today we’ll discuss the most popular Wifi modules available on the market, as well as which one we chose to implement first on circuito.io. We’ll also take a look at some of the amazing IoT platforms for making beautiful dashboards and controlling your IoT projects. And, finally, we’ll show you some cool and simple IoT project ideas to get you started. Ready to begin?
If you want to connect your project to the Internet, you need an internet-enabled device. You can either connect the device directly using an Ethernet connection, or you can use a wireless connection. You have a few different options here, such as Bluetooth, Wifi, and cellular connections. In this post, we’ll focus on Wifi. As you may have guessed, there are also quite a few different types of Wifi modules available.
Which Wifi module should you choose for your IoT project?
It really depends on your project. Things that you need to consider include cost, development environment, code language, and security. We’ve laid out the most popular Wifi modules on the market today:
ESP8266 is actually a “family” of 12 different Wifi modules with a few variations between them. Generally, they are low-cost Wifi modules that allow microcontrollers (MCUs) access to Wifi networks. ESP8266 has a self-contained SOC (system on a chip), which means that it can work independently, without an MCU. In other words, it basically acts as a small computer.
However, it is also possible to connect it to Arduino via software serial, which introduces the potential for more GPIOs (General Purpose Input Output) in addition to other benefits.
The most popular models are ESP8266–01 and ESP8266–12. There are quite a few boards that are based on ESP8266–12. We’ll cover them shortly. If you want to learn more about ESP8266, there is a community forum dedicated solely to ESP8266.
All of these boards are based on ESP8266–12. The problem with this board is that it’s not very comfortable to work with (no FTDI, less GPIOs). These boards basically make the ESP8266–12 more breadboard-friendly.
The ESP32 was described as Espressif’s new wonder-chip. This little Wifi module is the hottest thing around. Besides its (obvious) Wifi capabilities, it also has a double core and 36 GPIOs! That’s a lot compared to the ESP8266, which only has up to 9 GPIOs.
One other great thing about it is that it’s open-source, so there is much more documentation on it than there was on the ESP8266. You can find more technical details about it on Sparkfun’s Enginursday and the many updates on Hackaday’s blog.
Both ESP8266 and ESP32 are Arduino compatible.
There are two other options that can’t be ignored if you’re looking to build an IoT project:
Photon is Particle’s Wifi module. It has a lot in common with the ESP modules. However, if you want to work with the Photon, you’ll have to work with Particle’s eco-system and web IDE. That’s not a bad thing, necessarily; it just means that you’ll need to learn how to work in a different development environment.
Raspberry Pi is a bit of a different story. It’s not exactly an MCU like Arduino but, rather, it’s an actual computer running Linux OS. Among its many features is built-in Wifi, which makes it a great candidate for more complex IoT projects. It also has a much stronger processor then Arduino and it’s based on Python, so the development environment and libraries available are different than what you’d see in Arduino projects. It’s great if you want to do projects that involve voice or image recognition.
How is IoT implemented in circuito.io?
On circuito.io, we decided to integrate the ESP8266 Wifi module since it’s affordable, easy-to-use, popular, and reliable. However, as explained above, it has weak GPIO capabilities. That’s why we decided to implement it as a peripheral component and not as a standalone board.
If all this technical talk is gibberish to you, that’s totally fine. Just make sure that, when you buy it for your project, you’re buying ESP8266–01. There are many other ESP8266 modules, so it’s easy to mix them up at a glance. One last thing you’ll need is the Logic Level Converter. This is a component that safely steps down 5v to 3.3v.
If you’re going to use a Wifi module (of any kind), you need an active Wifi network to work with, and it needs to be one you have access to. Don’t go through all this trouble just to find out that you don’t have the Wifi password!
Once you have your Wifi module and your network credentials, you’re pretty much set to go on connectivity. If you decide to build your project with circuito.io, choose “add connectivity.” That’s the green plus sign on the left side of the builder.
Don’t forget to select the components you want to use and click “Generate” to get your circuito.io reply. After you put together your circuit and open the code in the Arduino IDE, you’ll have the option to insert your Wifi credentials into the code.
After that, upload the code to your Arduino and your project will be connected to your Wifi network! Now you can get data and control your project through your mobile phone or computer.
Apps and platforms for your IoT project
There are many services that can do this for you. One of them is Dweet. Dweet is a messaging service for IoT devices. What it does is send data from your device to the cloud by “Dweeting” it with a simple API (sort of like Twitter). Once you have this data handy, you’ll probably want to display it on a beautiful and easy-to-use dashboard. One of the best options we’ve found for this is freeboard.io. It’s a simple and intuitive display solution. Freeboard can be integrated with your Dweet project so everything works together in harmony.
There are many other IoT platforms that do a great job of collecting information from your Wifi-connected projects, then presenting them or controlling them. These services communicate with your device (and allow you to send commands) through cloud servers. Blynk and Cayenne are excellent platforms to start with.
Particle is a bit different. They refer to their platform as a “full-stack IoT device platform.” In order to work with Particle, you need to purchase one of their processors: either photon for Wifi or Electron for cellular. Programming is done on their online IDE. For some users, this can be a great solution — it has structured building blocks, and Particle includes everything you need to deploy an IoT product, including:
- a device cloud platform
- connectivity hardware
- and even SIMs for cellular products
Read more about the pros of using Particle in an in-depth article by Larry Halff from Bright/contrast. And, while you’re at it, also check out Porter, which connects to your Particle and allows you to control and interact with your project through a customized dashboard. Talk about a full IoT experience.
There is one other option: you can use a local web socket. This will work on your LAN system at home, and it’s much faster (since it doesn’t have to connect to a server far away). It’s also fully customizable and offers a reduced chance of security breaches compared to using apps and online services. This tutorial demonstrates how you can do this with Neopixel LEDs, but you can also use a local web socket for other projects. One other benefit of using a web socket is that you can build much richer HTML pages. That’s because the processing is done externally (on your computer) instead of on your Arduino.
So what are you going to make?
We’ve covered the technical sides of connecting your project to the internet. We’ve reviewed the different options you have in that regard. Of course, there are many variations and new solutions coming out all the time, so it’s best to stay up-to-date on the newest innovations. We’ll also be updating this post to keep you in the know.
Now that you have a better idea of how this whole loT thing works, we can get down to the good part — loT project ideas!
- IoT pet feeder: An automatic food dispenser for your dog, built with an ESP8266–01 wifi module and a PIR sensor. When the sensor detects movement, it triggers the servo and opens the dispenser. There’s a lot of different tweaks and additions you can add to this simple yet useful project. All the details are here.
- Alexa Trigger: This project also uses an ESP8266, but this time to connect Alexa to the internet via relay. This is actually a DIY version of a smart home infrastructure! So, if you want to give your ESP8266 a try, this could also be a nice project to begin with.
- Control an Arduino Robot with ESP8266: If you’re more into moving objects, you can control an Arduino robot with the ESP8266. In this project, the robot is given commands through the smartphone. Those commands are received through the ESP8266 device. The creator of this project could have also chosen to make this project with an InfraRed sensor, which would allow him to control his robot remotely. However, using your smartphone for this type of project opens up a much wider array of possibilities. Plus, you can also build your own app and customize it to fit your vision. And, after all, isn’t that what making is all about?
- Moisty — Orchid & Plant IoT w/ Blynk: Orchids are very delicate flowers. They need very specific amounts of water and humidity. Since it’s quite difficult to test the moisture levels due to media density, the program uses digital pins to power the sensor. Then, it takes the readings and puts them back into analog inputs. If you uncomment the push notifications in the code, the system will alert you when the moisture levels are too low.
- Solar power meter: This is a nice little project that can help you measure the voltage, current, and power supply; in this case, you’re measuring those properties on a solar panel. The meter is connected to Cayenne, another great dashboarding tool.
There are many more projects out there that you can make using ESP8266 and other IoT devices. IoT allows an optimal integration between the physical and virtual world. We are seeing big players in the market, such as Intel, focusing more and more on IoT development. Intel Edison and Intel Curie are just two examples.
We hope you find this article useful. We’d love to hear your feedback and see your IoT projects. One of our goals at circuito.io is to allow a simpler introduction to making. This is one of the reasons why we decided to implement IoT on circuito.io the way we did: because it allows beginners with minimal understanding of code and hardware to connect their projects to the internet with minimal effort.
You are more than welcome to leave us comments and feedback. We’d love to hear what you think.
Originally published at circuito.io on May 16, 2017.