Home > Microcontroller >Microcontroller Production > How to design an ESP32-based microcontroller development board

How to design an ESP32-based microcontroller development board

Source: InternetPublisher:三岁就很酷 Keywords: microcontroller development board ESP32 Updated: 2024/03/04

Recently I designed a microcontroller development board based on ESP32. I tested the board with different programs and Wi-Fi sharing. Now in this article I will show the schematic, circuit assembly and give a full review of this DIY board.

ESP32 development board:

The ESP32 WiFi and Bluetooth chips are the latest generation of Espressif products. It has a dual-core 32-bit MCU with integrated WiFi HT40 and Bluetooth/BLE 4.2 technology.

The ESP32 wifi and bluetooth chip (also known as ESP wroom 32) has significant performance improvements compared to the arduino ESP8266 (previous generation). It is equipped with high-performance dual-core Tensilica LX6 MCU. One core handles high-speed connections and the other is used for standalone application development. The dual-core MCU frequency is 240 MHz and the computing power is 600 DMIPS.

The ESP32 chip (ESP wroom 32) integrates a wealth of hardware peripherals, including capacitive touch sensors, Hall sensors, low-noise sensor amplifiers, SD card interfaces, Ethernet interfaces, high-speed SDIO/SPI, UART, I2S and I2C, etc.

feature:

Single or dual-core 32-bit LX6 microprocessor with clock frequency up to 240 MHz.

520 KB of SRAM, 448 KB of ROM and 16 KB of RTC SRAM.

Supports 802.11 b/g/n Wi-Fi connections with speeds up to 150 Mbps.

Supports classic Bluetooth v4.2 and BLE specifications.

34 programmable GPIOs.

Up to 18 12-bit SAR ADC channels and 2 8-bit DAC channels

Serial connections include 4 x SPI, 2 x I2C, 2 x I2S, 3 x UART.

Ethernet MAC for physical LAN communication (requires external PHY).

1 master controller for SD/SDIO/MMC and 1 slave controller for SDIO/SPI.

Motor PWM and up to 16-channel LED PWM.

Secure boot and flash encryption

Circuit design:

I made the schematic in EasyEDA. I changed the USB to serial port programming chip to CH340g, which is convenient and cheap. This IC requires two transistors in order to change the ESP32's normal mode to programming mode when compilation of the program is complete.

Required components:

1) ESP32 Wi-Fi module

2) Ch340g programmer IC

3) 10K, 5k, 1K resistors

4) 100nf capacitor

5) BC547 transistor

6) USB Type-C

7) Customized PCB

PCB design:

If you want to use the design then here is the download link, all 3 files Gerber, BOM and CPL are shared. Therefore, you can try JLCPCB’s SMT service.

Here I'm using a blue, HASL finish, 1.6mm double layer PCB. I adjusted the components to match the parameters of the original ESP32 boards available on the market.

test:

I tested this ESP32 module with a 7-segment display, for which I got the files for a 7-segment display from a friend on Instructables. This program is used to display numbers on the LCD.

Note : I noticed that there may be an issue with my design where the sketch programmer does not automatically switch to programming mode when uploaded. Therefore, we have to give external trigger by pressing BOOT and FLASH buttons.

7-segment display code:

#include

#define PIXELS_PER_SEGMENT 2 // Number of LEDs in each Segment
#define PIXELS_DIGITS 1 // Number of connected Digits
#define PIXELS_PIN 2 // GPIO Pin

Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXELS_PER_SEGMENT * 7 * PIXELS_DIGITS, PIXELS_PIN, NEO_GRB + NEO_KHZ800);

//Pixel Arrangement
/*
a
f b
g
e c
d
*/

// Segment array
byte segments[7] = {
//abcdefg
0b0000001, // Segment g
0b0000100, // Segment e
0b0001000, // Segment d
0b0010000, // Segment c
0b0100000, // Segment b
0b1000000, // Segment a
0b0000010 // Segment f
};

//Digits array
byte digits[10] = {
//abcdefg
0b1111110, // 0
0b0110000, // 1
0b1101101, // 2
0b1111001, // 3
0b0110011, // 4
0b1011011, // 5
0b1011111, // 6
0b1 110000 , // 7
0b1111111, // 8
0b1110011 // 9
};

//Clear all the Pixels
void clearDisplay() {
for (int i = 0; i < strip.numPixels(); i++) {
 strip.setPixelColor(i, strip.Color(0, 0, 0));
}
strip. show();
}

void setup() {
strip.begin();
}

void loop() {
//disp_Seg(200);        // Cycle through all segments    (DelayTime)
disp_Digits(1000);      // Show digits from 0-9       (DelayTime)
//disp_Animation();       // Show some Animations with the segments
//disp_CountUP(500, 450);    // Count numbers in Ascending order (NUMBER, DelayTime)
// disp_CountDOWN(500, 250);   // Count numbers in Descending order (NUMBER, DelayTime)
}

void disp_Seg(int wait) {
clearDisplay();
for (int d = 0; d < 5; d++) {
 for (int i = 6; i > 0; i--) {
  for (int n = 0; n < PIXELS_DIGITS; n++) {
writeSegment(n, i);
  }
  strip.show();
  delay(wait);
 }
}
}

