Tuesday 15 February 2022

Control Cybot from Web Browser using ESP32-CAM

I wanted to give Cybot Sight, that is add a camera to Cybot.


To do this, I decided to use an ESP32-CAM module.

Using an ESP32-CAM module will also enable me to control Cybot from a web browser.
To control Cybot with the ESP32-CAM module requires tapping into the Two-Wire Communication Bus.
The Two-Wire protocol used by Cybot is very similar to the I2C standard, but not quite the same.
So to use a modified I2C protocol to talk to Cybot, I need to use an Arduino NANO to translate the ESP32-CAM I2C protocol commands to the Cybot I2C protocol commands.


This means that all the original hardware on Cybot can be used and controlled from a web browser.


To mount all the components for the Camera Board, I used a cheap PY-5CM*7CM perforated board.


As the ESP32-CAM is 3.3v and the Arduino NANO and Cybot are 5v.
A logic level shifter is also needed.

The ESP32-CAM has a 5v input, this goes to a 3.3v voltage regulator, which can handle more than 5v input. This input is connected to the 6v side of the battery supply of Cybot under the new power board.
The 6v side of the power supply is for the motors, but by the time it gets to the motors its about 4v.
So I have connected the ESP32-CAM here before any voltage drop at the battery supply because the camera and Wi-Fi draws quite a bit of power. If the power drops it can create a brownout.

The power for the Arduino NANO is taken from the header that stacks through all the circuit boards.
The pins on the header are:
  1. Ground.
  2. 6 volt supply. (I haven't used this due to voltage drop)
  3. 5 volt supply.
  4. SCL. Two-Wire Clock.
  5. SDA. Two-Wire Data.
  6. Reset for Drive Microcontroller.
Made a cable to go from headers to the Camera Board.

I have done a Fitzing of the Camera Board circuit.



The Male Header for the power to the ESP32-CAM is separate from the cables to the Cybot, so that it can be disconnected from the batteries.

Designed some support and printed them on my 3D printer.
These are the STL files:
Those that end with R in there name require a mirror image making to make a left version.


I have done code for the ESP32-CAM and Arduino NANO.
They are all in this file: Pub_Cybot_ESP32CAM_Control.zip
There are three versions of HEX file for the NANO, no bootloader, old bootloader and new bootloader.
I have added XLoader to install your choice.











No comments:

Post a Comment