IoT Emoji Sign
Intro: IoT Emoji Sign
This instructables show how to use an ESP8266 and some NeoPixels to create an IoT Emoji Sign.
STEP 1: Preparation
Any ESP8266 board should be ok. This time I am using WeMos D1 Mini Pro, this is smallest and thinnest dev board I can find. If you want it portable, choose a board with Lipo support.
NeoPixelsThis project use Arduino Adafruit_NeoPixel library, any compatibles LED chip is ok, such as WS2812, WS2812B, SK6812, SK6812mini ... etc.
This time I am using 64 LED chips of SK6812mini to make a tiny 8x8 matrix panel. But the soldering work is not the main job of this project, you can use a LED strip to simplify the job or even direct buy a 8x8 NeoPixel LED Matrix ;>
Sign StandThis time I am using a micro USB metal flexible tube cable as a sign stand.
STEP 2: Optional: 3D Printing & Assembly
If you simply buy a 8x8 NeoPixel LED Matrix, you can skip this steps.
- 3D print the case: https://www.thingiverse.com/thing:3553675
- Put on SK6812mini chip in Zigzag direction
- Soldering work
- Use hot glue seal the circuit
- Connect power pins and signal pin (SK6812 Din to ESP8266 pin 4 / D2) to ESP8266 dev board
- Screw up
- Plug the USB cable
STEP 3: Software Preparation
If you are not yet install Arduino IDE, please download and install it from the official site:
https://www.arduino.cc/en/main/software
ESP8266 SupportIf you are not yet install Arduino ESP8266 support, please follow the steps in "Arduino on ESP8266" section:
https://github.com/esp8266/Arduino
Arduino LibrariesUse Arduino Library install 3 depending libraries:
- WiFiManager
- ArduinoWebSockets
- Adafruit_NeoPixel
STEP 4: Download Source Code
Please download my source code here:
STEP 5: 8x8 Emoji
This project require some 8x8 pixels emoji, I google and get a simple set from Justin Cyr tweet:
https://twitter.com/JUSTIN_CYR/status/658031097805...
Then I resized the image and use base64decode.org convert to an base64 encoded string to embed it into the HTML.
You may find the resized image at: src/emojis.png
STEP 6: Simple HTML UI
I have scripted a very simple HTML for selecting the emoji and then transfer the pixels to ESP8266 by Web Socket protocol in binary format.
Then I use html-minifier convert to a long single line string to embed it into Arduino code.
You may find the HTML file at: src/index.html
STEP 7: Arduino Program
- Connect the ESP8266 dev board to the computer
- Open Arduino IDE
- Select correct board at the Tools menu
- Press Upload button
STEP 8: Setup & Play!
Please see the video demo for the setup and play details.
Here are the summary:
- Plug the IoT Emoji Sign
- Setup WiFi (first time only)
- Use your mobile search and connect to the AP "esp-emoji"
- WiFiManager Captive Portal show
- Press "Configure WiFi" button
- Select your AP
- Fill AP password
- Press "Save" button
- ESP8266 auto restart
- ESP8266 auto connect to your AP
- Use your mobile browse to "esp-emoji.local"
- Pick a Emoji and Play!
STEP 9: Happy Signature!
The Emoji set from Justin Cyr tweet is only an simple example, you can prepare your own 8x8 Emoji set and show your signature!
18 Comments
MalcolmP5 1 year ago
krisferrari 1 year ago
var xo = 3;
var yo = 3;
var xs = 13;
var ys = 12;
var x = e.offsetX;
var y = e.offsetY;
var c = Math.round((x - xo - 4) / xs);
var r = Math.round((y - yo - 4) / ys);
document.getElementById('out').innerText = 'Selected [' + c + ', ' + r + ']';
var img = document.getElementById('emojis');
var ce = document.getElementById('emoji');
var ctx = ce.getContext('2d'); ctx.drawImage(img, -(xo + (xs * c)), -(yo + (ys * r)), 131, 122);
krisferrari 3 years ago
Trying on my l6 x 16, with canvas 16 x 8 only
var width=16;var ht=8;var d=ctx.getImageData(0,0,width,ht).data;var t='';for(var i=0;i < ht;i++){for(var j=0;j < width;j++){t+=cc(d[(((i%8)*width+j)*4)]);t+=cc(d[(((i%8)*width+j)*4)+1]);t+=cc(d[(((i%8)*width+j)*4)+2]);}}
Using modulo just to be sure that I dont get zeros or large numbers
But No luck for 16 x 8
Dont know if I have to dump this for 16 x8 . 2 people clicked made this and I was one of them.
krisferrari 3 years ago
陳亮 3 years ago
krisferrari 3 years ago
陳亮 3 years ago
krisferrari 3 years ago
I added below code - just after for loop (0 to 256) where 't' is constructed (in index.html)
var transformed ='';
for( var u = 0 ; u < 768 ; u ++){
transformed += t[u].charCodeAt(0);
}
console.log(transformed);
But I did observe lots of non-zeroes, a couple of days ago. But still no leds turned on
krisferrari 3 years ago
krisferrari 3 years ago
davidpaine 3 years ago
https://url-decode.com/tool/base64-decode
nolandoktor 5 years ago
陳亮 5 years ago
krisferrari 3 years ago
davew89 4 years ago
C:\Users\daves\Documents\Arduino\libraries\ESP8266WebServer\src\ESP8266WebServer.cpp:41:1: error: specializing member 'esp8266webserver::ESP8266WebServerTemplate<WiFiServer>::ESP8266WebServer' requires 'template<>' syntax
ESP8266WebServer::ESP8266WebServer(IPAddress addr, int port)
^
C:\Users\daves\Documents\Arduino\libraries\ESP8266WebServer\src\ESP8266WebServer.cpp:55:1: error: specializing member 'esp8266webserver::ESP8266WebServerTemplate<WiFiServer>::ESP8266WebServer' requires 'template<>' syntax
ESP8266WebServer::ESP8266WebServer(int port)
^
C:\Users\daves\Documents\Arduino\libraries\ESP8266WebServer\src\ESP8266WebServer.cpp:69:1: error: specializing member 'esp8266webserver::ESP8266WebServerTemplate<WiFiServer>::~ esp8266webserver::ESP8266WebServer<WiFiServer>' requires 'template<>' syntax
ESP8266WebServer::~ESP8266WebServer() {
^
C:\Users\daves\Documents\Arduino\libraries\ESP8266WebServer\src\Parsing.cpp:66:6: error: specializing member 'esp8266webserver::ESP8266WebServerTemplate<WiFiServer>::_parseRequest' requires 'template<>' syntax
bool ESP8266WebServer::_parseRequest(WiFiClient& client) {
^
any help would be great thanks
陳亮 4 years ago
Penolopy Bulnick 4 years ago
DutchTaurus 4 years ago