Hi, I am making a GPS localizing device for my dog. I am using Arduino NANO, Neo-6M GPS and SIM800L module.
The idea is that GPS updates position to google maps iOS url and store it in a variable text. GSM module checks for incomming messages and if message "Rotor" is received it changes boolean variable smsRequest to TRUE. Then smsSend function will know that it has to send SMS with GPS coordinates (text) to the sender.
GPS works alone, SIM800l works alone but I have no idea why they don't work together. Maybe there is some kind of conflict between SoftwareSerials. I have no idea how to repair it. I will really appreciate if you could help me out with it.
Only one instance of SoftwareSerial can listen at a time. If you want to just send SMS messages, you are OK. But, then you need to dump the RecSMS() call.
If you need to receive GPS data and SMS messages simultaneously, you need an Arduino (or variant) with multiple hardware serial ports. Quit beating your head against the wall trying to accomplish the impossible.
Thanks for reply! Is there any chance to use pins 0 and 1 for one of those devices and SoftwareSerial for others? What alternative to arduino Nano would you recommend? I need it to be small.
The SIM800 will pull it's RI (Ring Indicator) pin low when an SMS is received. You can use that as an interrupt for Arduino. So, wait till this interrupt happens, then switch to listening to the SIM800?
valdek737:
Thanks for reply! Is there any chance to use pins 0 and 1 for one of those devices and SoftwareSerial for others? What alternative to arduino Nano would you recommend? I need it to be small.
I use an Adafruit Trinket Pro 3V for a similar project. Do get an FTDI breakout/cable, else you have no serial monitor connection to your PC. FTDI is a lot more convenient for uploading sketches too. Trinket 3V wil run nicely on a LiPo battery too.
Thanks. I will consider using Trinket but I am not sure ATtiny will have enough storage for this program...?
I will order it and change votlage dividers to 3V logic. But until I receive it I will still try to make it work on Arduino. I will try to use Ring Indicator as you suggested. You think I should switch listening using "SIM900.listen();" ?
And for switching to SIM900 should I use
Your SIM800 board probably runs at 3V already, be sure to check that.. My GSM breakout has a VIO pin that you can put to 3V or 5V to tell it the logic levels used.
And no, the ring indicator pin needs to interrupt Arduino, not just read the pin. I think you need to do some studying on how interrupts work. It's not complicated, but you need to wrap your head around it... Especially when you have two devices to talk to with serial connections.
The trinket has The 328P processor, the same one as on the Uno, and the nano, I think, with 28k program memory and 2k dynamic ram. Don't let the size of the board fool you.
Thanks. I can't find any LoNet board available in Poland so I will go with the other one. What kind of power suply would you recommend? Phone/tablet battery?
I don't know how big your dog is, but mine prefers a small LiPo battery. I have a 550mAh one. For SMS only, smaller batteries may do too, not sure yet. Have a look at Adafruit fona too: Overview | Adafruit FONA 800 Shield | Adafruit Learning System That board is a bit big for my dog, so I went for the LoNet.
My dog is a pretty big guy (42 kg). I am going to power Arduino, Neo-6m GPS and SIM800L module with this battery and I would like it to work for at least 5 hours.
I am thinking about other possible solution. The major problem of mine was inability to simultaneous listening to GSM and GPS. I was able to send SMS and listen to GPS. So I can send GPS coordinates to previously defined phone number whenever Ring Indicator is pulled down. The problem is that I have to use my phone so when my wife or anyone else loses the dog while I am away they can't locate it.
I am thinking that maybe there is a chance that SIM800L could send coordinates to HTML file on a web server every minute and if the dog runs away anyone can access the website and check the position.
I hope this kind of HTML GPRS communication could work one way so listening to GSM SoftwareSerial port would't be necessary. For now I have no idea how to do it and how to setup my website but I will google it in a moment. That idea came to me a moment ago and I hope it is possible.
I use this code to turn GPS coordinates into iOS google map url:
It works pretty well on iPhone as it opens google maps app and shows a red pin.
I would like this kind of url text i.e. comgooglemaps://?q=50.234234,20.223423 appear on a specified website on my server.
For example I go to: www.myserver.com/dog.html and I see the map link I mentioned above.
Arduino has to update this link every minute somehow.
If anyone knows a similar project I could copy and modify please share
rickj:
I don't know how big your dog is, but mine prefers a small LiPo battery. I have a 550mAh one. For SMS only, smaller batteries may do too, not sure yet. Have a look at Adafruit fona too: Overview | Adafruit FONA 800 Shield | Adafruit Learning System That board is a bit big for my dog, so I went for the LoNet.
What micro controller do use with the Lonet? (sry for going off topic)