This is simple – just some wheels geared down 1:3 to move the card in and out over the color sensor. The touch sensor senses whether the card is being pushed in. and I also had a touch sensor and motor for the door but that was only to prove that the card reader worked.
I programmed using ROBOTC. I wanted to re-teach myself ROBOTC and I really like it. I’m never back to NXT-G. ROBOTC is just easier once you learn it. I was having trouble having it read the card (and tell me the code) because it was too inaccurate – it would give me the wrong colors a lot so instead it only figures out if it is the correct card.
You can download the code here.