Maker.io main logo

Hands on with the Adafruit Feather Huzzah ESP8266 IoT kit

2017-01-03 | By Maker.io Staff

Wireless Wifi Adafruit Feather ESP8266

The Adafruit Feather ESP8266 is the latest addition to the Feather range of development boards. Just like all the other Feather boards it keeps the same form factor with a thin and light PCB footprint, ideal for tight spaces.

This particular Feather board is based around the ESP8266 WiFi module, the most popular IoT module out on the market. It is clocked at 80MHz and running at 3.3V logic, and there are a number of ways to program (such as using the Arduino IDE) thanks to the SiLabs CP2104 USB-Serial chip. The board also has a helpful auto-reset function which can be such a pain having to hook-up a button to reset the board when uploading the code, this takes the stress out of getting ESP8266 to work. According to Adafruit the CP2104 Serial chip also has better driver support.

Like the other Feather boards, this one also features a JST connector for hooking up any 3.7V Lithium polymer batteries to it and also features a built-in charging circuit via USB.

Adafruit.IO

Adafruit IO is a complimentary service that runs hand in hand with their many IoT development boards. Currently in Beta, Adafruit IO focuses on the simplicity of creating data connection using a wide range of IoT devices with ease. It includes a number of client libraries for Arduino, Ruby, Python and Node.js with REST and MQTT API’s.

At the centre of the Adafruit IO are feeds, which are used to store data and metadata values. For each individual value you push or pull from the Adafruit IO website you will require a unique feed.

Adafruit IO Feeds

Adafruit IO Feeds

Not only can you push and pull data but there is also a comprehensive dashboard, which users can use to visualise data coming in on the feeds but also control things on your board. There are a whole bunch of widgets such as charts, sliders, buttons and gauges.

Adafruit IO Dashboard

Adafruit IO Dashboard

What’s in the Kit

Adafruit Feather HUZZAH IoT Kit Contents

Adafruit Feather HUZZAH IoT Kit Contents

The Adafruit Feather HUZZAH IoT Kit comes with a whole bunch of stuff to get you started with such as sensors, actuators, motors and LEDs. The kit was designed for people who are interested in using the Adafruit Feather platform with WiFi for connecting everyday objects to the internet. Adafruit has done a nice job of packaging everything together in a way that makes things easier to connect for beginners. The kit includes the following components:

  • Adafruit Feather HUZZAH
  • Vibration sensor
  • DHT22 temperature sensor
  • PIR motion sensor
  • Magnetic contact switch
  • Micro Servo motor
  • SPDT slide switch
  • RGB LED
  • Piezo buzzer
  • Photo cell light sensor
  • 3x 12mm Tactile switches
  • 10mm Red/Green LEDs
  • 10k Potentiometer
  • Resistors 10K/560R

Getting Started

The first thing you will need to do is to solder the headers onto the Feather board so that it can then be inserted into a breadboard for easy prototyping. The best way to do this is to insert the headers into the Breadboard and then place the Feather board on top, this way the headers will be soldered aligned.

Prepare the header strip

“Prepare the header strip” by Adafruit is licensed under CC BY 3.0

Add the breakout board

“Add the breakout board” by Adafruit is licensed under CC BY 3.0

By default, the Feather HUZZAH comes with NodeMCU’s Lua interpreter, but instead you can also use the Arduino IDE which most of you may be familiar with using. In order to upload code to the board you will need to connect a micro USB cable to your computer and install the CP2104 USB driver for you operating system. You can download the drivers from the Silicon Labs website.

Download the latest version of the Arduino IDE from the Arduino.cc website. Open up the Arduino IDE and head to the board manager to install the ESP8266 package. After the install process has finished you should see a list of ESP8266 board including the Feather board.

Boards Manager

Boards Manager

At this point you can test that everything is working as it should by uploading the Blink sketch from the Arduino examples. Select the Feather board from the Tools>Board menu and then select the CPU Frequency at 80MHz, Flash Size 4M (3M SPIFFS) and the 115200 baud rate at which to transfer the serial data over USB. Select the COM port for the Feather board and then upload the Blink sketch. After a few moments you should see the on-board LED blinking on and off.

Select the Feather COM Port

Select the Feather COM Port

Now that you have the Arduino IDE setup and talking to your Feather board, you can now install the Adafruit IO library. This allows you to talk to the Adafruit IO platform and includes a number of useful examples to get started.

