Electronic – use PIR + HC-06 Bluetooth Module without arduino to send events to Android

bluetooth

I want a PIR sensor to send a "something moved" event to Android.

Can I use a simple PIR + Bluetooth module to send such an event?
I was thinking that I could connect the PIR output (which goes 5V when movement is detected) to the TX of the bluetooth module, so that "something" would be sent to android (which has been paired before), which would read "something" from instream.read(buffer)

Would this work? Is it ok to just put +5V on the TX of the bluetooth module? I would say that it would send garbage, but I'm not interested in "what" is sent, just the event that something was sent…

Best Answer

Not with the HC-06. The HC-06 is a specialized firmware for the CSR bluetooth module it runs on. It lacks any options for GPIO, either from a master or to it.

There are other versions. The HC-05 is even more limited. A newer version known as the BC-04C or some variation on that now has a limited GPIO option, and can be run without a microcontroller host hooked up. (Electrodragon, not affiliated), but it has poor documentation.

See https://www.youtube.com/watch?v=ExtMyV3fDLM or https://www.youtube.com/watch?v=KMUMnF0F4jE

Even so, you would need to setup the module at least once, with a microcontroller or a usb-to-ttl serial cable, and put it in Monitor/Collection work mode (input reading mode).

As for directly hooking up the PIR output to the TX pin, that can create garbage characters that might lock up the module. I don't recommend it.

The easiest solution would be to use an Arduino clone, or ATTINY and make a quick sketch that involves reading an input pin, and sending a string via the TX and RX pins (software serial). It wouldn't take much.

Edit: A simple hack would be to use a device like a Bluetooth Selfie Stick button. These buttons are a fully contained bluetooth with multiple digital inputs, and even a battery. Add a transistor and a resistor and your all done. There are apps that can configure what the button "press" does on the android side. I may do this myself now!