12/24/2023 0 Comments Step 7 micro win full or half duplexTransceivers must be at least several meters apart to work.Ĭonst byte HC12RxdPin = 4 // Recieve Pin on HC12Ĭonst byte HC12TxdPin = 5 // Transmit Pin on HC12 Upload code to two Arduinos connected to two computers. Power HC12 with a supply of at least 100 mA with * HC12 Send/Receive Example Program 1Ĭonnect HC12 "RXD" pin to Arduino Digital Pin 4Ĭonnect HC12 "TXD" pin to Arduino Digital Pin 5Ĭonnect HC12 "Set" pin to Arduino Digital Pin 6 The software serial also has a 64-byte buffer however, the SoftwareSerial library can be modified to increase that, if required. The Arduino UART has a 64-byte receive buffer built into the hardware so any bytes of data that exceed the 64-byte limit will be discarded. As long as there is a non-zero value returned by "*.available()", the "*.read()" function pulls one byte out of the buffer and the "*.write()" function sends that byte along to the other serial port to be read by either the computer or the HC-12. The functions "*.available()" reads the number of bytes stored in the Arduino's Serial or SoftwareSerial FIFO buffers. Upload the following code and open the serial port monitor in the Arduino IDE to send/receive messages. Per the datasheet, if powering the HC-12 with more than 4.5V, place a 1N4007 diode in series with the HC-12 "Vcc" pin Connect HC-12 "Gnd" and "Vcc" to a 3.2 V to 5.5V 200mA source.Per the datasheet, connect a 22 ♟ to 1 mF reservoir capacitor in parallel with the HC-12 "Gnd" and "Vcc" pins.Connect the HC-12 "TXD" pin to Arduino pin 5.Connect the HC-12 "RXD" pin to Arduino pin 4.Connect the HC-12 "Set" pin to Arduino pin 6.Text typed on one computer will be displayed on the serial monitor of the second computer.īegin by connecting the HC-12 transceivers to each Arduino: This program will allow messages to be sent between two computers via the HC-12 transmitters. In "HC12 Send/Recieve Example Program 1," the HC-12s are used in their default state (FU3: 20mW transmit, 9600 bps, Channel 001) to create a wireless bridge between the serial ports of two computers. The transceivers must be physically separated by at least 1.5 meters to function. You can return to the default state by sending AT+DEFAULT once in command mode. Note that as the transmission rate increases, the sensitivity of the receiver decreases. The default configuration of the HC-12 is FU3-on Channel 1, FU3 is a fully automatic and transparent (to other devices) setting that adapts to the transmission rate of the connected device (although 9600 baud is still required to program it in Command mode). The 5th pin on the HC-12 is labeled "Set" and, when driven to logic low, allows various settings to be selected on the HC-12 using AT commands sent to the "RXD" pin. The HC-12 has 100 supported channels spaced 400 kHz apart, eight transmit levels, eight supported baud rates, and three different working modes. It offers many of the same capabilities as its ATMega and XMC counterparts. It is programmed to control the Si4463 as well as handle the UART communication between the HC-12 and whatever it is connected to on the other end.Ĭombined with other components, the Si4463 and STM8S003 create the HC-12 transceiver, which provides a 4-pin TTL-level UART interface (Vcc, Gnd, Tx, Rx), with a 5th pin that is used to enter "command" mode for changing the module's configuration. It supports UART, SPI, and I☬ and has multiple I/O pins. This is an 8-bit microcontroller with 8 kB of flash memory, 128 bytes of EEPROM, and a 10-bit ADC. See the datasheet for more information on multiband operation, frequency hopping, etc. Two 64-byte Rx and Tx FIFO memories are built into the chip along with a great many advanced features that are not implemented in the HC-12 design. It has a maximum transmit power of 20 dBm (100 mW) and receive sensitivity of -129 dBm. The Si4463 provides the wireless communication in this circuit. The HC-12 circuit board is built around the STM8S003F3 microcontroller and the Si4463 transceiver. This image has been digitally manipulated to enhance chip markings. Paired with an external antenna, these transceivers are capable of communicating up to and possibly slightly beyond 1 km in the open and are more than adequate for providing coverage throughout a typical house. The HC-12 is a half-duplex 20 dBm (100 mW) transmitter paired with a receiver that has -117 dBm (2×10 -15 W) sensitivity at 5000 bps. This project will begin by using the HC-12 to create a wireless link between two computers and end with a second article that creates a simple wireless GPS tracker. The HC-12 is a half-duplex wireless serial communication module with 100 channels in the 433.4-473.0 MHz range that is capable of transmitting up to 1 km. Learn about the HC-12 transceiver module and how to use it to transmit and receive digital data.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |