USB-to-Serial Converter Archives - CyberBlogSpot https://cyberblogspot.com/tag/usb-to-serial-converter/ Not just another blogspot site Mon, 06 Feb 2023 20:09:14 +0000 en hourly 1 https://wordpress.org/?v=6.5.5 https://cyberblogspot.com/wp-content/uploads/2018/08/cropped-iphone-iphone3gs-32x32.jpg USB-to-Serial Converter Archives - CyberBlogSpot https://cyberblogspot.com/tag/usb-to-serial-converter/ 32 32 ESP-01 and ESP-01S Pinout and Configuration https://cyberblogspot.com/esp-01-and-esp-01s-pinout-and-configuration/ https://cyberblogspot.com/esp-01-and-esp-01s-pinout-and-configuration/#respond Mon, 06 Feb 2023 19:59:12 +0000 https://cyberblogspot.com/?p=4635 ESP-01 and its latest version ESP-01S are popular microcontrollers with Wi-Fi networking capabilities. They are part of the ESP8266 family of microcontrollers manufactured by Espressif Systems. In this article, we will learn the ESP-01 and ESP-01S pinout and configuration in actual applications. ESP-01 Wi-Fi Module Specifications Power Supply:Voltage 3.0V ~ 3.6VCurrent >300mA Current Consumption: Continuous… Read More »ESP-01 and ESP-01S Pinout and Configuration

The post ESP-01 and ESP-01S Pinout and Configuration appeared first on CyberBlogSpot.

]]>
A picture of an ESP-01 module showing the pinout.
Figure 1. ESP-01 ESP8266 Microcontroller Board Pinout

ESP-01 and its latest version ESP-01S are popular microcontrollers with Wi-Fi networking capabilities. They are part of the ESP8266 family of microcontrollers manufactured by Espressif Systems. In this article, we will learn the ESP-01 and ESP-01S pinout and configuration in actual applications.

ESP-01 Wi-Fi Module Specifications

Power Supply:
Voltage 3.0V ~ 3.6V
Current >300mA

Current Consumption:
Continuous Transmission: Average: ~ 71mA, Peak: 300mA
Modem Sleep: ~20mA
Light Sleep: ~2mA
Deep Sleep: ~0.02mA

SPI Flash Memory:
Default 8Mbit (1MB)

Interface:
UART/GPIO

IO Port:
2

UART Baud Rate:
Support 300 ~ 4608000 bps
Default 115200 bps

Frequency Range:
2412 ~ 2484MHz

Transmit Power:
802.11b: 16±2 dBm (@11Mbps)
802.11g: 14±2 dBm (@54Mbps)
802.11n: 13±2 dBm (@HT20, MCS7)

Receiving Sensitivity:
CCK, 1 Mbps : -90dBm
CCK, 11 Mbps: -85dBm
6 Mbps (1/2 BPSK): -88dBm
54 Mbps (3/4 64-QAM): -70dBm
HT20, MCS7 (65 Mbps, 72.2 Mbps): -67dBm

For a complete specifications, you may refer to the ESP-01 Product Specification PDF.

ESP-01 and ESP-01S Pinout

Have you just bought a new ESP-01 Wi-Fi module? Take a look at
How to Test an ESP-01 ESP8266 Module


Learn how to differentiate between ESP-01 and ESP-01S Wi-Fi modules, see:
Difference Between ESP-01 and ESP-01S

Figure 2. ESP-01 Module Pinout A
Pinout of ESP-01 and ESP-01S with the male header pins on the right.
Figure 3. ESP-01 Module Pinout B
Picture showing the pinout of ESP-01 and ESP-01S with the board oriented so that the header pins are at the bottom.
Figure 4. ESP-01 Module Pinout C

ESP-01 Pin Descriptions

TX – UART0 data send (transmit) pin, also known as GPIO1.
RX – UART0 data receive pin, also known as GPIO3.
CH_PD – Chip Power Down (also known as CH_EN or Chip Enable) – Chip enable pin, active high
RST – External reset pin, active low
GPIO2 – General Purpose Input / Output
GPIO0 – General Purpose Input / Output
VCC – +3.3 Volts Supply Positive
GND – Ground – Supply negative

ESP-01 Module Breadboarding and Adapters

When breadboarding, you can not insert the ESP-01 module as it is. A few years ago, you do all sort of tricks to breadboard an ESP-01 module, from bending the header pins to making your own DIY adapter. Luckily, now you can buy a cheap breadboard adapter for the ESP-01 module. See Figure 5.

A picture of an ESP-01 and ESP-01S adapter module with an ESP-01 board inserted into it.
Figure 5. Breadboard Adapter for ESP-01 Module

If you will be connecting the ESP-01 board to an Arduino board, you must remember two (2) things:

  • Do not supply the ESP-01 module with the 3.3V output from the Arduino board – the ESP-01 module, as per specification above, may require up to 300mA of current. The 3.3V regulator on the Arduino board may overheat and may become damaged.
  • Provide logic level translation between the ESP-01 and the Arduino board – the Arduino board uses 5V logic while the ESP-01 module uses 3.3V logic.

A good ESP-01 adapter that can satisfy the requirements for interfacing with Arduino boards is shown in Figure 6. It has a built-in 3.3V regulator and two (2) bi-directional logic level converters for the RX and TX pins. The schematic diagram for the adapter is shown in Figure 7.

Picture of another ESP-01 and ESP-01S adapter that is complete with a 3.3V voltage regulator and bi-directional logic level converters.
Figure 6. ESP-01 Adapter with Voltage Regulator and Logic Translator
Schematic diagram of the ESP-01 and ESP-01S Wi-Fi modules adapter shown in Figure 6.
Figure 7. Schematic Diagram of ESP-01 Adapter

ESP-01 Programmers

ESP-01 USB-to-Serial Converter Programmer Module

Unlike the other ESP8266 boards, ESP-01 boards need a programmer to be uploaded with programs or sketches from the Arduino IDE. An inexpensive programmer is shown below in Figure 8. The programmer uses a Silabs 2104 serial to USB converter chip. With this programmer, you just plug it into your computer’s USB port, select the proper COM port and start uploading sketches.

A USB-to-serial converter programmer for the ESP-01 and ESP-01S modules.
Figure 8. ESP-01 Programmer or Flasher

DIY USB-to-Serial Converter Programmer

If you do not have a programmer module but you have an available USB-to-serial converter, you can wire it up as an ESP-01 programmer. The schematic diagram of a DIY programmer is shown in Figure 9. With this programmer, you need to put the ESP-01 module into programming mode before uploading a sketch. This is done by holding down the Flash switch, pressing and releasing the Reset switch, and then releasing the Flash switch.

Schematic diagram of a DIY USB-to-serial converter programmer for the ESP-01/ESP-01S.
Figure 9. DIY USB-to-Serial Converter Programmer

Shown below in Figures 10, 11, and 12 is my DIY ESP-01 programmer. The USB-to-serial converter connects to the programmer board via the 4-pin male header on the board.

Picture of an assembled DIY programmer for the ESP-01 ESP8266 Wi-Fi modules.
Figure 10. My DIY ESP-01 Programmer
Picture of a DIY USB-to-serial converter programmer with an ESP-01 module inserted on the female header.
Figure 11. My DIY ESP-01 Programmer with an ESP-01 Module
Picture of an USB-to-serial converter for use with ESP-01 DIY programmer.
Figure 12. USB-to-serial Converter

Arduino Board as ESP-01 Programmer
Another option for an ESP-01 programmer is to use an Arduino board. You may use any available Arduino board such as Arduino Uno, Arduino Nano, etc.

Schematic diagram of Arduino Uno used as an ESP-01 programmer that includes the pinout of both the ESP-01 and the Arduino Uno board.
Figure 13. Schematic Diagram of Arduino Uno as ESP-01 Programmer

The idea here is to use the Arduino board’s built-in USB-to-serial converter. The schematic diagram in Figure 13 is the same as the DIY ESP-01 programmer in Figure 9, but the USB-to-serial converter was replaced with an Arduino Uno.

As previously discussed above, the 3.3V output from the Arduino board should not be used. Instead, a 3.3V voltage regulator was provided for the ESP-01 module. Also, a logic level converter was used consisting of a 2.2K resistor in series with a 3.3K resistor acting as a voltage divider. This protects the RX pin of the ESP-01 module from being exposed to a 5V signal from the Arduino board. Note that the TX pin of the ESP-01 module was connected directly to the TX pin of the Arduino board. We can do away with the logic level converter because the TX pin is acting as an output (outgoing signal).

