Hi,
I am building a follow robot and i finish the first part which is:
Control car from phone manually via bluetooth.
when sellect auto mode, car will follow my mobile coordinates thru gps.
I did first test and it was pretty okay for the 2nd option just i let car to come to me but was not able to follow as my mobile is not very precise on location.
But on my second try car went crazy, even on manual drive it was going arround like i was giving commands or event not listens to any command from mobile.
At home, manuel control works perfectly, but outside i was not able to control the car at all. i have also configure that if bluetooth state goes to disconnected, car should stop immidiatly. no such think happend also, it was running arround like a crazy.
So question is: can be a interference on Bluetooth ? if such think is possible is there any way to overcome ?
if Bluetooth is not a good solution, is there any suggestion for more reliable connection to car.
I attached also my mobile app i made with MIT APP Inventor.
Maybe it goes 'crazy' when its using the GPS, in that the GPS position it sees and what you mobile is sending are moving around quite a bit, which is to be expected.
You have the car so you need to check what are the positions its GPS is reporting and what is being received from your mobile.
Do you have code in the car program to stop the car if the Bluetooth commands fail?
It is a good idea to send a message at regular intervals (perhaps 5 per second) even if the data has not changed. The car can then be programmed to stop if (say) there is a gap between messages longer than the time for 5 messages to arrive.
Hi,
When I go Manuel drive, its not listening to GPS any more. its only listens the commands i sent from my phone, when i go auto drive then it starts to listen to GPS and act accordingly.
When I switch to GPS auto drive its works somehow but as said the car send me data that its accuracy is around 1 meter, but phone says its accuracy is more than 6 meter.
So as a result, on Manuel mode, no GPS interaction is done. it only listen to mobile commands from Bluetooth.
Robin2:
Do you have code in the car program to stop the car if the Bluetooth commands fail?
It is a good idea to send a message at regular intervals (perhaps 5 per second) even if the data has not changed. The car can then be programmed to stop if (say) there is a gap between messages longer than the time for 5 messages to arrive.
...R
I have control if i lost connection to Bluetooth, but no control on commands as you said, nice idea thanks. I filter messages on phone that if consequent message are same, i sent only once to avoid to much message sent and avoid Arduino to process same messages again again. I will check this Thanks
Also one update, I use HC-05 Bluetooth and GPS NEO 7M, it took me lots of time to make GPS work, but at the end it works only when connected to Serial port of the Arduino in my case. 0 and 1. so I connect the Bluetooth to some other pins with SoftwareSerial library. I read some comments that SoftwareSerial library is not very good but I don't know if this causes any issue. I am also at 80% full on Arduino usage. when I upload the sketch it says Arduino may not function as expected because of too much variable.
I am planning to upgrade project to use 2 Arduino and make the car 6x6 off road version. When i will switch to to 2 Arduino option, i will move all motor drivers and controls to 2nd Arduino, and all sensors and serial connections to keep on first Arduino. So this way memory usage will be lower hopefully.