What should I do if the esp32 cam has insufficient pins?

hi all, I want to make a remote control car project, but the eps32-cam only has 8 gpio pins, and my four-way motor driver board takes up 8 of them. I also want to add an nRF24L01 module, what should I do?

Maybe dont use an ESP32CAM since it does not have enough pins ?

Are you using the SD card ?

Are you sure the ESP32CAM has as many as 8 GPIO that are free to use ?

What is the camera being used for ?

Model? Link? There are many different types and different options to control a driver.

Model? Link? There are many different types and different ways to add more I/o pins.

Potentially, i2c or SPI bus i/o extenders could be used.

Why? Nrf2401 doesn't have many advantages over the built-in wi-fi of the ESP32.

I wanted to use esp32cam because I wanted to see the car's perspective, and the project wouldn't be as cool if I lost the camera.

I know there are several ways to control the car, but I want it to become a platform so that I can add various modules for testing in the future.

If you won't give any more detail, you won't get much useful help.

2 Likes

Yes, more detail and answers to all the questions in post #2.


This is a similar driver board I ordered,is on the way.

This is the information provided by the esp32-cam supplier, but I have not ordered it yet.

You could possibly add another microcontroller and talk to it from the esp32 cam using a serial type protocol (say I2C). That would use only two pins on the esp32. This additional microcontroller could then handle the motor board and maybe other (read only) peripheral devices.

1 Like

I would avoid using another microcontroller. This can make projects very complex and difficult for beginners.

@jason7766 I can see that the SCL & SDA pins are available, so you can attach multiple i/o extender chips to those 2 pins. For example SX1509 will provide 16 additional i/o pins which are PWM capable.

Hopefully you have learned that the better approach is to ask for advice before placing your order!

I requested links (rather than a pics) for a good reason. Zooming in, the numbers in the chips on the motor board are not readable. It looks like they start with "L", and that probably means we would have advised something different because you may come to regret choosing this board. Well, let's find out for sure.

EDIT: I think the chips may be L9110

These have the disadvantage of a large voltage drop of about 1.5V. If you plan to use, for example, li-po battery (~3.7V) this would mean less than 2.5V reaching the motors.

Again, can you please answer the questions in post #2 ?

I spent a great deal of time trying to get an SPI LoRa device working on a ESP32CAM and it was not at all easy.

For sure the ESP32CAM has available pins for 0,1,2,3,4,12,13,14,15,16 but some cannot be used for various reasons, some are used for program upload, and the rest are used by the SD card.

So whether your project can work rather depends on how your currently planning to use the ESP32CAM.

The SCL and SDA in the diagram shown by @jason7766 are on pins 26 and 27, which are not externally available. This I2C interface is used by the camera.

However, the ESP32 has two I2C interfaces and putting that on the TX and RX pins does work, you can continue to use program upload and the I2C port. In this way I have had an ESP32CAM using an I2C GPS, FRAM, BME280, PCA9563 and TC74.

1 Like

1,I can do without esp32-cam, I actually have an ESP32-WROOM-32D on hand, but I want to try esp32-cam.

2,I want to use bluetooth to stream video,I don't plan to use the SD card at this time.

3,According to the information provided by the supplier about esp32-cam, it seems that it only has 8 GPIOs available, so I haven't ordered it yet.

4,Camera used to explore Bluetooth car’s perspective.

Yes, the supplier said it is L9110S four-way driver board module.

You need:
8 GPIO lines for Motor Driver
2 GPIO lines for Bluetooth Module
2 GPIO lines for nRF24L01 Module //Edit: this is SPI device

Total: 12 GPIO lines:

In ESP32-CAM Board, yu have
10 GPIO lines (UORX, U0TX, and GPIO0 are free upter uploading)
2 GPIO lines coulde be routed from ESP-WROOM-2 Module (Fig-1) onto right-bottom GND-pin (false GND and not connected anywhere) and 3.3V/5V pin (cut PCB track and make it free).

If you wish, you can have more GPIO lines from the ESP-WROOM-32 Module; however, you must be a professional in dealing with PCB track cutting and soldering; else, the CAM Board will be damaged! This job is not difficult for a careful person if he uses a magnifying glass to see the pins of the ESP-ROOM-32 Module and uses a sharp-tipped soldering iron.


Figure-1: ESP-WROOM-32 Module

I think you missunderstand, the supplier might well give you a diagram that gives you the GPIO pins that you can connect to, but it does not mean you can freely use them.

Of the GPIO pins with connections on the ESP32CAM;

Two are used for program upload.
Two are used by the camera.
One can be used, but be careful or the Flash does not work.
One is used by the White LED.

You said you want to use an NRF24, well that requires SPI mode and 5 GPIO pins.

And if your using the NRF24 that would require an additional IO pin.

It might be possible to do what you want, but the only hope on such a pin restricted board is to drive all the additioanl IO via I2C expanders.

I would suggest you try and make the motor driver board work with I2C IO expanders as a first step in the project.

For sure you could make up a PCB or stripboard and attach wires to the bare ESP32 module to get access to the normal SPI\I2C pins, but there was no suggestion that you wanted to hack the board in that fashion.

1 Like

Used by the camera

Really ?

Which ones on the ESP32 are not in use ?

https://dronebotworkshop.com/esp32cam-robot-car/

Exactly which false GND, on the ESP32 module or the ESP32CAM PCB ?