You may have noticed that the TX and RX pins of the Arduino board are connected to the corresponding TX and RX pins of the ESP-01 module. But in the DIY programmer in Figure 9, the TX and RX terminals are cross-wired. That is, the TX pin of the USB-to-serial converter is connected to the RX pin of the ESP-01 module and ,vice versa, the RX pin of the USB-to-serial converter is connected to the TX pin of the ESP-01 module.

If you want to find out why the Arduino board’s RX and TX pins are wired straight thru and not crossed over with the ESP-01 board, consult an Arduino board schematic and look at how the MCU chip and the USB-to-serial converter chip are wired. I am leaving this one as an exercise for the reader.

Related Articles on ESP-01 and ESP-01S Pinout and Configuration

How to Program ESP-01 with Arduino IDE
How to Set up Arduino IDE for ESP8266 Programming
How to Test an ESP-01 ESP8266 Module
How to Control ESP-01 thru a Router
How to Control ESP-01 Without a Router
ESP-01 with RTC and LCD Display
How to Save and Restore ESP8266 and ESP32 Firmware
NodeMCU V3 ESP8266 Pinout and Configuration
How to Test a NodeMCU V3 ESP8266 Dev Board
How to Use AT-09 BLE with Arduino and Smartphone

References on ESP-01 and ESP-01S Pinout and Configuration

ESP-01 Specification
ESP-01 Datasheet

The post ESP-01 and ESP-01S Pinout and Configuration appeared first on CyberBlogSpot.

]]>
https://cyberblogspot.com/esp-01-and-esp-01s-pinout-and-configuration/feed/ 0
How to Enable Serial Monitor on Digispark ATtiny85 https://cyberblogspot.com/how-to-enable-serial-monitor-on-digispark-attiny85/ https://cyberblogspot.com/how-to-enable-serial-monitor-on-digispark-attiny85/#comments Wed, 18 Jan 2023 01:14:31 +0000 https://cyberblogspot.com/?p=5739 The Serial Monitor in Arduino IDE is an indispensable tool for debugging purposes. However, although a Digispark ATtiny85 development board has a USB interface, the Serial Monitor does not work with it. The main reason is that the USB interface in the Digispark board is not a serial COM port. The second reason is that… Read More »How to Enable Serial Monitor on Digispark ATtiny85

The post How to Enable Serial Monitor on Digispark ATtiny85 appeared first on CyberBlogSpot.

]]>
The Serial Monitor in Arduino IDE is an indispensable tool for debugging purposes. However, although a Digispark ATtiny85 development board has a USB interface, the Serial Monitor does not work with it. The main reason is that the USB interface in the Digispark board is not a serial COM port. The second reason is that the ATtiny85 chip does not have a UART port. And third, the Digispark board lacks a UART to USB bridge circuitry to translate UART signals to USB signals. In this article, we will take a look at how to enable the Serial Monitor when using a Digispark ATtiny85 development board.

To enable the Arduino IDE Serial Monitor on a Digispark ATtiny85 board, connect a USB-to-Serial converter. Then use the SoftwareSerial library in the Arduino IDE to create a UART port on the ATtiny85 chip.

Picture of Fritzing breadboard diagram showing how to connect the Digispark ATtiny85 board to a USB to serial converter to enable the serial monitor when working with Digispark ATtiny85
Figure 1. Fritzing Breadboard Diagram of Digispark ATtiny85 with a USB-to-Serial Converter

For Digispark ATtiny85 pinout guide, kindly see Digispark ATtiny85 Pinout and Configuration.

Schematic diagram for connecting the Digispark ATtiny85 board to a USB to UART converter to enable the serial monitor of the Arduino IDE.
Figure 2. Schematic Diagram of Digispark ATtiny85 and USB-to-Serial Converter Connection

Step by Step Guide For Serial Monitor

STEP 1 – Connect a USB-to-Serial Converter

First, connect a USB-to-serial converter to the Digispark ATtiny85 board as shown in Figure 1 and Figure 2.

