Two Arduinos can be connected over the TX and RX pins, using hard wiring and the hardware serial. These wires can be replaced by 2 HC-12 modules: connect the HC-12 RX and TX pins to respectively the TX and RX pins on the Arduino. Do this for two Arduinos and (provided you configured both HC-12 to the same channel and baudrate) the communication will work as if hardwired.
Today I spent 5 hours trying to figure out why suddenly this setup would not work anymore in my testrig.
Result: when using original Arduino's with 16U2 drivers: no issue. However, when an Arduino with a CH340 driver is used in a receiver role, it does not work anymore.
In the pictures attached you see screenshots from my scope for 4 different measurements:
- 16U2 receiver TX pin: this is the measurement of a 16U2 in the receiver role with the scope attached to the pin receiving the data (TX pin on the HC-12) which is connected to the Arduino RX pin.
- 16U2 transmitter RX pin: here the 16U2 is in the transmitter role, scope placed on the pin where data for transmission over the HC-12 is placed
- CH340 receiver TX pin: the CH340 in the receiver role
- CH340 transmitter RX pin: CH340 in transmitter role
Conclusion: when the CH340 is in the receiver role the data is not being read because the voltage does not drop enough below the 5V line voltage.
EDIT: to be complete, I have to add that the HC-12 contains 1k resistors in both RX and TX lines, and that the RX input pin has a "weak pullup" dixit manual page 3. But that is actually the pin where no problems occur. The issue is with the RX-pin-on-Arduino-to-TX-pin-on-CH12.
My question: why is that?
I included the schematics of both boards.
All I can see is that the CH340 uses its TX and RX lines to drive each a LED (the original Uno has separate drivers). But why would the CH340 work as a transmitter (and not as receiver)?
Arduino_Uno_Rev3-schematic.pdf (81.4 KB)
2016-01-14_122335_HC-12_v2.3B.pdf (237 KB)