Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Project Documentation

ESP32-CAM Controlled 16x2 LCD Display

Image of ESP32-CAM Controlled 16x2 LCD Display

Circuit Documentation

Summary of the Circuit

This circuit integrates an ESP32-CAM microcontroller with a 16x2 LCD display. The purpose of the circuit is to display the message "Hello, world!" on the LCD. The ESP32-CAM is responsible for controlling the LCD through digital I/O pins. The circuit also includes a resistor for limiting current to the LCD's backlight and contrast pins.

Component List

16X2 LCD

  • Description: A liquid crystal display capable of displaying 16 characters per line across 2 lines.
  • Pins: VSS, VDD, V0, RS, RW, E, D0, D1, D2, D3, D4, D5, D6, D7, A, K

ESP32 - CAM

  • Description: A microcontroller module with integrated Wi-Fi and Bluetooth functionalities, which also includes a camera interface.
  • Pins: 5V, GND, IO12, IO13, IO15, IO14, IO2, IO4, VOT, VOR, VCC, IO0, IO16, 3V3

FTDI Programmer

  • Description: A USB to serial interface device used to program microcontrollers like the ESP32-CAM.
  • Pins: DTR, RX, TX, VCC, CTS, GND

Resistor

  • Description: A passive two-terminal electrical component that implements electrical resistance as a circuit element.
  • Resistance: 200 Ohms

Wiring Details

16X2 LCD

  • VSS: Connected to GND of ESP32-CAM and one terminal of the Resistor.
  • VDD: Connected to 5V of ESP32-CAM.
  • V0: Connected to the other terminal of the Resistor for contrast adjustment.
  • RS: Connected to VOR of ESP32-CAM.
  • RW: Connected to GND through a 200 Ohm resistor.
  • E: Connected to VOT of ESP32-CAM.
  • D4: Connected to IO15 of ESP32-CAM.
  • D5: Connected to IO14 of ESP32-CAM.
  • D6: Connected to IO2 of ESP32-CAM.
  • D7: Connected to IO4 of ESP32-CAM.
  • A: Connected to 5V of ESP32-CAM for backlight anode.
  • K: Connected to GND through a 200 Ohm resistor for backlight cathode.

ESP32 - CAM

  • 5V: Connected to VDD and A of the 16X2 LCD.
  • GND: Connected to VSS, V0, RW, and K of the 16X2 LCD (V0, RW, and K through a 200 Ohm resistor).
  • VOR: Connected to RS of the 16X2 LCD.
  • VOT: Connected to E of the 16X2 LCD.
  • IO15: Connected to D4 of the 16X2 LCD.
  • IO2: Connected to D6 of the 16X2 LCD.
  • IO14: Connected to D5 of the 16X2 LCD.
  • IO4: Connected to D7 of the 16X2 LCD.

Resistor

  • One Terminal: Connected to VSS of the 16X2 LCD.
  • Other Terminal: Connected to V0 and K of the 16X2 LCD.

Documented Code

/*
 * This Arduino Sketch is for an ESP32-CAM microcontroller connected to a 16x2 LCD.
 * The circuit is designed to display 'Hello world' on the LCD screen.
 * Connections:
 * ESP32-CAM  -> 16x2 LCD
 * 5V         -> VDD, A
 * GND        -> VSS, V0, RW (via 200 Ohm resistor), K (via 200 Ohm resistor)
 * VOR        -> RS
 * VOT        -> E
 * IO15       -> D4
 * IO14       -> D5
 * IO2        -> D6
 * IO4        -> D7
 */

#include <LiquidCrystal.h>

// Initialize the library with the numbers of the interface pins
LiquidCrystal lcd(16, 17, 15, 14, 2, 4);

void setup() {
  // Set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("Hello, world!");
}

void loop() {
  // Nothing to do here
}

Filename: sketch.ino

This code initializes the LCD and prints "Hello, world!" to the screen. The LiquidCrystal library is used to manage the LCD interface, and the pins are initialized to match the wiring of the ESP32-CAM to the LCD. The setup() function configures the LCD and prints the message, while the loop() function is left empty as no further action is required after initialization.