Android Question Is there any momement sensor that is easy to pair with an app ?

semar

Active Member
Licensed User
Longtime User
Hello folks !
I'm looking for an outdoor momenent sensor that could be easily connected to an B4A-App. Perhaps via WLAN or via BlueTooth or using a vendor API. Is there anything in the IoT-world, that can be used for it ?
In other terms, I would like to develop an B4A-app for android, which reacts to the signal generated from a paired external sensor movement.

I'm aware that I could use the mobile-phone as a "sensor movement", but I would like to use an external sensor.

Thanks in advance,
Sergio
 

BillMeyer

Well-Known Member
Licensed User
Longtime User
Good Day,
If I was doing something like this I would have in my tool box:

1. B4A for the Android App
2. B4R for coding the sensor (and associated processor)
3. An MQTT Server (private or public - see HiveMQ or Mosquitto Public servers)
4. Tools for soldering, creating the circuit, breadboarding etc.
5. A Large tin of patience :p
5. A LilyGo (TTGO) ESP32 based Camera and PiR board
1661428381446.png


Then to put it all together:
1. Program the board to look for movement, then take a picture of it (that's of whatever caused the movement).
2. Send this picture and other detail you might require via MQTT to your Server. (Information on this Forum - Sending Audio File via MQTT - Search for it)
3. Create your Android App with B4A
4. In your B4A app - include MQTT and subscribe to your camera topic to receive its payload (Clue - Base64 encode/decode the Image and send the B64 string - If you have trouble with the B4R - look for Inline C and get the code off the Internet).
5. Run a service to check for the MQTT message and then open the App once it arrives.
6. Depending how you have done it - decode the string and show the resultant image on your B4A app

Here is another excellent resource/tutorial - Link

And the most important of all - ask - we are all here to help !!!

Enjoy
 
Upvote 1

semar

Active Member
Licensed User
Longtime User
Hi Bill,
many thanks for your kind message and the clear description.
At the moment I'm evaluating a "quick and dirty" solution using another smartphone. But your DIY-Project is really interesting indeed.

Thanks for your time ! This shows me, again, how helpful this forum is !

Best regards,
Sergio
 
Upvote 0
Top