[OLD] gCore - For GUI-based gadgets

An ESP32-based controller board for the Adafruit 3.5" LCD featherwing display designed to serve as the base of portable gadgets.

Similar projects worth following
Touchscreen LCD modules coupled with powerful graphics libraries like LittlevGL make the perfect user interface for many projects. gCore, short for Gadget Core, is my slightly unimaginatively named experiment in creating a powerful core controller for all sorts of GUI-based devices. It couples an ESP32 Wrover module with gobs of memory to the 480x320 pixel Adafruit 3.5" Touch LCD featherwing. It includes a full USB power-path charging circuit for a pair of 10440 Li-Ion rechargeable batteries, a boost-buck 3.3V converter and circuitry to implement soft-power control and battery voltage/charge state monitoring. It also provides a featherwing expansion area for additional circuitry.

The design will be released as open source for others to play with. I envision that if this idea is successful I will design a follow on version integrating the LCD directly into the device.

gCore is designed for battery-powered gadgets (although with hacking it can also be used in fixed applications).  The impetus came from my having to constantly add external circuitry to commercially available micro-controller dev boards to implement soft power-on and off control (for automatic low-battery shutdown).  In addition I wanted a system that implemented a true USB power path, separating the battery charging from power deliver to the application.  Many inexpensive dev boards put both the Li-Ion/Li-Po battery and main system voltage regulator on the output of the charger making it impossible for the charger to correctly determine battery charge state.  A USB power path allows the charger to correctly determine battery charge state as well as automatically select between USB power and battery power as necessary to feed the load.

Although 320x240 pixel LCD displays are both ubiquitous and very inexpensive, I've found that 480x320 allows for far better GUI displays.  Although not cheap, the Adafruit display module includes a resistive touchscreen controller and Micro-SD slot in a flat, enclosure friendly form-factor.  The difference in resolution is noticeable as can be seen when the bigger display is initialized as if it was a 320x240 display.

I have also become quite fond of the ESP32 as a generic controller as it is both fast and inexpensive, includes WiFi and is well supported.  The WROVER-B module is less than $5USD from distribution and has up to 16 MB Flash and 8 MB PSRAM.

gCore is comprised of the following components.

  • WROVER-B Module
  • CP2102N USB UART (configured through the Silicon Labs Xpress Configurator  to support charger detection)
  • MCP73871 Charger and Powerpath (configured to support 100mA and 500 mA charging)
  • TPS63051 Boost/Buck converter generating 3.3V @ 500 mA.
  • Isolation circuitry to prevent sneak power paths to the ESP32 when plugged into USB but not turned on
  • Soft power enable of the TPS63051 using a push button to initially switch on power and a hold signal from the ESP32 to keep the system powered after the button is released.  The ESP32 can then power-down by de-asserting the hold signal.
  • Battery voltage monitor with a resistor divider array feeding an ESP32 analog input.  The resistor divider is disabled using a MOSFET when the power is off to eliminate a drain on the battery.
  • Charge state monitoring via a resistor divider network feeding an ESP32 analog input for firmware monitoring.
  • Mostly featherwing compatible expansion area for add-on boards (the WROVER-B module does not make GPIO16/17 available).

