r/raspberry_pi

Optical audio out with a 1 cents led on RPI5

Yes, this is audio over light from a Raspberry Pi 5 GPIO.

I wrote an experimental Linux driver for the Pi 5 that generates an optical S/PDIF signal on GPIO12 using RP1 PIO + DMA. For this first test, I used a cheap LED placed close to a TOSLINK receiver.

On a bare-metal microcontroller like an STM32 or ESP32, generating a precise bitstream is fairly straightforward. On a Raspberry Pi running Linux, it is harder because the OS is not real-time enough for accurate GPIO bit-banging.

The Raspberry Pi 5 is interesting because it has the RP1 I/O chip with PIO. I use the PIO like a small hardware bitstream engine:

Linux audio -> ALSA driver -> S/PDIF encoder -> DMA -> RP1 PIO -> GPIO12 -> optical receiver

So this is not just blinking an LED. It is a real S/PDIF audio stream generated from a Raspberry Pi 5 GPIO.

Linux sees it as a normal ALSA sound card, so it can be used with CamillaDSP for routing, filters, crossover experiments, and optical output.

Full technical explanation, install notes, GPIO12 wiring, limits, and validation:

https://github.com/RASPIAUDIO/CamillaDSP/blob/main/prototypes/pi5_spdif_gpio/README.md

My mid-term goal is to build an easy-to-set-up open DSP box where the Raspberry Pi 5 is seen by a PC as an 8-channel USB sound card, using USB gadget mode and a USB-C power/data splitter. The same box can then provide S/PDIF output, demonstrated here, plus 8 analog outputs using the four I2S lanes of the Pi 5 and a DAC board.

The use case is DIY active speakers, digital crossovers, FIR/PEQ/delay, and home cinema experiments.

Ongoing project:

https://github.com/RASPIAUDIO/CamillaDSP

u/No-Consequence7624 — 11 hours ago

Pick-o-Pocket Keychain gaming console

I saw the original retro gaming console by Fanis and to be honest I wanted to make it because it was so cute. I wanted to add sound to his original design and made this Pick-O-Pocket.

It runs on a Raspberry Pi Pico 2W and the main hardware change is that it now has a speaker. It contains all the original games by Fanis but also 5 new ones and a whole operating platform with many extra features such as WiFi connectivity to sync the time, weather updates, temperature/memory/battery checks, a simple music player and quite a few other features.

The full build video with all the features is available here: https://youtu.be/6fomNMBxOH4

The code is freely available here: https://github.com/robroy865/Pick-O-Pocket

The 3D print files are available here: https://makerworld.com/en/models/3007633-pic-o-pocket-keychain-retro-gaming-console

Thanks again to Fanis for providing the original files and allowing me to remix his design. His awesome original is available here: https://makerworld.com/en/models/1528169-orama-pico-handheld-retro-console

u/robroy865 — 10 hours ago

I never thought this could happen.

I've been trying to set up Home Assistant on a Raspberry Pi 3 Model B. It has to be connected to ethernet. I had it all set up but the web interface keep hanging and eventually I couldn't connect at all. I then noticed the ethernet lights weren't on. I tried several different ethernet cables and eventually broke down and bought a new one.

Nothing. I then went through my router configuration. Nothing.

I installed basic Raspbian with WiFi. WiFi worked, but no ethernet detected.

I finally pulled out another Raspberry Pi 3, and suddenly it worked.

Apparently the ethernet port was failing and finally stopped working. I've never had this happen before.

Just something to keep in mind before you pull out all your hair.

reddit.com
u/MentionPleasant2635 — 1 day ago

Rpi5 with ups and old Mac keyboard and trackball

Still a work in progress. A reiteration of one I built last year. A cross between a cyberdeck and a mobile pi. I plan to leave the top open for access.

The keyboard and trackball come from a PowerBook 170 that I was unable to repair.

Future upgrades: maybe some macro buttons to the right (like c64 function buttons). Maybe switch to a Bluetooth keyboard to clean up some of the mess I’ve got going on. Next major revision will hopefully be a rpi6 build!

What I like about this most is the access to the gpio and breadboard to easily prototype small projects.

u/jkeefe56 — 1 day ago

Power delivery concerns for Raspberry Pi in a car

I'm building a custom car head unit based on a raspberry pi 4b. I'm planning to power it from the battery line with a step down converter and controll the power flow via gpio-poweroff device tree overlay. What I'm worried about is rpi freezing, not shutting down and draining the car battery. Is there a real risk of this happening?

reddit.com
u/_-Diesel-_ — 1 day ago

raspberry Pi 5 + 2 Adafruit Feathers + 10m of LEDs = a real-time light map of my country

The Pi 5 is the brain. It runs Python, holds all the modes (ambient, data-driven, event-reactive, and the touch mode you're seeing in the video), and talks to 2 Adafruit Feather RP2040 Scorpio boards over USB serial with a custom binary protocol. The Scorpios are dumb pixel pushers, they just take the frames the Pi sends and drive ~800 RGBW LEDs across 16 parallel channels using NeoPXL8 (PIO + DMA). Those were too many channels to drive from just the pi even though, in retrospect, I could have just put the LEDs in series.

Originally, I thought that I could do it without a pi. But having a central brain that can calculate the position needed and push it to the right microcontroller, interact with APIs and on which you can host a LAN control panel is just such a life savior. Main problem I ran into is heat. In a closed box with that many LEDs, the Pi was heating up really fast. So I made a passive heat sink with a few aluminium corner brackets and installed 2 fans to pull air from the bottom and push it out from the top!

Other point, originally, I wanted to use a switch with ethernet connection but I found out that USB can be more than quick enough for that type of application!

Each of the 179 acrylic cuboids maps 1:1 to a real 100m x 100m cell of Monaco. Elevation data pulled from Copernicus, building heights from OpenStreetMap, gridded in QGIS.

In the clip I'm using the touch mode via a Flask panel on my phone, tap anywhere on the map, ripple spawns at that lat/lng :)

I have the full build video were more code and details are shared : https://youtu.be/-wLMfcOFt5M

u/-2811 — 1 day ago

Best Mariokart on Raspberry pi 5?

I've got N64 mariokart running, but haven't managed to get Wii or GameCube running without unacceptable graphical glitches. Is there a mariokart that people got to run well that's newer than the N64 version?

reddit.com
u/Killermelon1458 — 1 day ago
▲ 144 r/raspberry_pi+2 crossposts

I Taught a Raspberry Pi to Read My Gas Meter (With Machine Learning)

Hi Folks!

I've been working on this project for the past few months - Building a machine learning model to read my gas meter under my stairs and sending the reading to homeassistant. Might be of interest to some of you.

All the code is available here: https://github.com/Cian911/smart-gas-meter

Hope you enjoy!

youtube.com
u/Zy0n — 2 days ago
▲ 109 r/raspberry_pi+5 crossposts

Made an open source Alexa like assistant using Pi 5

I have had an Alexa from way back when they launched and were all the hype. However, they always fell short of my expectations when it came to answering simple questions that I would normally ask ChatGpt. All I use them for is to play music from spotify and check weather 😅

Moreover, I wanted one that can be customized to my exact needs (like giving me a dump of the latest hackernews updates every morning). 

So I built OpenLily: An open source voice assistant that is powered by LLMs. The core agent harness is easily customizable so can use any LLM (gpt-5.5, opus 4.8, etc) with any tools (like checking emails, slack, etc). 

Running it on a raspberry pi attached to a speaker phone is trivial. Here’s a video of me chatting with one in my bedroom :) 

Here’s the repo if anyone wants to try it: https://github.com/getlark/openlily 

Happy to answer any questions.

u/Mysterious-Rock7154 — 2 days ago
▲ 129 r/raspberry_pi+5 crossposts

