I am trying to make an alarm that goes off when the bluetooth sensors goes out of range like some bluetooth speakers for an EDD class. I'm using an adafruit trinket 5V, a piezo buzzer, and a bluetooth le breakout board. I've been trying to figure this out but I am not good with bluetooth or the arduino IDE software. Please tell me if this is feasible and if possible how to do this.
Please tell me if this is feasible
Suppose that you have a blindfold on. Suppose that you are talking to a friend, and he leaves the room.
How do you know that that has happened?
Unless your friend makes periodic responses, and you miss a response, you will NOT know that your friend has left.
Unless the sending app is periodically sending data to the Arduino, you will not know that the sender has left the room.
Thank You
Do you have any tips on how to set up the code. I was going to use the trinket to control LEDs and the buzzer, the alarm I spoke of, and I was going to connect the bluetooth component to the trinket. How would I need to set that up?
I was going to connect the bluetooth component to the trinket.
Using one bluetoth device is like using one walkie-talkie. Pointless.
What is the other bluetooth device going to be connected to?
I was going to wirelessly connect the bluetooth component to a phone.
tgray2200:
I was going to wirelessly connect the bluetooth component to a phone.
Do you have some app on the phone that will periodically send information to the Arduino? If not, your friend is not talking to you, so you have no idea whether he is still in the room, or not.
Yes, I have an app that will connect to the component but I cannot figure out how to code the trinket to set off an alarm when this bluetooth is disconnected from the phone.
You are NOT listening. It is NOT sufficient that the app on the phone pair to the bluetooth that is connected to the not-an-Arduino.
The app MUST periodically send data to the not-an-Arduino, so that the not-an-Arduino can tell that the phone has gone out of range. It could tell that when some period of time goes by that is greater than the period between messages.
I understand what you are asking perfectly and the app sends a signal every 30 seconds, what i cannot figure out is how to make an alarm go off when this signal is not received.
tgray2200:
I understand what you are asking perfectly and the app sends a signal every 30 seconds, what i cannot figure out is how to make an alarm go off when this signal is not received.
So, you have some code that receives the "signal" (whatever that means; the device receives data, not signals). You should be able to note when the "signal" was last received, and you should be able to determine if now minus then exceeds some threshold. If it does, you should be able to make the alarm go off.
All I wanted to know was how to code the LED and the buzzer to go off at the same time like an alarm.