HC-12 is an interesting device. It operates on 433 MHz and I think will be perfect for a sensor network. You can read very detailed info here, I will not go deep into details.
First, you need to configure it. For that purpose, I use very simple PL2303 USB to RS232 converter. If you use Mac OS X – you can use these drivers. Otherwise, you might not be able to see the device.
You need to connect HC-12’s four pins. VCC goes to PL2303’s VCC ( you can safely use 3.3 or 5V, HC-12 can work with 3.2 – 5.5V ), GND goes to GND, RX goes to TX, TX goes to RX. That’s how serial comms work.
Don’t forget to connect SET to GND in order to access it.
When you do this, connect to your computer ( I use Macbook Pro ) and find it:
ls /dev/tty.* /dev/tty.Bluetooth-Incoming-Port /dev/tty.KrasimirsBOSEQC35-SPPDev-1 /dev/tty.KrasimirsBOSEQC35-SPPDev /dev/tty.usbserial
Mine is /dev/tty.usbserial , yours might be different. I connect to it like that:
screen /dev/tty.usbserial 9600
After which you can send commands to it. For detailed commands info, see the top link. Note that you might need to paste it, as it expects the speed to be very fast. For my purposes, I will use channel 7, so I do:
and the reply is:
Which is okay for me. I leave all other settings by default. You can check it with
OK+B9600 OK+RC007 OK+RP:+20dBm OK+FU3
You can now disconnect SET and your module is ready for connection 🙂 In the next post, I will show you how to connect it to Arduino Mini Pro 8 Mhz ( or similar, it doesn’t matter that much ) and send sensor data ( temperature in my case, but really can be anything ).
I hope you enjoy this as much as I do. If you have questions, let me know.