void disp_Digits(int wait) {
clearDisplay();
for (int i = 0; i < 10; i++) {
 for (int n = 0; n < PIXELS_DIGITS; n++) {
  writeDigit(n, i);
 }
 strip.show();
 delay(wait);
}
}

void disp_CountUP(int num, int wait) {
clearDisplay();
for (int i = 0; i <= num; i++) {
 writeDigit(0, (i / 100) % 10);
 writeDigit(1, (i / 10) % 10);
 writeDigit(2, (i / 1) % 10);
 strip.show();
 delay(wait);
}
}

void disp_CountDOWN(int num, int wait) {
clearDisplay();
for (int i = num; i >= 0; i--) {
 writeDigit(0, (i / 100) % 10);
 writeDigit(1, (i / 10) % 10);
 writeDigit(2, (i / 1) % 10);
 strip.show();
 delay(wait);
}
}

void disp_Animation() {
clearDisplay();
//UP-DOWN
for (int i = 0; i < 7; i++) {
 for (int n = 0; n < PIXELS_DIGITS; n++) writeSegment(n, 5);
 strip.show();
 delay(100);
 for (int n = 0; n < PIXELS_DIGITS; n++) writeSegment(n, 0);
 strip.show();
 delay(100);
 for (int n = 0; n < PIXELS_DIGITS; n++) writeSegment(n, 2);
 strip.show();
 delay(100);
 for (int n = 0; n < PIXELS_DIGITS; n++) writeSegment(n, 0);
 strip.show();
 delay(100);
 for (int n = 0; n < PIXELS_DIGITS; n++) writeSegment(n, 5);
 strip.show();
 delay(100);
}
//LEFT-RIGHT
for (int i = 0; i < 5; i++) {
 for (int n = 0; n < PIXELS_DIGITS; n++) {
  writeSegment(n, 6);
  strip.show();
  delay(150);
 }
 for (int n = PIXELS_DIGITS - 1; n >= 0; n--) {
  writeSegment(n, 3);
  strip.show();
  delay(150);
 }
 clearDisplay();
 for (int n = 0; n < PIXELS_DIGITS; n++) {
  writeSegment(n, 1);
  strip.show();
  delay(150);
 }
 for (int n = PIXELS_DIGITS - 1; n >= 0; n--) {
  writeSegment(n, 4);
  strip.show();
  delay(150);
 }
 clearDisplay();
}
//ZIG-ZAG
for (int i = 0; i < 5; i++) {
 for (int n = 0; n < PIXELS_DIGITS; n++) {
  writeSegment(n, 6);
  strip.show();
  delay(125);
  clearDisplay();
  writeSegment(n, 1);
  strip.show();
  delay(125);
  clearDisplay();
  writeSegment(n, 4);
  strip.show();
  delay(125);
  clearDisplay();
  writeSegment(n, 3);
  strip.show();
  delay(125);
  clearDisplay();
 }
}
}

void writeDigit(int index, int val) {
byte digit = digits[val];
for (int i = 6; i >= 0; i--) {
 int offset = index * (PIXELS_PER_SEGMENT * 7) + i * PIXELS_PER_SEGMENT;
 uint32_t color;
 if (digit & 0x01 != 0) {
  if (val == 1) color = strip.Color(50, 0, 0);
  if (val == 2) color = strip.Color(50, 50, 0);
  if (val == 3) color = strip.Color(50, 0, 50);
  if (val == 4) color = strip.Color(0, 50, 0);
  if (val == 5) color = strip.Color(0, 50, 50);
  if (val == 6) color = strip.Color(0, 0, 50);
  if (val == 7) color = strip.Color(50, 25, 0);
  if (val == 8) color = strip.Color(25, 5, 75);
  if (val == 9) color = strip.Color(75, 25, 5);
  if (val == 0) color = strip.Color(5, 75, 25);
 }
 else
  color = strip.Color(0, 0, 0);

for (int j = offset; j < offset + PIXELS_PER_SEGMENT; j++) {
  strip.setPixelColor(j, color);
 }
 digit = digit >> 1;
}
}

void writeSegment(int index, int val) {
byte seg = segments[val];
for (int i = 6; i >= 0; i--) {
 int offset = index * (PIXELS_PER_SEGMENT * 7) + i * PIXELS_PER_SEGMENT;
 uint32_t color;
 if (seg & 0x01 != 0) {
  if (val == 0) color = strip.Color(50, 0, 0);
  if (val == 1) color = strip.Color(0, 50, 50);
  if (val == 2) color = strip.Color(0, 50, 0);
  if (val == 3) color = strip.Color(50, 0, 50);
  if (val == 4) color = strip.Color(50, 50, 50);
  if (val == 5) color = strip.Color(0, 0, 50);
  if (val == 6) color = strip.Color(50, 50, 0);
 }
 else
  color = strip.Color(0, 0, 0);

for (int j = offset; j < offset + PIXELS_PER_SEGMENT; j++) {
  strip.setPixelColor(j, color);
 }
 seg = seg >> 1;
}
}

Possible failures:

1) If you do not use SMT service, please make the solder joints correctly.

2) Do not overheat the Wi-Fi module when soldering.

3) If the microcontroller does not switch to programming mode, then reboot and flash the controller using the tactile buttons.

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号