CaRFID - Custom Ignition Switch Replacement (Open Source)

That’s funny, you remind me on the fact that the whole world, except the USA, is using the SI-System, but the Americans are calling their system “standard”. I’m not a native American and utterly fail to comprehend why the American people doing this.

Feature Update:

My car has a bit of quirk, in that the 12V ports/cigarette lighter ports are always live at 12V. They don’t ever switch off. This is a problem, because I have a dashcam, backup camera, and an Echo Auto. If I leave them plugged it, it completely drains my battery in the span of 3 days or so. So, for the last year, I’ve had to unplug them every single time I get in and out of the car. This is very, very annoying. It also took up both of my ports in the front of my car, so if I was on a road trip or something, there was no room for something like a phone charger.

I happened to have a spare relay on my board (didn’t need the secondary start relay), so I was able to hook that up to switch a 12V line to use for everything. The dashcam and the Echo use 5V, so I had to also throw in a voltage converter with enough current capability.

I then just had to reprogram the board to switch that relay at the same time as the accessory line.

There are two weird quirks from the same cause. Due to a wire length issue, I had to tap into the accessory power, rather than my constant 12V wire. This isn’t a huge deal, but it means everything takes a half second or so longer to start up, as it has to also wait for the accessory relay to kick on. The other quirk, is that it reboots when the car is started. For whatever reason, the accessory line disconnects for a split second when the vehicle is started. It’s always done that. It didn’t affect the stock radio, but more advanced electronics tend to do a full reboot.

Next time I pop things open I can actually hook it up to the right power line, and all of those will be fixed. I had actually considered just connecting the radio power through the same relay, but decided not to for these reasons:

  1. It’d make things more annoying to revert
  2. It’s nice having the radio play until I open the door. Sometimes I listen to music for a minute or two before I get out of the car.

I could also have in theory just hooked the other electronics through the accessory relay, but I want them to have constant power during start (after moving the power line), and I just want to be able to control them directly for some future feature expansions I have planned.

EDIT: Since I go back to college Thursday, I’m also in the middle of printing a cover for my keyhole area. It’ll just be a nice black plastic dome to cover the cut key completely.

2 Likes

OLED time! :blush: It’s hard to capture on my phone camera, but the screen is very crisp and readable from the front seats. I ran through starting a few times in this vid, to make sure the text was readable on camera.

I actually had to print the new front panel twice, I fucked up my bed adhesion the first time and it warped :slightly_frowning_face: thankfully this one turned out fine.

4 Likes

An unintended but welcome side effect of the screen, it’s really, really easy to notice now if I accidentally leave it on. I had intentionally made it so there were no status LEDs on in the idle state (not running & deauthenticated) in order to reduce power draw in the event of me leaving it on.

This was great as I could accidentally leave the board on for days without ill effect, but after leaving it on once or twice, I got worried, given that I sometimes don’t drive for over a week when I’m at college.

With the screen on, I can’t really leave the car without noticing that I left it the system on, with it saying “Scan implant:”.

Shouldn’t have any issues anymore. One thing I would definitely recommend to anyone doing this, or any other ignition replacement, is to go to your local hardware store and have a spare door key made. I needed to do that earlier for the ignition lock bypass, but I went back today and had another made for another $4. This is so that if I leave anything on (worst case scenario), and drain my battery completely, I can still get inside my car to pop the hood and jump the vehicle. I have a jump pack in my trunk, so it’s no biggie if it happens, and having the spare key gives me immense peace of mind for only $4.

1 Like

I’m officially working on a new revision of the board, with a few changes.

First are the obvious fixes, the ISP connector, pull-down resistors, etc.

But there’s a fundamental thing I want to change.

My car appears to have a bad connection somewhere. I haven’t been able to track it down yet. Somewhere, there’s a bad ground or something. Likely a result of the horrific radio install from the previous owner. Once before, my car has had an issue where the power flickered for a second while I was driving. This wasn’t a big deal at the time, as my radio just rebooted, and my headlights flickered for a partial second. I went on my merry way.

However, it happened again. With CaRFID installed. This happened over a week ago, but it took me a while to dissect what happened, and to calm down enough to actually write about it. It’s a bit embarrassing too, to be honest.

I was driving on a US highway (US-136), heading back to college, going 60mph (speed limit) on a dark part of the highway, deep in cornfields (at about 10pm). I turned a corner, then suddenly my entire car went dark. The power seems to have flickered, which knocked the ignition out completely, which caused my headlights to turn out, leaving me in pitch black. The engine cut out as well. I kept my wheel straight and carefully applied the brake in pitch black. Thankfully I didn’t go off the road. Turning my hazards on and pushing the car off the road, I got to work on getting it running again. I tried simply re-authenticating, but it didn’t crank over, in the same way it would if the transponder bypass wasn’t working.

I believe two events happened over the single drive. The first was the antenna shifted for the bypass. It moved out of the zone where it could get a good couple. I have it jammed in there somewhat awkwardly, so it’s not a huge surprise. The second event was the power flicker, which caused a full deauthentication.

After panicking for a bit, I managed to figure it out, and get the antenna put back in a position where it worked. I’ve been carrying all of the tools needed to take apart my center console, in case this happened (thankfully my ignition isn’t on my steering area, it’s by my radio).

This ordeal shocked me, as I had put over 10 hours of highway driving on as a test, with no issues. I even drove to a neighboring state after each significant change.

I was originally going to implement latching relays (or a latching circuit) as a safety feature, for the RUN and KEY_INSERT positions. I decided not to, due to the considerable cost increase for components, combined with the extra pins needed on the MCU. The new version is 1000000% getting 2 latching relays for those positions. My thought pattern was that other aftermarket push button starts don’t implement latching relays, so it must not be a big issue for most vehicles. I was wrong.

I’m lucky to be alive, to be honest. If it had cut out a few moments earlier, I might have veered off the road at full speed. I got passed by a few people before I got my vehicle pulled off the road, if someone hadn’t seen me, they would have hit me going 60+.

Learn from my mistakes here. Don’t sacrifice safety, even if you think you’ll be fine. In 99% of vehicles this wouldn’t be an issue, it was an issue of compounding errors, but it was still reckless. It was legitimately terrifying, and it took me a full day to stop shaking. Having to drive another hour afterwards wasn’t great either.

The second I can, I’m going to sure up the power connections to the board to the best of my ability, I’m considering even bodging some kind of secondary power, until I can get a new revision fabricated and assembled.

I’ve attached a video of my dashcam footage from the incident. Thought it would be interesting for everyone to see, at the very least. Ignore the incorrect date, my dashcam needs replaced (the internal rechargeable backup battery is failing, date resets every drive).

3 Likes

That wasn’t an ideal situation.
I’m glad it all turned out alright :+1:

2 Likes

How have your repairs gone?

Have you found the fault and ironed out the issue.

1 Like

Sadly not yet. School picked up an insane amount, been trying to keep up with everything. I’ve been driving casually, just to the grocery store and such 1-2 times a week, and haven’t had any issues since.

There’s a single wire splice in particular I feel might be at fault (think the ground might have an unsoldered joint from the previous owner, just twisted together), so I’ll tackle that first when I get a chance.

I plan on heading home either this weekend or the next, it’s much easier for me to perform repairs there. I plan on fixing that joint, then I also want to find a more reliable 12V tap. I’m tapped into the fusebox at the moment, but I’m not happy with the quality of the connection I was able to get.

I’m also going to add a sheet of plastic to the top and bottom of the area where the board is, in case something shorted somehow.

The redesign with additional safeties is the ultimate goal, but money is running a bit low right now (my decade-old desktop PC decided to fail a week into the semester…), need to save for a bit before I can buy the parts for another board (including the board itself).

I was a bit worried that there was something wrong with the board itself (something causing the code to crash, for instance), but I’ve done several drives 4x longer than the one where the issue happened, without problems. Feel like that can’t be it. I also accidentally left the system on for 3-4 days earlier this week (without causing battery drain :slightly_smiling_face:), and it was fine as well.

1 Like

how did you manage this? Is there a low power state / mode already implemented?

Nope, it seems to just be incredibly low power draw, even with the new OLED screen. It’s been a while, but IIRC, the original version drew about 44 milliamps (with no LEDs lit). This seems about right, looking at the datasheet for the 328P.

From data I found online, it looks like the OLED board I used only draws 2.5mA-85mA or so, depending on the amount of pixels that are on (less than half with the default idle text). One of the beautiful things about OLED.

The PN532 board is a trickier beast. To be honest, this is where my knowledge is lacking a bit, mainly with the implementation used in the Adafruit libraries.

During an active read, this board is supposed to be using 100-200mA. The board can go into a soft power down which heavily, heavily reduces consumption, however, I’m not sure how that’s implemented in the libraries, if at all. From my programming POV, I just call a function to read the UID, and it waits until a card enters the field. No clue if anything more sophisticated goes on there in the background.

(Edit before even posting: I’ve had a look at the git repo for the adafruit PN532 code. Looks like it doesn’t do any power management by default. It can slightly ease the load on the MCU by utilizing the IRQ pin via I2C (as I’ve done with my board) but that’s it. The adafruit library does however allow me to send commands directly to the PN532, and reading the documentation for the PN532, should be easy to set the PN532 into soft power down mode, which appears to reduce the current draw to less than 1 milliamp. I think I’ll actually implement this into the next version of the code, and make it so you have to press the green button first to activate the PN532 and enable the RF field.)
Screenshot_2021-02-04_03-46-33

Regardless, it looks like the board should draw in total 146.5-329mA assuming no PN532 power management, albeit at 12 volt. With power management, this would come down to 47-130mA or so. This really isn’t much though in the context of a car battery, and while you wouldn’t want to leave it enabled for weeks on end, a week should be no issue.

