Raspberry Pi Pico weather display (MicroPython)
Your first MicroPython project: temperature and humidity on an OLED.
Shop by category
Shop all componentsThe SinoSeen OV5640 module is a UVC USB camera, so any PC or Pi sees it without drivers, and its autofocus keeps close-up text sharp. Mounted on a stand looking down, it becomes a document camera for online classes or for scanning pages. The Python script shows a live preview and, on a key press, saves a full-resolution picture with a grey-scale, contrast-boosted copy that reads like a scan.
Tick anything you already have and the total updates.
SinoSeen OV5640 5 MP USB autofocus camera
Follow the colours: red is power, dark grey is ground, blue is a signal.
USB.
doccam.pyimport cv2, time
cap = cv2.VideoCapture(0)
cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc(*"MJPG"))
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 2592); cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 1944)
cap.set(cv2.CAP_PROP_AUTOFOCUS, 1)
while True:
ok, frame = cap.read()
if not ok:
break
cv2.imshow("doc cam (space = save, q = quit)", cv2.resize(frame, (960, 720)))
k = cv2.waitKey(1) & 0xFF
if k == ord(" "):
name = time.strftime("scan-%Y%m%d-%H%M%S")
cv2.imwrite(name + ".jpg", frame)
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
clean = cv2.adaptiveThreshold(gray, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY, 31, 15)
cv2.imwrite(name + "-scan.png", clean)
print("saved", name)
elif k == ord("q"):
break
cap.release(); cv2.destroyAllWindows()
Some systems ignore the size request without MJPG; check the modes with your camera app or v4l2-ctl.
Give autofocus a second, or move the camera a little higher.
Light the page evenly from two sides; avoid one lamp casting shadows.
Yes, it is a standard UVC camera.
Yes, run the scans through OCR software such as Tesseract.
Yes, it is enough for clear text on an A4 page.
1 part: SinoSeen OV5640 5MP USB Camera Module with Auto Focus. On this page you can tick the parts you already have and add only the rest to your cart.
It is a beginner project and takes about 1 hour. The build on this page has 5 steps.
No. This page has the complete, tested code (doccam.py).
About ₹2,779 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
UVC cameras and resolutions; Autofocus for close work; Simple scan clean-up with OpenCV.
Your first MicroPython project: temperature and humidity on an OLED.
A web page with ON and OFF buttons that switches a relay over Wi-Fi.
A warm ring light that fades up at dusk and down at dawn.
Turn a Pi and a touchscreen into a home command centre with a clock and to-do list.
Learning project. Check every circuit and the datasheet of each part before you power it up.