1 2
Keith Tanner
Keith Tanner GRM+ Memberand MegaDork
2/15/22 2:02 p.m.

Well duh, you've got your relay, you just need a couple of 12v signals to tell it to run forward or back. You can use one of these to supply them: https://www.amazon.com/gp/product/B00LW15F42/. Just tell the Arduino to turn one of the relays on by grounding a pin.

Your signal from the position sensor in the motor is already 0-5v. The Arduino should play nice with that.

For the resistance, just look at one of the many guides for making an ohm meter out of an Arduino. I think you just need a reference resistor that's in the same general range.
https://www.circuitbasics.com/arduino-ohm-meter/

iansane
iansane Dork
2/15/22 3:27 p.m.

Hrm. Cool! I'll start with that ohm meter sketch. Should I just structure the code to compare against a 150ohm resistor? Like, if the R2 in that sketch gets near 150 to kick the relay on?

I think that 5v that the motor position sensor sees is created by the EPBM that will no longer be there. But I can step down the car's 12v pretty easily.

iansane
iansane Dork
2/20/22 12:28 p.m.

Success! It took me awhile to get code correct for both sides of the switch but I set it up so that if it's between 150-160 ohms it kicks the relays on. I had a spare relay shield sitting around so I used that. I can show the code itself if anyone is interested. I cobbled it together from a few different sketches and modified a bit on top. I'm sure an actual coder would scoff at it. But it works! Now I have to figure out how to power it off the car and then hopefully get it to fit inside the original case for the parking brake module.

 

Although I guess the big feat is going to test it on the car now... 

iansane
iansane Dork
3/1/22 2:58 p.m.

Welp, I got it to fit inside the factory module's case. 

Don't mind that rtv as wire support... I mistook a couple wires on one connector and have to fix them but I think I'll be able to test it tonight. 

Keith Tanner
Keith Tanner GRM+ Memberand MegaDork
3/1/22 3:05 p.m.

"cobbled it together from a few different sketches and modified a bit on top" is pretty much how most people code, I think :)

Fingers crossed for success!

iansane
iansane Dork
3/2/22 10:53 a.m.
Keith Tanner said:

"cobbled it together from a few different sketches and modified a bit on top" is pretty much how most people code, I think :)

Fingers crossed for success!

Well that's at least a little reassuring. I really need to start notating my code more though. I have a trash memory.

Success was.... somewhat achieved? I tested the unit I stuff inside factory module's case and got nothing. Absolutely nothing. I brought it back inside and started testing it and for some reason now cannot get the arduino to trigger the relays. I obviously did not create the circuit board correctly. (pictured there with the rtv on it). I got extremely frustrated, brought my breadboard outside to the car and set it up with the screen so I could find out what resistances the arduino was seeing. Everything looked golden and the switch actuated the brake perfectly! I even startled myself a little bit; the car rocked when the brake disengaged.

Proof of concept was a success but my actual creation was a failure. Time to try again!

Are there places that can design a pcb from some measurements I take? Maybe easier to have one board that plugs into the arduino directly with the relays/can/power converter directly on it.

Keith Tanner
Keith Tanner GRM+ Memberand MegaDork
3/3/22 1:08 p.m.

There are certainly small run PCB suppliers, but I don't know about design services. 

If the goal of the RTV is to prevent movement, I'd recommend hot glue instead. RTV flexes, so you can have an intermittent connection inside the blob.

1 2
Our Preferred Partners
v6gPNASmmnlRcdiUSifyCx6TNFYw3lyyGdoYQzSKxvY9bZ6rPrUmg1R0b64kvGsB