Open handmade0octopus opened 3 months ago
Thanks for sharing your project!
I actually used the ESP32-C3 initially. Specifically the ESP32-C3-MINI-1 with 4 MB Flash Memory and 400kB SRAM. I was hitting the limits of both sooner than I liked. It was barely enough memory for Bluetooth and Wi-Fi, then you add in 2D graphics + LVGL and two partitions for OTA it was becoming an annoyance.
Because the current iteration was USB powered I decided to switch to the beefier ESP32-S3-WROOM-N8 with 8 MB Flash and 512 kB SRAM.
Long story short, you may need to turn features off or simplify them, especially RAM usage, if you switch to the ESP32-C3.
It'd be pretty time-intensive to review the entire schematic but keep me updated on the project! It'd be cool to see a mobile version of Bitclock. I'll consider a Discord in the future but I have bad experiences from too much noise from past Discord servers so I would probably not be active in it for now. Feel free to set up your own -- if it gets traction I can link to it in the README.
Ok lets do it.
I created server, join and PM me Ill give you admin rights: https://discord.gg/VAyvuMmuTU
As for the rest: ESP32-S3 has 400kb SRAM and tbh I written big projects on smaller older ESP32 with colourful LVGL so it shouldn't be bottleneck. But I will look at codebase a bit later on and figure where it needs trimming.
Not sure if LVGL is right in case we don't use any button inputs - I think it could be simplified and boot button could be used to let users to change screens or configure changing of screens over WiFi (or controlled by HomeAssistant in similar way as ULANZI does).
We can try other bits or leave it as ESP32-S3 but in any case moving to platform.io would give us ability to have different builds for different versions/variants of the boards and people could submit them.
Lets try and see if there is interest on developing that.
@babldev Though I will give you update: So far so good, made small mistake with one route but I managed to get most stuff working. I only implemented screen, wifi, HDC1080 and SDC40.
Screen is fine, maximum 1.91 fps and I wrote driver for adafruid library so its much smaller and easier to use - can be easily adapted for LVGL.
Of course it uses C++ zero cost abstractions and still have most of RAM and flash available (with OTA updates).
Now writing MQTT broker to put data to home assistant, once that is ready I will think what to do next.
I have 2 problems that you may have encountered:
SDC40 drifts a LOT, temperature starts high and if I query in 30s mode it drops slowly to normal levels. Humidity though goes up and up all the time, also you can see it being hotter than the rest of the board (on thermal camera).
HDC1080 temperature seems to work well although it has offset like 2 degrees (with or without heater set). Humidity though keeps at 99.9% so not sure what to do there..
Not tested charging/battery yet as I am waiting for connectors but so far I am quite happy with this.
@handmade0octopus Wow, super cool! Congrats on all your progress.
I had a lot of problems with accurate temperature and humidity with the SHT4X. Specifically:
Board self heating adjustment: https://github.com/goat-hill/bitclock/blob/f7410a7e918a6c5b4a211ab68c8a320072963e2e/bitclock-fw/main/tasks/sht4x.c#L148-L163
Relative humidity adjustment: https://github.com/goat-hill/bitclock/blob/f7410a7e918a6c5b4a211ab68c8a320072963e2e/bitclock-fw/main/tasks/sht4x.c#L178-L192
Thank you @babldev - I made some mistakes on switching off circuit and I think Ill get rid of it as wifi connection is too consuming anyway. But because of that I found some problems with ground.
Basically if I connect device with long cable or battery I think the ground connection isn't enough and this causes display to fail after ~1-2min (otherwise its fine).
I noticed you used 16V rated capacitor on C10 - but from my readings those lines go -20V and positive to +20V which I think may be bottleneck and I used similar setup (2x 2.2uF ones) so I think higher rated capacitor (50V) may solve this problem.
Not sure how temperature OTP code changes stuff but for now I hardcoded it at ~25°C.
Charging seems to be good, I think deep sleep mode may be better.
Will get respin on the board, still thinking if we need second humidity/temp sensor as I found with 30s time polling the main CO2 sensor seems to be good enough (although it settles for few seconds) :)
Haven't tested NOx sensors yet though.
Hello! I must say you inspired me a little. Was thinking of making project like this for very long time but never had time to figure which eInk screens would work best and get drivers working.
I spent the night and big part of today to get basic schematic in.
Ideas that I incorporated:
Biggest change is swap MCU to one that is less power hungry - namely ESP32-C3 which also has smaller footprint. We utilize 100% of the pins currently.
Use single 4.2v cell that will be power source with boost converter + timer controller that is selectable with dip switches to allow for configuration to wakeup at different intervals (from every ~45s up to 30 min - but it can be easily extended from 1s to 2h) or disable sleep completely if needed. Question there is if sensors need some time after powerup to get accurate readings, but because they will be disabled board will have neutral temperature. In general this should allow for super low power draw.
USB-C allows for safe charging of the battery. I based design of TP4056 module with overvoltage + undervoltage protection of battery, we can use analog input to measure battery voltage - there is also an option to put input for solar panel as charger will allow for that. Typical 6V solar panel should be enough although I never played with them so any tips are appreciated. Charging current is limited to around 250 mA. While USB-C is connected device will be always powered. LEDs will indicate status of charging and battery.
I recreated design in EasyEDA pro and will be happy to share it. I can't stand KiCad I am sorry :( 95% of resistors, capacitors, mosfets etc. are basic parts so should be fairly cheap to purchase and assemble from JLCPCB.
I changed temperature and humidity module to TI HDC1080 as it seems to be more accurate. Although this is just preference as they seem to be more accessible.
PCB is not done yet but I had few ideas on making footprint much smaller, but before proceeding I wanted to clarify few things about design and agree on some basics stuff. I know that battery support was requested by many people. Hence I would advise to create Discord server for discussion/ideas and quick development (I can help you set it up etc.)
Currently biggest problem is supply of screens, but if we are serious about I can get some higher quantities ordered if I ask my Chinese suppliers nicely ( ͡º ͜ʖ͡º)
Here is screenshot of early schematic/idea draft: