0

I have a project which needs a 7-9V power source. I use a battery, and plan to use a small regulator to supply 5V to a Lilygo TTGO T-Display V1.1 (1.14 inch display) via the 5V and GND pins.

I need to connect the Lilygo to USB from time-to-time to upload data. Will there be any conflict between the USB power and the 5V supply ?

I have peered for a long time at the schematic, and I see that there are MOSFETs doing some kind of protection, but I do not understand it well enough to be sure. Schematic: here

  1. Q5 appears to disconnect the battery (VBAT) from +5V when the USB is connected.
  2. Q4 also seems to disconnect the battery (BAT) from +5V when the USB is connected. What is the difference between VBAT and BAT ?
  3. VBUS (the USB power) is connected to +5V via a Zener diode. This appears to allow the USB to supply 5V, but prevent current flowing back to the PC. I think there could be an issue with high current through the Zener if my 5V regulator gave a voltage that was lower than the USB.
6
  • is that the official schematic diagram? ... it is sloppily drawn
    – jsotola
    Jan 25, 2023 at 17:49
  • What do you mean "via the 5V and GND pins"? Do you mean directly to the traces or do you mean by hooking up the regulated battery voltage to the battery input pins? Do note that the board expects a 3.7-4.2V input for the battery, 5V is too much; take a look at the charger datasheet (TP4054). Also, next time use the Electrical Engineering SE as it's more relevant to these kinds of questions, rather than the Arduino one.
    – Nick S.
    Jan 25, 2023 at 19:07
  • a zener between usb and 5v doesn't makes sense, sure it's not a Schottky? How do you even upload data over the USB connector anyway? Why not just use wifi so you don't risk your device or computer?
    – dandavis
    Jan 26, 2023 at 1:50
  • @dandavis it is a Schottky, yeah, even after reading the datasheet I came back to the post to write "Zener" in my answer hahaha. The USB is connected to the USB-UART chip, which in turn is connected to the ESP32's UART #0. Using WiFi would be fine, but you still have to power it and looking at the company's website and the schematic, they did not design the board with the intention of it being powered by anything other than the USB or the battery.
    – Nick S.
    Jan 26, 2023 at 2:24
  • 1
    I just looked at datasheet for the charger, TP4054. I see that Vin is given as 4.5 - 6.5V (with absolute max rating of -0.3 - 10V). It is connected to VBUS in the schematic, which I believe is nominally 5V. BAT is rated as -0.3 - 7V, so I am thinking applying 5V to the battery input should be safe. Maybe I am looking at the wrong datasheet. Jan 26, 2023 at 12:53

1 Answer 1

0

What are you trying to achieve? For how long is the board supposed to function? The simplest solution in this case is to simply get a 4.2V battery for the LilyGO board itself, most likely not just in terms of effort, but economically.

From your edits, I (now) assume you want to use the 5V pin on the board? I don't think that'll work the way you'd want it to, as it doesn't seem that it was intended for that (if it was, the VIN pin would've been brought out).

  1. Q5 appears to disconnect the battery (VBAT) from +5V when the USB is connected.

Yeah, that makes sense to me as well.

  1. Q4 also seems to disconnect the battery (BAT) from +5V when the USB is connected. What is the difference between VBAT and BAT ?

Yes, looking at the datasheet for the battery charger and the schematic for the LilyGO board, VBAT is the batteries voltage, while the BAT terminal is the one coming out of the charger and the one that usually supplies the current to both charge the battery and to possibly drive the system load.

  1. VBUS (the USB power) is connected to +5V via a Zener diode. This appears to allow the USB to supply 5V, but prevent current flowing back to the PC. I think there could be an issue with high current through the Zener if my 5V regulator gave a voltage that was lower than the USB.

Yeah, it prevents the current going back into the USB port if you have the battery connected. You need a pretty substantial voltage to overcome that Schottky* barrier.

One issue you'll probably encounter is that if you connect a 5V source to that pin, the system will think it's powered on by a battery and you can damage the BAT terminal. If you have more than 1 of those boards and you're willing to experiment, you could try cutting the trace to BAT terminal altogether and connecting the 5V source and seeing if that works.

Another issue is that for safety reasons, it'd be prudent to switch that source off when you're connecting the USB; you'd also want to protect that 5V source from being damaged by the VUSB once it's on. There are probably ways you could keep the 5V on if you desolder the USBC connector and try to manually attach a probe to the datalines and ground the two together, but dealing with USBC is not easy and you're rapidly venturing into territory where it's just easier to get a different board and the screen separately or just use a LiPo battery to power the board in the first place (you could probably find a way to use multiple LiPo packs if you need your application to last longer as well).

Note: I didn't spend too much time looking at the schematic and it is a bit confusing, so a possible good exercise would be to simulate those two circuits in a SPICE program. And again, these types of questions are covered more-so by the EE SE. If you'd have posted it there, I'm sure you'd get more (and most likely, better) answers.

2
  • Thanks for putting in so much effort. My project needs 9V to power some other equipment, so I want to power the ESP32 from the same battery - hence the idea of using a 5V regulator. Sorry about mix-up over Zener/Schottky - I checked Google and a lot of sources use the same symbol for Zener. The circuit diagram is not 'official'. I have not been able to find any official documentation for this board. I will post another question on the other site you mentioned. Jan 26, 2023 at 10:19
  • @elpidiovaldez5 that's okay, that's why looking at the datasheets helps - that one is a Schottky indeed!
    – Nick S.
    Jan 26, 2023 at 15:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.