Automating Your Car With A Spare Fob And An ESP8266

Despite the name, home automation doesn’t have to be limited to only the devices within your home. Bringing your car into the mix can open up some very interesting possibilities, such as automatically getting it warmed up in the morning if the outside air temperature drops below a certain point. The only problem is, not everyone is willing to start hacking their ride’s wiring to do it.

Which is exactly why [Matt Frost] went the non-invasive route. By wiring up an ESP8266 to a cheap aftermarket key fob for his Chevrolet Suburban, he’s now able to wirelessly control the door locks and start the engine without having to make any modifications to the vehicle. He was lucky that the Chevy allowed him to program his own fob, but even if you have to spend the money on getting a new remote from the dealer, it’s sure to be cheaper than the repair bill should you cook something under the dash with an errant splice or a misplaced line of code.

The hardware for this project is about as simple as it gets. The fob is powered by the 3.3 V pin on the Wemos D1 Mini, and the traces for the buttons have been hooked up to the GPIO pins. By putting both boards into a custom 3D printed enclosure, [Matt] came up with a tidy little box that he could mount in his garage and run off of a standard USB power supply.

On the software side of things [Matt] has the device emulating a smart light so it can easily be controlled by his Alexa, with a few helpful routines sprinkled in that allow him to avoid the awkward phraseology that would be required otherwise. There’s also a minimal web server running on the microcontroller that lets him trigger various actions just by hitting the appropriate URLs, which made connecting it to Home Assistant a snap. One downside of this approach is that there’s no acknowledgement from the vehicle that the command was actually received, but you can always send a command multiple times to be sure.

This isn’t the first time we’ve seen an ESP8266 used to “push” buttons on a remote. If you’ve got a spare fob for your device, or can get one, it’s an excellent way to automate it on the cheap.