I built a severe weather station that uses an SDR to pull data from cheap sensors, and runs a machine learning ensemble every 15 minutes on that data to forecast imminent severe weather.

(Pi 3b+)The thesis for this project is both simple, and a fun challenge: Design a model that only relies on locally gathered data, to predict severe weather events with minimal false negatives and an acceptable level of false positives, then put it all into a box that 'just works' when plugged in, unlike many 'smart' devices sold today.

I once bought a meat thermometer. I opened it to use on the Christmas roast, and the app greeted me with "we are happy to have been a part of your cooking experience. Unfortunately, as of <date 4 months prior>, our servers are shutting down."

Panicking about the tight timing of christmas dinner and cursing the God who made me, I ran out to get an emergency thermometer because <local big box store> sold me a brick! 

I got my money back eventually, but it's given me a vendetta against any machines or services that require offsite hardware, or require some company to pay their bills to work.

On June 10th, a major wind storm came to my city. That storm was powerful enough that it knocked all the NWS ASOS stations near me offline for a few days. Remembering my vendetta, and eyeballing the cheap Amazon-special weather station i recently acquired,  the seeds of an idea formed.

The result of that idea is Weather Station Alpha: A self-contained forecasting box that predicts seven distinct severe weather hazards across 1-hour and 24-hour horizons, using local sensor data only.

 The hardware sits inside a metal project box running neural net inference on a schedule, with an SDR, LEDs, a barometer, and its own cooling fans, so it runs at the absolute limit of what the Pi's power supply can handle. Any more overhead and this little guy undervolts. Ask me how I know.

I wrote five services to orchestrate the ui and api, sensor data pipeline, machine learning pipeline, active cooling, and physical LED status animations.

The prediction engine runs an LSTM neural net with attention, trained on 30 years of official NWS data. To resolve prediction confidence, the system blends a 500-pass Dropout Monte Carlo simulation 50/50 with a distance-weighted K-Nearest Neighbors algorithm. The Monte Carlo engine generates randomized path variants to simulate realistic transitions, while the KNN uses the network's N-1 layer as a vector embedding space. 

This acts as a real-time learner, and is the real strength of the system: when local anomalies or sensor quirks arise, you can flag the timestamps in the admin to inject new example vectors, teaching the box about local climatology and sensor quirks instantly without retraining the underlying neural network.

The data collection relies on an RTL-SDR USB dongle pulling radio transmissions from local wireless sensors, combined with an on-board USB barometer. 

After I got all the bits in the box, i drilled 1/2" holes. 2 in the lid for the antenna and LED, and one in the back for power. I put rubber grommets on those holes. I also added some o-rings to the silicone diffuser, and cut a nice decal and lettering for it with my circut machine. I think it came out pretty sharp :)

After initial setup, I spent a week calibrating it against the real local data..adding and removing samples and tweaking thresholds. It was a particularly stormy week so I had good data to test against. After that week, I was satisfied with its sensitivity and dataset...or so I thought.

About a week after this calibration a funny thing happened with the real time learning...The box was giving me a "wind" warning one afternoon. I looked outside at the nice calm day...and decided this was another false positive to be corrected and tamped down. I raised the thresholds and added a none point for that time.

Whelp, 15 minutes later, a gust front came thru that was strong enough to knock some tree branches off.

I sheepishly deleted that none point and put the thresholds right back where I had them. It was then I vowed to wait a week before questioning the black magic of the box and applying corrective inputs.

Now, if society collapses tomorrow, the National Weather Service disbands, and all the doppler radars are shut down...I'll still have a decent little severe weather warning system so long as I keep that computer powered, adjust it for events it misclassifies, and change the AAs in the sensors every 9 or so months. 

No one using this box will ever get a message saying "we are happy to have been a part of your weather experience, but our servers dont exist anymore, sorryyyyy".

The entire parts list, a more in-depth explanation, and the code are open-source and ready to build, available on my github.

Project repo: https://github.com/Dominic-Muscatella/weather-station-alpha

