PDA

View Full Version : Custom Arduino keyless entry + auto window/trunk integration...



Toni
12-31-2010, 05:48 PM
Did a first test of my custom Arduino keyless entry system and well, it works!


http://www.youtube.com/watch?v=AXI2P6WLoB4

I'm using the following:

Arduino micro controller
4channel wireless stamp(ebay special)
ULN2004 transistor array

The hardware is pretty simple. The software was a bit tricky. I have it setup to do 4 functions for each button. Click, double click, hold, long hold. So I have a TON of things I can do. Right now it's just the normal functions + trunk and I integrated it into my auto window controller(also arduino based).

Added bluetooth support to be able to control it with my Android based phone.

Using a RN-41 class 1 bluetooth module. See a few posts down for the app interface.

-Antoni

DocWalt
12-31-2010, 07:22 PM
Bringing the awesome again, Toni :)

Stealthlabel
01-01-2011, 06:07 PM
hell yea!! keep it up

akotten
01-01-2011, 07:32 PM
That's awesome. How big is it? Any pics? Any chance you'd do a write up or make more?

Toni
01-02-2011, 04:06 PM
Bringing the awesome again, Toni :)


hell yea!! keep it up

Thanks guys, I love tinkering around with electronics. Every new project I learn a lot and it's fun.


That's awesome. How big is it? Any pics? Any chance you'd do a write up or make more?

Right now it's still on a breadboard for testing. Once I get it onto a board it won't be very big. Maybe 3x2x1 (guestimate). I can get away with it because I'm not using any relays that you'll typically find on security systems/keyless entry because I know that everything I already tap into are relays so I'm not working with high current. I don't plan to make anymore because this is just a custom thing I was interested in doing. My goal is to end up with bluetooth support for my android phone. I don't mind helping anyone else out if they are interested.

B-Man
01-02-2011, 08:06 PM
Damn it, you beat me to it. I was looking at parts to make one of these.

Toni
01-02-2011, 08:08 PM
Damn it, you beat me to it. I was looking at parts to make one of these.

Well it should make it easier for you then :) What are your requirements?

B-Man
01-02-2011, 10:17 PM
Well it should make it easier for you then :) What are your requirements?

I really wanted to do a true proximity, so when you get 10ft or so from the car, it automatically unlocked. RFID looked best but the passive ones don't have the range I was looking for. Bluetooth was a possibility but power was a concern, so I was looking at miniRFs.

