RFIDuino Project 1 - Key Tag


Our final Hello World Sketch will differentiate between one special key tag and any other tag. For our 'key' tag, the RFIDuino will activate the green LED and sound 3 different notes to indicate the 'key' tag has been read. For all other tags, the red LED will activate.


  1. Connect your RFIDuino as shown.
  2. Open RFIDuino_project1 in your Arduino IDE. You can find this sketch under
  3. We will need to modify the sketch to include the ID of a tag that we found in Hello World 2. Find line 12 - it looks like this.
    byte key_tag[5] ={0,0,0,0,0};			
    Now insert the ID numbers for your tag. For example, if our tags ID was '70 0 44 22 242 we would modify the code to look like this
    byte key_tag[5] ={77,0,44,22,242};
  4. Load the RFIDuinoProject1 sketch onto your Arduino.
  5. Once loaded, you can leave your board connected to your computer - you will need this connection to power the board.
  6. Swipe the 'key' tag across the Rfiduino antenna. The green light will light up and your buzzer play three different notes.
  7. Swipe any tag that is not the 'key' tag across the Rfiduino antenna. The red light will light up and your buzzer play three monotone notes.

Code Overview

This sketch builds on the code from RFIDuino_helloWorld3. The main difference is that it calls the compareTagData() function a second time. This time, the code uses it to check the most recent tag data against the key tag data we defined. Based on whether or not these tags are the same, we can call different instructions.
In the previous examples we have just activated the buzzer. In this example the code uses the functions successSound() and errorSound() to add tones to our buzzer.

RFIDuino Functions used in this example

Next: Unlocking a Solenoid

Feedback Form