You are browsing as a guest. Sign up (or log in) to start making projects!

1h 11m 11s logged

Firmware Done!!

I thought I’d hate writing the code but with some YouTube videos and a LOT of help from the ESPhome docs, I managed to fully flesh out the firmware!

As of this time, the features include:

  • Multiple WiFi networks it can connect to (fallback)
  • A separate ‘secrets.yaml’ file so WiFi Passwords aren’t visible on the main file
  • The ability to update the firmware OTA (over the air)
  • Deep sleep, which will drastically increase battery life by only staying awake for 30s every 90s. (to be updated after IRL testing)
  • Our 3 sensors are exposed (SHT41 for temp, humidity and SGP-40 for VOC index
  • VOC index is set to utilise the temp and humidity sensors for a more accurate reading
  • Other internal sensors like internal_temperature, wifi signal, ESPhome version, uptime etc from the esp32 itself are exposed (some, like the ESPhome version and uptime are hidden by default)
  • Analog to digital converter that takes the raw battery voltage and multiplys it by 2 (as we halved it with the 2 resistors)
  • A battery % sensor that takes our new voltage and gives it a % number using 3.5v as empty (dead) and 4.2 as fully charged.
  • E-Ink Display showing temp, humidity and VOC index with the Dosis Extrabold font (to be updated with time once i’ve got the parts physically)

I did have a couple of issues along the way but i figured them out! (eg. I found out the hard way that ESPhome id’s can’t have hyphens..)

There’s no way to test this code yet, but after running it through the github copilot to check for any errors and triple checking it myself, it should work. Should anything go wrong when the parts arrive, I can iron them out but for now everything’s good.

Next is cleaning up the github repo so it’s not just a bunch of files and making a readme!

(I also added M2.5 screws to the BOM as 4 are needed for the front plate)

0
12

Comments 0

No comments yet. Be the first!