Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11543
Posted: 05:22pm 24 Jun 2026
Copy link to clipboard
Print this post
Version 6.03.00RC25 onwards will have support for the OV2640 camera module that is now ubiquitous and a significant update from the OV7670 that has been supported in multiple versions of MMbasic.
The OV2640 support is available on all RP2350 builds except VGA, VGAUSB and HDMIWEB. For the HDMI and HDMI builds you must be in mode 4 (RGB555) to use the camera. For the PicoMite builds you will need a connected SPI display (with working MISO) and have enough memory free for the firmware to allocate a 153600 byte buffer in main ram (not PSRAM). The basic resolution used is 320x240 RGB565 - hence the 153600 byte buffer and the firmware supports capture of images at that resolution and an image change algorithm that will detect motion in the camera field.
All good so far BUT the PicoMite OV2640 firmware also supports jpeg capture in resolutions up to 1600x1200. This allows for a trivial program that can monitor the visual fields for movement and then capture the image in much higher resolution.
Here is the manual entry for the new firmware
There is also a minor enhancement to the LOAD JPG command to allow images to be downscaled to making reviewing easier.
Taken together, these changes allow a simple motion detection program
Option explicit Option default none Dim float ch Dim imag%(320*240\8-1) Dim s$ If Instr(MM.DEVICE$,"HDMI") Then Mode 4 Drive "b:" Camera open ov2640 gp20,gp21,gp22,gp26,gp27,gp0 Do Camera change imag%(),ch' initialise the change image Do Camera change imag%(),ch,1 Loop Until ch>10 s$="Movement" Inc s$, LEFT$(Date$,2)+Mid$(Date$,4,2)+RIGHT$(Date$,2) Inc s$," "+LEFT$(Time$,2)+Mid$(Time$,4,2)+RIGHT$(Time$,2)+".jpg" Camera capture jpeg s$,sxga Load jpg s$,,,,,4 Pause 2000 Loop
Here is a sample image taken at 1600x1200 using my HDMIUSB reference board to control the camera
PhenixRising Guru Joined: 07/11/2023 Location: United KingdomPosts: 1964
Posted: 10:19pm 24 Jun 2026
Copy link to clipboard
Print this post
Do you know if these cameras are IR sensitive, Pete? I only got a definite maybe from AI.
al18 Senior Member Joined: 06/07/2019 Location: United StatesPosts: 240
Posted: 01:10am 25 Jun 2026
Copy link to clipboard
Print this post
Nice. I see Amazon has the camera on sale for $7.99 during Prime days.
On your picture, it looks like the red color of the camera PCB is being displayed as pink. The blue of the JLCPCB box and the green Raspberry Pico 2 looks correct.