Lambo15
Posts: 5
Joined: Fri Dec 07, 2018 12:16 am

Help: Raspberry pi alarm using gps

Fri Dec 07, 2018 12:24 am

So the goal of the project that i am trying to do is to set up a raspberry pi that alarms when you arrive at your destination. It will use your phone's gps to know whether you have arrived to your destination or not. I am completely new to raspberry pi so i would like to ask for help on how i can do this and how to code. Preferably, i would like to use python and raspbian to do this project, but if it is easier to do it using other software, i would gladly do so. Thank you.

User avatar
bensimmo
Posts: 3589
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Help: Raspberry pi alarm using gps

Fri Dec 07, 2018 7:57 am

Why are you using the Pi, if you are already using the phone?
Do it all on the phone.
..or look in front of you ;-)

Or am I missing something in the setup?

So is this,
for example, this a central Pi at home and you are monitoring if the family members get to their destimation.
Or perhaps a supervisor in a shop that does deliveries and you're seeing if the deliverer has arrived at the house to deliver it.

PhatFil
Posts: 764
Joined: Thu Apr 13, 2017 3:55 pm

Re: Help: Raspberry pi alarm using gps

Fri Dec 07, 2018 10:16 am

I agree just use the phone, for the remote pi server concept, getting the phone to publish a mqtt topic/payload to a public/cloud broker to which your pi can subscribe to should be all you need do.

perhaps you need to clarify your requirements

hippy
Posts: 4225
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Help: Raspberry pi alarm using gps

Fri Dec 07, 2018 12:58 pm

TL;DR: Yes, it can be done.

You can write a phone app which monitors the GPS and reports that via Bluetooth or Wi-Fi to a Pi, have a Pi app which receives that, compares co-ordinates to your destination and can set off an alert when you get there.

But, as others have said, you could do that co-ordinate comparison within your phone app and have it completely self-contained.

The best reason for adding a Pi into the mix would be if you were not writing your own phone app but were using something someone else had provided which used Bluetooth or Wi-Fi to deliver that data. That could also potentially cater for the case where whatever was providing GPS was not a phone.

How best to do it, what code is required, would depend upon what you have or will be using.

Lambo15
Posts: 5
Joined: Fri Dec 07, 2018 12:16 am

Re: Help: Raspberry pi alarm using gps

Fri Dec 07, 2018 1:18 pm

Uhm... I totally agree that it woulf be more convenient if i were to just use the phone, but you see, the goal of the project is to have a raspberry pi communicate with a phone then have the raspberry pi produce something (alarm) as a result of that connection. It also occured to me if would just be easier to create a phone app then have the Rpi alarm once i arrive at my destination. Sadly though, i dont know how to create the app nor the Rpi code to do it. Please help😅. Sorry for the inconvenience😅
-ps. This idea was made for people who commute so that if the ride is long, they can sleep without fear of going past their destination. The raspberry pi and alarm is to be placed in a neck pillow lol😅

hippy
Posts: 4225
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Help: Raspberry pi alarm using gps

Fri Dec 07, 2018 2:00 pm

Lambo15 wrote:
Fri Dec 07, 2018 1:18 pm
-ps. This idea was made for people who commute so that if the ride is long, they can sleep without fear of going past their destination. The raspberry pi and alarm is to be placed in a neck pillow lol😅
Sounds like a good idea, and a valid reason for splitting the functionality.

I am not however convinced the Pi is the most appropriate device for that because it is not designed for either low-power operation nor battery powering. Some phones may not be suitable either if their GPS has to be left on if that draws a lot of power.

And bear in mind that anything intended to be placed under a pillow should be safe for doing that. Especially if this is intended to be a sold or commercial product rather than just something for yourself.

Despite all that you can build a prototype or proof of concept. But you will need to indicate exactly what you are using before anyone can really help you with that.

User avatar
bensimmo
Posts: 3589
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Help: Raspberry pi alarm using gps

Fri Dec 07, 2018 2:11 pm

