NightVision - Raspberry Pi zero + Waveshare parts
Obliczymy ostateczną cenę na podstawie wybranego pliku. Sprawdzisz ją i zaakceptujesz przed płatnością.
Zapisane na tym urządzeniu.
Small night vision built from RPI zero and accessories from Waveshare. Dimensions only: 12x6x5cm
- Ocena
- 0 / 5
- Polubienia
- 2
- Pobrania
- 3
- Wydruki
- 0
- Wyświetlenia
- 48
- Oceny
- 0
Aktualizacja u źródła:
Informacje o modelu
- Źródło
- Printables
- Kategoria
- Portable Devices
- Licencja
- Creative Commons — Attribution — Noncommercial — Share Alike
Small night vision built from RPI zero and accessories from Waveshare.
Dimensions only: 12x6x5cm
You need:
- RPi ZERO (with hat) (16 USD)
- MicroSD (8GB or more) (6 USD)
- Cam + light - buy cable for zero! (29 USD)
- Round LCD (15 USD)
- Battery hat + battery 14500 (19+3 USD)
- M3 heat inserts + M3 bolt
- Some dupont cable
- Toggle switch + cable
- Hot glue
- Soldering iron
- PETG filament (about 75g)
- Total price is under 90 USD
Step by step:
- Print all the parts and insert the m3 heat inserts
- Install raspbian (I recommend turning on SSH and then you can continue with the rpi connected to the pc)
- !There is plenty of space inside the housing, so it's better to keep the cables longer!
- Prepare the battery HAT. Unsolder the switch and instead it solder toggle switch on a 10cm cable that you bring out to the front. You can attach the cable to the bottom of the pcb with hot glue
- Plug in the battery HAT and battery and connect display
- Prepare a camera with one night LED (pay attention to the orientation according to the cutout in the stl). Do not connect the camera yet, it will be difficult to work with it.
- Place the display in the cutout (front.stl) and secure it from the back using hot glue
- Place and secure the camera and light module in the same way into night_cam.stl
- Connect the camera and hide the camera cable between the legs under the RPI board.
- Screw it together
Program:
- Enable SPI and camera
- Install the display according to the official waveshare instructions
- Be careful, the official guide is missing "sudo" for installation and examples for python are in different folders
- Create a program to display camera output on the display (See program below. Use custom file paths and image settings)
- Set the program to start automatically when rpi is started. For example via /etc/rc.local
The printable parts are simple, if you want to use a different camera, light or display, you only need to modify two parts.
My program (night1.py)
import os
import sys
import time
import logging
import spidev as SPI
sys.path.append("/path_to_lib(use absolute path)/")
from lib import LCD_1inch28
from PIL import Image
from picamera2 import Picamera2Raspberry Pi pin configuration:
RST = 27
DC = 25
BL = 18
logging.basicConfig(level=logging.DEBUG)
try:
# Inicializace displeje
disp = LCD_1inch28.LCD_1inch28()
disp.Init()
disp.clear()
disp.bl_DutyCycle(50)
# Inicializace kamery
camera = Picamera2()
camera.configure(camera.create_preview_configuration({"size": (240, 240)}))
camera.start()
while True:
# Zachytávání obrazu
frame = camera.capture_array()
image = Image.fromarray(frame)
# Otočení obrazu pro správné zobrazení na displeji
im_r = image.rotate(90)
# Zobrazení obrazu na displeji
disp.ShowImage(im_r)
time.sleep(0.03) # Krátká pauza pro obnovu obrazu
except IOError as e:
logging.error(e)
except KeyboardInterrupt:
camera.stop()
disp.module_exit()
logging.info("quit:")
exit()