I am building a small GPS tracker for my car using a Raspberry PI Zero plus some additional components.
I would like to keep it off unless the car is turned on or it's moved forcefully.
To do that I am planning to use an:
- SW18020P
- NE555
- an NPN transistor
Because car alternator can produce more than 12v I am planning to add an LDO or a Switching Regulator to bring down the voltage to 12v roughly. Even if the voltage will be below the 12v it's ok anyway, both the SW18020P and the NE555 can work with smaller voltage.
The raspberry pi zero w + additional components (gps / gprs modem) will consume roughly - rpi zero w 120ma - 3g modem 230ma peak (the 230ma peak was reached during the upload test with speedtest, 150ma when connected with a low load like ping, 0.05 when not connected to internet) - the gps is a NEO M8N, I didn't measure the consumption of the board I am using but the spec of the module states that it should consume at max 67ma (I am planning to use it in power save mode so it will consume roughly 5ma after the acquisition that for my model is stated being 20ma roughly)
Even if I need the current at 5v and I will add an LDO or a switching regulator after the transistor (which one? I will ask later :)), for the sake of simplicity I will ignore that and consider that the current will be at 12v.
In total the npn transistor will need to handle at least 120 + 230 + 70 = 420ma.
that pretty much does what I need.
The idea is to keep the output pin of the NE555 high for a few minutes (ie 3 minutes, I will change the size of the resistor to increase the time) and then after the software on the rpi will finish to start it will use a pin on the board to drive another NPN transistor (I will add a resistor to control the amount of mamps it will absorb) to keep the rpi running even after the timer will stop to keep the output high and the rpi will use that to turn it off. Of course the rpi will not turn off if the timer will keep output high but in that case the software will realize that it is still running, enable the power again and try to keep tracking for X minutes until it will detect that it can be turned off again (a nice while true loop ;))
I potentially can add something like this http://www.hobbytronics.co.uk/mosfet-voltage-level-converter to try to detect if the output is high before trying to shutdown but from an application point of view there isn't any real advantage (the SO on the SD will be mounted in RO and only a partition of the SD will be RW with the noatime and sync options enabled, it will use a very simple approach to write in an uniform way on the partition but that is for another topic)
Questions:
- can I use the transistor contained in that schematic? The BC546 ( https://www.sparkfun.com/datasheets/Components/BC546.pdf ) looks like being a cut off type so the emitted voltage will be reduced, it should still be fine because on the other end of the transistor the will be the transformer (ldo / switching regulator) to bring down the voltage to 5v, and it looks like it accept a maximum of 100ma so in the schematic there is R2 to reduce the current to 50ma, the ne555 should be able to provide more than 200ma.
- From the schematics it looks like the collector needs more than 50ma to emit 12v, roughly 62/63 ma, but I cannot provide more than that otherwise it will provide less current, did I read the graph at the end correctly? something sounds off (ie. I misinterpreted)
- As alternative, can I use a TIP120? it looks like it works with 12v, can handle up to 5a and that 50ma are good for it to work with 12v
- The gps tracker will need roughly 0.5a to run at full load (at 5v but let's consider 12v, it is safer anyway), how much bigger the transistor needs to be? Five times more? I will add an heatsink anyway because it will be in the circuit in the car and, especially during the summer, it will be HOT
- The circuit is built to work with 5V, I will use it with 12V, it means that I will need to change the watt ratings of the resistors and capacitors, but I totally have no of how to size them :/
- As far I understand, I cannot keep using resistances of the same size because I am using a greater voltage, I ran a few calculations, can you tell me if the new sizing are fit for the schematics? I tried to keep the amount of Amps (I used this online calculator https://www.rapidtables.com/calc/electric/ohms-law-calculator.html)
- R1 (as far I understand I need to check the voltage drop of the led and the amount of ma I want to use to calculate it properly, I will do it later but with a voltage drop of 1.8v and 25ma I would need roughly 400ohm)
- R2 ?ohm (see question above related to the transistor)
- R3 2.4Kohm
- R4 2.4Mohm
- I am also planning to switch to 1w resistors, is that fine?
- C2 is used together with R3 to control the amount of time in which the NE555 will power the trigger pin, I guess I need to keep the same amount of power in C2 and, after a few calculations it looks like I should use a 20uF capacitor (the exact number is 17.36 but 20 is close enough), while C1 is used to stabilise the control volt pint of the ne555 so 0.01uf should still be fine
- As far I understand, I cannot keep using resistances of the same size because I am using a greater voltage, I ran a few calculations, can you tell me if the new sizing are fit for the schematics? I tried to keep the amount of Amps (I used this online calculator https://www.rapidtables.com/calc/electric/ohms-law-calculator.html)
- As I stated before, I need to bring down the voltage from 12v to 5v, considering the delta in the voltage and considering the amount of current that needs to be handled, a switch regulator would be a better fit, can you point me out to which one should I use? And which additional circuits / components do I need?
- I guess it would be better to add a fuse somewhere before/after the switching regulator, is that true? If yes can you point me out on how should I do that?
Sorry for this VERY LONG post, I am a soft eng and my experience with electronics is close to nothing, I barely know how to read a schematic or a ic sheet, so I have a lot of questions :)