Since every other device in my car (backup camera, dashcam, etc.) are all powered through the board, the CaRFID board is the only possible drain on the battery at any time.

1 Like

Well, it’s dead.

This revision of board isn’t gonna be used again any time soon.

I decided to head home from college, which is about a 2 hour drive. I was planning on working on the board more once I got there, to try and alleviate the issue from the last post. As I was driving, I was seeing some weird flickering, like the LEDs were turning on and off. Never caught it in the act though, just in my peripheral vision. Then, after like 1.25 hours of driving, blackout again. I hit my hazards instantly, and was able to stop safely on the side of the road. It instantly started up again, but I had already decided to revert it back when I got home. Then, I got to a major town (about 30 minutes later), and the screen turned off, the red LED was on dimmly for some reason, and the green LED was off, but the car was still running. I pulled into a parking lot, and the buttons didn’t work to stop it. I then hit the power switch (turning the car off), turned it back on, and restarted. Then I got back on the road, and a few minutes later, it died again. I pulled onto a side road (blocking the road in the process), turned on my hazards, and tried again. It didn’t start. Turned it off, tried again, and it worked, but seconds later everything went black on the panel. No screen, no LEDs. Thankfully, the car was still running somehow. Got to a gas station, pulled in, and went to work converting it back. Unlike last time, the cut key pulled right out. Half an hour later, I had the board pulled, and my key working again. I was then able to make it all the way home with no more issues.

I had been carrying the tools needed to switch things back ever since I installed the board, and I’m glad I did.

I still have to do an autopsy on the board and try and figure out the failure. My best guess is something wrong with the voltage regulator. It only happened on drives longer than an hour or so, and seems to have a “cool-down” effect. My guess is that for some reason it was producing less voltage than it should have, undervolting the MCU. That’s the only way I can see that it would be so completely erratic and unpredictable. This is also why I think the car remained running, it must have still been able to produce barely enough coil voltage to keep the relays latched, keeping them in their prior state (even when the MCU was confused as fuck). I plan on hooking up the board to power letting it run for a few hours, and see if I can replicate the issue. That would at least let me figure out what was happening. My only guess, if it is the voltage regulator, is that I ended up exceeding the rated spec somehow (unlikely since it was only powering the reader + the tiny OLED, should never have exceeded a single amp even). I also wonder if it was overheating, but I was hoping that running it at such low current would have helped that concern. It also wasn’t warm to the touch when I was removing the board.

I don’t plan on completely abandoning the idea. A second revision with actual latching relays in-case of power loss is the only way I could see myself coming back to it, though. Definitely have to figure out what’s going wrong with this revision too, so I can correct the mistake.

@Pilgrimsmaster I sent you a DM regarding this issue, as well.

2 Likes

Sounds like a component overheat yeah… probably regulator as you stated. A regulator literally uses a false load to act as a voltage divider, so it is quite literally a little heater by design. A buck converter works differently… so you definitely need excellent heat management on your regulator or need to change it over to a buck converter.

2 Likes

Definitely going to look into swapping over to a buck converter on the next revision.

Glad to hear that my hypothesis made sense, still gonna see if I can stress test it just to make sure that it’s the only issue.

I’ll still probably wait until I can make a second revision for putting it into my car again (don’t wanna do cludge on top of cludge), but I’ll feel a lot better about doing so if I can 100% pin down the cause of failure.

For testing it might be worth having the new CaRFID and your ignition key in parallel, with just a changeover switch wired in to swap what one had the Common connection - then at least if you have issues you can flick one switch to bypass it and put a key in until you are confident in it.

3 Likes

Sadly there didn’t end up being a single common. My vehicle is seemingly unusual in that there’s two seperate wires for each position, that are then connected together.

I wish I didn’t need the cut key for the steering lock bypass, otherwise I could just leave the key cylinder switch completely untouched.

That’s how mine is too, but you just splice your relay connections in so the key and relays can both work still.

Oh and definitely run your next iteration on the bench for a good 72 hour burn-in… checking component temps periodically

I mentioned this, but the problem is that I need a cutoff key in the ignition constantly in the run position, to bypass the steering lock. This would trigger the ignition at all times, if the switch was left connected (leaving it connected was my original plan).

I could always bypass the steering lock elsewhere, it’s just controlled with a Bowden cable in the switch, but I’d rather not.

There might be a solution to this I’m missing, though.

Also the multi-day testing period is definitely happening before it goes back on the road :+1:

The antenna lead for this is usually easily disconnected and you can make your own antenna wrapped around the key transponder, then hide it in the dash. I had the shop disable my steering lock with a wafer insert that can be easily reversed.

Oh course this is irrelevant if you prove your next design well :slight_smile:

I am very interested to see your new revision for his project. Are you talking to any professionals for help on this or is all you?