8
votes

I'm trying to think of a way to do a simple home automation project that involves an Arduino, a Bluetooth module and an Android phone. The idea is that I have two Arduino boards in different parts of my home. And if I walk into a room then a LED lights up on the board that has discovered my phone. If I walk out of the Bluetooth range, the LED should turn off.

I have tried the DomoticHome project with a router, but it's only for manual on/off and it's based on the Ethernet module.

I don't want to make an Android application from scratch, but I would like to take some existing open-source application that I could extend to use Bluetooth and/or turn on the LED automatically.

2

2 Answers

2
votes

Actually, you might skip that Android application requirement. Just make the Arduino board l2ping your phone by Bluetooth periodically and switch your LED based on success or fail.

As a side effect, you could automate with just any phone, that supports Bluetooth. But the devil is in the detail. It might be necessary to pair boards and phone initially.

Additionally, most Android phones switch off visibility after a minute or two. So you will have to check, whether a ping will work then. (I don't know whether l2ping is available on Arduino out of the box, but it should be portable easily.) Trying to open a Bluetooth port on your mobile device may be an alternative to l2ping. So a no-application-solution should be possible.

0
votes

Best way to do this would be using a handshake signal every 1 second or 2 seconds.. the bluetooth module should send HI if mobile receives that i should reply with HI.. Once the mobile does not reply it should turn the lights off.. If it receives the HI it should turn the light back on..I have a code that can connect to these bluetooth modules using serial communication..its very simple to use..i will check and send you the code.. All the best..