gCore includes a pair of ICR10440 Li-Ion batteries, each nominally rated at 350 mA/Hr.  Depending on WiFi utilization this should allow 2-3 hours of runtime on a charge. The batteries are connected in parallel through a pair of PTC fuses to both protect and allow equalization.  I did a bunch of online research about paralleling batteries and it should be ok as long as the batteries are installed at similar charge states and the charge current is kept lower than the battery maximum.  Early experiments show the batteries charge and discharge fairly equally.  While I am not too concerned about gCore bursting into flame, I am still a little nervous about the long-term functionality of this arrangement.  A future design may select a single, larger battery.  I chose this configuration to allow for smaller enclosures.

  • Battery Balancing - a mixed bag

    Dan Julio05/23/2020 at 18:55 0 comments

    I built two gCore prototypes and now have a few weeks experience with them.  The dual battery system seems to be working fine on one unit.  The batteries remain at the same balanced charge level for long periods of time when the device is off.  On the other unit the batteries would discharge over a few day period.


    I did some experiments with the failing unit to see if I could understand what was going on.  Unfortunately the results were inconclusive. 

    Charging until the charger terminated the charge cycle would result in both batteries being charged to within 10 mV of each other.  Based on my original internet research (yeah, I know, don't believe everything you read on the internet, even if it sounds good...) this should be sufficient for a pair of balanced batteries.

    I attached voltmeters to both batteries and put an ammeter in series with one battery with gCore turned off.  I saw a small current flowing between the batteries, usually between 1 and 3 mA.  At first I thought that this was just the batteries finding equilibrium and that it should stop after while.  But it didn't.  And the battery voltages ran down over a few days.

    I then shorted both PTCs so the batteries were directly in series and repeated the experiment.  Same results.

    One battery always had a slightly higher voltage, even as they discharged together, and there was always a small current flowing between them.

    I can understand the battery with the lower voltage drawing some current from the battery with the higher voltage but I don't understand why its voltage declined over time as well. 

    I'm pretty sure there were no other current draws on the board.  I verified this by removing one battery and verifying the current draw was essentially zero.

    The batteries I used include their own protection circuitry.  I don't know if that somehow interferes with the balancing.  The other gCore prototype hasn't shown this problem and when I measure the current between batteries while gCore is off I only see ~20-30 uA.

    So I would say my attempt to use the ICR10440 batteries in parallel to maximize use of the space was not a success, although it does seem to work some of the time.

    Back to a single battery

    It's easy to use a single battery with gCore.  Remove (or don't install) the AAA battery holders and connect it to one set of terminals.  Jumper that set of terminals PTC.

    I attached an old iPod Touch battery with 3M double sticky foam tape and gCore works fine.  Best probably to use a 3.7v LiPo or Li-Ion battery with between 600-2500 mA capacity to match the charge current.

  • Why I really made gCore

    Dan Julio05/09/2020 at 19:43 0 comments

    I have been experimenting with the Flir Lepton 3.5 radiometric thermal imaging camera module for a couple of years now (documented here) with the end goal of making my own useful camera.  The Lepton 3.5 has a moderately intense interface and requires a fair bit of capability in the micro reading image data from it.  I had great success using the PRU co-processors in the Beaglebone family of linux SBCs but ultimately decided that the boot time of linux was too slow for a device I just wanted to power on and use immediately.  I found that ESP32 was capable enough and set about designing a board around it to use in a camera.  Along the way I figured that the board could also be used for other things and finally settled on the gCore design.

    Finally, after writing the support code and documenting gCore I've had a chance to actually work on the camera.  At the moment the camera functions are complete.  I plan to add the ability to record images and videos and have a wifi-based interface for external control and viewing of the camera.  Files will have json content including the raw radiometric data and telemetry from the camera.  This allows me to generate images or perform thermal analysis on the image(s).

    The Lepton can be rotated through a 90° angle using a couple of 3D printed mounts.  The camera also includes a Maxim/Dallas DS3232 RTC powered by the main LiPo batteries with its own ultra-low quiescent current LDO.  This chip also has 236 bytes of RAM used to store camera settings and parameters.

  • Life - a tribute

    Dan Julio04/23/2020 at 02:46 0 comments

    To make this project more accessible to other people I put together some drivers and support code so gCore could more easily work with good graphics libraries like LittlevGL and FabGL as well as be programmable in the ESP32 Arduino environment.  Mostly that involved adding device drivers and the power management module to ports of existing demos.  My ESP32 work uses the ESP IDF directly and I also wanted to provide a demo for it that was more than just a port since I think it provides the best way to make sophisticated applications for the ESP32.  For days I couldn't really think of something interesting but reasonably easy to implement.  Then I read about the passing of mathematician John Conway from complications to the coronavirus.   I hadn't really thought about his Game of Life program in a long time but I remember programming it in my youth.  I realized it would be a great demo and a small tribute to a man who made a difference.  The code is in the github and could be ported fairly easily to other ESP32/TFT displays as well.

    It even has some famous built-in cell combinations.

  • Project uploaded to github

    Dan Julio04/21/2020 at 22:08 0 comments

    The hardware design and software support for Arduino, FabGL and native LittlevGL development has been uploaded to a github repository.

  • Taking advantage of great GUI libraries

    Dan Julio04/05/2020 at 22:39 0 comments

    I am a huge fan of  Gábor Kiss-Vámosi's LittlevGL graphics library and, recently, also of Fabrizio Di Vittorio's FabGL for the ESP32.  Check them out if you haven't already.  I have them both running on gCore and will include examples in the github repository.  Currently I plan to release 3 pieces of software for use with gCore.

    1. Arduino power control library - Control power with the ability to power-down from a long-push of the power button, low-battery condition or under control of code.  Monitor battery voltage and charge status.
    2. Code to add display and touchscreen driver for LittlevGL in the arduino environment.  This is in addition to and based on my work supporting the Adafruit display directly in the ESP IDF environment.
    3. Display driver for FabGL.

    Currently I have LittlevGL running on the port in the ESP IDF environment and a FabGL driver running in the arduino environment.  The power control library and Arduino LittlevGL module remain vapor-ware at the moment (I just set the HOLD signal high in my current test code and then press the RESET button to power down).

    Here are a few teasers of FabGL demos ported over.

    The terminal code functions perfectly.  The network terminal lets you log into a telnet server via WiFi.

    That lets you stream Star Wars - ASCII style from

    Graphics also works but the Space Invaders demo has a bunch of hard-wired code for a lower resolution VGA display and doesn't yet work properly.

View all 5 project logs

Enjoy this project?



tywy wrote 06/12/2022 at 19:47 point

is version of sdl2 ?

no every one have this electronic stuff

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates