How to make a time marking machine with Raspeberry and Nios4 (first part)


Let’s make the circuit of an attendance marking machine with Raspberry


In this article, you will learn how to make a time marking machine by using Raspberry Zero as a hardware base and Nios4 as a system for data collection.

You can also realize an outdoor attendance marking machine by using a waterproof box and including a battery. This way, it will be either independent and placeable anywhere.

However, this article will explain how to make the without-battery version by powering the Raspberry using its Micro-USB port to make it easier.

In the cover photo, you can see the one that we realized for the office: the device is fixed to the wall and powered directly.


Components


Assembling

Connect the RFID reader and the LCD headset to the Raspberry, as you can see in the diagram below.

In the example with the battery, I used a TP4056 to charge the battery and leave the Raspberry Micro-USB ports free.




The box


Download the project for the time marking machine from GitHub at the following link:

Inside the Models folder, you will find the 3D printing projects for the structure that you will put inside a Gewis GW44426 watertight box. This structure has a bracket for the Raspberry Pi 3 and one for the Raspberry Pi Zero.


 



There is also another project to create a complete case for the Raspberry Pi Zero.





Of course, the possible box and the arrangement of the various elements are completely at your discretion.



Installation of the basic software


To use your Raspberry Pi, you need a Micro-SD card.


Follow these steps to install the operating system:


https://www.raspberrypi.org/documentation/installation/installing-images/README.md


Install the full version of Raspbian. Then, insert the SD card in the Raspberry Pi.


To connect the Raspberry, you need:

  • Monitor connected with an HDMI cable

  • Mouse and keyboard

  • Power cord


After restarting the device, select MenuPreferencesRaspberry Pi Configuration, then select the Interfaces tab and enable: SSH, SPI, and I2C.


You can also install VNC or use SSH directly to connect remotely.



Verify that the hardware works


First, check if the RFID reader is read correctly.

Then, write the following command on the console:

    lsmod | grep spi



If the spi_bcm2835 line is displayed, the device is properly connected and ready to be used.
Now it is the turn of the LCD monitor: work on the I2C communication protocol by giving this command:
    sudo i2cdetect -y 1



The address grid is displayed. If there is a number inside the cell, it means that the LCD viewscreen is properly connected.



Install the SQLite libraries


Normally, the libraries should be already installed on Raspberry, except for those related to database management.

In this example, I use the SQLite database. If you prefer another data source, you need to change the sources.

As a good practice, update the Raspberry by giving the following commands:

    sudo apt-get update
    sudo apt-get upgrade

After the update, it is time to install the SQLite libraries:

    sudo apt-get install sqlite3

After doing it, you are ready for the next article in which you will upload programs in Python to read data from the RFID and send it to a Nios4 cloud database.

Comments