pia-468x60

pia-728x90

Showing posts with label esp8266. Show all posts
Showing posts with label esp8266. Show all posts

Thursday, September 10, 2020

Designing a USB to UART Module Board using CH340G

Overview

CH340 is a series of USB to UART converter IC. There are six options within this family. This chip is popular within some Arduino board, nodeMCU board module etc. I bought five of CH340G for my own esp8266 firmware flushing board in 2019 for a few Dollars. Finally it works well.

A commercial sample of CH340G

Various CH340 chips pins diagram

The USB version of this chip is USB 2.0 . It's supply from both 3.3V or 5V source. Data transmission could take up to 2 Mbps.

Referring to the serial communication, the data rate ranges from 2400bps to 115200bps.

In CH340G there are up to 16 pins. But I show only some important pin to know in this this design.

  • GND - Supply ground at pin 1
  • TXD - CH340G Transmit at pin 2
  • RXD - CH340G Receive at pin 3
  • V3 - Regulated +3.3V supply voltage
  • D+ - Data+ 
  • D- - Data-
  • XI and XO - 12MHz crystal pins
  • V5 - +5V supply voltage

Other remanding pins are serial port pin functions that I don't want show them here due to a rich of web-based resources.

Schematic And PCB Design

In this design I make a very simple USB to UART converter with only Transmit (Tx) and Receive (Rx) pin. The design  works at 5V.



Since in the EDA software I use for design doesn't have CH340 chip. So I made my own symbol following the original device pins diagram from the vendor. This video shows about the process of making a symbol of CH340 for schematic design.



 

I use a USB type-B connector for USB to Host communication due to the stock components I stock.

Designing a USB to UART Module Board using CH340G
Schematic Diagram

Designing a USB to UART Module Board using CH340G
PCB design view

Designing a USB to UART Module Board using CH340G
PCB pattern
Designing a USB to UART Module Board using CH340G
Component side

Designing a USB to UART Module Board using CH340G
A 3D View of this design

Click here if you wish to download a zip of this Proteus 8 design. This video shows about the schematic and PCB design.




Wednesday, August 26, 2020

Wi-Fi Networks Scanning Using ESP8266 With SPI TFT Display

TFT display module is widely available from online stores. The programming interface could make from scratch with Arduino ready to use libraries. It has many examples included.

The esp8266 IoT module is a low cost development platform with Arduino compatible.

In this example I use an esp8266 IoT module to scan all nearby WiFi networks, and display them on a ST7735 1.8" 128x160 SPI LCD module. It is very low cost from online store.

Wi-Fi Networks Scanning Using ESP8266 With SPI TFT Display
A Wi-Fi Scanning Using My Home Router


I use hardware SPI of esp8266. But it will need more control pins such as D/C, CS and Reset pin.

Wi-Fi Networks Scanning Using ESP8266 With SPI TFT Display
A 1.8 inches SPI 128x160 TFT LCD

 

Connect  the TFT LCD the esp8266 to module as below:



  1. GND to GND
  2. VCC and BLK to Vin(+5V)
  3. D/C to D1
  4. CS   to D8
  5. RST to D2
  6. CLK to D5 (HSCLK)
  7. DIN  to D7 (HMOSI)

The programming requires ucblib library for TFT from github. You can install it via Arduino library manager.

Wi-Fi Networks Scanning Using ESP8266 With SPI TFT Display
esp8266 and TFT display connections diagram





Arduino Source Code:


 

Labels

ADC (11) Analog (15) Arduino (12) Atmega16 (19) Audio (2) AVR (20) CCS PICC (3) Charger (1) Cortex-M0 (1) Counter (10) CPLD (25) DHT11 (1) Digital I/O (23) Display (37) ds18B20 (1) EEPROM (2) Environment Sensor (2) esp8266 (2) Experiment Board (12) I2C (4) Interrupt (8) LCD (3) LDmicro (29) measurement and instrumentation (7) Microchip Studio (3) MikroC (1) One-Shot (3) OpAmp (1) PCB (32) PIC16 Microcontrollers (16) PIC16F877A (2) PIC16F887 MikroC (22) pic18 microcontrollers (2) PIC18F4550 (3) PLC (35) PWM (11) Regulator (1) RTC (3) Sensor (9) Shift Registers (5) SPI (5) Timer (34) UART (2) ultra-sonic sensor (1) USB (2) VHDL (21) xc8 (1) XC95108 (9) XC9536 (15) XC9572 (1) Xilinx (23) Xilinx ISE (22)