Adafruit Feather HUZZAH ESP8266 Created by lady ada Last updated on 2018-01-11 03:27:01 PM UTC
Guide Contents Guide Contents Overview Pinouts Power Pins Logic pins Serial pins I2C & SPI pins GPIO pins Analog Pins Other control pins NC Pins Assembly Header Options! Soldering in Plain Headers 2 4 8 9 9 9 10 11 11 12 12 13 13 16 Prepare the header strip: Add the breakout board: And Solder! 16 17 17 Soldering on Female Header Tape In Place Flip & Tack Solder And Solder! 19 20 21 Power Management Battery + USB Power Power supplies Measuring Battery ENable pin Using NodeMCU Lua Open up serial console
Fabrication Print ESP8266 F.A.Q. 39 41 When I connect stuff to some of the pins, the Huzzah stops working.
Overview Feather is the new development board from Adafruit, and like it's namesake it is thin, light, and lets you fly! We designed Feather to be a new standard for portable microcontroller cores. This is the Adafruit Feather HUZZAH ESP8266 - our take on an 'all-in-one' ESP8226 WiFi development board with built in USB and battery charging. Its an ESP8266 WiFi module with all the extras you need, ready to rock! We have other boards in the Feather family, check'em out here.
At the Feather HUZZAH's heart is an ESP8266 WiFi microcontroller clocked at 80 MHz and at 3.3V logic. This microcontroller contains a Tensilica chip core as well as a full WiFi stack. You can progam the microcontroller using the Arduino IDE for an easy-to-run Internet of Things core. We wired up a USB-Serial chip that can upload code at a blistering 921600 baud for fast development time. It also has auto-reset so no noodling with pins and reset button pressings. © Adafruit Industries https://learn.
To make it easy to use for portable projects, we added a connector for any of our 3.7V Lithium polymer batteries and built in battery charging. You don't need a battery, it will run just fine straight from the micro USB connector. But, if you do have a battery, you can take it on the go, then plug in the USB to recharge. The Feather will automatically switch over to USB power when its available. © Adafruit Industries https://learn.adafruit.
Here's some handy specs! Measures 2.0" x 0.9" x 0.28" (51mm x 23mm x 8mm) without headers soldered in Light as a (large?) feather - 6 grams ESP8266 @ 80MHz or 160 MHz with 3.3V logic/power 4MB of FLASH (32 MBit) 3.3V regulator with 500mA peak current output CP2104 USB-Serial converter onboard with 921600 max baudrate for uploading Auto-reset support for getting into bootload mode before firmware upload 9 GPIO pins - can also be used as I2C and SPI 1 x analog inputs 1.
Pinouts © Adafruit Industries https://learn.adafruit.
Power Pins GND - this is the common ground for all power and logic BAT - this is the positive voltage to/from the JST jack for the optional Lipoly battery USB - this is the positive voltage to/from the micro USB jack if connected EN - this is the 3.3V regulator's enable pin. It's pulled up, so connect to ground to disable the 3.3V regulator 3V - this is the output from the 3.
RX and TX are the serial control and bootloading pins, and are how you will spend most of your time communicating with the ESP module The TX pin is the output from the module and is 3.3V logic.
If you want, you can connect to I2C devices using other 2 pins in the Arduino IDE, by calling Wire.
voltage you want to read that is higher, it will have to be divided down to 0 - 1.0V range Other control pins We have a few other pins for controlling the ESP8266 RST - this is the reset pin for the ESP8266, pulled high by default. When pulled down to ground momentarily it will reset the ESP8266 system. This pin is 3.3V logic only EN (CH_PD) - This is the enable pin for the ESP8266, pulled high by default. When pulled down to ground momentarily it will reset the ESP8266 system. This pin is 3.
Assembly We ship Feathers fully tested but without headers attached - this gives you the most flexibility on choosing how to use and configure your Feather Header Options! Before you go gung-ho on soldering, there's a few options to consider! The first option is soldering in plain male headers, this lets you plug in the Feather into a solderless breadboard © Adafruit Industries https://learn.adafruit.
Another option is to go with socket female headers. This won't let you plug the Feather into a breadboard but it will let you attach featherwings very easily © Adafruit Industries https://learn.adafruit.
We also have 'slim' versions of the female headers, that are a little shorter and give a more compact shape © Adafruit Industries https://learn.adafruit.
Finally, there's the "Stacking Header" option. This one is sort of the best-of-both-worlds. You get the ability to plug into a solderless breadboard and plug a featherwing on top. But its a little bulky Soldering in Plain Headers Prepare the header strip: Cut the strip to length if necessary. It will be easier to solder if you insert it into a breadboard - long pins down © Adafruit Industries https://learn.adafruit.
Add the breakout board: Place the breakout board over the pins so that the short pins poke through the breakout pads And Solder! Be sure to solder all pins for reliable electrical contact. (For tips on soldering, be sure to check out our Guide to Excellent Soldering (https://adafru.it/aTk)). © Adafruit Industries https://learn.adafruit.
Solder the other strip as well. © Adafruit Industries https://learn.adafruit.
You're done! Check your solder joints visually and continue onto the next steps Soldering on Female Header Tape In Place For sockets you'll want to tape them in place so when you flip over the board they don't fall out Flip & Tack Solder After flipping over, solder one or two points on each strip, to 'tack' the header in place © Adafruit Industries https://learn.adafruit.
And Solder! Be sure to solder all pins for reliable electrical contact. (For tips on soldering, be sure to check out our Guide to Excellent Soldering (https://adafru.it/aTk)). © Adafruit Industries https://learn.adafruit.
© Adafruit Industries https://learn.adafruit.
You're done! Check your solder joints visually and continue onto the next steps © Adafruit Industries https://learn.adafruit.
Power Management Battery + USB Power We wanted to make the Feather HUZZAH easy to power both when connected to a computer as well as via battery. There's two ways to power a Feather. You can connect with a MicroUSB cable (just plug into the jack) and the Feather will regulate the 5V USB down to 3.3V. You can also connect a 4.2/3.7V Lithium Polymer (Lipo/Lipoly) or Lithium Ion (LiIon) battery to the JST jack. This will let the Feather run on a rechargable battery.
The above shows the Micro USB jack (left), Lipoly JST jack (top left), as well as the 3.3V regulator and changeover diode (just to the right of the JST jack) and the Lipoly charging circuitry (right below the regulator). There's also a CHG LED next to the USB jack, which will light up while the battery is charging. This LED might also flicker if the battery is not connected.
battery needs recharging. Lipoly batteries are 'maxed out' at 4.2V and stick around 3.7V for much of the battery life, then slowly sink down to 3.2V or so before the protection circuitry cuts it off. By measuring the voltage you can quickly tell when you're heading below 3.7V Since the ESP8266 does not have multiple ADC pins, we didn't want to 'sacrifice' one for Lipoly battery monitoring. However we do have a tutorial that mentions how to do it, using two resistors.
Using NodeMCU Lua Each Feather HUZZAH ESP8266 breakout comes pre-programmed with NodeMCU's Lua interpreter. As of this writing, we ship with NodeMCU 0.9.5 build 20150318 powered by Lua 5.1.4 but it may be more recent Lua is still a work in progress, so we strongly recommend visiting NodeMCU and updating your Lua version to the very latest as they have the ability to make you the latest continuous build.
Once the terminal software is connected, click the Reset button on the Feather HUZZAH ESP8266 board to reset it and have it print out the welcome message: If you don't get this message, first check that the red/blue leds flickered when you press the reset button. If they didnt, make sure you've got the right baud rate selected in the software (9600) Hello world! Ok we can now turn on an LED.
Pin Notes PCB/Arduino NodeMCU/Lua No pullups! 0 3 2 4 3 9 4 1 5 2 9 11 10 12 12 6 13 7 14 5 15 8 16 0 So to set the pin #0 LED on and off (which would be pin #3 in Lua) first make it an output: gpio.mode(3, gpio.OUTPUT) Turn the LED on with: gpio.write(3, gpio.LOW) And off with: gpio.write(3, gpio.HIGH) You can make this a little more automated by running a longer script.
The LED will now be blinking on and off. Note that since its in a loop, its not possible to get it to stop via the interpreter. To stop it, click the Reset button again! This code halts the processor during the tmr.delay, a smarter way to blink an LED is to use the timer capability to set off the LED control (code from here) -- Pin definition local pin = 3 local status = gpio.LOW local duration = 1000 -- 1 second duration for timer -- Initialising pin gpio.mode(pin, gpio.OUTPUT) gpio.
-- print ap list function listap(t) for ssid,v in pairs(t) do authmode, rssi, bssid, channel = string.match(v, "(%d),(-?%d+),(%x%x:%x%x:%x%x:%x%x:%x%x:%x%x),(%d+)" print(ssid,authmode,rssi,bssid,channel) end end wifi.sta.getap(listap) We can connect to the access point with wifi.sta.config and wifi.sta.connect - it will take a second or two to complete the connection, you can query the module to ask the status with wifi.sta.
Using Arduino IDE While the Feather HUZZAH ESP8266 comes pre-programmed with NodeMCU's Lua interpretter, you don't have to use it! Instead, you can use the Arduino IDE which may be more familar. This will write directly to the firmware, erasing the NodeMCU firmware, so if you want to go back to Lua, use the flasher to re-install it Don't forget to visit esp8266.
Download Arduino IDE from Arduino.cc (1.6.8 or greater) from Arduino.cc The latest is usually the best Install the ESP8266 Board Package Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board Manager URLs field in the Arduino v1.6.4+ preferences. Visit our guide for how to add new boards to the Arduino 1.6.4+ IDE for more info about adding third party boards. Next, use the Board manager to install the ESP8266 package. © Adafruit Industries https://learn.adafruit.
After the install process, you should see that esp8266 package is marked INSTALLED. Close the Boards Manager window once the install process has completed.
The matching COM port for your FTDI or USB-Serial cable Blink Test We'll begin with the simple blink test Enter this into the sketch window (and save since you'll have to) void setup() { pinMode(0, OUTPUT); } void loop() { digitalWrite(0, HIGH); delay(500); digitalWrite(0, LOW); delay(500); } Now you can simply upload! The Feather HUZZAH has built in auto-reset that puts it into bootloading mode automagically © Adafruit Industries https://learn.adafruit.
The sketch will start immediately - you'll see the LED blinking. Hooray! Connecting via WiFi OK once you've got the LED blinking, lets go straight to the fun part, connecting to a webserver. Create a new sketch with this code: /* * Simple HTTP get webclient test */ #include const char* ssid = "yourssid"; const char* password = "yourpassword"; const char* host = "wifitest.adafruit.com"; void setup() { Serial.begin(115200); delay(100); // We start by connecting to a WiFi network Serial.
while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(""); Serial.println("WiFi connected"); Serial.println("IP address: "); Serial.println(WiFi.localIP()); } int value = 0; void loop() { delay(5000); ++value; Serial.print("connecting to "); Serial.println(host); // Use WiFiClient class to create TCP connections WiFiClient client; const int httpPort = 80; if (!client.connect(host, httpPort)) { Serial.
Open up the IDE serial console at 115200 baud to see the connection and webpage printout! © Adafruit Industries https://learn.adafruit.
That's it, pretty easy! This page was just to get you started and test out your module. For more information, check out the ESP8266 port github repository for much more up-to-date documentation! © Adafruit Industries https://learn.adafruit.
Downloads Datasheets & Files AP2112K-3.3V regulator onboard CP2104 USB-to-Serial converter EagleCAD PCB Files on GitHub Fritzing object in Adafruit Fritzing Library Feather HUZZAH ESP8266 Pinout Diagram https://adafru.it/z4d More info about the ESP8266 ESP8266 specification sheet FCC test report for the module used on this breakout CE test report for the module used on this breakout Huuuuge amount of information on http://www.esp8266.
© Adafruit Industries https://learn.adafruit.
ESP8266 F.A.Q. When I connect stuff to some of the pins, the Huzzah stops working. Whats up with that? The ESP8266 uses some of the pins as 'boot mode' pins so on boot they must be set to certain values: CH_PD (EN) should be always pulled high (it will disable the entire module if low) RST should be always pulled high (it will disable the entire module if low) GPIO 0 sets whether the bootloader is active, it must be pulled HIGH during power up/reset for the user program to run.
noticed that PL2303-based cables don't work on Macs for some reason. FTDI or CP210x based chipsets work best I tried that, but I'm still having difficulties uploading with the Arduino IDE Sometimes, it helps to switch the board type to "Generic ESP8266 Module".