Monday 27 February 2023

Testing 4WD Esp32-cam Arduino Car

https://s.lazada.com.my/s.UhSku
The board in Arduino should be AI Thinker ESP32-CAM.
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json  has the latest versions but cannot be downloaded into my Intel Macbook Pro.
 
For Mac, use the link below.
The board manager link below can be downloaded into my Macbook but only older versions but ESP32-CAN is available for selection.

https://dl.espressif.com/dl/package_esp32_index.json

 It keeps on crashing so we need to reset it frequently. The reset pin is at the bottom of the ESP32 board.


The camera sideways. It's highest resolution is 1600 X 1200. This picture was taken with the lens protector still attached.

The test was made using the example sketch, esp32/camera. Board is AI Thinker esp32-cam.
 
This kit is based on the project posted at hackster designed by 
 
Published © Apache-2.0.
 
 
The wiring should therefore follow its code. The control source codes look good. The circuit diagram is correct. 5V is actually Vcc input to ams1117 3.3V voltage regulator. The polarity of the wiring that is not clear because the right wheels will rotate backward if driver normally forward.

 
When compiling the original code with the edit for my Wifi router, it failed to compile with esp32 library version 2.0.6. As suggested by the blog below, I downgraded to version 1.0.6 for it to compile.

After a few recompiles, it managed to work somehow. The works perfectly. Camera does not produce any image. The controls are all messed up. The right motors work all the time, but the left motor worked rarely, but need to use the Android Chrome in my mobile phone. Browsers from my PC, do not work with the controls at all, only the flash.

My wirings appear to be reversed. The pins that worked for my wiring is as below. Physically, I reversed the right motors. out1 is negative, out2 is positive. It is better to do the adjustment in source code, rather than trying to correct the orientation physically.

Flash is at pin 4, but there is a port also at pin 4.

/* Defining motor and servo pins */
const int RMotor1 = 14;
const int RMotor2 = 15;
const int LMotor1 = 12;
const int LMotor2 = 13;
const int ServoPin = 2;
const int FlashPin = 4;
 
 

No comments:

Post a Comment