Search models, users, collections, and posts

DIY raspberry pi camera

Print Profile(1)

All
P1P
P1S
X1
X1 Carbon
X1E
A1
A1 mini
H2D
H2D Pro
H2S
P2S
H2C
X2D
A2L

0.12mm layer, 3 walls, 15% infill
0.12mm layer, 3 walls, 15% infill
Designer
8.3 h
1 plate

Open in Bambu Studio
Boost
50
110
0
4
42
6
Released 

Description

GitHub - penk/ruha.camera: 3D Printable Retro-style Raspberry Pi HQ Camera

got the idea from this but that screen does not work on my raspberry so I designed a body myself, see that site for electronics.

I used this screen:5.5inch HDMI AMOLED - Waveshare Wiki

 

 

 

The code that I used was this (still in progress)

 

from picamera2 import Picamera2, Preview
import time
from datetime import datetime
from gpiozero import Button
from signal import pause

# Initialize Picamera2 and GPIO button
picam2 = Picamera2()
button = Button(17)

# Configure the camera
camera_config = picam2.create_still_configuration(
main={"size": (1920, 1080)},
lores={"size": (640, 480)},
display="lores"
)
picam2.configure(camera_config)

def capture():
print("Starting preview...")
picam2.start_preview(Preview.QTGL)
time.sleep(1) # Give the preview time to initialize
picam2.start()

print("Waiting 2 seconds before capture...")
time.sleep(2) # Delay to allow framing

timestamp = datetime.now().isoformat()
image_path = f'/home/pi/{timestamp}.jpg'

print(f"Capturing image and saving to {image_path}")
picam2.capture_file(image_path)

print("Stopping preview and camera...")
picam2.stop_preview()
picam2.stop()

# Assign the button press event
button.when_pressed = capture

# Keep the script running
pause()

Comment & Rating (0)

(0/1000)