navigationGo.pngQuick Navigation
allprojects32.pngAll projects
hardware32.pngHardware
links32.pngLinks

favoriteStar32.pngTop projects
Alan numitron clock
Clapclap 2313/1386
SNES Pi Webserver
USB Volume/USB toys
Smokey amp
Laser cutter
WordClock
ardReveil v3
SNES Arcade cabinet
Game boy projects
cameleon
Home Presence Detector

github32.pngGitHub
AlanFromJapan

navigationMail.pngContact me

alanfjmail.png
3flags.pngWho's Alan?


Akizukidenshi
Elec-lab
Rand Nerd Tut
EEVblog
SpritesMods
Switch-science
Sparkfun
Suzusho
Datasheet Lib
Reddit Elec
Ermicro
Carnet du maker (fr)
Marutsu
ATmel blog (defunct)

Arduino and RFID

kalshagar - Arduino and RFID

Hardware

From SeeedStudio (HK based company).
Plug like this:
  • Antena (use the JST connector)
  • on the long (5 pins) connector (pin 1 = square)
    • Pin 1 (square) = connector to the RX pin of the arduino (it is the TX of the RFID reader)
    • Pin 4 GND
    • Pin 5 : Vcc 5v

Only deception is the read distance that reaches painfully 5cm ... little disappointed but for 12 $ reader, let's be realistic. Except that, it works perfectly and it is debounced ! (leave the card and it wont read it continuously, just the first time).
A nice tool to have definately.

Shopping


Sample code

Echoes the code read to the terminal.
// include the SoftwareSerial library so you can use its functions:
#include <SoftwareSerial.h>
 
#define rxPin 2
#define txPin 3
 
// set up a new serial port
SoftwareSerial mySerial =  SoftwareSerial(rxPin, txPin);
 
void setup()  {
  // define pin modes for tx, rx, led pins:
  pinMode(rxPin, INPUT);
  pinMode(txPin, OUTPUT);
  // set the data rate for the SoftwareSerial port
  mySerial.begin(9600);
 
  Serial.begin(9600);
}
 
void loop() {
  //format :
  // 0x02 %20 (card code on 10 byte) %20 checksum 1 byte %20 0x03
  for (int i =0; i < 13; i%20%20){
    char c = mySerial.read();
    Serial.print(c);
  }
 
  Serial.println(" ");
}
 

Roots version

All content on this site is shared under the MIT licence (do what u want, don't sue me, hat tip appreciated)
electrogeek.cc ~ Formerly known as Kalshagar.wikispaces.com (AlanFromJapan [2009 - 2019])