Archive for September, 2012

Another RFID project from the Past

Tuesday, September 25th, 2012

When I first got my RFID implant, the first thing I wanted to do was to RFID enable my car but I wanted to do more than just unlock the doors.  I set out to create a 3 point immobilizer as well as control the central locking.  The cool thing with having an implant as your key is well, you can never lock your keys in your car!  With that in mind, this also has the ability to have ‘passive lock’ but this was something I never really perfected in the code. It works (selectable) but it was too procedural in that you have to unlock car, start, run, stop, open door, close door and then after 3 seconds it would lock automatically.  I tried it for a while but while somewhat cool, it had some annoyances so i disabled it again.

The project is based on a PIC16f681 and coded in PicBasic pro and uses the ID-12 chip from Innovations.  The setup cost for this is probably in the mark of $100+.  The code works fine as-is.  In fact this is the exact setup that is in my car now but if i had to do it again, I’d probably start with an Arduino Nano and work from there.  Things are just much easier in Arduino land than Microchip Pic.

Provided as is – I will not change this code but hey,  feel free to do it yourself. I might be able to offer some info but this was written in 2010 so it might as well be someone else’s code to me by now. There is a couple of  missing links in the PCB as seen by the link wires in the photo.

If you don’t have a Pic programmer, I recommend the RCD Programmer and PicProg4U

Downloads:  PicBasic Source, compiled HEX, Eagle PCB, Eagle Schematic

Arduino Wiegand door access module

Tuesday, September 25th, 2012

A few years ago now I was implanted with an EM4102 compatible RFID tag in my left hand and since then I have created quite a few projects based on reading the tag for various tasks – Mostly access control.  One of my more recent projects was to create a ‘Door access module’ but this one would be different.  In the past I have interfaced with an ID-12 chip from innovations which has a generic serial output. While this is easy to interface with, the readers are expensive and somewhat awkward to use as far as mounting, waterproofing and tamper proofing.

This inspired me to come up with a way of interfacing to industry standard readers.  These readers use the Wiegand data format which comes from the days of mag/swipe cards but it also means this project can be used with almost any Wiegand reader.

This means I can use generic, cheap readers from ebay that generally cost less than $10 coupled with a $20 arduino and a homebrew shield for about $40 total cost. This is about the cost of the ID-12 chip alone.

Initially this project was a very simple reader with grant/deny access and nothing more but I reworked it a bit later on to be a complete online version as well (with Arduino ethernet module and POE).  For now lets look at the basic version.

This simply works by programming in a set of tags to EEPROM and when a card is read it is compared to those in EEPROM and if one matches, access is granted, if not, access denied.  No advanced control is used.  This is handy in scenarios where all users are trusted and you have no care for the time that they get ‘access’.

I made a simple shield that interfaces to the reader via a pin header, a couple of buttons, an output for the strike and a BD681 darlington transistor to handle activating an electronic strike or whatever other high current device you desire.

Downloads: Sketch and Shield in Sprint Layout format

LFS Gear indicator and shift light

Sunday, September 23rd, 2012

I always wanted to do some sort of Outguage project but never really got around to it and I guess it was more of a luxury than a requirement.  With recently getting back into the racing and now with a sequential shifter, I wanted a big gear indicator that could be glanced at and see the gear.  Sure, the built in LFS one works but bigger is better right? I also wanted a shift light so i can concentrate on driving line rather than shift points.

I looked at some ways of achieving this goal and ended up mashing some projects from some other people together and came up with my version.

The display is based on an ethernet enabled arduino – In my case the Freetronics Etherten.  You could just as easily use a Uno with ethernet shield however. This means there is no serial connection to the arduino and there is no noticeable delay in the display compared to LFS.

The code is based on the Outguage library from https://github.com/jlinnosa/arduino-lfs-outgauge-monitor by Jaakko Linnosaari and another individual by the name of Pete Willard with my own customization.

The gear indicator code is fairly simple as such, the harder part of it was for the shift light.  Since only a handful of cars in LFS actually have a shift light, we have to look at the theoretical shift point for each car and set the light to come on at that RPM.  The light is currently set to come on at the ‘Max power RPM’ as stated in LFS which is generally a few hundred to a thousand RPM before it hits the limiter.  Once it hits the limiter, the shift light will flicker.  This is achieved by using a ‘tone’ output from the Arduino instead of just turning it on. The shift light/LEDs are powered via a BD681 darlington transistor so you can use almost any light you want.  I just chose leds.

**The tone library used needs to be modified to compile under Arduino 1.0.1, see the comments in the code.

The common annode display is driven via a ULN2003 darlington transistor array.  All 7 pins from the arduino go straight to the input pins of the ULN2003 and the segments of the display are grounded via a 500 ohm resistor for current limiting.  It’s a bit of a hack job – Not normally how i like to have my projects but this one was so quick and easy to implement, there was not really much need for a shield to run it.

Arduino sketch: http://www.hux.net.au/wp-content/uploads/2012/09/outguage_udp_7seg.ino

Racing sim update

Sunday, September 23rd, 2012
Some time ago I somewhat shelved the sim, mostly because I didn’t really have the room to keep it set up but also because I decided to re-work the wheel setup but it never really took off.  The idea was to make my own electric feeback wheel with an optical encoder, arduino and a big DC motor but I could not get it right.  The movement side of it was fine – I had the arduino reading the pulses and converting this into a joystick axis but it was the electric force where I could not get it right. Big DC motor, H-Bridge and PWM but I could not get enough force out if it that I was happy with.  I decided the best option was to buy a commercial wheel and use my pedals/shifter.
I ended up buying a Logitech G27.  I am very happy with the mechanics of the wheel and it’s force abilities but the pedals and shifter really let it down. I tried them but going back to a position type brake (over force like my pedals) just felt all wrong and while the shifter is ok, it just did not have that realism of my DIY aluminium H shifter.
I also removed the stock wheel from the G27 and replaced it with the one from my other setup and placed some button switches on the wheel to hook up in place of the stock ones.  This is a much better size and feel.  The only downside is the flappy paddles are now too short but I hardly ever use them. Maybe one day i will make up some longer ones.
I have re-worked my H shifter now too.  As well as replacing the H plate with a friendlier soft plastic (cutting board) instead of the aluminium I had before I have modded it to be able to swap to sequencial mode. This is great for RBR and other rally games but I also prefer it to paddles where it is harder to change gear while turning.
There is now an extra 2 switches mounted to the bottom of the H plate and a removable washer is screwed to the bottom of the shifter shaft.  This gives a little extra throw on the shaft to push the switches.  I also too advantage of the holes in the upper part of the shifter to insert some tube to restrict the movement forwards and backwards.  This restriction allows the shifter to return to center.  Another screw in one of the brackets supporting the shifter prevents sideways movement too.
Swapping from H to sequencial takes about 30 seconds and is very easy.