WiFi Controlled Waterproof LED String

by Galopago in Circuits > Microcontrollers

321 Views, 5 Favorites, 0 Comments

WiFi Controlled Waterproof LED String

MOS_WIFI_IOT_LIGHTS_MEDIUM.jpg

Decorative lights suitable for Halloween, Christmas, parties, etc. Not only controlled over internet but, also completely reprogrammed wirelessly using OTA over WiFi. Waterproof, dustproof and sturdy. Ideal for indoor projects like interactive backgrounds for youtubers/streamers controlled by their audience and for outdoor projects like advertizing signs in walls or vehicles.

Key component: WS2811 waterproof LED string.

Concept

With the advent of addressable LED like WS2812, WS2812b, WS2811, etc. is now possible for small microcontrollers to handle large amounts of LEDs with only one I/O pin. That advantage popularized this component and a lot of variants appeared: surface mount single leds, flexible strips, Christmas-like strings, etc. The last one will be used in this article due to its flexibility and strength and could adapt easily to different project from Christmas ornaments to led matrix, without soldering or other electrical modifications.

The microcontroller chosen was an ESP8266, more exactly a development board known as “NODEMCU V3” which has all additional components necessary to start work on programming the MCU with a computer. The onboard WiFi of the ESP8266 is not only possible to to change light sequences, but also download a totally different firmware wirelessly (OTA), using a powerful combo: Mongoose OS and its remote device management dashboard mDASH. Mongoose OS uses a scaled down version of JavaScript known as mJS. This is an attractive language for web developers whom already work with JS. Mongoose OS is built on top of Espressif’s ESP-iDF, so it is possible to write functions in C, which is also attractive for more “traditional” embedded programmers. The circuit is built using TUSISTEMITA hardware prototyping system, which provides different kinds of prebuilt modules which allows to build an electronic project without soldering, but making it very robust and expandable. All the parts are enclosed in a dustproof and waterproof IP65 box. This enclosure gives an “industrial look” to the project and also adds mechanical strength to withstand abuses. The external electrical connections (AC, and LEDs) were fitted with IP accessories to provide a good seal.

Key Features

mos_wifi_iot_lights_blockdiag.png
  • Mongoose OS embedded operating system running on ESP8266.
  • Dustproof, waterproof and wall mountable.
  • Wireless remote firmware update, thanks to Mongoose OS management dashboard mDASH.
  • Built with TUSISTEMITA hardware prototyping blocks
  • 110/220V AC power

The circuit is composed of 4 elements well differentiated: Power source, CPU, logic level shifter and LEDs. Power source is switched type, 20W power, 5V output and 110/220V input, so it could be used in any country of the world. ESP8266 was used as CPU (NODEMCU V3). This board can be powered by 3.3V directly to processor power pin or by 5V using the onboard regulator. The high logic level output of ESP8266 is 3.3V, so a logic level shifter is needed for working with 5V sensors. WS2812 works with 5V logic levels so TUSISTEMITA D06 logic level board converter was used. This board is based on BSS138 MOSFET.

Power source output current is around 3.8A max, and each WS2811 LED consumes 60 mA max, so at least 63 LED could be powered. To stay below absolute maximum only 50 LED is recommended. Any LED string that works with WS2811 compatible protocol could be used.

Mongoose OS

Mongoose OS is an operating system for the Internet Of Things, it can run on ESP8266, ESP32 and others. Is a blend of easiness and robustness. Ideal for rapid prototyping of IoT products because of its native built-in cloud connectivity (AWS, Google, Azure). There are two characteristics that make Mongoose OS so versatile. One of them is the possibility to work “remote/local”. Remote is the default option, and compiles the code in the cloud, this is good for beginners because avoids the problems related to SDK installations. Local option is based on docker containers and is good for automatic builds without internet connection.

Another important characteristic is the use of a scaled down version of JavaScript called mJS as programming language. Advanced functionalities could be written with few lines of code compared to other languages (Assembler, C, Processing). However, nothing prevents to call functions written in C, especially for time sensitive device drivers.

Software

Sample application presented here is composed of two tasks: Send color data for every LED in the string and listen to incoming data coming from the cloud.

To send data to each LED, the color code is randomly extracted from a predefined color table. Communication to the LED string is made using NEOPIXEL library bundled with Mongoose OS. An MQTT connection is established to a broker where the app subscribes to a specific topic. A third party client application must connect to the same MQTT broker and publish data to the same topic to change the color palette used. This is a very simple way to change the light pattern over the internet.

Circuit Assembly

MOS_WIFI_LIGHTS_WORKING.jpg
MOS_WIFI_LIGHTS_WIRED.jpg
MOS_WIFI_LIGHTS_PARTS.jpg

The circuit was built using components of TUSISTEMITA, like enclosure backplate, power source backplate, NODEMCU breakboard, logic level shifter board and screw terminal board. Once the app is downloaded for the first time, and electrical connections verified, the backplate could be attached to the enclosure hassle free. Just unplug external cables from terminals, screw backplate to enclosure and reconnect cables again.

Enclosure

MOS_WIFI_LIGHTS_FINISHED.jpg
MOS_WIFI_LIGHTS_CONNECTOR.jpg
MOS_WIFI_LIGHTS_CABLEGLAND.jpg

It is recommended to change the connectors of the LED strip, for a more robust and waterproof connectors. Heatshrink tube with glue (double wall) should be used to protect solder joints from the elements.

Once the enclosure is closed, firmware updates could be done via wirelessly via OTA, using Mongoose OS device management dashboard mDASH.

Bill of Materials

TUSISTEMITA Blocks

Software Sources

Optional Components