In September 2014, I created this project with Arduino Mini Pro Mini and Android APP loved by so many readers! There are more than 100,000 App downloads by now! Since then, quite of few readers asked me how to change the sketch to be used on ESP32 with built-in Bluetooth. Here it is!! 😀
Be aware that LED PWM pins used on ESP32 were completely different, since Arduino Mini Pro and ESP32 have different architectures.
For ESP32, I used following pins:
Pin 13 = Red
Pin 12 = Green
Pin 14 = Blue
Caution: ESP32 does not allow to use pin 6, 7, 8, 9, 10, 11 or it will crash and reboot. I tried...😂
Also, there is no analogWrite() function in ESP32, so I need to change analogWrite() to ledcWrite() with
It's always troublesome to update firmware for your IoT projects? Tried Arduino BasicOTA examples, but never get it to work? Then you must try AsyncElegantOTA! It's very easy to use and I've succeed the first time I try it.
For those of you do not have time to watch it all, here is the video timeline for your quick reference.
Video Timeline:
00:13 Tutorial summary
00:53 What's OTA & Why
01:25 Tutorial begin
01:36 Install AsyncElegantOTA library
02:32 Download ESPAsyncWebServer & ESPAsyncTCP
02:57 Ensure Arduino board is capable of OTA
03:41 Where to place downloaded libraries
04:09 Open sample AsyncElegantOTA sketch
04:52 Upload sketch
05:05 Open serial monitor to see ESP8266 IP address
05:36 Access to ESP8266 from browser
06:10 Update ESP8266 firmware from browser
06:31 Where to find .bin file in VS Code
06:54 How to create .bin file in Arduino IDE
08:16 OTA update ESP8266 firmware
09:01 Next video tutorial - How to combine ESP8266 project with AsyncElegantOTA library
In recent years, Microsoft VS Code is considered the one of the best Arduino IDE!! I've made a video to show you how to use VS Code to write your Arduino codes, in Chinese only...
Have you met this problem before? You were making an fantastic Arduino IoT project. However, in the code, Wi-Fi SSID and Password were hard-coded and the only way to change these is to edit the code and re-upload the code to Arduino. At home, this is okay, since you were experimenting things here and there anyway.
Let’s say you bring this project to a friend place or a venue to demo. And you didn’t know the Wi-Fi SSID nor the password beforehand. Then, you need to bring your computer to change SSID and password and re-upload to Arduino.
Is there a way to get rid this problem? Yes. The answer is use Arduino Wifimanager library.
Start
Open Arduino IDE. From Tools and select Manager Library in space here type Wi-Fi Manager to search
Arduino IDE will filter keywords with Wi-Fi manager. Scroll down until you find a Wi-Fi manager by author Zabu. The current version 0.14 just click and install. Ok, install completed. Click close.
Upload "Auto Connect" sketch to NodeMCU
Next, let's get a Wi-Fi Manager code. example from Files-> Example, scroll down and find Wi-Fi manager. Let's open "Auto Connect" in a new window.
In the "Auto Connect" code., let's not make any change and upload this code directly to NODEMCU to understand how it worked.
Now, let me compile the code and upload this code to my NODEMCU Compiled sketch.
This will take a while depending on your computer configuration. You can see the progress bar is showing here it's uploading the flashing LED indicates the program is uploading. Let's wait until upload complete. Okay.
Set it up on your smartphone
Upload completed. Let's look at the Arduino Serial port right now. It says: using last saved values, should be faster. Since this is a new NODEMCU and I haven't set anything to it in the program code. There's neither Wi-Fi SSID nor password setting. The "AutoConnectAP" is AP name that you could define yourself.
Let's see the serial monitor NODEMCU now acts as Wi-Fi AP named AutoConnectAP and waiting for Wi-Fi client connection. As I said this NODEMCU is now in Wi-Fi AP mode with IP address 192.168.4.1 What I need to do now is to input this IP address in a browser either smartphone or a computer. Let me enter this IP address into my smartphone browser.
Type IP here 192.168.4.1 Remember to connect the phone to NODEMCU Wi-Fi AutoConnectAP first.
Swipe down and click Wi-Fi symbol and then click AutoConnectAP from available Wi-Fi list. It's connected to AutoConnectAP.
The Wi-Fi manager AP page will show up on your smartphone now.
On this page let's, click configure Wi-Fi. Wi-Fi Manager will scan adjacent available Wi-Fi AP and show them here. Let me click my home Wi-Fi AP named stonez24 and and type in Wi-Fi password. Password entered and click Save.
it shows Credential saved. Let's look here NODEMCU you will now connect tostonez24 AP automatically.
Ready to go!
Okay, connection result shows connected. Great!! We have connected NODEMCU to Stonez24 AP. In the future when you visit a new place or venue, there's no need to Hard-Code SSID or password in Arduino code let Wifimanager do the hard work for you!
That's all for today's tutorial. I hope you find this useful!
Tired of using tape to glue the iPad to the treadmill, my wife asked me to design and print an iPad holder for her. Here it is!
This is a multiple weekends project, since the 3D design took me many weeks to complete. Hope you could also get some inspiration from this and design your own.
I needed a smartphone mount for my tripod, so I designed this from a sketch using Fusion 360. I know there are relatively cheaper smartphone mounts for tripod out there in the market, but I just can't help to make one myself to learn.
In fill: 70% for the middle part and 20% for rest
Nozzle: 0.4 mm
Layer high: 0.2 mm
For people who like to use this STL file, please be aware that not each tripod mount base has the same dimension, so, I highly recommend you to measure the base before 3D print.
Also, for the middle part, please use 70% infill to make the clip part stronger.
After couple of days struggling with Fusion 360, I was able to make the thing!! :)
My draft sketch about the mount design.
For the base, I printed 3-4 times to perfectly match my camera tripod. I think this is due to the precision of my Ender 3 Pro printer or PLA material.
Filament was broken inside the Bowden tube during a print.
My printer is Creality Ender 3s (or Ender 3 Pro). Maybe the tension on the filament spool was so tight caused filament broken inside the tube.
How to remove the broken filament:
Turn on Ender 3s
Adjust nozzle temperature to 210 degree Celsius (keep it at 210 degree the whole time)
From main menu -> Control -> Temperature -> Set it to 210
Raise the Z axis to see the nozzle from below
Remove the nozzle with a wrench. Remember the nozzle is heated at 210 degree; it's super hot! It's better to use a socket wrench to remove the nozzle.
Cut the end of filament flat and then push it through Bowden tube, until the broken filament is pushed out of the Bowden tube.
Use the socket wrench to screw the nozzle back to the printer.
Be sure the nozzle is really tight and level the bed before try to return nozzle back to home. Here is what happened to my magnetic bed! (see below) I forgot to level the bed and hit the HOME command, then the nozzle scratched it badly! (The photo shown was after I cut the scratched part off the bed.)