0
\$\begingroup\$

Is it possible to use a HC 12 circuit(https://www.elecrow.com/download/HC-12.pdf) to control a 5V relay?

If yes, can you give me a clue on how to do this?

I've been searching for a while and I found nothing.

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

Yes and no.

To make a stable device you will need a microcontroller that will read serial data received, implement a protocol, verify checksums and so on. Your module could receive whatever from the air and if it is not veryfied at least through checksum your relay can go ON and OFF without your command.

Other methods that can be done without a smart bug (MCU :) ) will not be stable enough.

Why don't you look at the ESP12 family modules? They are WiFi compliant, can connect to your home network and have GPIO pins that can easily be connected with a NPN transistor and a couple of resistors to drive a relay.

\$\endgroup\$
4
  • \$\begingroup\$ Ok, but I don't want wireless on the Raspberry Pi side, I want wireless on the relay side, I see that the ESP12 is usually used for the raspberry Pis without wireless module. \$\endgroup\$
    – yonutix
    May 26, 2017 at 10:46
  • \$\begingroup\$ ESP12 could be used whereever you like. It can connect to existing WiFi network or can create one if you wish. If your Raspberry is connected to WiFi or Ethernet through the same router then you just need to connect the ESP to this netowrk and then you can access it bi IP address. If you don't have a WiFi network you can get 2 ESP12 modules - connect one of them to Raspberry and configure it to create network and the other can be configured to connect to this netowrk and control the relay. \$\endgroup\$ May 26, 2017 at 12:20
  • \$\begingroup\$ One more question: How is it able to connect to the network without knowing the SSID and the password? \$\endgroup\$
    – yonutix
    May 26, 2017 at 12:42
  • \$\begingroup\$ For start you need to configure it through its UART (RS-232 TTL level) port. It has EEPROM and saves configuration, so next time when powered it will connect on its own. Take a look at this: instructables.com/id/Getting-Started-with-the-ESP8266-ESP-12 \$\endgroup\$ May 26, 2017 at 12:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.