RFID-Kit - Computerzugangsberechtigung (3/3)

Today's blog post is the third part in the three-part series on our topic "Setting up a computer access authorization" RFID kit:

 

At the end of these 3 days you will know:

- What ours RFID kit  can and how you set it up

- Like you with ours RFID kit  can write and read

- Like ours RFID kit  it is possible to install a computer access authorization

 

RFID project: computer on / off switch

In this project we are replacing the on / off switch of a desktop computer with a microcontroller with an RFID reader. To turn on the computer, hold an RFID card against the housing wall after the conversion and the PC will go on if the card has been programmed as authorized.

 

material

  • RFID reader and RFID chip card - both are included in our RFID kit
  • Microcontroller - e.g. ours Nano V3
  • NPN transistor
  • Mainboard manual
  • RGB LEDs (optional)

 

Mainboard connection

To switch the PC on and off, the microcontroller must be connected to the mainboard. A normal PC on / off switch works in such a way that it bridges a connection on the mainboard while being pressed. The illustration illustrates this functionality.

The control of this bridging is to be transferred to a microcontroller here. An NPN transistor, which has the electrical property of the connections, is suitable for this Collector and Emitter to connect if on base-Connecting a voltage. The figure shows how the microcontroller, the mainboard and the transistor are connected. If at the base the transistor has a voltage, so the digital microcontroller output pin is set to high, it is as if the power button was pressed.

To carry out the cabling in your PC, you can either track the cables of the power switch from the front panel to the mainboard or read the mainboard manual to find out where the relevant pins can be found.

 

The mainboard manual contains information on the exact position of the pins.

 

RFID reader

The RFID reader is connected to the microcontroller. You can find details on the cabling in our blog postRFID introduction. In use, the RFID reader reads the Unique identifier  (UID) of the created card and compares it with the UIDs saved in a list. Only UIDs from the cards that have permission to switch on the PC are entered in this list. The UIDs of your RFID card (s) can be connected with the Read UID example sketch (Link https://github.com/Simsso/Arduino-Examples/blob/master/RFID/ReadUID/ReadUID.ino) simply read out via serial monitor. Make a note of the four bytes that look like this: B5 A3 2B 1B. If the microcontroller recognizes that the UID of the RFID card created is present in the list of accepted cards, it switches the transistor for half a second. This process corresponds to pressing the PC switch.


The electronics can be powered via a USB cable, which you route from the outside into the housing. However, the better solution is to use the internal USB ports: You can also find the position of these in the manual for your mainboard. The internal USB connections deliver 5V and can therefore be connected directly to a 5V microcontroller (e.g. Arduino Nano, Uno, ...). To do this, the 5V pins of the USB connector and microcontroller and the ground (GND) pins must be connected.

 

Installation

After wiring the mainboard, RFID reader and microcontroller, the actual installation begins. The RFID reader can recognize cards about 2 to 4 cm away. It can, for example, be attached to the inside of the housing wall or behind a drive bay cover (see pictures).



software

The Arduino sketch used can be viewed on GitHub (Link to this) can be downloaded and will be explained here in part. After importing the required libraries, an array with authorized UIDs is created. All chip cards whose UID occurs in this array can operate the PC switch. Enter your UID (s) here:


const uint8_t PERMITTED_UIDS [UID_COUNT] [UID_LENGTH] = {

 {0xB5, 0xA3, 0x2B, 0x1B},

 {0x3A, 0x06, 0xE8, 0xAB}

};


In this case the chip cards would be with the UIDs B5 A3 2B 1B  and 3A 06 E8 AB  authorized to switch the PC on and off. If the number of UIDs changes, the variable must also UID_COUNT be adjusted to the new number.


The actual code checks whether there is a new card on the reader. If this is the case, your UID will be read out (details can be found in our post RFID reading and writing) and compared with the saved UIDs. This function takes over bool isPermitted (uint8_t * uid). If there is a match, pin 2 (on this pin is the base  of the NPN transistor connected) switched to high for half a second. This bridges the contacts on the mainboard and the PC goes on!


The whole system can be expanded with RGB LEDs. For example, they light up green when a card is recognized and red when a card is rejected. A slightly modified version of the program linked above, which controls a NeoPixel LED ring with 8 RGB LEDs, can be found here (Link https://github.com/Simsso/Arduino-Examples/blob/master/RFID/ComputerSwitchLED/ComputerSwitchLED.ino).


Access granted! This PC was switched on by the RFID chip.


No authorization!

 

We hope you enjoyed our first project - we look forward to your feedback using the comment function!

In our next blog post there is an introduction to how to use our 16x2 LCD display. You can find the tutorial on this from tomorrow on our blog ataz-delivery.de, so it's best to drop by every day to find exciting tutorials and great projects every day!

Your

Team AZ delivery

For arduinoProjekte für fortgeschrittene

Leave a comment

All comments are moderated before being published

Recommended blog posts

  1. Install ESP32 now from the board manager
  2. Lüftersteuerung Raspberry Pi
  3. Arduino IDE - Programmieren für Einsteiger - Teil 1
  4. ESP32 - das Multitalent
  5. OTA - Over the Air - ESP programming via WLAN