0
\$\begingroup\$

I have a TTGO that hosts an ESP32 with SIM800L. I want to also connect a GPS breakout board that will be switched on and off using ESP32's pin 15.

schematic

simulate this circuit – Schematic created using CircuitLab

As shown in the schematic above, I connected R1 to pin15 and its other side to the base of BC547C (the V2 3.3V + SW1 are there merely to illustrate toggling pin15 that of course is done with the digitalWrite from Arduino IDE). The board has also a "convenient" 5V output, so I thought to use it for powering the GPS breakout board, using R2.

I have successfully used in a standalone test the SIM800L, and another standalone test the GPS breakout (i.e. toggling it with pin15). However, when using both of them as shown in the schematic above it doesn't work. After thorough tests, I realized that the SIM800L modem cannot connect to the network (the circuit somehow affects it). When the ESP32 boots, it writes a logic 0 to pin15, in order to switch off the GPS breakout, and then tries to start the modem, however it fails (i.e. keeps trying to connect but without success).

My limited experience says that this should be an issue of the SIM800L not getting enough current, but I cannot understand why this would happen. I tried a USB power supply both from a PC and phone charger but no luck.

UPDATE: looks like the TX / RX wires from the GPS breakout, create the issue. When I disconnected them, the SIM800 model started working.

So, my question is why this could happen, and if there is a way from software to "disconnect" these pins?

\$\endgroup\$
2
  • \$\begingroup\$ Guess the problem is caused by the attempt of a "GND" switch. Have measured supply voltage at the GPS breakout when its turned on? I bet its not 5V... \$\endgroup\$
    – schnedan
    Commented Oct 2, 2020 at 12:23
  • \$\begingroup\$ Thanks Schnedan for the suggestion; I measured it at 4.7 Volts, looks like it was ok. The issue was with the tx / rx pins of the GPS breakout, when not connected.. \$\endgroup\$
    – Dimitris
    Commented Oct 5, 2020 at 11:38

3 Answers 3

1
\$\begingroup\$

When you turn off the transistor the GPS unit floats to +5V and applies 5V to the TX and RX lines.
As the LilyGO is a 3V3 device you are applying an 'illegal' voltage to it.

To avoid this consider using a "high side" PNP transistor in the 5V line, driven eg by Q1.
Then the GPS unit is at ground potential when off.

You may still have issues with the GPS 5V level TXD and RXD but that is an issue you are going to have to address regardless. TX data into the LilyGO is easily reduced to 3V3 max with 2 resistors. LilyGO pin27 to GPS RX may or may not work depending on the GPS levels. You may need to use a voltage upshifter there.
A "clever" noninverting driver can be made with an NPN transistor with base to 3V3 via a resistor, emitter driven by the LilyGO and collector with a pullup to 5V.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
1
  • \$\begingroup\$ Thanks Russell, indeed using both of the above circuits for interfacing the serial port resolved the issue. However, eventually I used pins 25 are tx and 35 as rx, since the others above created software issues.. \$\endgroup\$
    – Dimitris
    Commented Oct 5, 2020 at 9:59
1
\$\begingroup\$

I guess the issue here is the port 27, which is used by the sim800l modem. I had the same problem, but reconfigured GPS from pin 27 to 25 and both are working fine parallel. I used 3,3V as VCC, so I don't have to use any voltage regulators or resistors. Just wire them together directly.

\$\endgroup\$
0
\$\begingroup\$

Firstly, I did not understand why did you connect the 10k resistor with 5v and ground, why is it there? And did you look at the schematic of the evaluation board that you are used. Maybe the pin15 of the ESP32 is connected to SIM800L for some purpose.

SIM800L and the GPS board is so current sensitive and I didn't see a good ldo regulator on the link on banggood.

I use MIC29302 regulator to run SIM800 module and it is working like a charm.
MIC29302 datasheet here.
The EN pin can be used to disable to regulator output.

Additionally, why do you need extra gps module to take gps? Why didnt you take it from SIM800L directly?

\$\endgroup\$
1
  • \$\begingroup\$ Ratatosk thanks a lot for the regulator suggestion, for sure I will check it ;) I need the GPS to have a precise location; the SIM800L uses only the cellular network for acquiring a location which is way too off for my application. \$\endgroup\$
    – Dimitris
    Commented Oct 5, 2020 at 9:57

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.