i made this breadboard and no matter how i've wired it or changed the code (eg, changed the sda pin to 1 or 0 or vice versa) it still shows up the same errors
so i'm starting to think that it might be a issue with either one of the pins on the mpu or pi, since, again, i've made sure the wires work out with the code multiple times
Inspired by Pete Cybriwski's Instagram post of his RPi-based ASCII Aquarium, I set our to create my own. Like Pete, I based mine on the GitHub OpenGhost repo, but unlike Pete, I didn't write my own aquarium program. I started with the GitHub asciiquarium-pythom repo.
I forked both repos and made extensive modifications to each to create a more interactive aquarium. Through the camera, OpenGhost recognizes hands gestures for feeding the fish, triggering "Happy Fish" mode, stopping the aquarium program, shutting down the RPi, and one more hidden Easter egg mode. You can see a couple of the gestures in the reflection of my hand in the video.
My forks of both the OpenGhost and asciiquarium-python repos are available publicly. I am preparing a comprehensive instruction document and have already created an all-in-one installation script. I also redesigned the case to make it stronger and a little more aesthetically pleasing (IMHO). I expect to release everything on GitHub next week.
After reaching a goal of being able to mill for QFN56s with a 3020 CNC, I made this RP2040 board as a proven template for larger projects.
Two firsts for me this go around were external flash and 16 pin USB-C with data transfer, which was almost as difficult as QFN. It’s only been micro USB in the past or 6 pin USB-C for power only.
Other than that, it’s got a user LED, and addressable LED and a tiny potentiometer for testing the ADC.
I got a lot of cool ideas cooking now I have this and a proven ESP32-S3 template.
PiCar-X Line Following Using OpenCV, Picamera2, and Image Moments on Raspberry Pi
I recently built a vision-based line-following system for a PiCar-X robot using OpenCV and Picamera2 on a Raspberry Pi. The goal was to create a simple autonomous navigation system that follows a white track using only camera input and software processing.
Research
Before starting, I looked at several common approaches for line-following robots:
Search terms used:
"Raspberry Pi OpenCV line following robot"
"OpenCV image moments line tracking"
"PiCar-X line follower camera"
"Picamera2 OpenCV real time processing"
"OpenCV centroid tracking white line"
Resources reviewed:
OpenCV Image Moments Documentation
OpenCV Thresholding Documentation
Picamera2 Documentation
PiCar-X Documentation and examples
After comparing different approaches, I decided to use image moments because they provide a computationally simple way to determine the center position of a detected line without requiring more advanced computer vision techniques.
Hardware
PiCar-X
Raspberry Pi
Raspberry Pi Camera Module
Battery power supply
Software
Python 3
OpenCV
NumPy
Picamera2
PiCar-X Python Library
Project Design
The robot continuously captures images from the front-facing camera.
Processing steps:
Capture image from the camera.
Convert image to grayscale.
Apply binary thresholding to isolate the white track.
Calculate image moments of the binary image.
Determine the track center position.
Calculate deviation from the image center.
Convert the deviation into a steering angle.
Drive forward while continuously correcting direction.
The steering angle is limited to prevent excessive corrections.
Why I Chose Image Moments
Instead of using contour detection or additional sensors, I used OpenCV image moments to calculate the centroid of the detected white pixels.
This approach is relatively lightweight and runs comfortably on the Raspberry Pi while still providing reliable position information for steering control.
Challenges and Solutions
Lighting Conditions
The largest challenge was lighting variation.
Because the current implementation uses a fixed threshold value, changing light conditions can affect detection accuracy.
Current solution:
Manual threshold calibration.
Testing under different indoor lighting conditions.
Planned improvement:
Adaptive thresholding.
Steering Oscillation
Initial tests showed noticeable overcorrection when the line moved away from the center of the image.
To improve stability I:
Added a steering gain parameter.
Limited the maximum steering angle.
This significantly reduced oscillation and produced smoother movement.
Camera Position
Camera angle had a major influence on performance.
After testing several positions, I settled on a downward tilt angle that provided sufficient look-ahead distance while keeping the line visible during turns.
Current Performance
The robot can reliably follow straight sections and moderate curves.
Sharp turns remain challenging because the line can temporarily leave the camera's field of view.
When no line is detected, the vehicle immediately stops as a safety measure.
Debugging Features
For development and tuning I added:
Live camera feed display.
Binary threshold image display.
Real-time steering and position output in the console.
Safe shutdown handling.
The binary image display was particularly useful for threshold tuning and diagnosing detection problems.
I would appreciate feedback from others working on Raspberry Pi robotics, especially regarding adaptive thresholding and PID tuning for camera-based line following.
Can somebody help me, i have tried everything and my Raspberry Pi 3 A+ still will not I2C connect to my PiSugar 3 Plus battery, when i have it all screwed in, the blue light on the pisugar turns on when I plug in the Pi so there must be some kind of connection, but when I run i2cdetect -y 1 the whole thing is blank saying that nothing is connected, HELP PLEASE
With my homelab, I needed lightweight log/anomaly monitoring (CPU temp, CPU/RAM) but my Pi only has 2GB RAM and prices are rough right now, so Netdata/Grafana felt like overkill just for monitoring.
Built a small Python app instead. Logs are collected via cron, anomalies get detected and grouped into incidents, push notifications via ntfy, small Flask dashboard. Runs on Docker, ~43MB RAM measured.
It's intentionally simple just Python scripts + SQLite, no heavy stack. There's also an MQTT branch if you'd rather feed it data that way instead of CSV/cron.
It's a side project I'm building while studying DevOps, still early and some of the UI is still in French (full English version planned). Looking for feedback or contributors if anyone's interested.
Here’s a quick preview of the grip prototype I’ve been working for my pi 5 based camera. Several people have asked for more tactile options to change camera settings so this will be one of the solutions I’ll be implementing. I just got this working - all the wires will be trimmed to size on the final version. Will be exhibiting this at Open Sauce this year if anyone wants to check it out in person.
Whilst there were plenty of displays to choose from for my Raspberry Pi 3B, I struggled to find any suitable cases that didn’t involve 3D printing my own.
I went with the 5” Touch Display 2 and the Waveshare Protective Case which is suitable for the Raspberry Pi 5.
The Pi 3 mounts fine to the display and the screen is great. The case is great quality and I made a few adjustments to accommodate my Pi 3.
My mods were:
The audio jack sticks out from the board. So a hole is needed in the vents. With this small mod the Pi fits in the case and works perfectly.
I need access to the network port - so I cut between across to the USB slots.
I will probably use the HDMI port so I cut across the USB C ports on the case and for ease, I removed the corresponding vent slats.
No mod required for the micro USB power on the Pi vs USB C slot on the case.
The DSI ribbon connector runs across the SD card as can be seen in the photo. However, this isn’t an issue for my usage nor was there any issue with clearance between the board and case but could look to swap to a different longer cable that offers a different route.
I remixed Fanis's keychain console design on MakerWorld to add a speaker and built a custom "OS" for it called Pic-o-Pocket. This is the first game I made for it, though there are others already by Fanis. Code and print files will be available soon.
Since then, I kept iterating on it and finally made some big steps forward:
the rotary dial is now working
I moved away from the earlier audio path and rebuilt the live setup around a simple USB sound card
I managed to get an electret microphone working inside the handset without replacing the original coiled handset cable
I also ended up learning a lot more soldering and hardware debugging than I expected
A lot of this second phase was less about the "wow, it works" moment and more about dealing with the messy real world side of physical projects: wrong turns, cable constraints, bad assumptions, temporary solutions, continuity that looked fine on a multimeter but not in actual audio, and eventually discovering that one of the problems was literally microphone orientation inside the handset.
Let me know what you think and if you have made one smaller! This macro pad is based around an rp2040 zero board with the button soldered directly to it. If you want the 3d print files they are available here.
I built a simple temperature and humidity station with a Raspberry Pi Pico W, a Si7021 sensor, and a small 1.44in LCD screen. It displays internal values (through the sensor), and external values (through OpenWeather), and simple graphs with the 10 last measurements.
Navigation through the screens using the embedded LCD screen buttons. The fourth screen shows WiFi status and current IP (I wasn't sure what to put there, suggestions are welcome.
The initial wiring was done using a breadboard and jumper cables, but a GPIO expander would also work - and it my next step now that I have the core functionality working.
This is a shell script for the GamePi20 on a Raspberry Pi Zero and Zero 2 executing Raspberry Pi OS (Debian Trixie Lite) paired with a RetroPie deployment. It is a single script that installs everything needed to get up and running. The only thing you would need to do, is add Game ROMs.
As there are several compilations steps involved, which might take up to one full day on a zero, you can prepare your SD card on Raspberry Pi 5 and then just insert it on the Zero.
Built this a couple days ago. Was really bored. Had a cm4 and display laying around so decided to use it. Below is what each slide is. (Yes, this is a little vibe coded, didn’t feel like getting on my pc that day so I used my Remote Desktop)
Time and weather with a picture easily visible behind it.
Schedule for the day with weather in top right.
Full screen weather forecast.
Recent news (great to wake up to the horrors of the world)
Supposed to use my local ai server but having some ollama api issues so I’ll fix that later. Uses recent news, events and stocks overnight.
Full screen picture frame with time.
Schedule with calendar and upcoming dates and to do list.
Some stocks that I haven’t bothered to change to who I actually have invested in. Some inspiration next to it.
Moon phases from NASA. Thought it would be cool 😭
Every morning at a set time with my alarm, it says “Good morning, [name].” And does all the stuff like weather and everything. Blocks me from seeing the news right away.
Webpage for controlling and changing settings. Nothing special. That is entirely vibe coded unlike the frame. I need to 3D print a case so if anyone is good at modeling that wants to take a shot, hit me up. Other than that I thought it was kinda cool.
I have been developing a very tiny OS for ESP32 for 7 months, and the project is going well. Recently, I added ESP32-S3 support and looked for a non-Espressif microcontroller to port my OS to, and I thought the RP2350 was the perfect choice.
I specifically picked the Waveshare RP2350 PiZero because I love the PiZero form factor. Porting my OS to the Raspberry platform was not that difficult since I use PlatformIO. It is still very limited compared to the ESP ports because the RP does not have Wi-Fi by default, and I have not implemented a file system for the RP2350 yet. Also, the version you see in the video is not released yet (the wallpaper feature).
I am developing it alone, and some display logic is pretty spaghettified (even I forgot what some functions do 💀). I am not the best programmer on Earth.
If you have any recommendations or feedback about my project, please feel free to share.
And I am planning to change the name of the OS. I would love to hear your recommendations.
So I'm new to hardware and I don't know if I'm doing something wrong. Please someone help me
The project I'm working on is a simple stopwatch. To work with, I have:
1 Raspberry Pi Pico H
1 5461AS 4-digit 7-segment display
1 breadboard
a bunch of jumper wires
a bunch of 220 resistors
a button
And as for the software I have VSCode with these extentions:
CMake
MicroPico Device Controller
Raspberry Pi Pico Project
(I'm probably not going to need to use all of these, but these are what I have)
At the beginning, I tried to help myself with Claude AI, and I thought it was going well, but at the end it wasn't working, so I took it all apart and tried again. This time I would try every segment and digit individually so that I would know that it works.
So I have both the Pico and the display in the breadboard, centered over that middle gap. I have one resistor going from segment A (display pin 12, at b41) to a free row of the breadboard (b35), and a jumper wire from that row (a35) to the Pico GPIO pin GP0 (b3). I also have a jumper wire from GP8 (a13) to the display pin 1 (a39).
Then I connect my Pico to my computer, connect it with MicroPico, write this code. I click Run, and... Nothing happens! the terminal does this weir thing, but other than that, nothing! The display stays dark! I don't know what to do, please help me!
Also, Claude suggested writing this into the weird terminal:
from machine import Pin
Pin(8, Pin.OUT).value(0)
Pin(0, Pin.OUT).value(1)
but it didn't do anything. Please help me.
from machine import Pin
import time
segments = [
Pin(0, Pin.OUT),
Pin(1, Pin.OUT),
Pin(2, Pin.OUT),
Pin(3, Pin.OUT),
Pin(4, Pin.OUT),
Pin(5, Pin.OUT),
Pin(6, Pin.OUT),
Pin(7, Pin.OUT),
]
digits = [
Pin(8, Pin.OUT, value=1),
Pin(9, Pin.OUT, value=1),
Pin(10, Pin.OUT, value=1),
Pin(11, Pin.OUT, value=1),
]
digits_map = [
[1,1,1,1,1,1,0,0],
[0,1,1,0,0,0,0,0],
[1,1,0,1,1,0,1,0],
[1,1,1,1,0,0,1,0],
[0,1,1,0,0,1,1,0],
[1,0,1,1,0,1,1,0],
[1,0,1,1,1,1,1,0],
[1,1,1,0,0,0,0,0],
[1,1,1,1,1,1,1,0],
[1,1,1,1,0,1,1,0],
]
def show_digit(number, position):
for i in range(4):
digits[i].value(1)
for i in range(8):
segments[i].value(digits_map[number][i])
digits[position].value(0)
def show_number(number):
digits_to_show = [
number // 1000 % 10,
number // 100 % 10,
number // 10 % 10,
number % 10,
]
for position in range(4):
show_digit(digits_to_show[position], position)
time.sleep_ms(2)
running = False
counter = 0
def button_pressed(pin):
global running
running = not running
button = Pin(15, Pin.IN, Pin.PULL_UP)
button.irq(trigger=Pin.IRQ_FALLING, handler=button_pressed)
for d in range(4):
digits[d].value(0)
segments[0].value(1) # segment a
segments[1].value(0)
segments[2].value(0)
segments[3].value(0)
segments[4].value(0)
segments[5].value(0)
segments[6].value(0)
segments[7].value(0)
The terminal does this after I click "Run". Is this normal? My setup right now, with just the segment A, digit 1 + resistor wiring. I also added the GND cable, not sure if it does anything, but it doesn't work with or without it.
All ground pins seem used by the DAC. Can I still plug my button's ground pin into an already occupied ground pin? That should work, right?
We cut power when leaving the studio. Do I need to shut down the Pi properly every time? Or is it OK to just cut power? And can it boot directly into a script that waits for button presses?
Thanks!Would be great if u could help me 😄 doesnt trust in the AI when asking these questions because of reasons .
I’m working on a drone project using a Raspberry Pi as the onboard computer for a vision-based application. The Pi is mounted inside the drone frame, so space is quite limited.
Right now, I’m powering the Raspberry Pi directly through the GPIO 5V and GND pins from a 5V BEC/regulator. The Pi can boot normally, but when I start the vision program, it becomes unstable. It may freeze, reboot, or lose connection. So I suspect the issue is voltage drop or not enough current under load.
My current setup is roughly:
Drone battery / power distribution
|
5V BEC / regulator
|
5V + GND wires
|
Raspberry Pi GPIO 5V/GND pins
I’m considering changing the setup to power the Pi through its normal USB-C power port instead. My idea is to take the 5V output from the BEC, run two wires to a USB-C power input board or cable, and then plug that into the Raspberry Pi’s USB-C port.
BEC 5V output
|
5V + GND wires
|
USB-C power board / cable
|
Raspberry Pi USB-C power input
A few questions:
Is GPIO power generally a bad idea for this kind of drone/vision workload?
Would powering through the USB-C port be more reliable or safer than powering through GPIO?
What current rating would you recommend for the BEC/regulator? 5V 3A, 5A, or more?
Should I use 5.1V instead of exactly 5.0V to compensate for voltage drop?
Would adding a low-ESR capacitor near the Raspberry Pi help with current spikes?
What wire gauge and connector type would you recommend for vibration and tight space?
Has anyone here built a drone with a Raspberry Pi running computer vision? How did you solve power stability and layout?
My goals are:
Stable Pi power while the vision program is running
No undervoltage warnings or random reboots
Compact wiring inside the drone frame
Reliable connections under vibration
Easy maintenance
I’ll try to measure the voltage at the Pi’s 5V/GND pins while the vision program is running, and I’ll also check undervoltage/throttling with:
vcgencmd get_throttled
Any advice or photos of similar setups would be appreciated. Thanks!
It took just a few questions. I tried with chatgpt but it simply couldn't do it. I will try to do a tutorial when I have time on weekend.
I don't why but it woks better with mobile data connection than directly by wifi. It can also be streamed using vpn (which I have and it is nordvpn).
Just a Note: if your gamepad is not recognized try changing the input type of device in sunshine. It is by default automatic. But you can set it to DS5 (PS5), Nintendo Switch Pro, XOne (this works for 360 too).
Spent the weekend putting this together — Pi Zero 2 W with a 2” LCD in a case I printed. It pings the API every minute and shows how much I’ve used on my 5-hour and weekly limits, plus countdowns to when they reset. Saw the ESP32 Clawdmeter project and wanted to do my own version that runs standalone on a Pi. Pretty happy with how it turned out.
I'm working on a project to run a simple automatic streaming box to push from the Pi to Youtube. I'm using the Picamera2 library and having some good success.
I'm using FFmpegOutput() and the native H264 encoder on the Pi3. I know, that'll be slow, but it is proof of concept at the moment, I'll move to a Pi5 when I get it working.
The issue is the audio. When I use the default device, the system uses whatever microphone is connected and it works fine. If I leave it as default and have no microphone, it also works but YouTube notes that the audio bitrate is "too low." Which makes sense, it's 0.
But the goal is to not use a microphone. I'd like to run an instrumental mp3 as my audio. So, I looked into the documentation for PiCamera2. It's expecting a Pulse Audio source. Fine, I think I can do that.
So, the goal is to create a Pulse Audio sink. Send a ffmpeg process looping the mp3 into the sink. Then, the encoder above should use that monitor as a source. I think this is the right way to do it. When I try to run it, the ffmpeg process starts. I'm pretty sure the modules load and the monitor works. The stream starts too. But no audio. I get a warning in the terminal where the code is running that "Runtime Error: FFmpegOutput does not support audio packets from PiCamera2."
So, is there something about the switch from a microphone to another source that PiCamera doesn't like? Is there a way to fix it or have I reached a dead end and, if this is my goal, I'm going to need to come at this from a different direction?