Sunday, February 2, 2025

Getting ESP32 CAM with USB-C Camera to work

    I picked up a different version of ESP32-CAM off Aliexpress.  It purports to support OV-5640 AF, a better camera than the typical ESP32-CAM, and supporting autofocus feature.


    The board has support level about as you would expect from Aliexpress sellers: there are some figures on the product write-up, the seller did send a couple zip files when asked for documentation, and the provided Arduino sketches do not work as written.  The camera fails to initialized, as the pin mapping is not correct.

    Thankfully, the provided documentation does include a schematic for the camera module, and a pin mapping between the camera module and the ESP32.




    Probably the most perplexing move was to provide a figure showing which of the pre-defined cameras to select in the CameraWebServer example sketch, then another image with the pins definitions of that camera overwritten. Thankfully the pin mappings overwritten in the figure are the correct mappings per the previous two figures, but the thought process there is a bit hard to grasp.

The left is the pin definitions in camera_pins.h that comes with the CameraWebServer example. The right is the figure on the seller web page.

    I went ahead and made a new camera definition instead, rather than overwriting the existing definition.  The seller description figures also had some input on how to configure the board.  These do seem necessary, as compile was crapping out without these changes.  


    Finally I tried uploading and met with success.  With corrected pin mapping this board works like any other ESP32 CAM board running the CameraWebServer example.  I guess autofocus works, I don't really remember having a problem with that with the older boards, but surely it is nice to have.

    Will this be the board to make ESP32-CAM a useful product?  Hard to say; it still seems you get what you pay for, and paying a little more gives a little improvement.


No comments:

Post a Comment