Archives for category: Components

In order to use an ATtiny85 as an AVRFID, it is necessary to know the exact inner workings of these microcontrollers.

attiny85_pins

For I/O-operations the pins (2=PB3, 3=PB4, 5=PB0, 6=PB1, 7=PB2) can be used. The configuration of the ports is affected by the three 8-bit registers PORTB (data register), DDRB (data direction register) and PINB (port input pins):

Read the rest of this entry »

Advertisements

First of all I emphasize that unfortunately none the following attempts of reprogramming fused AVRs was successful in my case. Therefore this is more a personal documentation of what did not work, rather than a tutorial on how to get AVRs reprogrammed.

The general problem is, that once the fuse bits of an AVR are set to except an external clock source, the AVRs can in theory only be reprogrammed when they have that external clock source during the reprogramming process as well. In practice it is much more complicated.

Read the rest of this entry »

Two more online shops with useful RFID sketching materials:

Right now I have build four 125 kHz RFID reader antennas, so it was time to make a little first comparison, on how they perform. With each antenna I read two RFID tags and measured the read distance of each one of them. The first one is a RFID Card by Sparkfun (8,5 x 5,5 cm) and the second is a smaller RFID tag sticker ( 2,3 cm).

Image

Read the rest of this entry »

First I had to get some S-code programm and flash the ATtiny85 AVR microcontroller chip. Luckily my supervisor had some first assembler source code for a RFID tag on his github. For the sake of completeness I have left all the comments in the following code, because they give detailed specific informations on this topic. File ‘avrfid.S‘:

/*
 * Software-only implementation of a passive low-frequency RFID tag,
 * using an AVR microcontroller.
 *
 * Version 1.1, 2010-06-15
 *

Read the rest of this entry »

Using AVRs as RFID chips makes it necessary for me to build a new RFID reader, because this system only operates in the 125kHz frequency (I think this comes from the internal clock of the ATtiny85 microcontroller, but I still have to confirm that). Therefore I have two new RFID modules. The first and older one is the RDM 630 also sometimes refered to its Model Nr. RFR101A1M by SeeedStudio. The second one is a relative new RFID module, the SM125 by SonMicro, with which only little experiments are found in the web. But there is some exsample code and schemes on their support page and a Arduino Library for it in a Github repository.

For the RDM630 exist some example tutorials (1, 2), which help wiring up this RFID module. With the help of the datasheet I transfered this wiring onto the SM125 RFID module. In order to test both RFID modules, I took a big breadboard and integrated both on it:

Image

Here are the pinouts for the RDM630:

Image

And here the pinouts for the SM125 like its in the datasheet:

Image

Here is the Arduino code I used to test the 125kHz RFID modules so far:
#include <SoftwareSerial.h>
#define rxPin 6
#define txPin 7

unsigned char card[12];
unsigned char p;
int printed = 0;
int val = 0;
int bytesread = 0;

//------------------------------------
//create a Serial object RFID
SoftwareSerial RFID= SoftwareSerial(rxPin, txPin);

void setup()
{
Serial.begin(9600);
Serial.println("Serial Ready");
RFID.begin(9600);
Serial.println("RFID Ready");
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
Serial.println("P ="+p);
}

void loop()
{
if (RFID.available()>0)
{
//    Serial.println("RFID is available");
p = RFID.read();

if (p == 2)
{
//      Serial.println("There is a 2 discovered in the data");
while (p != 3)
{
//        Serial.println("Reading data");
delay(5);
p = RFID.read();
Serial.println(p);
Serial.println(", ");
}
printed = 1;
}
//    Serial.println("Read completed! ID is: "+p);
}

if (printed)
{

//    Serial.println("\n——————");
printed = 0;
}
}

Until now both modules are working in that way, that any time a RFID tag comes near, informations can be read. Unfortuntely the data has a wild format and makes no sense yet. I still have to check the wiring one more time, but it also can be a matter of the two formats: TTL and Wiegand. General informations on the Wiegand interface. Further I found some Wiegand specific code, which will maybe help me and a YT-Video explaining the Wiegand format:

I have to dive deep into that probably! I will post some more updates on how I hopefully solved this problem.

The paper RFID tags, were the first tests with the 13,56MHz preprogrammed RFID chips. During the next step I will experiment with the Amtel AVR microcontroller chip ATtiny85. First of all I will have to install different things and get the Eclipse IDE updated for programming AVRs. Then I will wire up a small docking station to programm the ATtiny85s with the Pocket AVR Programmer by Sparkfun. Good overview about AVR programmers can be found here.

Image

Similar to the tilt RFID tag by N. Marquardt I built a tilt RFID tag version, which switches between three different IDs depending on the way the RFID tag is aligned in space.

Image

The picture above shows the two tilt sensors on the back side of the RFID tag. It was hard to find three distinct postions, in which only one tilt sensor gets active. In the future one should limit it on only using two tilt sensors. The antenna of this RFID tag has four windings.

Image

Image

Surprisingly it was not that easy to find a suitable switch, which switches between several states. After little research I thought I have found the right one with the ArcolectricSlide by Conrad Electronics. But it turned out that this slider switch is not connecting two opposite pins, but is respectively connecting each adjoined pins.

Image

Out of this, I came up with following scheme, to be able to switch between atleast three antenna lengths instead of five which the slider switch originally had. BTW three antenna lengths turned out to be perfectly fitting for a reasonable read distance calibration. As a side effect, one complete line of pins were not used, and therefore could be bend over for fixation.

Image

In order to achieve a bigger effect of switching between the three different antenna lengths, the antenna of this RFID tag has got six windings. As you can get out of the scheme, there are two middle postions of the switch, connecting the same antenna winding. But overall it works surprisingly well and has a noticable effect on the read distance.

Image

This is my first 13,56MHz RFID Reader Setup: Arduino, SM130 with PCB Antenna. Parts of the Wiring are covered by the RFID module, but they get understood when you have a look on the according scheme.

Image

Like the scheme, also the code by A. van der Meer worked well for me:
//Simple communication sketch for the SM130 RFID-reader.
//The sketch reads a tag end sends it over the Serial port.
//Made by A. van der Meer (AvdM.nl)
// http://www.avdm.nl/?p=164

//#include <NewSoftSerial.h>
//NewSoftSerial mySerial(6, 7);

#include <SoftwareSerial.h>

SoftwareSerial mySerial(6, 7);

String temp;
String reader;
String tag;

void setup()  {
Serial.begin(57600);
mySerial.begin(19200);//begin mySerial at 19200(standard baudrate for the SM130
}

void loop() {

mySerial.print((char)0xFF); //first byte for indicating a new frame
mySerial.print((char)0x00); //a reserved byte for future use; it always has to be 0x00
mySerial.print((char)0x01); //the length of the frame
mySerial.print((char)0x82); //the real command: seek for tag
mySerial.print((char)0x83); //CSUM byte

delay(500); //a small delay is needed for giving the rfidreader time

while (mySerial.available() > 0) {
temp=String(mySerial.read(), HEX);
reader=reader+temp; //compile the answer of the rfidreader
}

if(reader!=”ff02824cd0″){//ff02824cd0 is the answer if no tag is found
tag=reader.substring(17,25); //distract the tagid from the answer
Serial.println(tag); //print the found tag over the Serial port (usb)

}
reader=””;

}

The code by Ben Lamb could be compiled, but I could not get any RFID tag ID be printed in the arduino serial monitor. Haven’t spend more time, to get that version running. I found some more example code by Marc Boon, which I have not tested yet. Always be patient with the example code. Once in a while there some issues on the Arduino library SoftwareSerial, which changed to the NewSoftSerial.