I want to create a GPS+Bluetooth (Neo-6m and HC-05) device that works on LiPo battery (charged using TP4056), but that can also work while battery is charging (from USB power).
I added a FTDI module so that i can charge and program the device while connected to PC.
Here is a schematic of what I'm trying to do, i would appreciate if someone can point out anything wrong with it. (probably a lot of stuff, first time try to create a schematic for something)
Also, since both FTDI and GPS modules will be using hardware Serial, i added a switch to disconnect GPS module if i want to upload a sketch. Is there a way to do this automatically somehow?
Using SoftwareSerial releases You from one problem. Use it if You like.
The code is too large for code tags so I attache the file. Search for the GPS lines of code from my GPS based speedometer.
For me, using a software serial port allows me to not only upload code without a switch but also use serial prints to serial monitor for monitoring the program and troubleshooting. Serial prints are about the only debugging tool you have.
To disconnect the GPS from the Arduino while uploading a sketch --
What about wiring the GPS's GND thru the switch that you are using to "switch input voltage from LiPo to FTDI"? If the GPS's GND or VCC is disconnected will this give the same effect as breaking its TX connection?
Note one thing. A GPS module needs quite some start up time upon being powered on after resting. It's not instant, can take minutes. Figure out the baalance between charging and discharging time. How to cut down pwr the best I can't tell. I don't have enough overwiev of the project.