Nordic FOB - SparkFun Electronics (http://www.sparkfun.com/products/8602)
Transceiver nRF2401A Module Trace Antenna - SparkFun Electronics (http://www.sparkfun.com/products/153)

Roy
01-03-2011, 10:12 AM
Good job. I love the Arduino, I use it for all kinds of random projects.

DrGonzo
01-03-2011, 11:04 AM
Great job Toni!

Now where's the write-up and pic's...LOL

Tiberius
01-04-2011, 04:41 AM
Also interested in code & circuit design. I already have an arduino from which i planned to build a custom datalogger. This would be a nice addon.

@B-Man: Have a look at the nRF2401A modules from Sparfun.com. I've never worked with them but the specs and the prices look good.
I'm doing a university project with Atmel ZigBee modules right now and they are quite complicated. But I think the ZigBee/X-Bee modules from Digi international are quite well established in the Arduino community. And you can buy ready-to-go arduino shields for them.

Toni
01-04-2011, 10:22 AM
I really wanted to do a true proximity, so when you get 10ft or so from the car, it automatically unlocked. RFID looked best but the passive ones don't have the range I was looking for. Bluetooth was a possibility but power was a concern, so I was looking at miniRFs.

Nordic FOB - SparkFun Electronics (http://www.sparkfun.com/products/8602)
Transceiver nRF2401A Module Trace Antenna - SparkFun Electronics (http://www.sparkfun.com/products/153)

I was looking at that but decided to go with something cheaper to start. This is what I got for my wireless. Sure it's not the best and I haven't tested range but can't beat the price.

4 Ch RF Controller Wireless Remote Control Basic Stamp - eBay (item 320637372389 end time Jan-04-11 09:15:27 PST) (http://cgi.ebay.com/4-Ch-RF-Controller-Wireless-Remote-Control-Basic-Stamp-/320637372389?pt=Radio_Control_Vehicles&hash=item4aa77a07e5#ht_5478wt_906)


Good job. I love the Arduino, I use it for all kinds of random projects.

Yeah they are great. It's perfect to jump right into getting something to work.


Great job Toni!

Now where's the write-up and pic's...LOL

Once I get the bluetooth added and a board completed then I'll get some pics up.


Also interested in code & circuit design. I already have an arduino from which i planned to build a custom datalogger. This would be a nice addon.

@B-Man: Have a look at the nRF2401A modules from Sparfun.com. I've never worked with them but the specs and the prices look good.
I'm doing a university project with Atmel ZigBee modules right now and they are quite complicated. But I think the ZigBee/X-Bee modules from Digi international are quite well established in the Arduino community. And you can buy ready-to-go arduino shields for them.

I'll have to do some sort of write up on this. It would be good to get some critique and suggestions anyway.

Toni
01-06-2011, 12:38 AM
I have some updates!

Got my bluetooth module and for the moment I can now control some lights on the board via bluetooth serial :) FUN! Gotta work on the android ui now.

Toni
01-11-2011, 09:23 AM
Well I was able to get some time to work on the UI for the app. Nothing too crazy just using built in elements. Still have some debugging stuff on it (status/connect/disconnect). This is just a first stab to get something usable.

(The lock/unlock long hold to reveal options along with the button. 2nd picture )

http://www.primaryboost.com/store/rt/customkeyless/entroid_01.pnghttp://www.primaryboost.com/store/rt/customkeyless/entroid_02.png

-Antoni

Tiberius
01-11-2011, 09:35 AM
Uhhh I like it. Gotta have a look at the android sdk myself. It's a Java API right?

Toni
02-09-2011, 08:04 PM
Well, have an update. I have the fob and bluetooth code merged so I can now send arbitrary commands to the microcontroller from the phone and still use the fob. It's pretty interesting as now I have much more granularity in what I can tell the car to do as compared to just a few buttons on a fob. I should be able to finish up soon and get a new video together showing the phone in operation.

-Antoni

jba3
02-09-2011, 10:50 PM
I'm about to have a nerdgasm. I may have to go to a smart phone if you're willing to share some of the secrets.

Toni
02-10-2011, 12:46 PM
Not a problem, I'd like to get my projects up on google code but haven't looked into open source licenses. I'm just working locally right now and that is a nice quick way to go for the time being.

mindctrl
02-10-2011, 03:48 PM
Hey guys please PM me with your contact info..preferably AIM or Cell phone, id like to talk to you about an upcoming project that can utilize this work!

Toni
02-15-2011, 12:37 PM
Well, f my balls. Problems in paradise....

Did my first tests of both wireless systems enabled. The bluetooth is interfering with normal FOB operation. EE friend of mine seems to think since it's a high power device it's basically flooding the air with only it's frequency messing with the ability for the fob receiver to pick up what it's looking for. The further away I move the bluetooth device the better the fob signal but that only seems to get me so far. Major bummer! Still trying to debug this further :(

jba3
02-15-2011, 02:18 PM
Well, f my balls. Problems in paradise....

Did my first tests of both wireless systems enabled. The bluetooth is interfering with normal FOB operation. EE friend of mine seems to think since it's a high power device it's basically flooding the air with only it's frequency messing with the ability for the fob receiver to pick up what it's looking for. The further away I move the bluetooth device the better the fob signal but that only seems to get me so far. Major bummer! Still trying to debug this further :(

Ah, complete bummer! I was wondering how it would work with two devices - my head unit uses bluetooth for hands-free calls, and I don't know if it would be able to do that and control the in-car arduino at the same time.

Tiberius
02-15-2011, 03:39 PM
Doesn't really surprise me, both bluetooth and the nRF24 are using the 2.4 GHz band and as far as I can tell the Nordic's do not conform to IEEE 802.
ZigBee tranceivers are based on IEEE 802.15.4 and should (in theory) co-exist a lot better with bluetooth and Wifi.

Toni
02-15-2011, 03:44 PM
Doesn't really surprise me, both bluetooth and the nRF24 are using the 2.4 GHz band and as far as I can tell the Nordic's do not conform to IEEE 802.
ZigBee tranceivers are based on IEEE 802.15.4 and should (in theory) co-exist a lot better with bluetooth and Wifi.

Well I'm not using the nRF24, just an ebay special running at 315mhz. I was also curious about my wireless router and it's 802.11g so I decided to test packet loss while the RN41 was on and saw no throughput issues (although I guess I could still be having some packet loss and not really know).

Tiberius
02-15-2011, 03:59 PM
Ok thats strange then. I'd try shielding the receiver module.
I looked at the eBay pic. Where does the antenna go on this thingy?

Toni
02-16-2011, 03:59 PM
Well I'm going to try another wireless receiver/fob implemented differently. hopefully that will work out!


Ok thats strange then. I'd try shielding the receiver module.
I looked at the eBay pic. Where does the antenna go on this thingy?

It has it build it, you can see the trace grid connected to the inductor. This one looks like it's implemented with an RLC circuit. The new one I'm getting is implemented using a SAW crystal circuit. We'll see if that makes a difference. I guess I should have looked up if that will...or at least asked someone in the know but oh well.

Toni
02-28-2011, 10:08 AM
Good news! The new module works like a charm. It is a little more advanced, has auto remote learning and rolling security codes. Also the fob is much nicer. I'm back in business!

Stealthlabel
02-28-2011, 11:36 AM
nice!

Toni
03-02-2011, 10:48 AM
Finished up the power folding mirror circuit. Has some nice features like individual left/right control and speed synchronization via pwm (allows me to adjust the speed of one mirrors open/close because for some reason one is always slower, noticed that on another person's mirrors as well). Yeah, I like to over engineer shit.


http://www.youtube.com/watch?v=g8IimTvyEvA

Stealthlabel
03-02-2011, 11:00 AM
nice looking good!! gonna have all this on your car at BRG??

Toni
03-02-2011, 11:41 AM
nice looking good!! gonna have all this on your car at BRG??

That is the plan. Right now I'm on target to be complete at the end of the month.

Stealthlabel
03-02-2011, 02:15 PM
sweet

Toni
10-06-2011, 09:59 AM
Well, I was not on target haha. I'm still running into interference between the bluetooth and keyfob bands. The keyfob module just won't work near the bluetooth module. Works perfect if I move bluetooth 4-5ft away. I really need to talk to a rf engineer on this one. I've tried to do some reading and man...it's complex stuff. Hard to find simple answers.

Anyone have any experience in this field?

Jimvr4
10-06-2011, 02:20 PM
Can you provide a block diagram of your system? I've been engineering RF products and systems for 25 years.

Toni
10-06-2011, 03:55 PM
Outline of what I have going on.

http://dl.dropbox.com/u/29716828/keylessblockdiagram.png

Some links

rn-41 bluetooth->serial module
http://www.rovingnetworks.com/documents/RN-41.pdf

433mhz keyfob module (Their site is down but their ebay store has some info)
Rolling Code RF Superheterodyne RX Module&Remote/Keyfob | eBay (http://www.ebay.com/itm/Rolling-Code-RF-Superheterodyne-RX-Module-Remote-Keyfob-/290368742464?pt=Radio_Control_Vehicles&hash=item439b536440#ht_2546wt_1140)

I've tried isolating them by powering one off battery. It really came down to the distance away so I don't think it's a decoupling issue.

Jimvr4
10-06-2011, 04:48 PM
The keyfob is using on/off keying. The 433 MHz receiver module is probably using a simple filter and an envelope detector to convert the RF pulses back to digital signals. This kind of receiver is not very immune to interference.

The bluetooth module is operating in the 2.4 GHz ISM unlicensed band and uses frequency shift keying. There may be unwanted emissions coming from the bluetooth module in lower frequency bands depending on how the final RF frequency is generated.

An invaluable tool for determining what is happening is an RF spectrum analyzer. If you could borrow one you could attach an open ended coax cable and use it as a "sniffer." You would be able to place the bluetooth module near the spectrum analyzer and see what RF frequencies and levels are being generated. IF you found energy near 400 MHz then you could take steps to filter it out on board prior to the bluetooth antenna element.

If you are unable to make changes to the bluetooth module you could try alternative vendors to find one that is compatible with the keyfob device. Unfortunately I don't think you will find keyfob devices with better interference immunity as they are not expected to coexist with other transceivers.

Hope this helps :)
Jim

Toni
10-12-2011, 07:50 PM
The keyfob is using on/off keying. The 433 MHz receiver module is probably using a simple filter and an envelope detector to convert the RF pulses back to digital signals. This kind of receiver is not very immune to interference.

The bluetooth module is operating in the 2.4 GHz ISM unlicensed band and uses frequency shift keying. There may be unwanted emissions coming from the bluetooth module in lower frequency bands depending on how the final RF frequency is generated.

An invaluable tool for determining what is happening is an RF spectrum analyzer. If you could borrow one you could attach an open ended coax cable and use it as a "sniffer." You would be able to place the bluetooth module near the spectrum analyzer and see what RF frequencies and levels are being generated. IF you found energy near 400 MHz then you could take steps to filter it out on board prior to the bluetooth antenna element.

If you are unable to make changes to the bluetooth module you could try alternative vendors to find one that is compatible with the keyfob device. Unfortunately I don't think you will find keyfob devices with better interference immunity as they are not expected to coexist with other transceivers.

Hope this helps :)
Jim

Well I did some light reading on different modulation types for some background and started searching around. I was actually able to find a keyfob and receiver module that allowed me to use both it and bluetooth to over 130ft! I'll have to do a few modifications for my application but it looks like it will actually work out. I'm pretty excited. Can't wait to fire up the cnc and mill out the board :)

Jimvr4
10-13-2011, 11:22 AM
Well I did some light reading on different modulation types for some background and started searching around. I was actually able to find a keyfob and receiver module that allowed me to use both it and bluetooth to over 130ft! I'll have to do a few modifications for my application but it looks like it will actually work out. I'm pretty excited. Can't wait to fire up the cnc and mill out the board :)

Good news :) What type of modulation did you end up going with on the keyfob?

Toni
10-13-2011, 11:54 AM
Good news :) What type of modulation did you end up going with on the keyfob?

It's using FSK modulation.

Roybatty
10-17-2011, 03:08 PM
subscribed :)

Toni
11-03-2011, 12:42 PM
So I've gotten deeper into all of this rf stuff...

The new fob and receiver I was using left me with a few limitations. I was stuck monitoring multiple input lines to detect what button was pushed on the receiver. I also had to debounce them and try to figure out if buttons were double clicked etc. This is not ideal as I could miss events. There were too many delays etc.

I wanted to modify the firmware on the fob and receiver but unfortunately this was not easy. First the transmitter was an RF transceiver and MCU combo that was not modifiable. I'd have to replace it and buy new burning hardware from the company.

This basically led me to a direction I should have gone in the first place. Roll my own rf fob and receiver hardware. The new fob/receiver module was from Silicon Labs and used their new EZRadio chips. I liked the features and found a tuned breakout board with one of their rf transceivers.

So now I'm using the si4432 on a hope electronics 434mhz tuned breakout RFM22. I am amazed at how powerful this chip is as far as function goes. I'll be able to use the fobs from the kit I bought so I'll just come up with my own board. This chip allows me to set the modulation I want to use and add any encodings etc.

Now I'm working on the uC firmware to control it. My plan is to use an Atmel attiny24 on the fob side and the atmega328 I have on the receiver/controller will handle receiving.

I have two circuits talking to each other so now I'm just going to work out the details.

Toni
11-05-2011, 01:53 PM
Came up with some design flow for the fob/receiver to include passive entry. We'll see how well this works out, the biggest hurdle will be battery life on the fob.

http://dl.dropbox.com/u/29716828/fobdiagramas.png

Toni
11-14-2011, 01:52 PM
So I got the fob button code working. It now correctly debounces and handles single and double clicks on all 5 buttons only sending one byte for a command. Both the uC and transceiver go into power down modes when there is no button press. It should be in the nA range. My meter reads 0mA :) I can still go one more power mode lower on the transceiver but then I have to reinitialize it and use another pin. Not sure if it's worth it.

I ran out of program space to implement the passive entry but I won't be using a tiny2313 that I'm testing on now, most likely attiny44 or 84. The toughest part will be fitting the transceiver board and tiny on the fob board.

Toni
11-21-2011, 10:28 AM
So I worked on the board this weekend. Had to redesign the above board somewhat. I forgot to add an antenna trace (yea that might help range out a bit), pins to program the chip, can't do it on a bread board since it's surface mount, and the data pins into the transmitter were switched DOH!

After I milled out the first side I realized I put the antenna underneath the battery :( Luckily I was still able to put it on the other side. Part of the board didn't mill all the way because the copper layer was lower in that section. This is a main problem with fine cnc milling of pcbs since I use a v bit for the best cut. I manually moved to these sections and cut them deeper but I forgot to lift the cutter up at the end and moved it across two traces, DOH!

Nothing major so far, I keep going... Hardest thing to solder is the QFN 20...
http://dlnmh9ip6v2uc.cloudfront.net/images/products/09604-04b.jpg

Yea, tiny bitch is tiny. The pads for it are .3mm and the space between them is .2mm. Unfortunately, since I use a .2mm v bit, by the time I get it deep enough and any spindle wobble, it's about .3mm. So I extend the gap between the pads to .3mm leaving only .2 for the pad. I ended up cleaning the board after cutting it and two of the pads came off :( Stupid things are fragile. So I decide to keep going and use wire strands as jumpers. I end up getting it soldered on, programmed, and tested outside of the case. Woohoo!

So I fit it into the case and give it a go. Stupid thing won't work. Turns out I managed to break some of the connections(fragile) and can't continue. Gonna try another board tonight. Maybe I can make the pads larger and soldered better. This won't be a problem with a real board but I would have wasted money had I sent the first design in.

Jimvr4
11-21-2011, 10:36 AM
When you send out for boards where do you go? I have a couple of sources I've used that are relatively cheap and great quality.

Toni
11-21-2011, 11:12 AM
When you send out for boards where do you go? I have a couple of sources I've used that are relatively cheap and great quality.

I actually haven't had any professionally made yet. Everything up to this point has been soic and larger and my CNC has no problems making it. QFN, etc is a much different animal so I will need one made if I want this thing to last. I was looking at dorkbot (PCB Order | DorkbotPDX (http://dorkbotpdx.org/wiki/pcb_order)) $5 a square inch for three boards shipped no setup fee. Curious, where you have gone? Feel free to pm if you want to keep it private.

Thanks
Antoni

Jimvr4
11-21-2011, 12:26 PM
Sending you a PM :)

Toni
11-25-2011, 01:13 PM
All done! Prototype board seems to work pretty well.

http://primaryboost.com/store/rt/keyless/fob/tn/DSC_2544.jpg

http://primaryboost.com/store/rt/keyless/fob/tn/DSC_2550.jpg

http://primaryboost.com/store/rt/keyless/fob/tn/DSC_2554.jpg

http://primaryboost.com/store/rt/keyless/fob/tn/DSC_2558.jpg

http://primaryboost.com/store/rt/keyless/fob/tn/DSC_2563.jpg

Toni
11-28-2011, 09:59 PM
I was bored and decided to play around with manual mode on the camera...

http://primaryboost.com/store/rt/keyless/fob/fob1.jpg

http://primaryboost.com/store/rt/keyless/fob/fobPCBFront.jpg

http://primaryboost.com/store/rt/keyless/fob/fobPCBBack.jpg

Toni
12-18-2012, 12:54 PM
Well, in case anyone was wondering where this thread went. I ended up using this as a project for school. Now that I am done I can update my progress.

Here is a shot of the board made on my cnc.

http://primaryboost.com/store/rt/keyless/receiver/DSC_1188.JPG

Here is an in car test of the unit working in the car.


http://www.youtube.com/watch?v=DLibplFfawU

duke3k
12-18-2012, 02:06 PM
Pretty cool and nice work. I'm super impressed you fabbed your own PCB boards by CNCing them. Some serious tech.

Duke

n2nsanity
12-18-2012, 08:59 PM
nice work :)
any future plans for this?

Roybatty
12-19-2012, 08:10 AM
Nice :thumbup:

Sent from garage

stealthify
12-19-2012, 08:21 AM
That's awesome! Nice work Toni!

Toni
12-19-2012, 02:12 PM
Thanks everyone, this was a fun project and I learned a lot.


Pretty cool and nice work. I'm super impressed you fabbed your own PCB boards by CNCing them. Some serious tech.

Duke

I do all my boards on the cnc now. Nice way to get something prototyped for cheap.


nice work :)
any future plans for this?

Unfortunately I don't see that happening. I just don't have the time. To be able to bring this to market will still involve a lot of r&d.