In the Arduino IDE, head to Sketch > Include Library > Manage Libraries. In the Library Manager search for ‘adafruit io arduino’ and you should see the library listed. Click ‘Install’ button to install the library to the Arduino IDE. You can also install the Adafruit MQTT library here, I won’t be using it in this article but it is worth looking at for future projects. Search for ‘adafruit mqtt’ and install the library.

Adafruit IO Examples

Now that everything has been installed and all of the dependencies have been met, it is now time run the first example to make sure that the Feather HUZZAH board can connect to the WiFi and also send data to the Adafruit IO platform. The first example we will look at is to send a value to the cloud incrementing its value every second starting from zero. This example will also show you how to configure your Feather board for connectivity, which you can carry over to all the other examples in the Arduino IDE. Open up the ‘adafruitio_00_publish’ example in File > Examples > Adafruit IO Arduino.

In the sketch window, click the ‘config’h’ tab in which you will use to enter your Adafruit IO and WiFi settings to connect to. Before you enter your setting you will need to get your unique Adafruit IO Key, which is unique to your account. Login to io.adafruit.com and in your Dashboard menu on the right hand side click the yellow key button to retrieve your key. A window will pop up with your Adafruit IO key, make a copy of this key but also keep it safe.

Adafruit IO Key

Adafruit IO Key

Heading back to the Arduino IDE, in the ‘config.h’ file enter your Adafruit IO username and Key and also enter your WiFi credentials:

#define IO_USERNAME "your_username"
#define IO_KEY "your_key"

#define WIFI_SSID "your_ssid"
#define WIFI_PASS "your_pass"

If you haven’t done so already, select your Feather HUZZAH board from the menu, Tools > Board > adafruit HUZZAH ESP8266 and select the communication port. Now click the upload button to compile an upload the sketch to your Feather HUZZAH board.

Upload Sketch to Feather HUZZAH

Upload Sketch to Feather HUZZAH

The upload will take a few moments and once done so it will start sending data to Adafruit IO platform. To make sure it is sending the data before we head over to Adafruit IO dashboard you can open up the Serial window and you should see the Feather HUZZAH outputting something like in the figure below.

Serial Output

Serial Output

Now that the Feather HUZZAH is sending data to Adafruit IO, you can view the incoming stream on io.adafruit.com by adding a stream block to the dashboard. In order to do this, you can click on the blue ‘+’ icon on the right hand side of the dashboard.

Adding a Block to the Dashboard

Adding a Block to the Dashboard

In the next window you will see a comprehensive list of widgets in which you can add to your dashboard. In here select the ‘Stream’ block and click ‘Create’.

Create a Stream Block

Create a Stream Block

In the next window you should see the Feed which is coming from your Feather HUZZAH board. You will see information such as name of feed, last value sent and last recorded time stamp the data was sent. Choose the Feed ‘counter’ and click ‘Next Step’.

List of available Feeds

List of available Feeds

In the next window you can configure how you want the data to show and change some of the info in which appears on the stream. If you’re not interested in this, then just hit the ‘Create Block’ button for it to be added to your dashboard.

Creating a Block

Creating a Block

In the dashboard you should now see the data that is being sent from your Feather HUZZAH board to your Adafruit IO dashboard.

Stream Output

Stream Output

Not only can you send data to Adafruit IO but you can also receive data from Adafruit IO by using the subscribe method. This allows you to control things from the dashboard such as a Servo motor or some LEDs. There are some examples showing how to control digital and analog outputs form your Adafruit IO dashboard such as switching on an LED or using a slider widget to control the level of brightness on an LED.

Summary

After using the Adafruit Feather HUZZAH Kit for a number of days I have been somewhat impressed with its simplicity. For beginners wanting to get started with the ESP8266 and the Adafruit IO platform this is the perfect way to get started with creating your own IoT projects. It doesn’t just stop there, there are a number of options for experienced users such as programing in Python, Ruby and even Node.js allowing users to convert exhibiting projects into IoT projects. I will definitely think twice before selecting hardware for my next IoT projects.

The views expressed in this article are from my own user experience in getting started with the Adafruit Feather HUZZA IoT Kit. Some information has been taken from the Getting Started Guide by Adafruit.

制造商零件编号 2821
ESP8266 FEATHER HUZZAH LOOSE HDR
Adafruit Industries LLC
¥121.69
Details
Add all DigiKey Parts to Cart
TechForum

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.

Visit TechForum