Notification bluetooth sur Android

Hello,

To explain my project: I try to receive a notification on my phone in bluetooth when a movement is detected in a room.

For this: I have a pir sensor and an HC-06, I create the program that can detect the movements and send a message in a bluetooth terminal when a movement is detected.

My question is: How to receive a notification instead of a simple message in a terminal?

Thanking you in advance ! :slight_smile:

Lucas

I suspect a simple message is all you are going to get from Arduino via Bluetooth, and it is down to you to programme your phone to interpret that message in the manner that you want.

Thanks a lot for your answer !
I am not an expert in mobile programming. Do you have any idea how to proceed?

Thanks,
Lucas

lucas9442:
To explain my project: I try to receive a notification on my phone in bluetooth when a movement is detected in a room.

For this: I have a pir sensor and an HC-06,

As Bluetooth has very short range won't you have to be in the same room where the movement is happening?

...R

Robin2:
As Bluetooth has very short range won't you have to be in the same room where the movement is happening?

...R

Agreed, I think lucas should use a esp8266 instead, or maybe a SIM module to handle this. Otherwise looks a little too short ranged to me too.

Robin2:
As Bluetooth has very short range won't you have to be in the same room where the movement is happening?

...R

Yes, but it's not a problem, my phone will stay in the same room than my Arduino. And i not have a wifi shield.

(I'm French, sorry my english is not perfect) :wink:

Lucas

lucas9442:
Yes, but it’s not a problem, my phone will stay in the same room than my Arduino. And i not have a wifi shield.

(I’m French, sorry my english is not perfect) :wink:

Lucas

It’s okay to have a little shabby English, no problem on that part. I don’t see the point of your project if your phone is going to stay in the same room with the arduino, but I think it’s achievable. Arduino side shouldn’t be that hard actually, but you need a little mobile programming to handle the phone side for sure.

Side programming of arduino I have no problems. It is more the programming of the telephone which is complicated.

My project in detail: My boss would like me to make him a painting that speaks when someone approaches (yes it’s original).
I programmed my phone to play the music at the reception of a notification.
All I have to do is receive a notif when the PIR sensor detects a movement.

RabbitTheDevil:
Agreed, I think lucas should use a esp8266 instead, or maybe a SIM module to handle this. Otherwise looks a little too short ranged to me too.

Yes, i think i will try with a esp8266.

lucas9442:
My project in detail: My boss would like me to make him a painting that speaks when someone approaches (yes it's original).

Why use a phone then? Just use an Arduino, an MP3 Shield with that and when you detect a movement on PIR sensor, pick one of the pre-recorded MP3s and play it. Do you really need to voice to come out of your phone?

lucas9442:
Yes, i think i will try with a esp8266.

This will still require you to do a little bit of mobile programming. But your project doesn't look like it really needs a phone.

RabbitTheDevil:
Why use a phone then? Just use an Arduino, an MP3 Shield with that and when you detect a movement on PIR sensor, pick one of the pre-recorded MP3s and play it. Do you really need to voice to come out of your phone?

Because I need a speaker flat enough and small to get into the painting.
Yes but the arduino mp3 shield has not a small speaker ?

The sound should not necessarily come out of a phone but a small enough to enter in a painting

lucas9442:
Because I need a speaker flat enough and small to get into the painting.
Yes but the arduino mp3 shield has not a small speaker ?

The sound should not necessarily come out of a phone but a small enough to enter in a painting

Then you need a small speaker with a 3.5mm connector. If I were you I'd completely ditch the phone, get a small enough speaker with 3.5mm adaptor, connect it to an MP3 shield and hide these all behind the painting. MP3 shields usually have their own SD Card adaptor as well which makes sense for you because you somehow need to store your MP3 formatted voice files.

EDIT:
Actually you don't need 3.5mm connector, I just checked SparkFun's MP3 shield and it has places that you can connect a right and a left speaker with ground. You just need to find a flat enough speaker for this project. Here is the link, and I'm sure you can find a copy of this for cheaper:

EDIT 2:
This one might be even better for your application, check this one out as well please:

lucas9442:
My project in detail: My boss would like me to make him a painting that speaks when someone approaches (yes it's original).
I programmed my phone to play the music at the reception of a notification.
All I have to do is receive a notif when the PIR sensor detects a movement.

That gives me much clearer concept of your project. You should have said that in your Original Post.

If you are using the phone to play music then it does seem to me both practical and sensible to use an Arduino to send it a Bluetooth message when the PIR detects movement. (However I am not contradicting those who have suggested the alternative of an MP3 shield.)

You will need to create the Android program (I'm assuming you have an Android phone) to receive and interpret the message from the Arduino and creating an Android program is outside the scope of this Forum.

...R

RabbitTheDevil:
Then you need a small speaker with a 3.5mm connector. If I were you I’d completely ditch the phone, get a small enough speaker with 3.5mm adaptor, connect it to an MP3 shield and hide these all behind the painting. MP3 shields usually have their own SD Card adaptor as well which makes sense for you because you somehow need to store your MP3 formatted voice files.

EDIT:
Actually you don’t need 3.5mm connector, I just checked SparkFun’s MP3 shield and it has places that you can connect a right and a left speaker with ground. You just need to find a flat enough speaker for this project. Here is the link, and I’m sure you can find a copy of this for cheaper:

SparkFun MP3 Player Shield - DEV-12660 - SparkFun Electronics

EDIT 2:
This one might be even better for your application, check this one out as well please:

https://www.sparkfun.com/products/14810

I think the solution with MP3 shield is easier because the Android program is difficult for me. (I have 0 knowledge on android programming, so i prefer avoid that ^^).

Is there a software that allows me to simulate this system ?? I would like to avoid buying the components if it does not work.

Robin2:
That gives me much clearer concept of your project. You should have said that in your Original Post.

If you are using the phone to play music then it does seem to me both practical and sensible to use an Arduino to send it a Bluetooth message when the PIR detects movement. (However I am not contradicting those who have suggested the alternative of an MP3 shield.)

You will need to create the Android program (I’m assuming you have an Android phone) to receive and interpret the message from the Arduino and creating an Android program is outside the scope of this Forum.

…R

How to receive and interpret a message sent in bluetooth?
All I can do is receive info on an android terminal via an application.

if you have tutorials, … I take ^^

lucas9442:
if you have tutorials, ... I take ^^

Like I said earlier, this is not the Forum for Android programming.

You can program an Android device using Python with QPython. That's the extent of my knowledge.

It would probably be easier with a MP3 shield.

...R

lucas9442:
Is there a software that allows me to simulate this system ?? I would like to avoid buying the components if it does not work.

I don't think there is a software for that, you might need to go trial and error on the connection side, but well it's a shield so you really really shouldn't be able to see the magic smoke easily, it just sits on top of the Arduino. I mean you can't really jam it in sideways or something. The problem is, I'm not exactly sure if the speakers will be loud enough. Other than that, those shields have their own libraries, so it really shouldn't be that hard to code.

Thanks for your help :wink: I have create an application with appinventor and it's ok ^^