OR, skip over the setup instructions and go right to the explainer:
https://github.com/Dominic-Muscatella/weather-station-alpha/tree/master#how-it-all-works

u/MakerOfGreatThings — 2 days ago

I built a robotic body controlled by Claude Fable 5.

The main brain is a Raspberry Pi 5 with 8GB of RAM. It handles the core logic and communicates with the model over the API. A second brain, an Nvidia Jetson Nano with 8GB, takes care of the heavier processing like vision tasks. Two cameras mounted up front act as the eyes, giving it stereo vision of whatever is in front of it.

All the hardware and control systems run locally on the robot itself, while Claude Fable 5 acts as the controlling intelligence through the API. It makes decisions based on what the cameras see and sends commands back to the body.

u/wonderingada — 3 days ago

52Pi N07 case + Adafruit RGB Matrix Bonnet — anyone confirm GPIO splitter works alongside an existing OLED ribbon cable?

Hey all, I’m running a Pi 5 8GB in a 52Pi N07 Minitower case at home (it handles Pi-hole, Home Assistant, some web crawling, Tailscale, etc.). I’m now adding an Adafruit RGB Matrix Bonnet (PID 3211) with a 64×32 P3 panel. I checked the Adafruit forums and the 52Pi product page first, but couldn’t find anyone mentioning this specific combo, so I’m asking here.

Right now the case’s GPIO pass-through already has a ribbon cable running to a small I2C OLED display (using GPIO 2/SDA and GPIO 3/SCL). I want to add the Bonnet on top of that same GPIO header using Edge GPIO expansion board splitter, so both the OLED and the Bonnet are connected at once.

Has anyone actually tried this combo? Specifically:

Any electrical/signal issues running I2C (OLED) and the Bonnet’s GPIO lines through the same splitter simultaneously?

Photos of your setup would help a ton. Thanks!

u/Prestigious_Heat_198 — 2 days ago

Pi-Frame and GIBSON - IBM Mainframe simulator on Raspberry Pi.

Mainframe on a Rasp Pi 4 or 5? I've released the latest version of GIBSON, my mainframe simulator and education environment that is now 70,000 lines of python code built from the ground up - running on a Raspberry Pi 4 or 5. I'm currently writing a book for No Starch Press on 'Hacking Mainframes' and out of necessity, due to the fact most folks who will be reading it would not have the chance to to touch a mainframe, I decided to build it. It has most of the features of the modern mainframe, is open source and can be downloaded from Github https://github.com/kmilne40/GIBSON - why not have a look and provide some feedback. I'm generally never on here - didn't know the group existed as usually on LinkedIn. Glad I found this spot. Some screen shots below! I've even added an email system, ISPF web browser and ISPF RSS feed (just for nostalgia). Of course it runs over EBCDIC. I've also created a Pi Frame project for anyone wanting to put all the bells and whistles together which is on kmilne40/PiFrame

https://reddit.com/link/1uma1y5/video/vkb89s1t31bh1/player

https://preview.redd.it/z2h8hscx31bh1.png?width=455&format=png&auto=webp&s=845a93df42c220c99bf8f11183aa8d734116794f

reddit.com
u/Professional_Virus72 — 3 days ago
▲ 919 r/raspberry_pi+1 crossposts

Converted my grandma's vintage chandelier into a proximity sensing light and sound experience

Built this using 8 VL53L1X ToF sensors and an ESP32 handling the sensor reads and LED control via DotStar strip. Raspberry Pi manages the audio. The sensor data comes in from the ESP32 and the Pi triggers and crossfades samples based on proximity zone.

The closer you get the brighter the LEDs and the louder the music.

u/Back-to-a-planet — 4 days ago

How to Automatically Update Pi-hole &amp; Raspberry Pi

Can I configure my Raspberry Pi, which I use only for Pi-hole, to automatically run sudo apt update -y && sudo apt upgrade -y and sudo pihole -up for updates without me having to do anything manually?

