ESP32 super smart watch tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
how would you like to have a watch that not only tells the time has a torch and laser pointer but can also work as the control for home automation system well in this video i'll show you how to make one the whole project is based around an esp32 ttgo development board which you can get for around 10 pounds we'll be using this board as is based on the esp32 microcontroller giving it both wi-fi and bluetooth capabilities also the board has an lth78 bmsic which stands for battery management system that well uh manages the battery no but basically it protects the battery from short circuit over charge which is when the battery is charged to high voltage and over discharge which is when the battery is discharged to lower voltage which all can decrease the lifespan of it another advantage of using an esp32 based development board are the vastly superior space compared to say a generic arduino nano which in this case allows the screen to be driven very quickly finally and the main reason we'll be using it is because of the nice sharp 240 by 135 display which weirdly costs more to buy without the rest of the board so you're saying i could go buy tt go boards they solder their screen sell them make a profit and then have the rest of a perfectly good esp32 development board yes huh oh yeah this is supposed to be a tutorial firstly we'll get the case sorted thankfully i've already designed it which definitely took more than a couple of revisions so you can go ahead and print that out on your 3d printer you can find the stls in the description i would of course recommend using an ftm printer rather than sla as even cured resin may be toxic another thing i would definitely recommend is first putting down a layer of glue stick as the edges are quite rounded which makes the print more prone to peeling off the bed i'll be printing with filamentum vertigo starlight pulley and as always i'll be printing it on my artillery sidewinder x1 once the case is done you'll probably want to clean up the glue with rubbing alcohol after that we can then remove the corner pads with clippers now for the wrist straps for this we'll use ninjaflex flexible tpu which may not be the cheapest but can come out with very good prints the thing with flexible tpus is that they need very specific settings to work well the two most important conditions are temperature and speed if you have too high a temperature the walls will be wavy as the filament doesn't come out consistently if you have too lower temperature the printer will under extrude and the filament again will not come out consistently if you print too quickly the printer will also under extrude and you guessed it the filament will not come out consistently i found the best for my printer was to raise it to a temperature of 225 degrees and to print at 40 millimeters per second hopefully you get that working fairly quickly because i didn't to connect the straps i was inspired by other watches where they slot tiny pins in holes in the case and straps for this i decided to use the two millimeter brass tubing as you should be able to get it easily at a diy shot if the tube doesn't fit perfectly into the case you can just heat it up with a lighter or heat gun to cut the tube i'm going to use a knife as wire cutters would bend the ends and make it impossible to fit in the case oh yeah don't forget to print this thingy we'll glue it to the straps with gorilla glue okay that's the case done we'll put in the electronics now all the parts i'm going to use are linked in the description below which includes a ttgo esp32t display development board a six millimeter 650 nanometer laser diode a five millimeter wide led 220 milliamp hour battery a 2n 222 npn transistor two six by six by six tactile switches an ss12f15 sliding switch a ds3231 rtc module a one kilo ohm resistor and 30 gauge silicon wire but you could also use enameled copper wire here's the schematic that i made that we'll be using as well as one for the position of the components before you solder them in there is actually a bms on the battery that you want to remove as there is of course one already on the board to remove the bms you need to make sure that you clip the wires one at a time because clipping them together will short the battery and damage it also you'll need to remove the tabs on the side of the sliding switch and solder off the sockets of the rtc to save space when you got your ttgo board you should have also received these pins and this connector you don't need the pins for this project but you will need the connector it's used to connect the battery to the port on the bottom of the board okay now go ahead and solder the parts together make sure you solder the wires to the bottom of the board as it will need to sit flush with the case if any of the components don't fit in the holes you can just make them bigger with a file and make sure you leave the laser diode protruding so you can focus the laser beam properly that's the hardware portion of this video done now for the software but before we get into that it would be really helpful if you would leave a like and maybe consider subscribing thanks first of all you want to make sure that the usbc cable is a data cable and not just a charging cable you can do this by plugging it into a phone and seeing that allows files to be transferred the first download you want to do is the arduino ide it's really easy so i won't cover it right now once that's installed we need to tell the ide what board what we're dealing with we can do this by opening file then going down to preferences this will then come up next you want to paste in this url where it says additional board manager urls then press ok next we'll go to tools uh don't worry if it doesn't look exactly like this yet go to boards then board manager and type in esp32 then click install mine is already installed that will have downloaded firmware for many different esp32 development boards but we need to select the one that we'll be using to do this go to tools boards esp32 arduino then click on one called ttgo lora 32 oled v1 next you'll need to install drivers to work with the board except for if you're using linux in that case you don't need to do this um link is of course in the description all you need to do is click on the top one if you're using windows or the second one if you're using mac open up the zip file and then open the windows 64 executable file it'll be something similar for mac i'm sure by the way you don't need winrar for this but i just have it because it's pretty useful now plug in the board when you plugged in the board you just see this demo sketch carry out that just indicates that it's factory new next we need to select the port via tools then port for me it's port 7 but it probably won't be for you to check you can just unplug the board and see which port disappears to check is working we can go to examples then scroll down to esp32 then ship id and click on get chip id once that open make sure you have the right port selected if so press the arrow that will compile the code then upload it onto the board it will also remove the demo sketch so you know say goodbye to that it should take about 10 to 30 seconds to upload you can see when it's done from the progress bar disappearing now go to tools then open serial monitor and then click on baud rate and select 115 200 and you should see it print this that means that everything you've done so far is right so good job we'll now download one of the libraries we'll be using to do this go to tools then click on manage libraries it might take a minute to load but once it has type in tft underscore espi and then install this one make sure it's the one that says by bodmer now you'll need to find the tft esb library on your computer for me it's under documents arduino library now open up this folder then open up this file user setup select dot h that should open in something similar to this what we want to do here is comment out this line line 22 by typing in two forward slashes then scroll down to line 53 where it says set up 25 uncomment that by deleting those two forward slashes then go to file then click save and now you can close this window all that will have enabled the board to use its display to see if it's working you can open the arduino ide go to file examples then scroll down to tft underscore espi you probably won't have all these libraries so don't worry they're not anything to do with this project they're just uh stuff i've downloaded to work with loads of different things anyway go to tft underscore espi then generic then select this alpha blend sketch that should open up in a new window go ahead and upload that by pressing the arrow once that's uploaded you should see your ttgo board display this that means that everything so far is working now we'll install a plugin that allows images to be uploaded to the board also linked in the description first click on the top one which should download a zip file but we'll want to unzip it i'm just going to do it manually by putting it onto my desktop and dragging it out of this file next go to documents arduino then create a folder named tools then we'll want to put our unzipped folder into it if you have the ide open you'll need to close it to get it working once you open it again you can go to tools and this should have appeared esp32 sketch data upload next we're going to download a few more libraries once again we go to tools then manage libraries first we're going to download jpeg decoder which allows jpeg images to be displayed next rtc lib by adafruit which allows the board to communicate with the rtc module and finally button 2 which handles buttons finally we'll get the sketch for the watch that i wrote on my github page again link in the description go ahead and download that take the zip folder and put it on your desktop open up the zip file and get the folder named watch 3 and then drag that into your arduino folder then open up the watch 3 folder and open this sketch also called watch 3. so once that's open you can go to tools and then click on esp32 sketch data upload and in the meantime we can go down to line 102 we want to get rid of these two forward slashes to uncomment this line um what this does is it tells the rtc module what the date is once the images are done you can upload it once that's uploaded you want to upload it again but with this line commented out otherwise it will keep resetting the time every time it turns on and off if you look now at your watch you'll see that it's telling the time which means it's done finally i'll show you how to use it properly to navigate to different functions you double click these buttons the first screen has time obviously but it also has temperature which matches environmental temperature when you're not wearing it if you double click on the right button it should take you to the stopwatch screen where you can start the stopwatch by clicking the right button once and stop it by clicking the left button once it will automatically reset when you press the right button again if you double click the right button again we will get the peripheral screen where we can turn on the led by pressing the right button for half a second or turn on the laser by doing the same with the left button for the battery it lasts for about four hours of screen time so i put a function that turns the backlight off after 30 seconds but only if you're on the time screen if you don't like that you can go to the sketch and comment outline 607 then re-upload the code i would recommend turning off every time you're not using it as then the battery can last weeks on a single charge to charge it plug in a usb type-c cable and it should take about half an hour when it's connected to the charger you'll see that it says connected in the bottom left this doesn't necessarily mean that it is charging when it is charging you'll see a dim blue light come out of the led so when that light turns off you know that is fully charged and finally unplugging it will show a battery monitor in the corner that's about all i have to say for this video i was originally going to talk about the whole home automation system um and also a different design for a watch that actually became between the first watch and this watch hence why the sketch is called watch three but i've spent about as much time as i want in this video plus some so tell me in the comments if you want to see that or don't but i have an exam in two days less than two days you
Info
Channel: Gabriel McFarlane
Views: 71,931
Rating: undefined out of 5
Keywords:
Id: LUGhLd94f8A
Channel Id: undefined
Length: 14min 5sec (845 seconds)
Published: Mon Apr 26 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.