The program creates a new log file every monday, which can be found in the logs
folder.
The format of the log file is csv
, so it can easily be imported to Excel as shown below;
video_2021-07-20_05-13-26.mp4
video_2021-07-20_05-14-49.mp4
- Try to trigger for errors and make the program more stable.
- I coded the entire project in a day, so I haven't had the chance to test for bugs and errors. It works stable so far but I want to make sure.
You can refer to this image.
Name | Pin # | Pin name |
---|---|---|
SDA | 24 | GPIO8 |
SCK | 23 | GPIO11 |
MOSI | 19 | GPIO10 |
MISO | 21 | GPIO9 |
IRQ | None | None |
GND | 39 | Ground |
RST | 22 | GPIO25 |
3.3V | 1 | 3V3 |
Name | Pin # | Pin name |
---|---|---|
DIN | 12 | GPIO18 |
GND | 14 | Ground |
5V | 2 | 5v Power |
- As the first thing, open up a terminal and type
sudo raspi-config
then enable the SPI interface from the Interfacing options. - Let's update the system and make sure the python is properly installed. Run the command below in a terminal.
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install python3-dev python3-pip
- Now let's install the python packages that we are going to use; run the command below in a terminal.
sudo pip3 install spidev mfrc522 rpi_ws281x RPi.GPIO
- First you have to register the cards in the system. Run the command below, hover the card on the scanner, and the program will ask you to enter the name of the owner of that card. Once you enter a name, you will be given two choices. You can either type "yes" to continue registering cards, or you can type "no" to exit the program.
sudo python3 register_cards.py
- If you've done registering the cards, now you can run the main program to start logging with the command below.
sudo python3 read_cards.py