There are many inexpensive USB-to-serial converters on the Internet. Examples of USB-to-serial converters are shown below in Figure 3. These converters are sometimes referred to as USB-to-serial TTL converters or USB-to-UART converters. Also, the converters use a variety of chips, hence, they may be referred to by their chip names. Some of the popular USB-to-serial chip names that you may encounter are FTDI, CP2104, CH304, and PL2303.

Picture of the different types of USB-to-serial converter used for activating the serial monitor on Digispark ATtiny85 when working with Arduino IDE
Figure 3. USB-to-Serial Converters

STEP 2 – Install the USB-to-Serial Converter Device Driver

Download and install the device driver for your USB-to-serial converter. Because USB-to-serial converters use different chips, you need to search the internet for the device driver for your particular USB-to-serial converter.

You can do a quick test if you have the right device driver installed. Open the Arduino IDE and go to the Tools/Port menu. You should see an additional port instead on only COM1 on the Serial Ports list when you plug in your USB-to-serial converter. Please see Figure 4.

Screenshot of the Arduino IDE showing the serial COM ports list.
Figure 4. Arduino IDE Showing Serial Ports List

STEP 3 – Install the Board Core ATTinycore by Spence Konde

Although we may use the original Digistump AVR board core, I prefer to use the ATTinyCore as it supports almost all of the ATtiny line of AVR chips. Additionally, the ATTinyCore gives us the option to program the ATtiny85 in several ways: no bootloader, Optiboot, and Micronucleus (Digispark) modes. If you need help in installing the ATTinyCore, please see How to Install ATTinyCore on Arduino IDE.

STEP 4 – Use Software Serial to Create UART Ports on ATtiny85

Open the Arduino IDE and upload the sketch shown below. If you need help in uploading the sketch using the board core ATtinyCore, you may visit How to Program Digispark ATtiny85 Board with Arduino IDE.

IMPORTANT NOTE
Before hitting the Upload button to install the sketch, unplug both USB cables for the Digispark board and the USB-to-serial converter. Plug in the USB cable for the Digispark board when prompted by the Arduino IDE. When the sketch upload is done, unplug the USB cable from the Digispark board. Connect the USB cable for the USB-to-serial converter and proceed to STEP 5 for testing the Serial Monitor.

/* cyberblogspot.com 15Jan2023 */

#include "SoftwareSerial.h"

SoftwareSerial mySerial(1, 0);  //RX, TX  PB1, PB0

void setup() { 
  mySerial.begin(19200);
  
  mySerial.println("Change baud rate to 19200");
  mySerial.println("Type something and press ENTER");
}

void loop() {
  if (mySerial.available()){
    mySerial.println(mySerial.readString());
  }
}

The sketch above needs no explanation. Simply include the library header file for the SoftwareSerial library. You do not have to download the SofwareSerial library as it should come with the ATtinyCore board core installation.

Regarding the code creating the SoftwareSerial object in line 5,

SoftwareSerial mySerial(1, 0); //RX, TX PB1, PB0

you may use any two (2) available ATtiny85 ports available. In this case, I used PB1 for RX (receiver) and PB0 for TX (transmitter).

STEP 5 – Test the Serial Monitor

After uploading the sketch to the Digispark ATtiny85 board, unplug the USB cable from the Digispark board. Plug in the USB cable for the USB-to-serial converter.

Then, select the correct COM port for your USB-to-serial converter in the Arduino IDE “Tools/Port” menu. Test the program and you should now be able to use the Serial Monitor on the Digispark ATtiny85 board.

References on How to Enable Serial Monitor on Digispark ATtiny85

USB-to-serial adapter – Wikipedia article on USB to Serial Converter
How to Install Arduino IDE on Windows 10
How to Install ATTinyCore on Arduino IDE
How to Use Arduino as ISP Programmer
How to Program ATtiny85 with Arduino IDE
Digispark ATtiny85 Pinout and Configuration
How to Program Digispark ATtiny85 Board with Arduino IDE
Digispark USB Device Not Recognized
How to Use AT-09 BLE with Arduino and Smartphone

The post How to Enable Serial Monitor on Digispark ATtiny85 appeared first on CyberBlogSpot.

]]>
https://cyberblogspot.com/how-to-enable-serial-monitor-on-digispark-attiny85/feed/ 2