Using android GPS for Arduino - arduino

I'm currently doing my project on IOT.I need a GPS for that.I would like to use my Mobile's GPS for Arduino. How can the connection can be done?

Actually, your question is a little broad. But I would give you some tips to do it.
If you want to get your Android phone GPS data you need to create two apps; one for the Android side and one for the Arduino side. The procedure can be something like this:
Read Phone's GPS data based on what you need (E.g Lat/Long or other GPS parameters).
Create a JSON based on the data, e.g:
{
"lat": 1.234,
"lng": 5.678,
"speed": 100,
"hdop": 1.2
}
Send data to Arduino board through a proper connection (I will explain this).
Get data in Arduino board from the proper connection.
Parse received data (e.g JSON) and convert it to desired variables inside your Arduino code.
Continue your work with the received GPS data.
Let me explain a little more about proper connection. There are many options to do that. A simple option is to use Android Bluetooth and based on that on the Arduino side you need a Bluetooth receiver module which there are many out there like HC-05.
There are a bunch of tutorials to get a Bluetooth module working that you can find based on your Bluetooth module like this.
Another solution for the connection is to use wifi. For the Arduino side, you can use esp8266 and directly program it. There are some variants for it like Node-MCU
which has a builtin circuit to directly program it with an Arduino IDE software.
You can also go one step forward and use the newer ESP32 module which has both wifi and Bluetooth.
The good thing about using esp modules is that there are good APIs for creating your app and. You can find more about that on similar projects like here and here.

Related

Create the Pairing limitation on HC-05 sensor

I have been trying to set the limit of pairing the Bluetooth device HC-05(interface by Arduino controller) with my smartphone.
I have tried making this solution work with AT command
AT+INQM=<Param>,<Param2>,<Param3>
Example: AT+INQM=1,9,48\r\n
But instead of converting AT commands using serial.h with embedded C, I am looking for any dedicated library which helps to work this kind solution in using Arduino.
Basically, with the help of Bluetooth device connect to Arduino Nano, I want to send the altimeter sensor data to my smartphone.
During the connection, HC-05 should be responding any one device at a time, if another smartphone tries to pair then the error will be shown.
Please share your advice on this.
Yes there are some libraries in arduino but these are only meant for connection and pairing and low energy connections. We don't have any dedicated library from where we can control the mode of operation of HC05 or any bluetooth module. like bypassing or accessing GAP and GATT services of bluetooth. However there is a way to flash HC-05. But we can only use it for updating the firmware of this device. This github repo is dedicated for this purpose . Hope it helps you

how to communicate between openmote and arduino?

I'am working on an IOT project. The goal is to communicate between two openmotes (one is the server and one is the client). When the client receives some data, it is supposed to pass it to an arduino to activate different controllers (like a motor, some leds ...). So, I wanna send data from a openmote to an arduino. The idea is to use a bus. The openmote is the master and the arduino is the slave. Do you have any idea how to do this ? I can't find any documentation fro the open mote part. I thought about using the serial UART but i don't have any idea how to do that.
Thank you !
If anyone is looking for an answer, it is possible to activate the UART 1 on the open mote and to send data to the arduino using that bus. You have to pay attention to the speed you are using on both sides.You can refer to this file to see the functions to use: https://github.com/contiki-os/contiki/blob/master/examples/cc2538-common/test-uart.c

Arduino 101 and BLE

I'm using Arduino 101 and a HM-10 Module(BLE). I want to make an android app to send and receive data from Arduino via this Bluetooth module.
I was unable send data or receive data. I was able to connect to module.
Can you tell me a good tutorial how to do it? or to provide some useful information
I had to figure with the same problem currently on IOS, but i have found a good example Project to get startet. Look for one on the internet. Best is to look for a example that is basically a Serial Monitor/Terminal. After you have found your Example you should be able to modify it after your needs.

Best way to transfer data from Arduino to Server

