Dicontinued – BT Bot Control & IPCam Bot – Android App to control Arduino Robots
BT Bot Control is an Android application that allows you to remotely control a micro controller-based robot using Bluetooth (i.e. Arduino). It also allows you to (optionally) view a video stream from an IPCamera mounted to your robot. This could be any type wireless IP camera or phone that has the ability to broadcast a video stream/images to the web. Example Foscam, Ai-Cam etc. If you are looking to control your robot over WiFi, check out WiFi Bot Control. *** BT Bot Control is no longer available.
- Use Joystick via finger movement, or the orientation sensor on your device. (default is Joystick mode).
- Ability to poll and display sensor and other data from your micro controller.
- Supports 8 individual commands via Command Buttons. 4 on by default. 4 more can be turned on in the Settings section.
- Sends the x/y coordinates as positive and negative integers based on 4 quadrants of the joystick. Data is sent via Bluetooth and can be parsed to set both direction and velocity. (sample code below)
- Coordinates are generated as X+/- and Y +/-. These are packaged and sent in the following format sX=val,Y=vale i.e. sX=75,Y=-55e where ‘s’ indicates the start and ‘e’ indicates the end.
- Command button values are packaged and sent in the following format: sC=[val]e i.e. sC=2e where ‘s’ is the start, ‘c’ indicates the a command button as pressed, ‘2’ is the value and ‘e’ indicates the end.
- Configurable Bluetooth packet send interval – used to set the speed (quantity) of packets sent. Default of 200ms works well.
- Shows video stream of IP Camera mounted to robot. (see FAQ below for important tips on getting your IP Camera working)
- Configurable camera URLs (3). Remembers last camera connection for easy re-connect.
- Configurable Bluetooth connections. Remember last Bluetooth connection for easy re-connect.
- Sample Arduino Sketch provided (below).
- Screen auto re-sizes for smaller phones.
- Supports any micro controller that can parse Bluetooth data (bluetooth module required).
- Should be compatible with other Bluetooth / Arduino modules such as the BLEduino, RFduino, Arduino Bluetooth Shields the Cortado, and many others. Please drop me a line if you get it working with other BT devices and I will update the list. Update (2015) – lately, a number of fully integrated Arduino/Bluetooth micro controllers have come to market via Kickstarter. This app is not particular. As long as the controller / bluetooth module can connect to your Android smartphone, this app will work.
Note on Lite version: The Lite version is a fully functional version. However, Bluetooth data will be sent as ‘9’s. i.e. s9,9e and c9e which will provide you with enough to determine if this app is right for you. If you like BT Bot Control, the Pro version has full functionality enabled with proper data, and can be yours for less than the price of a coffee. Also, you won’t be pestered by that start-up message either! We hope you agree that the features and functionality provided are well worth the pocket change. 🙂
Note on Bluetooth: The control distance is dependent on a number of factors including; your Bluetooth device range, battery power, obstacles etc. Typical distance for Bluetooth is 10 meters for most Bluetooth modules. However, higher classed BT modules could extend the range.
Get BT Bot Control:
If you are an existing BT Bot Control user, drop me a line on your project so I can feature it here.
Arduino Sample Sketches:
BT Bot Control – Recent Versions:
This version includes sample code to demonstrate sending data from the Arduino to BT Bot Control (you must have v 5.1.0 or later). It uses a Timer (library here) to call sending data every second (recommended).
- BT Bot Control Arduino Sketch (for BT Bot Control v5.1.0 or later)
BT Bot Control – Earlier Versions prior to v 5.1.0:
- Default Mode Joystick Sketch: BTBotControl12DefaultModeJoystick
- Simple Mode Joystick Sample Sketch: BTBotControl12SimpleJoystickSample
Note: For this project, I used a Digispark (Arduino-based micro controller). This sample sketch is targeted for a Digispark (ATTiny85), but was also tested on an Uno, so it should work for most Arduino’s. If using an ATTiny, remove any Serial.Print statements. Also watch the size of the sketch as there are limitations on the ATTiny85.
Displaying Sensor Data in BT Bot Control:
BT Bot Control (version 5.1.0 (14)) now has the ability to display sensor and other data from Arduino. Before getting into specifics, note that this feature is experimental due to the nature of both the joystick and sensor data using Bluetooth at the same time. Adding sensor polling may slow the robot’s response to joystick movements. Be sure to test this feature before implementing.
On the Arduino side, you need only add Serial.Print() commands to print sensor / data results to the serial port. The data also requires a start and end delimeter. For BT Bot Control, the “>” (start) and “<” (end) delimeters are uses. If you are passing more than one data item, each much be separated by a pipe character “|”. A simple single item example would be Serial.Print(“>MyData<“); This would display “MyData” once BT Bot Control has been configured. When enabled in BT Bot Control, the sensor / data information will show at the bottom of the main interface.
In BT Bot Control, go to Settings, check the box for “Enable Sensor / Data Polling“. This will reveal other options as follows:
- Manual / Timer base polling. In manual mode, you have to click the refresh icon that will be shown beside the data. Timer-based polling will automatically poll ever X seconds. The frequency can be configured by moving the slider (ranges from 1-30 seconds)
- Data Element Titles. This allows you to give each data element a title. If left blank, the app will use default values. i.e. Result =. To add titles, separate each item by a comma. i.e. Temperature =, Humidity =. Save the changes when done. Note that each title will be assigned to each data item parsed in the order it was passed. (example below)
Example Arduino code:
//Include and initiate the Timer library in the header section
#include “Timer.h” //get it here: https://github.com/JChristensen/Timer
//in the void Setup() section add the below code:
int sendData = t.every(1000, doDataSend);
//At the beginning of void loop() add:
t.update(); //timer for sending data
//The below flag is included in the code to stop data from being sent when data is being received from the joystick. It is highly recommended that this is include. The value is set to true in while(Serial.available() > 0) and set back to false after the motors are driven or turned off.
receivingCommands = true;
//Here’s a sample showing data being sent. Note that passed data must begin with a “>” and end with a “<” delimiter. All data sent via Serial.print within these delimiters will be passed to BT Bot Control.
//TESTING PRINTING SENSOR DATA TO BT BOT CONTROL
Serial.print(“>”); //Start of String
Serial.print(“|25° C”); //degrees = ALT + 0176
Serial.println(“<“); //End of Content
//END TESTING PRINTING SENSOR DATA TO BT BOT CONTROL
Based on the above example there are 2 data elements being sent. If you did not configure any titles in Data Element Titles, the results would look like this: Result = 75° Result = 45% If you added two titles; Temperature =, Humidity =. You would get Temperature = 75° Humidity = 45%
Note: During testing, it was observed that a sketch that ran very fast (i.e. with little delays), would not render data well to BT Bot Control. If this happens, try adding delay (100); or more to your code. Also note that this will affect the joystick commands and how the robot is driven. Alternatively, you can get creative by having the sensor data only send every x cycles (i.e. if your delay is 10 ms, put the sensor data print commands in a function and call them every X iterations. I suggest having them sent every 1 second.
Note that any Serial.Print command that is placed within the “>” and “<” will be parsed by BT Bot Control and displayed.
Bluetooth Wiring for Arduino (Nano)
Video: BT Bot Control In Action
Video: BT Bot Control Bluetooth Connection Testing
Pictures of CamBot:
Check out Umur’s Omnidirectional Bluetooth Controlled Robot:
Check out Jon’s Place for a very cool 3D printed roboot.
add wifi support and I will bite.
Done. Check out WiFi Bot Control
sorry forgot to post this dont see an edit button so here goes.
someone has to make a little wifi bot with one of these and if you guys support it all the better.
BT Bot Control seems to work ok, I even got it working with the Android IP webcam app;-) The URL to use is http://:/jsfs.html , that seems to work.
Glad to hear you find the app use full.
One improvement suggestion: Can you keep the screen on when the `motion sensor’ is selected. In that case, I don’t need to touch the screen and it goes dark eventually:-(
Thx for the comment. I am not sure about this, but there are limits over what ‘influence’ developer can have an a users’s device. This may be one of those items that is left to the user to modify as opposed to an app changing default device behavior. Although I would want the same thing, it is akin to an app not allowing a PC’s screen saver to come on. Probably breaks some rule somewhere. 🙂
Something like described @ http://stackoverflow.com/questions/3723634/how-do-i-prevent-an-android-device-from-going-to-sleep-programmatically
Problem is, I don’t have access to the entire API due to the development environment I used to make the app.
Great app! or it would be if I could get the bluetooth to work. it comes up with “need BLUETOOTH_ADMIN permission: Neither user 10156 nor current process has android.permission.BLUETOOTH_ADMIN” which is a bit of a shame
Thx for the comment. BT Bot Control will attempt to turn Bluetooth on if it is off. However, you must a) your device must have Bluetooth and b) ensure it is working correctly. Sounds like you need to fix the Bluetooth issues on your device first.
Hey Dave, thanks for the reply. No the bluetooth on my device works fine, I have used many other bluetooth control (BT-Bots for example) apps. If you google the error, you’ll see its something to do with a description in a configuration file in the app. It seems like something you need to configure in your development system or something.
Please contact me offline so we can get to the bottom of this. picoware at gmail dot com.
I am going to begin a project soon and wanted to know if this will work with an arduino uno with an arduino motor shield by changing the pins for motor direction and speed to match those of the motor shield?
The sample code provided uses the digispark motor or shield which has 2 pins for speed, and 2 for direction. If this is the way the Arduino motor shield is setup, then it should be plug and play. Else, you will have to modify the sample sketch. Don’t forget that you need a Bluetooth module as well.
very nice keep it up where can I get full sketch.mail me
Not sure what you mean by “full sketch”. The entire sample Arduino sketch is available for download on this page.
very good projects .keep it up .
Thanks for putting this together Dave ~ bought your app and used your digispark idea to build out a smaller version (rover) that I hope to launch on a high power model rocket at some point. Great support too ~ patient and quick replies!
Hi Dave. I bought this application and it work very nice. Is it possible in a future update to include user defined labels for the 8 buttons?
Also, is it possible to receive data from the bluetooth module. Just a few field were we can receive for example battery information and sensor readings?
Thanks for purchasing BT Bot Control. Glad you like it. I considered user-defined labels for the 8 buttons. Issue is that there is not a lot of room on small screens for this, and BT Bot Control is made to work on small to large screens. If there is enough demand, I’d look at some alternatives for larger screen devices. The idea for receiving BT data is also one I considered. If there is enough demand for it, I’ll consider some sort of ‘response’ box. Again, real estate is at a premium on small devices. 🙂
How can I connect to my ip camera? I have entered the camera URL in the form http://192.168…. but I cannot connect to the camera because it asks for a login.
Where do I enter the login info ?
I can see the IP camera interface and feed using firefox and the same URL but I cannot connect using you app.
I have looked at the FAQ and tried what is juggested, but still nothing on video feed. I also went ot ispycoonect.com and found my camera (wanscam jw0008). tried the suggested url layouts but still nothing. How can I contact you offline ?
if it needs a password
well that is what works for my camera
Hi, I just bought your app and after modifiying the arduino sketch to work with servos, I am able to control my little robot. The app acts a little funny sometimes, like lagging behind with the joystick inputs and then trying to catch up by moving the joystick by itself (and eventually crashing in the process). I also noticed, if you release the joystick, the zero position is not transmitted over bluetooth. You have to move the joystick to the zero/middle position with your finger and it is hard to hit the center, exactly.
Otherwise a great app, my son is having a ball with it. 🙂
Hey there.. Good to hear your son is having fun with the app. Some thoughts:
– When in the normal mode, the joystick should always bounce back to center when you let go of it. I have not heard anyone else have this issue. Are you sure you are not in Orientation mode?
– regarding the lag – this could be due to the speed of Bluetooth or quality of signal to the BT receiver you are using. Since you mentioned the catching up piece, this sounds like something you could try to tweak in the Arduino app as it appears the Android app is doing its job (sending all movements as you move the joystick). It seems like the Bluetooth buffer on your Arduino is where you need to check as it is simply executing the commands you have sent that built up in the buffer. Did you change any of the delays in the sample app? Check that, or consider shortening the delays.
hi just starting with arduno have a rover with plans for a basic arm this looks grate but ive used servos for my drive as thay are what worked for me and onley nead one I/o pin. any chance of a mod to the scech as Im having trubel under standing parts of code and others may go doune the same root
A sample sketch has been provided. You can modify it any way you wish. Just make sure you keep the bit that brings the data in via Bluetooth.
I have tested your BT Bot Control app for Android and I always get the value x=9, y=9, c=… I forgot the value for c, maybe 1 if I’m not mistaken.
But I always get the fix value no matter what x-y and buttons combination I move or press.
Where can I get the previous version? I am glad that you add wifi camera viewer in your app and that’s what I barely needed.
Thank you in advance.
It sounds like you are using the free version. Please read the instructions on the Google Play listing (you need the Pro version).
Ups… Yeah.. My bad. I’ve just read it over. Well, then I should play with the 9’s first omitting the analog speed control ^_^ Thank you.
Hi, i thought it was the RX of the bluetooth that needed to be protected by the voltage divider?
Yup, you can do. See this post. I like to play in the danger zone! 🙂
Hola,en principio con una camara ip mas viejita me había conectado sin problemas por la url http://192.168.1.. y ahora con una camara ip p2p no consigo por ningún medio conectarme, me dice que no estoy autorizado, que necesito usuario y contraseña, pero no me presenta ningun medio para ingresarlos.
Con otras aplicaciones de camaras me puedo conectar perfecto. Como puedo hacer? gracias Lucas
thanks for your application now it being connected in arduino it already communicate i just want to ask what pin number will be use for motor shield
Not sure I follow the question, but the pin numbers are identified in the code near the top. There are 2 – 1 for each motor. Being Arduino, you can change it to whatever you want based on the hardware you implement. This project is not just for the hardware I noted in the write-up. 🙂
someone help me please . i am beginner and i am work on Robot remote control & IP Cam viewer via WiFi and Bluetooth . but i have arduino uno and i need a default code for simple code modified for Uno .
The example provided here should work with the Uno as well.
i need Default Mode Joystick code for arduino Uno stp !!
The sample is included in this blog posting…
Would there be BT l298 motor controller sketches available ?
Hi. I don’t have anything other than what is there now. That said, it should be easy to modify. I suggest you look up some sample sketches for this controller, then modify the sketch I provided with the correct libraries and calls.
I have built a small tracked rover running an UNO R3 clone with generic servo/connector shield, and have used many differing way to control it; Your BT Bot Control is my favorite! (I purchased the Pro).
It took me awhile, but I finally (coding is not my forte) figured out how to control a servo (for high low gear) and a LED light using the numbered buttons and everything seems to work fine… except I have recently noticed that when “steering” the bot in any direction for more then a few seconds (Typically forward, but sometimes rotating left or right)… it seems to lock into that mode and I have to chase it down to reset it. Disconnecting and reconnecting the BT has no effect, only the arduino reset button.
To help in my troubleshooting, I am thinking of putting in an LED that will briefly flash on and off as the code cycles through (thus looking lit when code is properly cycling and off if the code locks), but I am at a bit of a loss in determining where to put that simple On/Off command that will show what I want without causing a lag or false indication. Any ideas? Thanks.
There could be a couple of reasons for this:
1) Insufficient power to the bluetooth board – degradation of signal. Also 30m is the limit with BT devices.
2) Sketch loop/processing time – it takes time for the bluetooth stream to be read, parsed, and executed. Make sure you have sufficient time between loops to allow for the data values to come through and do their thing. I suggest slowing down the loop and seeing if this makes a different.
Hello Gunner, Can you help me, on how you programmed the code to use the 1-8 buttons? i’m trying to include some servo’s and led light as well..
Hello Plastic Bot, Can i have the electrical diagram… how you connected the pins? Which pins to which pins? Thank you.
Its very confusing and the programming is hard as well..
Would be glad iif could help a lil bit…
Looking forward to it.
Thanks for Your work on all projects!
I just got tank chassis for experiments, and now I am considering to try Your APK and Arduino code. I see from pictures You use hacked servos as motors. Could you please provide some hints and suggestions how to adapt code for popular motor drivers L293, L298 ? I would much appreciate any help. Thanks in advance!
Hi. …and thanks. Adapting should be easy.. There should be plenty of code samples / library references on Arduino.cc for various motor drivers you want to use. After implementing any require library, it’s likely 1-2 lines of code changes for each reference to the motors. The flow of the code should remain the same, just how you send direction and speed data to the drivers will change.
Thanks for the reply Dave, and sorry for really late response… health issue have been plaguing my ability to concentrate on learning Arduino code.
I guess I need to clarify, I wasn’t having any issues until I hacked in the button control; I am not even sure how, as that was awhile ago, but I apparently broke something in the timing as power distribution is discrete and stable to both Arduino and motor controller, and the range was within 10m.
Anyhow, I reverted back to your original code, so now I guess I need pointers on the PROPER way to utilize the existing buttons (that currently don’t seem to do anything??) to control digital pin output for servo and/or switching control. Thanks.
Well, you can disregard my request 🙂 After much comparison between your versions, I was able to break the code down and modify your ver.5.1.0 example for my L298N motor controller, tweak the joystick dynamics for smother straightaway and quicker extreme turns, as well as controlling a servo for gearing and a headlight on my tracked robot… and best of all, it no longer “locks up and runs away” once I determined proper timing 😛
I haven’t fiddled with feedback to the controller yet, but time will tell.