reddit.com
u/IvoryVervain — 3 days ago
▲ 19 r/raspberry_pi+1 crossposts

My Raspberry Pi 4B lost remote connection and I don't know how to recover without turning off

My issue is memory corruption.

I have a Raspberry Pi 4B connected with a UPS HAT (with no USB ports left) and a 2 TB HDD, my initial purpose was to make a server with Immich in Docker (installed in the external HDD), which worked and started to upload my photos and videos.

Since I don't have much money nor space, I don't use a monitor, rather I use VNC Viewer to access my Raspberry Pi, which worked perfectly fine.

Now I tried to install more apps to Dock, specifically Bookstack, but I made the terrible mistake of rebooting, this is the moment I lost connection, I could move the Raspberry Pi to my TV and use it as a monitor and make the connection again, but I'm afraid I would corrupt the memory server I made and got tons of work to make :(

Can I just turn off the computer without corrupting and losing the external files? What can I do to preserve the files?

reddit.com
u/MinrkChil-Alwaff5 — 3 days ago

An update broke my Pi

I just fully reinstalled RPi OS from version bullseye to version trixie, and all of a sudden, no matter if using the 32-bit or 64-bit version of RPi OS, my taskbar does not show up. No settings changed yet, just a fresh install. Can anyone solve this problem?

-I attempted to use several commands I found on the internet to reset, no dice.

-Raspberry Pi 3B+

-No errors on startup.

reddit.com
u/Vijfsnippervijf — 3 days ago

Problem with Rasp Pi 5 using SATA SSD and Desk Pi 5 Lite

Hello! I just bought a Rasp Pi 5 4GB RAM on an online shop.

When it arrived, I immediately tested it to see if it works WITHOUT the case and cooler fan

I used:

HDMI

27W USB-C Power Supply for Raspberry Pi 5

SATA SSD inside a SATA enclosure + SATA to USB

The Pi turned on. I did the setup and it worked. I could see the Raspberry Pi Desktop and edit files on it (that was WITHOUT the case and cooler fan)

Then, the Desk Pi 5 Lite arrived the next day (It includes a case for Raspberry Pi, a cooler fan, and a Desk Pi V1 for RPI 5 board). We placed the Rasp Pi 5 inside the case.

Now, Raspberry Pi Connect doesn't detect the Pi 5 with and without the HDMI (Photos 1 through 3)

I tried removing the case but kept the Desk Pi V1 for RPI 5 board and checked if it detects (Photo 4). It doesn't detect on Rasp Pi Connect

I tried removing the Desk Pi V1 for RPI 5 board but kept the cooler fan and checked if it detects (Photo 5). It still won't detect.

Would appreciate the help

(I can't place the photos in between paragraphs so I chose the Photo option)

u/Super_Awesome_H — 4 days ago

Functional Odradek from Death Stranding using Pi 5 8GB and AI HAT+2

Here's my latest project, an embodied local AI agent based on the Odradek scanner from the Death Stranding games.

It uses a Pi 5 (8GB), v3 camera module, and AI HAT+2 (Hailo-10H) to control a robotic arm and track objects. Under the hood I used openWakeWord + Whisper to transcribe voice prompts, and then use Qwen3 1.7B Instruct to call a tool that maps the prompts to COCO ids. These get handed off to YOLOv11n to do the object detection.

If you're familiar with the games, the Odradek tracks invisible ghostly figures called BTs so I thought it would be fun to track real life BTs - Bluetooth identifiers. There's a XIAO ESP32-C6 in the head of the tracker that controls the actuator, motor, and lights, but it also scans for BT signals from AI glasses similar to the Nearby Glasses app.

Originally, I wanted to use the BT detection to signal the agent to start looking for people wearing glasses but was disappointed to find the models supported on the Hailo-10H lack the post processing capabilities of similar models available on the older AI HAT+ (Hailo-8). Would love to hear tips for getting this working.

u/brenpoly — 6 days ago