I am new to Arduino and I would like to do a project that sends data, remotely. So, the Arduino would not be connected to Wifi/Bluetooth, Ethernet, etc. Would using a GSM shield be the best way to transfer data? I do not need to make phone calls or send SMS (unless sending SMS would be a better, more reliable, option) just data to a server, who's app I would create. If this is the best option, what else would I need to make this happen? For example, on top of the GSM shield (I am looking at something cheap like this: https://www.amazon.com/Geeetech-SIMCOM-Quad-band-Development-Arduino/dp/B00A8DDYB6/ref=sr_1_2?ie=UTF8&qid=1467651878&sr=8-2&keywords=Arduino+GSM+Shield) what other charges would I need to pay? I.E. would I also need to get another phone plan? Would I have to pay for a gateway service that would receive the cell phone data and then send it to my server?
Thanks your any thoughts on this
Wifi, ethernet or GSM, it depends on what you want to use, and what you have.
With all three you can send data to a server.
There is a bench of Arduino shields. All shields from Arduino come with a library to handle communication.
Other shields from other vendors exist and they provide their libraries too.
For Ethernet you can check the arduino shield https://www.arduino.cc/en/Main/ArduinoBoardEthernet.
For Wifi there are plenty. You have first the arduino shield. You can also take a look at the CC3000. Or the famous ESP8266. For all three you can find libraries.
For GSM, Arduino has a shield and a library. Arduino uses the Quectel M10 GSM moduel. You can find lots of examples in the arduino website and all over the net (https://www.arduino.cc/en/Guide/ArduinoGSMShield).
There exist other shields like the one you mentioned. Libraries does exist for those "other" shields however they are not as maintained as the arduino one.
You need to be careful though, you'll find over Amazon (and most likely on Alibaba) some GSM modules like SIM900A that are way cheaper, those are only dual band and will work only on certain contries.
There is another cheap GSM Module called the A6. It was made by espressif the company behid the ESP8266. It's relatively new and no library exist for it at the time. You can write you own functions to use it, but that would be some extra work.
In all cases, to use a GSM module you'll need a sim card with it's phone plan and all.
Another thing to consider is how to power these shields. They use more power than an Arduino can generate (A GSM modules datasheet recommend to use a power supply that can deliver up to 2A). If you power them straight from the Arduino, you may encounter some strange behaviour.
So the ideal way is to have for them an external power supply with the required amps and have a commun ground with the Arduino.

ESP8266 Point to Point communication with 2 arduinos

I am using 2 esp8266 wireless modules to establish bidirectional wireless communication between 2 arduino boards (one mega and one uno) without the use of any earth based technologies (i.e. radio frequencies, wifi which relies on earth sattelites, etc.). My solution was to use the esp8266 to establish a private area network with both esp's acting as a station and an access point (AT+CIPMODE=3). Unfortunately, this solution has proven to be more of a hassle than it was worth.
To start, I have the esp's each wired according to this diagram
When I first started out, the red LED was on and the blue LED was off. During this time, I was able to send AT commands, establish the server, and achieve the communication I required by entering commands directly to the serial monitor. After this, I started writing a library using the SoftwareSerial library to allow me to issue commands directly through the program to set up the esp as needed upon start up of my script. Before doing this, I changed the baudrate to make sure it was running at 9600, and entered the AT commands in the serial monitor to make sure everything was working properly and it still worked.
After I began writing the library, before uploading the code with a test of the library I noticed the blue LED was lit solid now. Noticing this, I reuploaded the barebones script (I haven't uploaded the library code to the arduino yet) and the esp was no longer receiving the AT commands.
Does this indicate an issue with the board which I can fix or does this mean the board is done?
With my deadlines approaching fast in about 3 weeks it is crucial I get this wireless communication working so if this is an issue with the board, I'm going to have to scrap the esp's and use a different way of communicating. So my second question is, if this is the case, what are other viable options for establishing this communication? I have used xbee's before and while that would be ideal, they fall out of the budget I have been alotted so I need to keep it under $50 for this. If bidirectional communication is not possible for that price I can live with one way because I just need to get this system working. Basically I just need to transmit a single byte of data.
I realize this response is a little belated, and I hope you got it sorted: I've started working with the ESP8266 myself in the last few weeks, and hence why I was looking around for tutorials on direct communication between 2 units, when I found your post.
From what I've been able to ascertain, the AT commands are a part of the 'firmware' which ships with some modules. The Arduino code however starts loading onto the chips at memory address 0x0000, which is the same address that the firmware update tools use.
In other words, I believe that with the Arduino-coded program running on there, you lose the AT command functionality.
If you find a firmware update tool for the ESP8266 (plenty online) you'll get back the AT commands.
I suppose though the real question is why would you want to? It seems that the AT commands are just a way to treat the ESP as a dumb WiFi antenna. With the Arduino code, you're actually treating it as a micro-controller in its own right.

Resources