Questions tagged [raspberry-pi]

The Raspberry Pi is a low cost, credit card sized, ARMv6 instruction set based PC device developed by the Raspberry Pi foundation.

Filter by
Sorted by
Tagged with
47 votes
6 answers
7k views

Raspberry PI controllable car (code for a 6-year old)

I've been trying to show my 6-year old daughter a way to build and create a simple toy car. We've got a 4-motor chassis kit, Raspberry PI and a motozero shield that can operate these 4 motors. We've ...
alecxe's user avatar
  • 17.3k
34 votes
4 answers
20k views

Recording audio in C

Please note there are newer revisions of this code, one here, and one here for continuous audio recording. This is a program I wrote as a .wav audio recording library for Linux. It was developed on ...
syb0rg's user avatar
  • 21.8k
22 votes
1 answer
586 views

Raspberry PI controllable Christmas Tree

After having the scales, thermometer and a coffeemaker connected to the internet, it is finally time for Christmas Tree to become smarter. Hardware 6ft Christmas Tree An addressable WS2811 LED strip (...
alecxe's user avatar
  • 17.3k
19 votes
3 answers
1k views

Automatically turn on Computer from Raspberry Pi (based on user presence in home)

I know the code is full of useless data and stylistic and analysis errors and I'd really love and appreciate to have a pro's idea about it so I can learn to code (and think) better. ...
Pitto's user avatar
  • 819
17 votes
4 answers
1k views

Sensor logger for Raspberry Pi in a stratospheric probe

I'm writing a Python Script for a Raspberry Pi to measure different sensors. We are planning to send the Pi with that Script running to the stratosphere, so the power usage for the Pi is limited. I ...
Lexu's user avatar
  • 273
16 votes
2 answers
2k views

Car computer in python / GPS tracking

I have an old car that I use for long distance driving and have coded an onboard computer based on a Raspberry Pi 3 and a few other modules. It's my first project in Python and while I've already ...
Damien Bourdonneau's user avatar
16 votes
1 answer
7k views

Streaming H264 video from PiCamera to a JavaFX ImageView

I'm currently working on a robotics application where a video feed is being displayed from a Raspberry Pi 3. I've been working on a way to stream the video directly into JavaFX (the rest of the UI is ...
flakes's user avatar
  • 1,925
14 votes
4 answers
3k views

Reading a DHT11 to a file

Disclaimer: not a Pythonista, first actual Python programme written right here. I'm reading a DHT11 sensor from GPIO pin 4 on my Raspberry Pi (thanks Thomas Ward for sending the RPi to me), and I ...
Der Kommissar's user avatar
14 votes
2 answers
3k views

Sort-of Alexa clone using Python on a Raspberry Pi

It's still a working process. There are still things I would like to add, and if you have any critiques or ideas they would be greatly appreciated! I would like to know if my code is readable. ...
AwesomeMeAY's user avatar
12 votes
3 answers
961 views

Speeding up spectrum analysis

I'm trying to speed up this code that loops over an entire spectrum range. It's using a Raspberry Pi, and a rtl-sdr dongle that covers up to around 1.7 GHz. My goal is to be sweep over that spectrum ...
Omari Smith's user avatar
12 votes
3 answers
959 views

Raspberry-Pi morse-code LED

I am new to programming, python and raspberry-pi, but I am keen to learn more. After doing a few basic tutorials I though it might be best to give it a shot and just come up with a task in which I ...
zomb23's user avatar
  • 123
12 votes
1 answer
12k views

Time and temperature displaying program for Raspberry Pi

This program displays either the time, current temperature, 12hr graph of temps, 24 hr graph of temp or a week's graph of temps. Selection is based on user input of one of the GPIO pins. Please ...
Mwilliams03's user avatar
11 votes
1 answer
116 views

Python RPI button board

My project consists of a Raspberry Pi 2B V1.1 connected to a number of push-buttons via GPIO pins. The goal is to create a panel of buttons, allowing the user to make a selection of one or more items ...
Orphevs's user avatar
  • 231
11 votes
1 answer
499 views

Pillow-based basic GUI library for an LCD

I am working with an LCD screen and an RPi. The library I use sends 1-bit images to the screen, so I wrote this library based on Pillow to help developing the on-screen GUI. I am playing with the ...
Neinstein's user avatar
  • 405
10 votes
3 answers
268 views

Getting funky with Pi

Push a button and an LED lights up1 and sends a signal to another computer that plays a song. First project on the Raspberry pi, really simple but definitely fun and educational to implement. Also, ...
Legato's user avatar
  • 9,829
10 votes
1 answer
2k views

Weather station for a Raspberry Pi

Please tell me how I could have done this better. The code is here on Github. ...
fidepus's user avatar
  • 103
10 votes
1 answer
391 views

Touchless lightswitch with Raspberry Pi

I am currently developing a touchless lightswitch via a Raspberry Pi, an ultrasonic module and a nice radio module. However, I am quite a beginner in Python and it was a hard time (at least for me) ...
german_guy's user avatar
8 votes
2 answers
258 views

Car computer in Python / GPS tracking VERSION 2

This is an updated question with new code, taking into account your comments from last time: Car computer in python / GPS tracking I have an old car that I use for long distance driving and have coded ...
Damien Bourdonneau's user avatar
8 votes
2 answers
170 views

Backup Linux system to web

First I create a .tar of the root directory with all the file permissions saved and excluding all irrelevant directories (are these the right folders to be ...
maxisme's user avatar
  • 237
8 votes
1 answer
408 views

Runner 1-bit game in Python like the offline chrome dino

I made this little game to test if my Nokia 5110 screen can handle games. As in handle many frames per second/game loops. I am using a library made for this screen called Adafruit_Nokia_LCD These ...
Offtkp's user avatar
  • 371
7 votes
2 answers
1k views

A baby monitor using a Raspberry Pi to send push notifications when triggered by noise

I have a Raspberry Pi 3B with a USB microphone. I have used a combination of Bash and Python scripts to detect noise levels above a certain threshold that trigger a notification on my phone. The ...
Chris's user avatar
  • 226
7 votes
2 answers
150 views

Measuring the speed of a river

I already improved my program with the suggestions of @Mast. As requested by him I re-upload the code in English so we can check it out together. But before I'll explain a little bit what this ...
Lorenz Bonat's user avatar
7 votes
1 answer
416 views

Python siren control

Below is some code I've put together to contol a siren for a fire service. It works by webscraping a paging feed and looks for set triggers. Is there a better way of doing my code or is this "...
shaggs's user avatar
  • 173
7 votes
1 answer
319 views

Raspberry Pi Heating Controller

In "most" (my experience) older UK houses, Central Heating and Hot Water both come a gas boiler. They are controlled by a programmer, to come on at different times, which is effectively just three ...
fishkake's user avatar
  • 123
7 votes
1 answer
367 views

Getting prices of crypto coins

I have been working on this Raspberry Pi project for a while. It uses the Poloniex API to get prices of crypto coins and it shows the prices on multiple OLED displays. The displays use different i2c ...
BoKKeR's user avatar
  • 135
7 votes
1 answer
454 views

Raspberry Pi GPIO safe clean up

We are always told to call GPIO.cleanup() before we exit our Pi programs. I've seen people using try ... catch ... finally to ...
rabbit.aaron's user avatar
7 votes
1 answer
813 views

Motion detection program for snapping of images

I'm doing a motion detection program where it snaps an image when it detects movement and snaps an image of the person's face if in view while this is all recorded and sends it all to Dropbox. It's ...
Marciano Ng's user avatar
6 votes
3 answers
628 views

Measure distance using echo signal from Ultrasonic sensor

I was not happy with original code for Ultrasonic sensor and decided to write my own implementation. I managed to do this, but it still looks weird. Could you help me to improve it? ...
Iaroslav Karandashev's user avatar
6 votes
3 answers
311 views

Pausing a loop with a Raspberry Pi 3

I am trying to perform a loop and then stop the loop when the last line of code in the if statement is printed to screen saving on CPU cycles. I want to start a <...
rosskopp's user avatar
6 votes
2 answers
1k views

Get external IP via email

I wrote a script for my Raspberry Pi that keeps checking my external IP. If it changes, the Raspberry Pi will send me the new IP via email. Any suggestions for improvements? ...
ser_u's user avatar
  • 61
6 votes
1 answer
110 views

Signal output on Raspberry Pi that acts as input for FPGA

Problem I'm writing a verilog program that does the trapezoidal integration method (where a review is also welcome, wink wink). But turns out you need input for these kind of things, so in the overly ...
auden's user avatar
  • 421
6 votes
1 answer
270 views

Python script which sends telegram message if Raspberry Pi's temperature crosses 60 °C

I need to know if there is any way I can optimize my code so that it does not use 0.6% of my total memory - which is approx. 22.4MB. This is a really small script that runs for as long as the ...
Aditya Sahu's user avatar
5 votes
3 answers
3k views

NTP Clock on a Raspberry Pi

I've been tinkering around with making a fancy clock on a Raspberry Pi B. This little application will sync the Pi's time with an NTP server, then display it using ...
zomgdavidbowie's user avatar
5 votes
3 answers
405 views

Raspberry Pi Safe Clean Up - the decorator way

Yesterday, I've come up with the idea of using python context manager to ensure cleanup available here. This time I am using that context manager to make a ...
rabbit.aaron's user avatar
5 votes
2 answers
181 views

Recognizing a sequence read through OCR software

I am trying to recognize a sentence that I have read through optical character recognition software. This code will eventually run on a Raspberry Pi. I know for certain that it's meant to be one of a ...
Tarrare's user avatar
  • 159
5 votes
2 answers
1k views

A PHP script used on my home server to download YouTube videos

I have a PHP page I used to download YouTube videos, hosted on my Pi 4. The site is only going to be used on my home network (so a dot local address), but it allows me to download videos on my phone ...
TwentyCharMax's user avatar
5 votes
3 answers
1k views

Web server to switch GPIO pin

I am running a simple Python webserver to toggle a GPIO pin on a Raspberry Pi. All seems to work well, but I have a few questions about my code (see below). I am using the ...
tubos's user avatar
  • 51
5 votes
2 answers
654 views

Stopwatch program written in C, using Pico W

I've a raspberry Pico W and developed a simple stopwatch program in C. I configured GPIO pin 15 as an input and enabled the internal pull-up resistor. If the state is high, I will start the timer and ...
Isakkiii's user avatar
5 votes
1 answer
2k views

Raspberry Pi LED for new emails

I'm learning how to use Python with the Raspberry Pi. I successfully followed the tutorial for how to have a Python script run on the Pi to check for new email and turn on an LED if any new messages ...
backwardm's user avatar
  • 153
5 votes
1 answer
842 views

Ping Pong Pi - A Ping Pong score and serving manager

I have spent a few hours on this code, but think it could be improved a bit. It requires eSpeak to be installed to run the speech synthesis, but the voice can be toggled on or off using the ...
ntzm's user avatar
  • 165
5 votes
0 answers
916 views

Uploading captured video to Google Cloud Storage

My program intends to capture video streams (in mjpeg) with OpenCV and upload the captured frames into Google Cloud Storage for later processing. I am expecting to capture ~15-20 frames per second and ...
Rex Low's user avatar
  • 151
4 votes
3 answers
475 views

Loop to print changes in irrigation state to turn on and off a pump when water is low

Python Noob building an automation irrigation system in Python for Raspberry Pi. Python has two functions in the most basic use case: on/off the LED (which will in future be a relay->pump) and ...
GlennB's user avatar
  • 93
4 votes
2 answers
650 views

Bash script for setting up a LAN to WLAN router

I wrote a bash script for the Raspberry Pi 3 (Raspbian) which has the main task of setting up a LAN to WLAN router. In addition it makes some things nicer for the intended users who have Windows ...
Thomas Weller's user avatar
4 votes
1 answer
97 views

Webcam frame splitter

I wrote a camera streaming app for pizero. Since the pizero is too weak to do any video encoding I am using it to just capture usb webcam frames (mjpeg format) and forward them over udp to a ...
user3017869's user avatar
4 votes
1 answer
420 views

Reading analog moisture signal from Arduino over USB to RPi3 and publishing via paho MQTT

This program is meant to read a moisture sensor attached to an Arduino UNO board via USB to a Raspberry Pi3 which broadcasts it over MQTT. I am looking for any constructive criticism. ...
Dinocv's user avatar
  • 381
4 votes
1 answer
890 views

Raspberry Pi headless server using bash and USB automounting

Revised from: Bash scripts and udev rules to handle USB auto mounting / unmounting Tested: Uses USB insert/remove to control a headless Raspberry Pi 3 with Raspian Jessie Lite Changes: Implement ...
dbmitch's user avatar
  • 295
4 votes
1 answer
2k views

Controlling motors using USB serial connection from Raspberry Pi to Arduino

I am working on building an RC car/robot with Raspberry Pi and Arduino. I connected Arduino to Raspberry Pi using USB and send serial commands with python. I haven't done much programming with ...
Yan's user avatar
  • 683
4 votes
1 answer
2k views

Pygame Slideshow

I have written a basic slideshow program that uses pygame to manage the display screen. It cycles through all pictures files in the directory and sub-directories. There is a user configuration section ...
bstipe's user avatar
  • 177
4 votes
1 answer
2k views

Websocket-based server for Raspberry Pi

I am trying to build a websocket server to run on the Raspberry Pi. The websocket server has to push periodic realtime update to a browser. Here is a sample code that I am planning to use. The example ...
Lord Loh.'s user avatar
  • 319
4 votes
1 answer
835 views

Remote control receiver for robot control

I have built an RC car and attached a Raspberry Pi to it - in order to control it, I wrote some Java code to listen to commands over the network and make the car move accordingly. ...
user2813274's user avatar