A USB-to-TTL adapter (USB-to-UART adapter, USB-to-UART bridge) is a USB device that lets us connect a device with TTL/UART port to our PC through the regular USB port. We can use it to update firmware on routers, modems, mobile phones, hard disks, and so on. For testing AT Commands, we need a USB-TTL module built on CP2102 IC. For the sake of proper description, we will describe how to wire The HM-10 BLE Wireless Module with CP2102 USB 2.0 to TTL UART Serial convertor Module.
CP2102 USB 2.0 to TTL UART Serial convertor Module is a $2 device, HM-10 BLE Wireless Module is a readily available Bluetooth 4.0 module. It can be configured as either Master or slave. HM-10 BLE original has two crystals, while the clones only single crystal and the firmware of clones support limited AT commands. Clones can be named MLT-BT05. One of the easiest way to spot the non-HM 10 (actually HM-10s) was the lack of a crystal, unfortunately you can now buy actual HM-10s without the crystal. So the confusion is likely to get worse but this is not an article about HM10.
You need the original one to follow this guide.
---
HM-10 BLE original has the following pins :
- STATE: state test pins (it is connected to an internal LED)
- BRK: break connect
- VCC: positive pole of the power source
- GND: Ground
- TXD: serial interface, transmitting terminal.
- RXD: serial interface, receiving terminal.
CP2102 USB 2.0 to TTL UART Serial convertor module has the following pins :
- 3V3
- +5V: positive pole of the power source
- GND: Ground
- TXD: serial interface, transmitting terminal.
- RXD: serial interface, receiving terminal.
Tx of HM10 can be connected to Rx of USB-TTL.
Rx of HM10 to be connected through a level shifter to Tx of USB-TTL. A 1K resistor in series and a 2.2K resistor across to GND is a simple level shifter.
HM10 can be supplied power 5V (there is onboard 3.3v regulator)
Now, you can connect the USB plug to your PC, open Device Manager in Microsoft Windows (Press Win+R to open the Run dialog, type devmgmt.msc in it and press Enter) and note the COM port allotted. We require a terminal software to test AT commands. We can use the CoolTerm terminal (in LINE MODE) :
1 2 | ## download from https://freeware.the-meiers.org/ |
Install CoolTerm software. Run the software, click “options”. Under “serial port” select the COM port of USB-TTL, set Baud Rate as 9600, data bits 8, parity none, stop bits 1, (tick mark) software supported flow control, (tick mark) block keystrokes while the flow is halted, initial line states when port opens – DTR on, RTS on.
Under “terminal” select Line Mode.
Click on connect. Typing AT on the line mode gets an OK reply from HM10. You can pair this module with an Android phone and use the BLE Terminal app.
Tagged With usb to ttl test