All parts

AI camera (Arducam Mega)

A camera that recognises colours and some objects on the board itself, and says where they are and how big.

The test program

Test this part on its own before you build the rest: if it works alone, the rest is built on something you know works.

10 IF SEE() = "red" THEN LED red, on
20 IF SEE() = "green" THEN LED red, off
30 WAIT 100
40 GOTO 10

What you should see: Show the camera something red: the red light comes on; something green: it goes off.

▶ Try it in the IDE

What to buy

  • Arducam Mega 5MP camera (SPI)Get the SPI Arducam Mega, the 5MP Autofocus variant. NOT the Raspberry Pi CSI-ribbon or USB cameras: only the SPI one talks to the board. It ships from the US, so allow a couple of weeks.

How to wire it to an ESP32-S3

  1. 1 · VCC → ESP32-S3: 3V3The connector has 6 pins in a row: this is the FIRST, from the end where the module prints VCC. The others follow in this order.
  2. 2 · GND → ESP32-S3: GNDCommon ground: this link is mandatory.
  3. 3 · SCK → ESP32-S3: SCK
  4. 4 · MISO → ESP32-S3: MISO
  5. 5 · MOSI → ESP32-S3: MOSI
  6. 6 · CE (CS) → ESP32-S3: CSThe module silkscreens this CE, not CS: same signal (chip select).

If it does not work

The program runs but nothing happens
Too little light, an object too small in the frame, or the board's pins below 3.3 V. Try in full light with an object that fills the frame; if the voltage is low, the IDE tells you how to raise it when you connect the board.

What you can adjust

  • The colours or objects it reacts to.

Which boards it works on

  • ESP32-S3 Freenove: yes
  • Nordic nRF54LM20 DK: yes
  • Arduino UNO R4 WiFi: no, no AI