ESP32-C3 with integrated GC9A01 - cheap touch controller

Here’s a short video of mine. Intend to use it as a media player controller.
It’s still work in progress, e.g. I need to fix a condition so that the screen does not “flicker” when I join a different speaker. But it’s quite nice :slight_smile: and the image quality actually looks ok in real life - but does not translate very well to video.

4 Likes

Try using a different cable, and for the other, the error indicates the image file you are using is too big - that would cause the program to fail to load as the device does not have a lot of memory.

It suggests using the resize option, but personally I’d consider simply removing the images from the code to begin with or find some smaller images/use something like gimp to resize them to (say) 40*40 pixels.

Edit the code here:

animation:
#  - file: "icons/2051v2.gif"
  - file: "images/40x40.gif"
    id: clear_day
    resize: 40x40
    type: RGB565 #default is binary ie greyscale
  - file: "images/40x40.gif"
#  - file: "images/lightoff.png"
    id: light_off
  - file: "images/40x40.gif"
 # - file: "images/lighton.png"
    id: light_on
    type: RGB565
#    resize: 80x80
#    type: RGB565
# Need the following image section currently with esphome since 2023.7.0
# Otherwise you will probably get 'id' is a required option for [0] errors when trying to compile
# I will note here a pet hate with breaking changes - I know that this is community developed code
# but still, it's a total pain when updating brings in weird issues like this and I continue to be in 
# awe when the community discover work arounds that are so left field
image:
#  - file: "icons/2051v2.gif"
  - file: "images/40x40.gif"
    id: gifArt

…and use this file just to get going:
40x40

So I am on to the next stage - looking at wall mounting my test controller. It uses a standard JST 1.25mm 2 wire connector (a lot of batteries use these connectors), so fortunately I had one in my box of bits. As a bonus it also fits quite flush to the case, meaning that the controller should easily mount to the wall and I can run the power cable through a small hole. As always be cautious as to which wire is positive and which is negative. With my cable the black wire connected to the positive terminal, so the red to negative. In DC circuits it is usually the other way around but as in this case it is not always, so triple check before connecting power - if you accidentally reverse these you may hear a small pop and the magic smoke will be released. :wink:



…and also so I can work out how many of these I could potentially run off a single power supply, I tested the draw and mine seems to draw up to 0.1 of an amp (usually more around the 0.07 mark) and when the screen is powered off (I plan to use motion sensor to turn the screen on/off as required) it drops to around the 0.03 amp mark. Not too bad.


What size battery are you planning on using? We can calculate runtime once the battery capacity is known, but from what I remember, you will only get a week to a month run time out of a pretty large battery.

I’ve got the gesture sensor working down to 10uA or something really low by using deepsleep. The trick is to use a espnow gateway so it can respond quickly. Then it works for closer to a year depending on use.

1 Like

I think this route is the way to go

https://es.aliexpress.com/item/32838390049.html?gatewayAdapt=glo2esp
(not this one in particular, picked up random one)

step down converter 220v (or 110v in USA, etc) to 5v and forget about batteries, small enough to fit in the light switch connections hole (I don’t know the term in english xD)

No batteries - I have the luxury of old cat5 cables running from the walls to a central location, so can use that to provide 5v from a power supply, so for me a single 2amp supply would easily support a dozen of these controllers without breaking a sweat even allowing for loss over distance (roughly 5% loss over 100 meters of FTP shielded cable) in particular assuming most of them would be off at any one point in time. :slight_smile:

Definitely would work, but my concern would be the risk of fire from something like that being constantly powered in the wall behind the switch. Personally I’d either put the controller on a box that contains a battery and live with having to recharge it every now and then, or run a cable down/in the wall to a remote power pack.

No batteries - I have the luxury of old cat5 cables running from the walls to a central location

Oh! That is nice!

I feel the same as zagnuts. It’s a viable path, but I think I would be worried about something like that, it would keep me up at nights. :slight_smile:

I’m hoping to make an open source battery operated design with a 3d printed enclosure that anyone can make for themselves, or I can sell for those who don’t want to make one.

I honestly don’t know the answer, can you power a device from pins that are designed for a rechargeable battery?

As long as you keep within the rated voltage etc, absolutely. The device won’t care if the power is coming from a battery or not. :slight_smile:

I suppose so, I was wondering what happens if the voltage drops a bit and the device tries to charge the “battery”.

Ummm… it would need some form of charging circuit and built in power supply like another battery or capacitors to pump power back so that’s not going to happen. What would happen is the device would not get enough power and act weird or just stop working. If the power did regularly fluctuate a bit you could put a capacitor in there to try to regulate things a bit, but for the most part it is unlikely to be an issue.

Is there charging circuitry on the device?

Yes, there is charging chip that is meant to take voltage from the usb connector power rail to charge the battery if it goes low. So in the scenario you mentioned where if the voltage on the battery connection went low, it would be the same as a battery being connected with no power source on the USB port. It would just keep working until the voltage got so low that it couldn’t function anymore. There is no danger in that scenario, it would just treat it like a low battery.

You might have trouble if you try to connect a usb cable at the same time as a power supply is connected to the battery connector… If the charging circuit tried to send current from the usb connector out the battery connector to “charge” the battery which is really a poe power supply, then you would have reverse current going into the poe power supply. Most power supplies should have a “shunt” resistor or something to dissipate reverse current, but it would depend on the power supply. It would not be a good situation for any extended amount of time.

But that is only a worry if you connect a USB cable at the same time that a power supply instead of a battery is connected to the battery connector.

This is a circuit board that I designed where the datasheet called for a shunt resistor that would protect the power supply from reverse current. The section on the RPAR resistor gives more details about a shunt resistor and why it was added. So component datasheets will call for a shunt resistor if needed and I would think that most power supplies will have some protection for reverse current as the components they are built with will have a section in the datasheet about dealing with reverse current.

1 Like

Makes perfect sense, sorry for the noise.

Thank you for bringing it up, it was a good topic of discussion. I don’t think the answer was obvious, I had to think that one through for a while. :slight_smile:

The trouble was, my thinking was sub-par last evening.

Ah - yes. Good point!