WiFi Controlled Unicorn Cap🦄 With RGB Lights

by IgorM92 in Circuits > LEDs

965 Views, 11 Favorites, 0 Comments

WiFi Controlled Unicorn Cap🦄 With RGB Lights

2020-02-21 21-17-54.jpg
IMG_3164.JPG
UnicornCap

Hello everyone.

My little one was nudging me, for a while, about interesting wearable DIYs related to the unicorns. So, I've scratched my head and decided to create something unusual and with very low budget.

This project doesn't require app to control it, it could be controlled by using any device where web browser is available. It also can operate in 2 modes, as standalone and part of home WiFi network.

Web has plenty of projects about caps that has unicorn horns with build in LEDs, but many of them are complex, or uses proprietary components that are not cheap. Keeping in mind all of the listed above, I've set a budget to spend less than 5 USD on it.

So, let's continue.

Supplies

• ESP12 series, could be purchase on aliexpress (1USD)

• ams1117 3.3v, like this one (0.2 USD/piece)

• 16 LEDs of the ws2811 x 60 pixels/m LED light strip, used this, it works nice from 3.3v (1.6 USD for 16 pixels)

• flat Li-Ion battery, could be used from old cell phone (like I did)

• flat click switch

• some wires

• sewing supplies

• solder iron with supplies

• baseball cap

• 10 cm of Velcro tape (optional)

• hot glue gun with a glue

• jig that'll allow you to program the ESP without soldering, I'm using Wemos D1 based programmer

• 3D printer

Models to Print

Here are a couple of models to print. For the safety reasons I've printed the horn from the TPU plastic. so it's soft and flexible. cap could be printed with any favourite plastic, e.g. PLA, ABS or PETG

Software

Unicorn_wiring.jpg
IMG_0329.png
IMG_0299CD530F52-1.png

Sketch for this instructable could be downloaded from my GitHub

Software part is the similar to the previous project that I have used, with lots of advantages, like autonomous (WiFi AP) mode with autoplay loop. There is no need to say a lot about software and copy the same information, it described in details in this instructable created by me. Hardware part is more important and have to be described, so let's focus on it in details.

We have to download and configure Arduino IDE, thanks to Steve Quinn, who already created a comprehensive guide of doing this in his Instructable, so there is no need in typing all of that.

Once you downloaded the sketch - open it in Arduino IDE.


Find the "#define NUM_LEDS 8" line and set the number of pixels equal to the length of the LED stripe (in our case it'a 8, change if you'll be using different number). Open the Secrets.h tab in Arduino IDE and change the password '11223344' file based on your choice. Save and upload the sketch to the ESP board. Use "ESP 8266 Sketch Data Upload" menu and upload other files from sketch to the SPIFS.

For the AP (standalone) mode you have to find WiFi Network called "Unicorn + numbers" and connect to it by using password that you have set in "Secrets.h" file. After this done - connect to the Horn by typing http://192.168.4.1 in your browser. A page will be loaded with many control options.

Connect the LEDs and check that all works fine and detach the ESP from the jig.

Electronics

IMG_3150.JPG
IMG_3148.JPG
IMG_3149.JPG
IMG_3134.JPG
IMG_3133.JPG

Take the battery and solder 2 wires with a connector and power button. Soldering spots could be isolated with a hot glue. This will give us a possibility to disconnect and charge the battery.

Take the ESP board with uploaded software, stick the power regulator to the back side of it with the double sided tape and finish the wiring. Use photos as reference.

Note: Data pin should be soldered to the GPIO4 output.

Assembling the Horn

IMG_3132.JPG
IMG_3139.JPG
IMG_3141.JPG
IMG_3142.JPG

Take the printed parts. Mount the LED stripe to the horn cap, like shown on the attached photo.

Note: Please use a strip of thin film between the stripes, it'll isolate the conductors on the back side of the LED stripe to avoid short circuits.

Insert the cap with sticked LEDs and glue it with a hot glue gun and It's done.

Finishing the Assembly

IMG_3145.JPG
IMG_3170.JPG
IMG_3146.JPG
IMG_3167.JPG
IMG_3166.JPG
IMG_3168.JPG

Take the horn, find the seam on the cap's front side, expand the seam with an awl and thread the wires through this hole. Pull the wires inside the cap. Sew the horn to the cap by using the special ledges on the bottom edges of the horn. Wrap the ESP board with electric tape to avoid electric shock. Snap the battery and button to the cap from inside where Velcro applied, see photos for the reference. Fix the wires with the sewing thread to the cap.

Now it's done.

Thank you for reading and thanks to my beautiful wife that she helped in video recording.