Archives for category: Own Hardware

This is the final prototype of the Tesla User Interface. It was developed during the time of my diploma thesis in media computer science at the Ludwig-Maximilian University of Munich. Thanks go out to my supervisor Aurélien Tabard for a helping with this setup.

The wireless and batteryless control widgets are regular Mifare Classic 1k protocol RFID ICs by NXP Semiconductors, that have been enhanced with mechanical control element functionalities, like button, slider or rotary switch.

Few Words about the Reader Setup:

TUI-ReaderScheme

Under the white plate an Arduino is connected to two SM130 reader modules. Via two dual 4-channel analogue multiplexer/demultiplexer each of the modules itself is connected to two antennas like it can be seen in the figure above. The communication naturally proceeds through the modules. The Arduino directly controls the multiplexer, by applying a current to the multplexer’s address pins in the right way. Furthermore each module has a status LED that tells if it is ready and one LED indicating when an ID read event occurred. The detected ID information is delegated over the serial connection to the Arduino and from there further to the PC and the Processing software. This means that three serial communication connections have to be handled by the Arduino, what demands an equal baud rate. Therefore the maximum baud rate is determined by the maximum baud rate of the slowest component in the setup. And finally a picture of the wiring:

100_0391

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 »

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 »

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.

Here some images and schemes for the correct wiring to programm an ATtiny85 microcontroller:

Image

Here one can see the pin description of the ATtiny85:

Image

And here a wiring scheme. The pin allocation of the 6-pin plug is seen from above the plug, which gets really confusing when you have to put the wires right.Furthermore its quite hard to get it clearly laid out:

Image

Here the pin allocation of the 6-pin plug, when you look into the holes of the plug:

The communication works on the ‘Serial Peripheral Interface Bus‘. In the next picture you can see the pin allocation a little better (top > down like in the picture):

  • ground (GND)
  • master output, slave input (MOSI)
  • power supply (VCC)
  • master input, slave output (MISO)
  • source clock (SCK)
  • reset (RST)

Image

In order to get a fast feedback, if the programming really worked, I took a little LED blink sample code:

/*
* blink.c
*
* Created on: 22.09.2012
* Author: Dario
*/
/*Filename: blink.c */
#define F_CPU 8000000UL
#include <avr/io.h>
#include <util/delay.h>
int main (void)
{
  //Set PORTB.3 to be output (physical pin #3 on the ATTINY85)
  DDRB = 0b00001000;
  while (1) {
// //Set PORTB.3 high
    PORTB = 0b00001000;
    _delay_ms(1000);
// //Set PORTB.3 low again
    PORTB = 0b00000000;
    _delay_ms(1000);
  }
  return 1;
}

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

Image

As my second paper RFID tag, I used a standard potentiometer for being able to adjust read distance of the RFID tag. In order to get a comparable result, this RFID tag has got six windings like the RFID tag with the slider switch.

Image

Unfortunately already a tiny change of the resitance by the potentiometer made the RFID tag inoperable. In order to choose read distance by adjusting the resistance of the circiut, one could try it with a really precise potentiometer in the future.