witnessmenow / ESP32-Cheap-Yellow-Display

Building a community around a cheap ESP32 Display with a touch screen
MIT License
1.31k stars 130 forks source link

Need a solution/method for battery powering CYDs #47

Open witnessmenow opened 8 months ago

witnessmenow commented 8 months ago

It would be great to create a method or documentation around battery powering the CYD.

I'm sure it's very achievable using a cheap lipo IC like the TP4056* and possibly using the JST connector beside the USB, but a documented path to this would be great.

Not my area of expertise at all, but I do have some of the ICs ordered so I'll probably throw a stab at it shortly. But would be very happy for others input.

Also, maybe a stretch goal, but maybe even a PCB design specifically for the CYD , so it could be neatly mounted, might be cool

*Affiliate

suchmememanyskill commented 8 months ago

I can confirm using the JST connector next to the usb port, you can provide 5V to VIN and ground to ground, and the display powers on. (using the model that also has a usb-c port)

I did notice some weird behaviour (web requests failing) while i was doing this, but i'm unsure if that's due to the way i'm powering the display or if my power source is just bad

bjinse commented 7 months ago

You might check out this case, mentioned on the 3d models page, that links to a BMS and batteries. https://thangs.com/designer/dimosram/3d-model/ESP32-2432S028%20enclosure%20for%20Battery%20and%20BMS-788656

BludzUK commented 4 months ago

Hello all. I'm new to world of programming and have been thankful for this GitHub page, it has allowed me to make a good start on a project I'm working on. It wasn't until I had got quite far into the project that I realised that powering the CYD is going to be a bit of an issue, and then found that I wasn't alone. Today I managed to find a workable solution. I tried a couple of different power modules from Amazon and found one that allows you to connect a 1s battery (18650 or lipo) and it ups the voltage to 5v (you adjust the output voltage with the dial). You can charge the battery using the usb c and the lights indicate when it is charging or charged. Here's a link to the module, https://www.amazon.co.uk/gp/product/B0C3V847G2 I'll be working on a case in the near future that will house these extra components and maybe some physical buttons depending on how my project goes. Hope this helps. IMG_20240314_181059405 IMG_20240314_181122799

kf106 commented 3 months ago

Why is the switch needed? Is it just there for a manual power on/off or do you need to turn off the board when charging the battery? Can it be left out?

https://nl.aliexpress.com/item/1005005236888266.html?gatewayAdapt=glo2nld seems to be a similar unit, but without a trimmer and a fixed 5V output if I understand correctly. It's also cheaper.

Also, this video https://www.youtube.com/watch?v=wYAZQzt_TVY is for an older USB-micro version of the TP5046 charging module, but a comment claims that it doesn't detect that the battery is drained which can cause damage to the battery.

NB: I'm always concerned about battery connection to homebrew devices because there's a fire risk.

gjashley commented 3 months ago

TP5046's are pretty safe. I used one of these boards: https://a.aliexpress.com/_mKCGlnc. It switches to the battery when it's unplugged (which also reboots the CYD so it's not really a UPS solution) I have measured the power draw and it does drop way down to battery maintenance levels when all the power leds on the board are lit (ie when it measures 4.2v) There is a button which powers it off when it is running on battery.

BludzUK commented 3 months ago

@kf106 It there was not a switch the unit just powers up when the battery is connected. Sadly the little charge/voltage regulator doesn't have a switch. I did also wonder if you could run the screen while charging so I wanted to test that. I can confirm that it works like I hoped and you can charge the battery while the screen remain running. Honestly though I realise that a lot of the work I'm doing to make this screen work (not to mention all the work everyone else has done), is all to make the shit version of this screen/esp32 work. They sell a MUCH better version 3.2 inches with capactive touch instead of crap resistive touch, oh and it is IPS so the colours look way better, black actually is black rather than grey. They also added battery input direct on the board and it uses a single usb c to do charging and programing. Seems pointless wasting time making the shit version work when the best version is so cheap still (like $7).

BludzUK commented 3 months ago

@gjashley Yea, I have some of those too actually, but it doesn't have a usb c for charging, so I assume you just add one?

gjashley commented 3 months ago

Yeah, here's a project I've been working on with i2c sensors: image

gjashley commented 3 months ago

They're Micro JST 1.25MM 4-Pin Cables, I got mine from AliExpress, but you can probably get them faster from local suppliers: https://a.aliexpress.com/_mqkq4l8. Make sure you get the 4-pin Male ones if you want pigtails which fit the port.


From: alextipos @.> Sent: Thursday, March 28, 2024 1:30:06 AM To: witnessmenow/ESP32-Cheap-Yellow-Display @.> Cc: Snorkers @.>; Mention @.> Subject: Re: [witnessmenow/ESP32-Cheap-Yellow-Display] Need a solution/method for battery powering CYDs (Issue #47)

Yeah, here's a project I've been working on with i2c sensors:

Sorry for the OT but can you please tell me where did you buy the JST connector and the measures? I'm lost, thanks a lot.

— Reply to this email directly, view it on GitHubhttps://github.com/witnessmenow/ESP32-Cheap-Yellow-Display/issues/47#issuecomment-2024662253, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AASUMNZA4FQ4NP4OZMPRSM3Y2PBH5AVCNFSM6AAAAAA7EKRMX2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRUGY3DEMRVGM. You are receiving this because you were mentioned.Message ID: @.***>

kf106 commented 2 months ago

I ordered a bunch of "5V 1A TYPE-C Micro USB 18650 TC4056A Lithium Battery Charging Board Charger Module with Protection Dual Functions TP4056" boards that were 1-50€ each. Scavenged a battery from a broken PS4 dualshock, and a broken bluetooth speaker provided both a connector for the battery, and a plug for the connector next to the micro USB port.

Five minutes of soldering, and it's charging the battery and powering the CYD. Unplugging the USB-C cable results in the display dimming ever so slightly, but the software keeps running.

It's a cheap solution, and it works. It's a shame they didn't include a TP4056 on the board and a battery connector like some of the boards out there.

cyd-charger

lcorsini commented 3 hours ago

Is there an alternative way to power the board with a battery without using the serial jst connector? because I have a gps receiver already connected to it I thought of desolder the micro usb (mine has usb-c too) and connect the TP5046 and battery to that connector, is there a cleaner solution without removing the port? (apart from making a micro usb power cable)