Use python on Android, Pydroid3 for example.
It's easy to use the GPS from that.
Pick communication method and data transfer, pass the destination and location somehow.

Bluetooth seems viable as both can have it and it is wireless

Use Python3 on the Pi to get the data.
Do some checking and job done, activate the vibrator and buzzer.

How many marks does that get me ?


Or do it all in Pydroid3 and have the phone buzz and make a sound, stick that in the pillow.
It comes with a battery too.

Lambo15
Posts: 5
Joined: Fri Dec 07, 2018 12:16 am

Re: Help: Raspberry pi alarm using gps

Fri Dec 07, 2018 2:15 pm

Our professor said that its alright even if an actual prototype is not made. As long as i can have the raspberry pi alarm when i arrive at my destination which is determined by my phone. Is there any tutorial as to how to create a phone app that uses gps that will send a signal to a raspberry pi to alarm once you arrive at your destination? Or maybe even just a tutorial on how to code the pi so that it receives a signal from the phone and then it will alarm once a condition(location) is met?

Lambo15
Posts: 5
Joined: Fri Dec 07, 2018 12:16 am

Re: Help: Raspberry pi alarm using gps

Fri Dec 07, 2018 2:21 pm

bensimmo wrote:
Fri Dec 07, 2018 2:11 pm
Use python on Android, Pydroid3 for example.
It's easy to use the GPS from that.
Pick communication method and data transfer, pass the destination and location somehow.

Bluetooth seems viable as both can have it and it is wireless

Use Python3 on the Pi to get the data.
Do some checking and job done, activate the vibrator and buzzer.

How many marks does that get me ?


Or do it all in Pydroid3 and have the phone buzz and make a sound, stick that in the pillow.
It comes with a battery too.
Thank you! 😊 Ill check it out😊

hippy
Posts: 4225
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Help: Raspberry pi alarm using gps

Fri Dec 07, 2018 2:25 pm

hippy wrote:
Fri Dec 07, 2018 2:00 pm
And bear in mind that anything intended to be placed under a pillow should be safe for doing that.
Note that also means that a Pi with Wi-Fi or Bluetooth has to be kept at least 20cm away from a person's body to ensure FCC regulatory compliance -

https://www.raspberrypi.org/documentati ... 3b_FCC.pdf

There are likely similar requirements under other regulations, and those likely also apply to some degree to mobile phones.

hippy
Posts: 4225
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Help: Raspberry pi alarm using gps

Fri Dec 07, 2018 2:35 pm

Lambo15 wrote:
Fri Dec 07, 2018 2:15 pm
Is there any tutorial as to how to create a phone app that uses gps that will send a signal to a raspberry pi to alarm once you arrive at your destination?
You haven't said what your phone is. If it's an Android phone you can use MIT App Inventor 2 to easily access the GPS or Location data and send that or an alarm signal via Bluetooth or Wi-Fi.

You can find examples and tutorials at http://explore.appinventor.mit.edu and via a search engine.

There are examples and discussions on receiving data on a Pi from a phone on this forum and more which can also be found using a search engine.

Lambo15
Posts: 5
Joined: Fri Dec 07, 2018 12:16 am

Re: Help: Raspberry pi alarm using gps

Fri Dec 07, 2018 2:44 pm

hippy wrote:
Fri Dec 07, 2018 2:35 pm
Lambo15 wrote:
Fri Dec 07, 2018 2:15 pm
Is there any tutorial as to how to create a phone app that uses gps that will send a signal to a raspberry pi to alarm once you arrive at your destination?
You haven't said what your phone is. If it's an Android phone you can use MIT App Inventor 2 to easily access the GPS or Location data and send that or an alarm signal via Bluetooth or Wi-Fi.

You can find examples and tutorials at http://explore.appinventor.mit.edu and via a search engine.

There are examples and discussions on receiving data on a Pi from a phone on this forum and more which can also be found using a search engine.
The phone I am using is an OPPO A83.
Thank you also for the link. I'll keep the distance between the phone and Rpi in mind. 😊

Return to “Automation, sensing and robotics”