47 thoughts on “Automating Your Car With A Spare Fob And An ESP8266

    1. As easy as buying some new ones from eBay or Amazon and following the instructions on how to pair them with your car. My 2002 silverado was super easy to do myself, not sure if you rHonda will be similar or not.

  1. I did a similar thing about 10 years ago. I used the key fob and soldered it to an Arduino, placed that in the car. Additionally I added a small wireless module, IIRC it was a XRF serial module.

    Instead of the key fob, I created a similar sized device, using an Arduino mini pro, another XRF module and a small vibration sensor – it was kind of a metal tube with a metal ball in it – along with a small lipo, usb charging socket and a real battery switch.

    When the vibration was triggered, it sent requests to the car, and about at 10 meters distance, the module in the car then would activate the original key fob to open the car. Even featured some kind of hand-knitted pseudo crypto..

      1. Yup. Remote start like this is FAR more beneficial for a vehicle parked outside. If it’s in the garage, it’s going to be significantly warmer (unless it’s a freestanding garage?) My garage almost never goes below 50-55F no matter how cold it is outside.

        I do remote-start my car when it’s in the garage, but that’s because I drive an electric, so it’s perfectly safe (and desirable) to get the vehicle up to temperature while it’s still plugged in.

    1. It depends on the make and year. With my ’02 ford ranger you just had to have two chipped keys used in a particular sequence to program new keys or fobs. With the GMC Terrain I just bought a preprogrammed key blank with fob off eBay using the VIN and took it to a local locksmith to cut it.

      Dealer pricing can vary wildly, don’t be afraid to call around and ask for prices. But there are usually ways to get a new fob/key without going to the dealer, do your research online and you should be able to find something.

    2. GM has standardized enough that people can use fobs from non-Bolt vehicles successfully.

      There’s an extremely similar project to this that was posted on chevybolt.org 2-3 months back – which I’m planning on doing soon because OnStar is such a shitfest and always goes through cellular even if the vehicle has a WLAN connection. (cell signal in my garage is extremely weak, wifi is strong, and I want to fire up preconditioning from Alexa without going through OnStar)

      1. The key fob within 3 feet of the car doors will unlock on some cars. Actually, here in Atlanta,Ga it is a problem. Car owners are leaving the key fob in the car and the cats are being stolen.

          1. I removed the brand new cat fro my motorcycle this summer and tried to sell it to one of those “:We buy all makes and models catalytic converter” ad places. They didn’t want it even though it’s bigger than the ones on a lot of cars!

          2. If your cats like to hide under vehicles, pay extra attention. A friend killed his cat by accidentally driving over it – the vet could not safe him, he died 24 hours later :(
            It was a normal house cat, not an expensive breed, still tragic enough.

      1. My 2017 Cruze hatchback only needs the fob in the car – there is no key. All cars with push-button starters are this way. No key needed to open the doors or start the car, the fob just needs to be in proximity to the car. But you can’t drive off without the fob in the car, it’ll kill the engine as soon as you step on the brake.

    1. How so? Gm cars require the doors to lock before remote starting by the fob, so unless someone breaks the window they can’t just jump in. It says in the article he could program his own. If you know gm cars, you know that is a fob that doesn’t automatically unlock when the fob is in range. Also, there is still the need to break the column lock as a fob doesn’t do that.

    2. In my case it was the opposite.

      I kept forgetting to press the button to lock my car after living in an area where you *intentionally* left the doors unlocked (cheaper to let a drug user steal $1.50USD in spare change as opposed to $150+ to replace the window).

      So I did basically this same idea, but as a serial device with a cron job which triggered the lock button once (but not twice which would cause the “beep” from the car horn to alert for user feedback).

      The system couldn’t do anything _except_ lock the doors.

  2. “… very interesting possibilities, such as automatically getting it warmed up in the morning if the outside air temperature drops below a certain point.”
    Motor independent parking heaters were invented for that purpose. Using the engine on idle is the worst way to warm up a car in cold climates, and it is outlawed in most parts of the civilized world for good reason.

    1. “Using the engine on idle is the worst way to warm up a car in cold climates, and it is outlawed in most parts of the civilized world for good reason.”

      Reference? As far as I know, having lived in the coldest parts of the continental USA, most drivers use remote start or traditional ignition key to warm up the car each morning prior to school/work/errands. Some folks (a minority) do have engine block heaters able to be plugged into normal AC outlets.

      My concern about having the key fob in the car, as alluded to, is security. In some makes/models, the key fob is a presence device that allows unlocking the vehicle upon proximity. Leaving a key fob in my vehicle while locking the door on my exit with another key fob will honk the horn.

      1. It’s about noise, air pollution and all that stuff. The car will emit a lot of stink and suffer unnecessary wear because the engine is running at unfavorable conditions and the catalytic converter won’t reach its working temperature.
        In Austria this is regulated in § 102 Z 4 KFG, which states “Der Lenker darf mit dem von ihm gelenkten Kraftfahrzeug und einem mit diesem gezogenen Anhänger nicht ungebührlichen Lärm, ferner nicht mehr Rauch, üblen Geruch oder schädliche Luftverunreinigungen verursachen, als bei ordnungsgemäßem Zustand und sachgemäßem Betrieb des Fahrzeuges unvermeidbar ist. […] “Warmlaufenlassen” des Motors stellt jedenfalls eine vermeidbare Luftverunreinigung dar. […]”
        (“The driver may not cause undue noise with the motor vehicle he is driving and a trailer towed by it, nor more smoke, foul smell or harmful air pollution than is unavoidable if the vehicle is in a proper condition and operating properly. […] “Warming up” the engine is definitely an avoidable air pollution. […]”)
        Similar laws exist in all european countries and probably also in the US.

        1. I don’t interpret your cited noise ordinance as forbidding remote car starting. Rather, the law appears to forbid things like removing mufflers or failure to maintain a vehicle such that it becomes noisier than a reasonably maintained vehicle.

          Additionally, I don’t see a significant difference in operating conditions between starting a vehicle remotely and starting one in the “normal“ fashion.

          1. You can look at it this way:
            No matter what, if you’re planning on driving it, you’re putting a starting cycle on the car.

            Remote start allows the ECU to light off the cat/etc before the engine is put under load, as opposed to putting the engine under load when still cold.

        2. From Italy (and UK where i spent some times. And as i know Germany too where my ex GF were from): there is NO similar law so please, just talk about YOUR country. Plus, in your translation, there is nothing “it’s forbidden to stay with engine off and parked”.
          In Italy isn’t appropriate because of the high consuming of fuel (of course because the engine isn’t hot enough) but you can stay how many time you want in idle (exception to the noises, you can’t stay with music or exhaust system modified in front a house in the night)

    2. It’s outlawed to go into a store or something and leave your vehicle running. This came about due to cars needing keys in the ignition to stay running and people making off with their vehicles, not for emissions. These days you can leave a car running with no keys if it’s the keyless start type. My 2017 Cruze will happily stay running when I pop into a store real quick with the fob in my pocket. If someone breaks in and steps on the brake pedal it’ll kill the engine if the fob isn’t in the car.

      Also remote start is LITERALLY used to warm up (or cool off in hot weather) your vehicle so you’re not getting into a freezing cold or burning hot vehicle.

  3. Also, in most of the button ignited / stopped cars like mine (Jaguar XF 2011) you have to press the brake to be able to get ignition and start the engine. Plus, nowadays these relay car thefts are very popular, this would just give them an extra help already having a key cpse to the car.

  4. I have had a similar setup on my van for a few year now. I used a cellular module instead of a wifi module so it works everywhere. I then have scripts on my home automation server that check the time of day, my phone GPS, outside air temp, alarm clock status, and vehicle GPS to see if my car needs to be started. My van is always parked outside and i live where temps hit -40 degrees. If i leave work during a certain time window and start walking toward my outside parking 10 blocks away the van starts and warms up. In the morning if i am home, the van is home and my alarm clock was set then it starts my van and turns on the outside lights as i walk outside toward the van.

    I have also setup Alexa so i can ask for the van to be started.

    The key fob isn’t a key and cant be used to drive the car, having it in the vehicle causes no risk. My van is old enough that the key fob will not stop the doors from being locked when its inside. The unit uses its own lithium battery to support the cellular module and it only charges while the vehicle is running.

    Honestly i would never go back to not having it. Walking outside in -40 is tolerable when your vehicle is warm :-)

    1. Do you have an auxiliary solar panel or something to keep the module from draining the battery?

      At some point I plan on replacing OnStar with my own telematics module, but finding a system with good power management (sadly, the Macchina P1 uses an Octavo variation of the BeagleBone that lacks deep sleep support based on what I can see in the docs) is a challenge.

      Even a Bluetooth OBD reader can permanently sulfate a starter battery if left for 2-3 weeks by accident.

      1. its powered by the ignition wires (so it only receives power from the car when its running). That works to charge up a bank of 18650’s inside the starter unit. If the car is left long enough to drain the 18650’s to their cutoff threshold then the unit will power down until the car runs long enough to charge them back up.

        So its like having an Aux battery in the vehicle.

  5. I also did this a few years ago. With the addition of a free freedompop hotspot (before they went to crap), the esp connected to the hotspot and ran a blynk server on my computer, which gave me a nice app on my phone. Used it mainly to extend the range of my built in remote start.

    Also helps ease the stress if you think you might have forgotten to lock your car.

    To ease the other comments,

    Only the FOB was there and it was hidden. My car needs the key to start. The built in remote start does not start unless all the doors can be closed locked, including hood and trunk.

  6. Hope they have good Wi-Fi security! Not using the HTTPS libraries for the ESP is asking for trouble. Key fobs have a rolling code for a reason. Using HTTP mostly bypasses all of that.

    1. So you assume someone trying to steal your car will go the effort (and have the skills) to hack into your WiFi, find the IP address to your ESP (most likely OP not only has one on the network) and find the correct command sequence / HTTP Call / whatever that OP uses to trigger the remote remote start?

      1. “There’s also a minimal web server running on the microcontroller that lets him trigger various actions just by hitting the appropriate URLs, which made connecting it to Home Assistant a snap. ”

        Since it’s running a webserver, you could scan port 80. Probably find one that looks promising. And start messing with that. I doubt those webservers have logging or advanced anti tampering code in there to prevent bruteforcing in case of http basic auth.

        Also the skills needed to hack a network arent that difficult to learn.

Leave a Reply to Tyson J MertenCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.