User Tools

Site Tools


2016:huzzah_gpio

Huzzah ESP8266 Breakout

This breakout has 9 GPIO: #0, #2, #4, #5, #12, #13, #14, #15, #16 all GPIO are 3.3V logic level in and out, and are not 5V compatible. Read the full spec sheet to learn more about the GPIO pin limits, but be aware the maximum current drawn per pin is 12mA. These pins are general purpose and can be used for any sort of input or output. Most also have the ability to turn on an internal pullup. Many have special functionality:

  • GPIO #0, which does not have an internal pullup, and is also connected to both a mini tactile switch and red LED. This pin is used by the ESP8266 to determine when to boot into the bootloader. If the pin is held low during power-up it will start bootloading! That said, you can always use it as an output, and blink the red LED.
  • *GPIO #2, is also used to detect boot-mode. It also is connected to the blue LED that is near the WiFi antenna. It has a pullup resistor connected to it, and you can use it as any output (like #0) and blink the blue LED.
  • *GPIO #15, is also used to detect boot-mode. It has a pulldown resistor connected to it, make sure this pin isn't pulled high on startup. You can always just use it as an output
  • *GPIO #16 can be used to wake up out of deep-sleep mode, you'll need to connect it to the RESET pin

Rev A of this board has GPIO #4 and #5 swapped (the modules changed pinouts on us) so if #4/#5 aren't working for you, try swapping! We'll fix in the next PCB run

NodeMCU has weird pin mapping. Pin numbers written on the board itself do not correspond to ESP8266 GPIO pin numbers. We have constants defined to make using this board easier:

  • static const uint8_t D0 = 16;
  • static const uint8_t D1 = 5;
  • static const uint8_t D2 = 4;
  • static const uint8_t D3 = 0;
  • static const uint8_t D4 = 2;
  • static const uint8_t D5 = 14;
  • static const uint8_t D6 = 12;
  • static const uint8_t D7 = 13;
  • static const uint8_t D8 = 15;
  • static const uint8_t D9 = 3;
  • static const uint8_t D10 = 1;

If you want to use NodeMCU pin 5, use D5 for pin number, and it will be translated to 'real' GPIO pin 14.

I2C

The Huzzah does have I2C on it's interface. Pinout is:

  • #4 = SDA
  • #5 = SCL

Verified to work on 8/8/2016 using DS3231 and Huzzah on proto board.
Must use the following include:

   #include <RtcDS3231.h>

which is in the library RTC by Makuna.

SDA/SCL default to pins 4 & 5 but any two pins can be assigned as SDA/SCL using Wire.begin(SDA,SCL).

2016/huzzah_gpio.txt · Last modified: 2016/08/08 17:29 by 192.168.1.1