I just got a new car with Android Auto, and I'm doing a little bit of work to make it work the way I like. The first problem with Android Auto is that it (mostly) requires a data connection for navigation. In this post, I add a hotspot with free data to my car that turns on and off automatically with my car.
I don't want to use my phone's data because I don't want to pay for more data. To get free data, I just signed up for FreedomPop and got one of their cheapest hotspots, a Franklin R850. This gets me a measly 500 MB of data each month, but that should be enough for just navigation.
The first problem with leaving a hotspot in my car is the summer heat in Texas. The battery in the hotspot says "Do not expose battery to temperatures above 113°F (45°C)."
Considering temperatures in August in Dallas, where I currently live, often reach over 105°F in the shade, it's likely that any battery left in a car for a single summer would be toast. Autotrader measured the interior temperature of a car to be 113°F on a day when the outside temperature was only 95°F!
Removing the battery
Obviously, the battery had to go. Removing the battery solves two problems: 1) the hotspot will now shut down when the car is turned off, and 2) the battery will not degrade over time due to heat.
Removing the battery was super simple, I just had to pry off the back cover and then pull it out:
Powering on with car
Next, I needed a way to power on the hotspot with the car. The hotspot powers on when it has power and the power button is pressed for 2 seconds.
Originally I had considered just taping the power button down, but once the hotspot is on, the power button is used to cycle through some menus. Obviously, whatever I use to press the power button has to press it only temporarily.
Reverse Engineering
Next, I decided to open up the hotspot and do a little investigation to find out how it worked. 99% of the time, buttons are simple switches that are connected to a pull-up or pull-down resistor and an input pin on a microcontroller (MCU).
When I opened up the R850, I was pleased to see the board had many well-labeled test points.
Using my trusty multimeter, I figured out that one side of the power switch was connected to ground via a 10k resistor. (The resistor is a pull-down! It's not a pull-up!) I also found that when the power button was pressed, it connected to +5 V from the USB connector.
Luckily the three nodes I needed access to all had test points located near each other: GND, USB_VBUS, and POWER_ON. GND provides a 0 V reference. USB_VBUS provides 5 V when the R850 is plugged in to a USB power supply. POWER_ON is connected to the switch and is normally pulled low through a 10 kΩ resistor. The pushbutton on the front of the R850 connects POWER_ON to 5 V.
Basic Power-on Reset Circuit Design
I now knew enough to get to work designing a solution. I needed a circuit that would provide +5V for two to ten seconds and then turn off. Well, that makes the output portion of the circuit obvious: It should be an open-drain p-channel MOSFET. P-channel MOSFETs provide a high voltage to their output (drain) when their input (gate) is low, and their outputs look like large resistances when their inputs are low.
So if I want my p-channel MOSFET to be on for a couple seconds and then turn off, I need to provide a low voltage to the MOSFET's gate for a couple seconds and then a high voltage forever after that. That's easy! I can just use a resistor and a capacitor for that.
If I charge a large capacitor through a large resistor, then the capacitor will slowly charge up to the supply voltage. The voltage of the capacitor is the perfect input to my p-channel MOSFET.
With my circuit designed, I simulated it to make sure it would work the way I hoped it would.
It works! Well, it works in theory. The MOSFET drives its output high for about 7 seconds and then lets the 10 kΩ resistor pull it low. After the first seven seconds, it's like the MOSFET isn't even there anymore and the physical pushbutton can be used to send signals to the MCU as normal.
Building the circuit
Finally, I had to actually build the circuit. I picked a couple parts off Digi-Key, ordered them, and set to work.
Part Number | Description | Package | Price | ||
---|---|---|---|---|---|
SSM3J338R,LF | P-Channel MOSFET | SOT-23-3 Flat Leads | $0.44 | ||
LMK316BJ476ML-T | 47 μF capacitor | 1206 | $0.62 | ||
RC1206FR-07100KL | 100 kΩ resistor | 1206 | $0.10 |
First, I took some strip board and cut it in half with a hacksaw so it would fit in the battery compartment. I used a small clamp to hold the strip board still while I was cutting it.
I then soldered wires to the GND, USB_VBUS, and POWER_ON test points on the R850's circuit board and pushed them through a small hole into the battery compartment.
And then I built the reset circuit on the strip board.
After closing up the case, it was ready to test. I plugged it into the nearest power source, waited a couple seconds, and the world "Welcome" popped up on its display. It worked!
Was this information useful or interesting to you? Do you have any automobile/hotspot related hacks? Let me know in the comments!