Skip to content

A connected ESP8266 Huzzah lightning a NeoPixel led for lightning a pins using websocket

Notifications You must be signed in to change notification settings

rawouter/connected_pins

Repository files navigation

Connected pins

Connected pins, is an IOT project. This project control an Adafruit NeoPixel led using ESP8266 Huzzah connected to a remote 3rd party websocket, the websocket simply send the RGB value of the led, that will in turn blink once with the value read.

Usage

Install the dependencies (see below).

Edit the connected_pins.ino project and setup the configuration constants accordingly, you should look at:

#define SSID "yourssid"
#define SSIDPASS "yourssidpassword"
#define SSOCKETURL "your websocket URL"

#define FREQ 1             // Number of blink(s) during BLINK_TIME
#define BLINK_TIME 2       // Total blinking time
#define MAXBRIGHTNESS 255  // 0 to 255, overall brigthness of the leds
#define PIN 12             // Pin number of the NeoPixel bus
#define NUM_PIX 1          // Number of NoePixel leds

Note: the websocket connection will by default be on port 443, over SSL.

The websocket must send the following JSON messages:

{"color": [<r>,<g>,<b>]}

Where r,g and b are integer between 0 and 255.

Dependencies

Install the NeoPixel library, see project README.

Install the JSON library.

For Bluetooth LE, install the BLE library.

If using WIFI with MQTT, you need the MQTT library. Be sure to use this clone as it includes a small but important change in packet size.

If using WIFI you need the WifiManager library

Tested hardware listing:

Battery life

First results without optimisation indicates that the 1000mAh battery should last at least 10 hours (but for sure not more than 15h). Given the above result, the sketch will probably not try to put the board to sleep.

Hardware connection

Example for the mentionned hardware above (Huzzah Feather + Flora NeoPixel v2):

Connect the led UP ARROW port to Huzzah Feather PIN 12.

  • Note: There are two arrows pins on the led PCB, do not use the arrow going form the led to the pin, but the one from the pin to the led.
  • Note: You can use any other GPIO ports on the board, but don't forget to change the PIN number in the sketch

Connect the led (-) to Huzzah GND.

  • Note: There is only one GND port on my board, if you want to connect more hardware to the board you may want to not solder the wire directly.

Connect the led (+) to Huzzah VCC (see below note for Huzzah Feather)

  • Note: connecting to the 3.3V regulator works but the blue led will be very dimm, giving fake colors, and less overall brightness
  • Note: On the Huzzah Feather there is a specific port giving the LIPO direct power named BAT, this is the one you should use for mobile led pins project.
  • As written above, if you use your other esp8266 with your own power regulator, the direct power from a 1S LIPO gives good results with the Adaftruit Neopixel

Connect led to pin 12

MQTT bridge over bluetooth LE

curl -H "X-AIO-Key: myadafruitsecretkey" -H 'Content-Type: application/json' -X POST --data '{"value": {"color":[111,252,0]} }' "https://io.adafruit.com/api/feeds/borg-event-json/data.json"

About

A connected ESP8266 Huzzah lightning a NeoPixel led for lightning a pins using websocket

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages