This Abandoned Project Haunted Me for Years…

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] it happened again the hardware dream it's been almost 3 years since I first bought that board mostly because it was $10 and after 3 years of wasting way at my desk I finally came across this updated version of the board from the same company liligo also known as Shenzhen shinan Electronics Company Limited this is the T display S3 am LED and it features a beautiful 536 x240 pixel am OLED screen don't ask me why it only works in the morning which is a big improvement over the 135 by 240 pixel display of the previous board but it's not just about the screen this new board's biggest Improvement is the microcontroller an ESP 32 S3 if you're into microcontrollers then you've definitely heard of the esp32 a chipset developed by a shangi based espressive systems there are dozens of different versions of the esp32 and as the name suggests they're typically built from one or more 32-bit risk 5 processor cores in the case of the esp32 S3 it comes with built-in support for Bluetooth Wi-Fi i2c plus it comes with an ultra low power co-processor on this board the esp32 so is connected to a 3D antenna 16 MB flash chip reset button battery input i2c Port USBC Port Two Face buttons and of course the am OLED screen the obvious thing to do with this device was to turn it into into a home theater for the local rat population but with movie prices nowadays it didn't quite work out as well as ID had hoped well since my last watch died at around 3:15 someday before I figured that I might want to turn this into a smartwatch companies like Apple and Samsung spend unfathomable amounts of money on R&D to make their digital wearables with tons of features packed inside but since I consider myself more of a software guy than a hardware guy I didn't want to go crazy with the extra sensors and all that so no custom Hardware today but I will be doing everything else while keeping my own R&D cost hopefully to less than $100 first things first I can't just strap the wrist to my board so I'm going to be designing the case with the aid of a computer in Google SketchUp I know it's not the best CAD software out there but I'm already familiar with it so I feel comfortable designing the first version of the case here and of course without a 3D printer at my disposal my first thought was to turn to PCB way who offered to sponsor this video PCB way doesn't just do custom PCB manufacturing they also offer 3D printing and CNC services and a variety of materials including resin pla ABS ASA and even aluminum and titanium for this case I'm using utr 3000 resin which will provide the exceptional level of detail and dimensional accuracy that I need working on this scale in this case besides a slot for including an SD card reading module plenty of space for a battery some side clips to include an Apple Watch compatible strap I've also added a decent sized hole between the two shell halves here I'm going to use a rotary encoder to get some additional input from the user these are really cool you can detect whether the user is rotating the module clockwise or counterclockwise based on the high and low values of the A and B signals I've got my hands on these little rotary encoder modules here and in a minute I'll hook these up to the board to test them out on the software side of things liligo has provided a C library to communicate with the Amed screen and I'll be using the Arduino IDE to compile all the C code I'll right or at least I tried to this IDE gets the job done it compiles and communicates with the device well enough but if you've used the Arduino IDE before you probably are already aware that it can be really frustrating at times all the good features are split between the new and Legacy version of the program so you're really picking between which issues you'd rather live with and I guess that makes sense since this is an election year but the biggest problem was just how ridiculously slow the compiler was to clarify I'm talking about compiling large programs something much more substantial than a hello world if there are no issues in the code then it'll take no no longer than 30 seconds until it's done but if there are any errors in the code then for some reason it stretches out compilation time to several minutes and those are minutes I'm just staring at the screen waiting for it to tell me something useful because I already know I mess something up and believe me I've tried a bunch of different things to alleviate this but no success so I checked out some other Alternatives and all the cool kids are talking about micro python nowadays it's basically what it sounds like it's a runtime interpreter for python built for microcontrollers just flash the version targeted for your chip onto the device and then you can use an IDE like Tony or Mew to write Python scripts manage which files are on the device and run your code as you can see from my python light blinking here it works and it's much less painless than the Arduino IDE though the trade-off here is that you're using python though we don't necessarily have to abandon C which is good since all those libraries I was using from liligo to drive the Amed screen are back in C so to use them I just need to recompile the micropython firmware for my device while including these external C modules that then flash that new firmware onto the device and liligo already has a micro python repository with all the libraries needed for this device ready to go so it should be pretty simple to recompile for this device right so first clone the repository then run make Windows didn't have make open window failed lemon I could hardly squeeze a lime so I tried but in the end it was just easier to go with this different version of the am o screen driver that has already compiled the entire 3 megabyte python firmware for me and honestly I don't see what's keeping liligo from doing that either so anyways no additional C libraries right now but after doing a fairly basic comparison trying to push the board to its limit via a bouncing ball program both the micropython version and C version performed similar at low ball levels with C clearly performing better when several hundred balls were added obviously I'm missing out on some efficiency here but I'll make this deal with a python devil just because of how easy it is I just got a package from PCB way with the first prototype looks like this board slides right into the top ports and buttons are a little off watch strap is a little tight here but everything looks great except for that I can't actually close the case since I got a couple measurements wrong on the front connections plus I did these weird spikes and holes to try to hold it together I believe that's a technical term for them and clearly I'm new to this I'm genuinely embarrassed about having to show off this first version but I think it's good to see the struggle and learning process that it takes to bring something together so let me head back to my 3D model to fix those mistakes and while I'm at it let's take a look back at The Rotary encoder so this is a surface mount component which means that unless I want this thing to look like an octopus I need a PCB to mount it on again as a software Guy this is going to be my first time making my own PCB but I found a footprint online for the monor and linked the outputs with some through holes and sent it off to today's sponsor pcbway who again provide more than enough options from multi-layer pcbs to HDI and flex boards PCB way provides quick turnaround for PCB prototyping and PCB assembly getting back to the software side of things I'll be creating an operating system for the watch which I call the micropython operating system or impos for short it'll manage the esp32s io with a screen SD card time system internet battery and we the main launching point for the watch's apps which will make it easier to focus on creating good apps without having to worry about setting up the whole system every time and from the bouncing ball test I did before I'm already pretty familiar with using this new library to drive my AMOLED screen and I've also found that the best way to interact with the screen is through the micropython frame buffer class which defines a buffer of some size and 565 color that's 5 pixels for red six for green and five for blue the extra pixel given a green here since that's what human eyes are most s stive to impos will create an initial frame buffer and also contain various Graphics related functions to manipulate this Frame buffer to do things such as drawing basic shapes text and clearing the buffer these changes to the buffer will then be realized on the screen when the buffer is pushed to the screen's driver the only downside with this current setup is that the frame buffer doesn't have built-in support for text characters larger than 8x8 pixels which is incredibly tiny on this large screen however the board driver itself does contain some custom fonts and texture drawing functions though it writes them directly to the screen not a frame buffer but unless I want to create my own custom text display functions which I really don't want to do this is what I'm going to have to work with and for anything beyond basic shapes and texts I'll need to use some Custom Graphics I've got these two versions of an SD card reader here this first version supports both sdio and serial peripheral interface while this last one supports only the lad sdio is faster since it uses four data pins but to fit in the watch case I'm going to be be using the smaller SD card reader here so I'll be using SPI to communicate with the micro SD card the micropython library includes a class for SPI and SD card file interface so all I have to do is make sure that the wires are set up to the correct pins then Mount the SD card and add it to the virtual file system after that apps can access files on the SD card just like any other normal file on the system dis all the apps and their resources will be loaded in from the SD card via an apps folder which simplifies the files on the esp3 two to only those relevant directly to impos this first app I'll be making is a digital clock since it would be convenient to be able to look at my wrist and see what time is rather than having to go and check my Sund dial outside all the time for this I'll need some bit maps of the right size and color but I can't use normal image files since they don't contain the right data but I can create all the images I need and then convert each pixel of each image to a 565 color value and then add those two bytes to an output binary file I can put this file on the S d card in the app's local folder then when the app is initialized read it into memory and break it up into individual frame buffers there's a function in the micro python frame buffer class called blit which does a block transfer from one frame buffer to another So based on the time I can take the correct digits image and copy it to the frame buffer then once it's ready push the frame buffer to the screen ah so I forgot here that there's no transparency in these images so adding them one after the other will also copy their whole black outline onto the buffer but there are a couple of solutions utions one is to create a function that will add only the Pure White pixels to the buffer but that removes the anti-aliasing of the text leaving with just aliasing a better method is to cut out everything that is black which saves the soft edge here but if you change the background color then it reveals that edge that Fades to Black you could remove this by multiplying the new background color by the level of black in each pixel but since I only wanted a black background anyways I didn't bother with it and for the second app the analog clock these functions worked out well too but instead of having hands and numbers I've always W one of those watches that has the Earth on it that shows you which parts are light and dark kind of like this and actually yeah I like the look of that then for the hands I'll add a sun moon and star flower thing for the hours minutes and seconds and getting them in the right position around the earth is a simple matter of trigonometry rotating the Earth isn't any harder though there aren't any simple rotate functions built in to do it for me so I had to insert the Matrix transformation to rotate the Earth around its Center Point on on my own now it's just a matter of finding out what time zone the image of the earth is in then adjust it to show which part of the earth is at noon then before adding it to the buffer I can gradually darken the colors of the bottom half of the image to Black of course doing all that is a fair bit of computation that overall takes a couple seconds of time luckily it doesn't need to be repeated that often as the Earth will only rotate 1.25 de every 5 minutes so I figured that's a good interval to redraw the Earth at it creates a little delay here but the system system clock runs asynchronously from this process so no real time is lost the next app is a weather app so I'll first need an internet connection like I mentioned earlier the esp32 S3 has built-in Hardware support for Wi-Fi and micropython makes it as easy as putting in the SSID and pass key than connecting and now that I have an internet connection I can also make use of some built-in functions to use the network time protocol to sync the devic's time and that's all handled on the OS side of things so once the app is launched it just has to create a socket to make an API call to the Weather Service I'm using called open weather map which provides up to a, free calls per day so unless I'm really interested in the weather one day it isn't going to cost me anything and after getting the weather data I can display the 7-day weather forecast having a weather icon based on the main weather of that day and also show the high and low temperatures underneath I'll also show The Daily breakdown as well so I can know not only when it'll be the hottest but by pressing the pop button also see how much it'll rain each hour and that's PCB way with my next Prototype all right these pcbs look great and the components fit on perfectly and this new case is looking good too looks like nothing's wrong except for a couple of mistakes I made with it this one connecting edge here was just a bit too large this one up front too so I cut those down a bit just to make sure that the rest of it fits together but that's it everything else fits great I even add a little ink box logo to the side here that I'm going to paint and add to the final version so after fixing everything I can submit one last order to today's sponsor PCB way and originally I wanted to print the final version of this case in solid titanium since that's the new hip Trend but I figured that having semi-exposed Electronics in a solid metal case sitting on my bare skin may not be the best idea so instead I decided to go for a spray painted surface finish to get a unique look though I could have gone for electr plating as well and now between these new apps that I have and the bouncing ball program that I worked into an app I'm ready to deal with the app management side of the operating system beginning with the status bar on the left side I want it to display the date and time and on the right side the current battery state on this board the esp32 is attached to a power management unit TP 4056 chip which manages the power intake output and through an attached pin tell the MCU the current voltage and percent charged of the attached battery oh hang on now that's the TP 4056 this board has a TP 465 it still manages the power including automatically charging the battery when an external power supply is connected but it only outputs the current voltage of the power source being used so how do I know if I'm running off battery or external power well external power typically runs at a higher voltage than the battery how do I know what percent my battery is at I don't but eventually the voltage will get so low that the MCU won't be able to work any longer this is definitely a missed opportunity for the board here I'd really want a better power management unit unit on an updated version because for now I'm basically stuck having to display the current voltage and monitor it as best I can as for the other information that I want to display on the status bar whether the SD card is connected whether the Wi-Fi is connected and the current screen brightness I'll be using some custom icons which isn't anything new but again remember that all this text for the time that I'm writing isn't going to the buffer but directly to the screen so by trying to update the clock every second I'm stuck with this flicker program where my text keeps getting erased so I have to do exactly what I is trying to avoid create my own textt display function it all starts with a really cool font and I really like this 16x 32 pixel font from the new driver so I can copy that and then since I only need the text portion of it I can take the first 128 Graphics of the character set add some new custom graphics and then recompile them into a 565 color biner then I'll write a function that takes an input string and outputs the correct character from this set of Graphics onto the specified screen location then wait I I guess that's it I mean I also added a function to colorize a bit map that takes into account transparent edges by only multiplying the color value against the white value and I also added an option to Center the text but it really wasn't that difficult at all and with these new functions I can now draw text directly to the buffer finally getting rid of that annoying flicker problem below the status bar will be the app icons and the secret to good app icons is getting the corners just rounded enough to square and you look like a cheap knockoff version of Android to round in you also look like a cheap knockoff version of Android so go with halfway in between and you'll land right in what I like to call the Apple Zone each app in impos will have its own 96x 96 pixel icon which is just enough to squeeze two rows of apps onto the home screen though I think 10 apps makes the screen look a little too crowded so I'm going to limit it to eight apps and keep the left side for something special later on besides Apple I'm taking inspiration from another Titan of American industry Apple be's because it's all about the apps and what my watch is missing is that killer app that keeps I guess just myself coming back every day sure knowing the weather is nice but I could also stick my head out the window so introducing mini Billiards not real Billiards since I didn't want to program the whole thing but this is a little 2D ball Collision program that has mostly correct physics just glitchy enough to be funny but not frustrating each round will randomly place two holes somewhere on the board and you have to knock all the balls into these holes to win pretty simple and I'm not really doing anything I haven't done before in any other app so it was easy to put together and quite fun to mess around with it's really something I don't mind having on my wrist to just open up and spend 5 minutes with one remaining key app left is the settings which will control the screen brightness and airplane mode but since my watch can't connect to the internet if it isn't at home anyways I guess I don't really need an airplane mode so basically the settings app just controls brightness the brightness level will be stored in the esp32 is nonvolatile flash memory that way this setting won't be lost when the board reboots for the remaining blank space on the left here it took me a minute to think of what I wanted here but this place of honor should be dedicated to the star of the show The Heart and Soul of this device the esp32 S3 so I've added this little processor via bitmap and I'm using all the colorizing functions I have created to move the espressive logo between various colors I also wanted to show the Chip's temperature since I saw a function for that in the documentation but apparently this feature has been depreciated since 2019 so I'll stick with pins randomly showing activity instead now you may have wondered why I haven't been using the rotary encoder this whole time when it would have been very convenient for a few of the apps well after I hooked it up it didn't quite give a clean signal I didn't notice this circuit on the product page which is supposed to help provide a much cleaner signal until it was too late so in the end I'm only using it as a fancy side button to sleep the device since at least that button switch works well enough oh and this is it straight from PCB Way the final version of the case I've gone with a finish that makes it look like an ivory box with bright red buttons for some contrast and fitted with the ink boox logo it looks pretty cool and while it did wind up being a little bulky not bad for my first weigh into Hardware in hindsight I really should have added those extra components to help the rotary encoder work or just gone with a version of the board that includes a touchscreen am OED I guess if you want to see a version with a touchscreen then subscribe and if not then like the video and that's how I know what your opinion is but for now my Hardware nightmare is over I've developed a really cool watch and a software platform that I can easily add on to into the future and the best part is that it's totally optimized just for me at a grand cost of $681 and I better not get one comment ask me if this thing runs Doom or I swear I'll [Music]
Info
Channel: Inkbox
Views: 116,684
Rating: undefined out of 5
Keywords: smart watch
Id: dIjQjbp4MSc
Channel Id: undefined
Length: 19min 57sec (1197 seconds)
Published: Thu May 30 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.