Double-clap light switch
Clap twice and the lights come on. Clap twice again to switch them off.
Shop by category
Shop all componentsThe Pi's own headphone jack is noisy. The Raspberry Pi DAC+ is a HAT with a PCM5122 digital-to-analog converter that takes I2S audio straight from the Pi and gives a clean line output on phono (RCA) sockets. MPD (Music Player Daemon) plays internet radio streams and can be controlled from a phone app or the 'mpc' command.
Keep volume low when first connecting speakers.
Tick anything you already have and the total updates.
Follow the colours: red is power, dark grey is ground, blue is a signal.
Official Pi 4 supply.
stations.sh#!/bin/sh
# Add your favourite stream URLs; many stations list theirs on their website.
mpc clear
mpc add "https://example-station-1/stream.mp3"
mpc add "https://example-station-2/stream.aac"
mpc volume 70
mpc play
Check 'aplay -l' lists the DAC+, and that onboard audio is off so MPD uses the HAT.
Use a different power socket for the speakers or a shorter cable; avoid ground loops.
Some sites change stream URLs; test the URL in a browser first.
Yes, put them in /var/lib/mpd/music and run 'mpc update'.
Yes, with a separate tool such as raspotify using the same DAC+.
The phono outputs are line level; use a headphone amplifier.
4 parts: Raspberry Pi DAC+ HiFi Audio HAT (24-bit 192kHz), Raspberry Pi 4 Model B 2GB RAM Single Board Computer, Official Raspberry Pi 32GB A2 Class Micro SD Card and Official Raspberry Pi 4 USB-C Power Supply – 15.3W. On this page you can tick the parts you already have and add only the rest to your cart.
It is a beginner project and takes about 1 hour. The build on this page has 6 steps.
No. This page has the complete, tested code (stations.sh).
About ₹10,066 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
I2S audio HATs and device tree overlays; Playing streams with MPD; Line level outputs and powered speakers.
Keep volume low when first connecting speakers.
Clap twice and the lights come on. Clap twice again to switch them off.
Plays a friendly ding-dong whenever someone walks into the shop or room.
Beeps and flashes any message in Morse, or key your own by hand.
Turn a membrane keypad into a two-octave piano.
Lessons are free to read. Maker (₹499/month) and Pro add quizzes, worked problems and certificates, paid with your Geekobot account. See plans
Learning project. Check every circuit and the datasheet of each part before you power it up.