Operating servo/strike latch for secret compartment using -stock- buttons

Hi all :slight_smile:

Yay! First post. Let me preface myself by stating that I have no intention of creating a 'car trap' that is used to smuggle anything illegal. I am simply fascinated by secret compartments, and was inspired by a recent WIRED article that discussed them (they're not illegal in Australia by the way - which is where I am ). I wouldn't mind using it to hide valuables in my car though when I park it in the city though!

I have limited experience with Arduino, but tend to take to new concepts fairly well.

The project I would like to build is a secret compartment in a car that can be operated by pressing a combination/sequence of -stock- buttons (i.e. defroster, power windows etc), which would then in turn activate a servo to lock/unlock the compartment.

I have identified a hollow space that would be perfect for the compartment (rear door coin tray that screws out, and leaves a big gap underneath). I'd love to design it in such a way so that I can unlock the mechanism with the stock key combo, then slide out the coin holder, which would uncover the compartment.

Any help anyone could give me would be incredibly appreciated!

Please let me know if there's any other info I can supply that will help with my query (e.g. photos, diagrams, the original article etc)

Thanks!!

Scott

Does your car have CAN bus or anything similar where you might be able to capture all these stock key presses?

Wow!

Thanks for the very prompt reply. The car does have an easily accessible OBD2 diagnostics port, and one of the protocols it can communicate with is CAN BUS. I'm not sure how I would go about using the interface between the buttons and the ECU/BCM though.

Cheers,

Scott

First you might make a few application decisions I would think.
First the power default state.

Do you wish the lock to remain locked if all power is lost in the car as in a dead battery or something causing the vehicle to loose power, making access impossible without first re-establishing vehicle power? Or do you wish power required for the lock to be locked, thus creating a continuous battery drain when the vehicle is parked? That would have a bearing on what you use to activate or deactivates the locking mechanism be it a solenoid or servo or come up with some very low current device.

Lefty

Unfortunately now I am going to disappoint you: Neither do I. Though I had read that some vehicles interface just about every button in the car through the CAN bus.

I would spend some time over in the mp3car.com forums.

I do know that more than a few people have done OBD projects with the Arduino. Here is a library that look pretty good:
http://www.arduinodev.com/arduino-obd-ii-library-gets-updated/

Use a solenoid latch powered from the fuse bus and controlled via a pushbutton under the dash. Sometimes simple things work best.

retrolefty:
First you might make a few application decisions I would think.
First the power default state.

Do you wish the lock to remain locked if all power is lost in the car as in a dead battery or something causing the vehicle to loose power, making access impossible without first re-establishing vehicle power? Or do you wish power required for the lock to be locked, thus creating a continuous battery drain when the vehicle is parked? That would have a bearing on what you use to activate or deactivates the locking mechanism be it a solenoid or servo or come up with some very low current device.

Lefty

I was just ticking that over actually - I think I'd like to go for the 'fail secure' option, purely for the fact that I would like to keep my options of latching mechanism open, and I'd hate to come back to my car after a period of time and find it had a dead battery if I din't get the design spot-on!

Thanks!

Retroplayer:
Unfortunately now I am going to disappoint you: Neither do I. Though I had read that some vehicles interface just about every button in the car through the CAN bus.

I would spend some time over in the mp3car.com forums.

I do know that more than a few people have done OBD projects with the Arduino. Here is a library that look pretty good:
Arduino OBD-II library gets updated | ArduinoDev.com

Thanks! Hopefully someone can point me in the right direction with this.

zoomkat:
Use a solenoid latch powered from the fuse bus and controlled via a pushbutton under the dash. Sometimes simple things work best.

Very much agreed - would be much easier. I would really like to give this a shot though - it's incredibly fun.

Thanks for your input though :slight_smile:

scottiejmurray:

retrolefty:
First you might make a few application decisions I would think.
First the power default state.

Do you wish the lock to remain locked if all power is lost in the car as in a dead battery or something causing the vehicle to loose power, making access impossible without first re-establishing vehicle power? Or do you wish power required for the lock to be locked, thus creating a continuous battery drain when the vehicle is parked? That would have a bearing on what you use to activate or deactivates the locking mechanism be it a solenoid or servo or come up with some very low current device.

Lefty

I was just ticking that over actually - I think I'd like to go for the 'fail secure' option, purely for the fact that I would like to keep my options of latching mechanism open, and I'd hate to come back to my car after a period of time and find it had a dead battery if I din't get the design spot-on!

Thanks!

I would certainly feel better with a fail-secure system. If someone is trying to get into your car and your alarm is going off, one thing they might do is kill power to the car. Just don't lock anything in there that would be needed to restore power to your car. And as for the latch needing constant power to stay locked or even unlocked would be a very poor design anyway. Your gas cover latch or trunk latch doesn't take constant power in either case, does it?

Personally, having been stuck with a dead battery before, I ALWAYS carry a battery operated jump starter in my trunk. In fact, it saved me just a few weeks ago!

It's incredible how quickly even a relatively small current can drain a car battery - not to mention, even if it's not fully drained, too low a voltage can make the computer act all screwy!

I was thinking, it's not absolutely necessary for the board to pickup the signal through OBD to recognise it's been pressed. I'm sure that the majority of buttons (with the exception of things that require resistors like fan motors) are either power on or power off.

Would it work to hook up to the wires running to each switch (window up/down) for example, and assign that to a pin? Then I could do the same thing for several others, and write some code that would only allow the solenoid to open if the inputs were triggered in the correct order?

Of course. That's why you would connect it to your Auxillary circuit that is powered only when the ignition is in the ON position. You wouldn't be able to read you CAN codes otherwise anyway.

I am with making things a bit simpler as well, though. A well hidden button or even a few buttons would be just as effective. I wouldn't put them under the dash or in the glovebox though. Consider inside your upholstery. Or even reed switches that you activate with magnets in a certain sequence.

You have a certain amount of security through obscurity. How common is it that someone would have a hidden compartment in their car? Unless you made it very obvious, they wouldn't even know it was there and wouldn't be looking for buttons to open it.

It's worth pursuing, but there is no guarantee that you will have CAN codes for the stock buttons in your car.

That's an awesome idea actually! (Reed switches or buttons under the upholstery)

A couple of queries if I'm going to take the approach of just connecting wires to the switches themselves to detect when they are switched on/off and use this to trigger the solenoid:

  1. How would I connect up the wires to the two wires coming off the back of each switch appropriately? I was thinking it would need to be in series to detect the voltage change - which will then I assume require relays so as to not fry my board!

  2. Does anyone have any experience powering a board from a vehicle? (e.g. does anyone know what would be the best way to connect the board to a stable source of power (i.e. current, voltage))

Thanks thanks thanks in advance :slight_smile:

I have seen many projects where the Arduino is just powered right off the vehicle 12V, but personally I would put a 9V regulator (LM7809 would be fine) before the Arduino and some big smoothing caps and place it as close to the Arduino as possible. Use 25 to 50V caps on the side towards the car battery. A 1000uF to 2200uF cap. With this and the regulator, it should protect the Arduino. The 7809 can take a voltage up to 35V.

For the solenoid power itself, just connect that to the vehicle power directly and switch it with whatever flavor you like such as an automotive relay, SSR, etc... In a bit of over-engineering, you could use an optoisolator on the Arduino output to ensure voltage spikes don't somehow make it into the Arduino. Or even just a 5.1V Zener between the output and ground (or even just a diode in series since it is always an output to prevent current from entering.)

Again, this is probably not really necessary, but those are suggestions to protect things and parts are cheap. They would go in my own design. And likely will soon, as I have a trip computer planned in the near future.

If the switches are wired all in series, all switches would need to be closed at the same time. Make sure the switches use the same ground that your Arduino uses.

I'm not sure what you mean by a relay on the switches. A switch just closes or opens a circuit. It doesn't generate voltage on its own. However long wires in the car may develop large spikes of current on them. Again a zener would help here. It would just go between the Arduino pin and ground. That would sink any volatge over the 5.1V to ground and away from the Arduino. Or you could use optoisolators here as well, but you would need to provide voltage to the switches on the other side of the the opto isolator. Go with a zener to keep things simple.

Just keep in mind that if you do wire the switches in series that they all need to be pressed at the same time to register. So lay them out accordingly so that all CAN be activated at the same time. You could not do a specific sequence this way. And realize there is a chance that it could be accidently activated this way unless you layed it out in some way that it would be very unlikely that all switches would get pushed at the same time (for example by people sitting across all the switches at once.) It would certainly be simpler to wire up and code that way, though.

Retroplayer:
I have seen many projects where the Arduino is just powered right off the vehicle 12V, but personally I would put a 9V regulator (LM7809 would be fine) before the Arduino and some big smoothing caps and place it as close to the Arduino as possible. Use 25 to 50V caps on the side towards the car battery. A 1000uF to 2200uF cap. With this and the regulator, it should protect the Arduino. The 7809 can take a voltage up to 35V.

For the solenoid power itself, just connect that to the vehicle power directly and switch it with whatever flavor you like such as an automotive relay, SSR, etc... In a bit of over-engineering, you could use an optoisolator on the Arduino output to ensure voltage spikes don't somehow make it into the Arduino. Or even just a 5.1V Zener between the output and ground (or even just a diode in series since it is always an output to prevent current from entering.)

Again, this is probably not really necessary, but those are suggestions to protect things and parts are cheap. They would go in my own design. And likely will soon, as I have a trip computer planned in the near future.

If the switches are wired all in series, all switches would need to be closed at the same time. Make sure the switches use the same ground that your Arduino uses.

I'm not sure what you mean by a relay on the switches. A switch just closes or opens a circuit. It doesn't generate voltage on its own. However long wires in the car may develop large spikes of current on them. Again a zener would help here. It would just go between the Arduino pin and ground. That would sink any volatge over the 5.1V to ground and away from the Arduino. Or you could use optoisolators here as well, but you would need to provide voltage to the switches on the other side of the the opto isolator. Go with a zener to keep things simple.

Just keep in mind that if you do wire the switches in series that they all need to be pressed at the same time to register. So lay them out accordingly so that all CAN be activated at the same time. You could not do a specific sequence this way. And realize there is a chance that it could be accidently activated this way unless you layed it out in some way that it would be very unlikely that all switches would get pushed at the same time (for example by people sitting across all the switches at once.) It would certainly be simpler to wire up and code that way, though.

Hi! Thanks for the great advice - much of it will be incredibly useful, however I think some of my comments were misinterpreted. When I was talking about wiring in relays in series I meant using the wiring of the stock buttons as outlined in the graphic below

I assume I would need something like a relay so the voltage of the stock circuit doesn't fry the board. However, I have no idea as to what kind of component to use for the 'green box' - it's like a relay in reverse I guess - using a higher voltage circuit to switch a lower voltage. Does anyone have any practical tips on how I could make this work?

Thanks!

Scott

Your stock button is likely to be getting pulled up and is shorted to ground when pushed. So, the negative side of the switch would always be at ground.

The main consideration here is not to disturb the functionality of the original switch (I assume that you would still like to be able to use your rear defroster.)

I would tap off the positive side and use a comparator. Your other options are a relay, and you would connect the coil to the positive side as well, but that would mean the coil was always energized until the button is pressed. And it may draw enough current that it is sensed as a switch pressed. A zener diode is another option, but may end up also drawing too much current (a zener will conduct when the voltage is above its threshhold.)

A comparator will have a high enough impedence as to not disturb your stock circuit.

Retroplayer:
Your stock button is likely to be getting pulled up and is shorted to ground when pushed. So, the negative side of the switch would always be at ground.

The main consideration here is not to disturb the functionality of the original switch (I assume that you would still like to be able to use your rear defroster.)

I would tap off the positive side and use a comparator. Your other options are a relay, and you would connect the coil to the positive side as well, but that would mean the coil was always energized until the button is pressed. And it may draw enough current that it is sensed as a switch pressed. A zener diode is another option, but may end up also drawing too much current (a zener will conduct when the voltage is above its threshhold.)

A comparator will have a high enough impedence as to not disturb your stock circuit.

Yes - I would definitely still like to use the original functionality of the switches I'll be messing with :slight_smile: Thanks for the advice on how to do it correctly.

Another question as well (sorry - I've asked a million already). As the pins on the board don't have a positive and negative, I assume I would attach the ground on the board to the car body, and then as you said, tap off the positive side, correct?

Cheers :slight_smile:

Use a multimeter to determine that. Car body is not always ground, some chassis have positive on the body. You will need to use a multimeter to determine how the switches are wired up anyway. It is probably as I mentioned, but safer to double-check than to assume. :slight_smile: