Posts

Showing posts with the label Jukebox

Jukebox. Reading NFC cards. Connecting all together

Image
 Today We are connecting the RC522 NFC-card reader. NFC reader RC-522 we are using needs to be connected to the SPI bus on the Raspberry Pi. RC522 pin Raspberry Pi pin SDA 24 (SPI0 CE0, GPIO 8) SCK 23 (SPI0 SCLK, GPIO 11) MOSI 19 (SPI0 MOSI, GPIO 10) MISO 21 (SPI0 MISO, GPIO 9) IRQ Not connected GND 20 (GND) RST Not Connected 3.3V 17 (3v3 Power)     Software Make sure, the SPI interface is enabled on the Raspberry Pi. Start the "raspi-config" tool sudo raspi-config and there navigate to "Interface Options"->"SPI" and enable it. We will  use MFRC522 library to communicate with the RF522 reader, it can be easily installed:     pi@raspberrypi:~/rfid $ python3 -m pip install MFRC522    And write a simple script: 1 2 3 4 5 6 7 from mfrc522 import SimpleMFRC522 reader = SimpleMFRC522() while T...

Jukebox. Solving sound quality problem

Image
 Last time I've finished connecting amplifier to the Raspberry Pi and playing music. But we heard not only music but the relatively high level noise as well. Now we I'm trying to figure out where the noise is coming from and how to get rid of it. What do we know? The noise sounds like digital data line connected to the output. No surprise: the raspberry pi is a computer and the "sound card" there has interesting approach: the jack output is connected to the GPIO pins with a couple of resistors and capacitors. And PWM signal produced by the CPU is averaged over small time and looks like sound wave afterwards. There are blog posts about how does it work or how to do the "sound card" for smaller raspberry pi . But we tested the sound with headphones already and haven't heard this noise. The noise apparently appears only when the amplifier is connected. Maybe amplifier is noisy? Let's connect it to the laptop output.  No noise. So it is not amplifier M...

Jukebox. Playing music for the first time

Image
Last time I unveiled the jukebox project , I'm working on. I've described parts I building it from. Let's continue and connect them together. Setting up Headless Raspberry Pi For initial configuration, and ease of debugging it will be easier to connect HDMI monitor and keyboard. But many do not have them in the lap-top era, so let's set up Headless Rapberry Pi Components we need are: desktop/laptop PC (I use mac, some steps can be different for Windows, Linux should be mostly the same) micro-SD card SD card reader Raspberry Pi  USB power supply WiFi access point Software Configuration Let's use Raspberry Pi OS for this project. Other Linux-Based distributions can work as well, but Raspberry Pi has libraries and tools preinstalled, which you may need for configuration and debug. Let's download official tool for flashing images on SD card . And write Raspberry Pi OS on our SD card Next follow the headless setup instruction , and a headless part from the SSH con...