Bluetooth controlled robot - Updated, new video

 

This bot is remote controlled over Bluetooth using a Bluesmirf module. This works just like a wireless serial port.I have written a program for my smartphone which sends serial commands to the Picaxe via Bluetooth, and the Picaxe then moves the motors using an L293 motor driver chip.

Unfortunately the Picaxe doesn't have enough built-in PWM channels to drive the motors proportionally forwards and backwards so I wrote my own PWM routine. However this can't run in the background so there is a pause when the Picaxe waits for new commands. I've ordered one of these  http://www.pololu.com/catalog/product/1110 which should get around that problem. It has a Maxbotix EV-1 sonar on the front, this doesn't really do anything just now.

The program that runs on the phone is written in C# and can access the phone's built-in sensors (accelerometer, light sensor, compass, and proximity sensor). The robot can be controlled by tilting the phone forward to drive forward, left to turn left etc. The phone is a Samsung Omnia 2 running Windows Mobile 6.5.

This chassis is built from pizza-foam just to check it works, I've got some polycarbonate in the post which I'll use to built a better chassis.

Eventually I plan to add an autonomous mode where the readings from the sonar are reported over bluetooth and the program uses this and the phones sensors to navigate.

Video shows it as it is just now, definately improvements to be made.


 

Chench 

 

 


UPDATE

 

To get around the pauses in driving when the Picaxe was listening for input rather than doing its PWM routines, I got a Pololu dual serial motor controller. Because this just needs serial commands, i did away with the Picaxe and just wired it straight into the Bluesmirf module. Also, the Maxbotix EZ1 can report the range via serial. However, it does this in inverted TTL for RS232 compatability so I had to build an inverter circuit for it to talk to the Bluesmirf.

Also I've built a sturdier chassis.

In the video you can see my first autonomous function (maintaining a given heading using the phone's built in compass) along with remote control using the phones accelerometer like before (only a lot smoother now!).

 

 

 

Drives under remote control

  • Actuators / output devices: Tamiya twin gearbox, Tamiya tracks
  • Control method: Tilt sensor (accelerometer) in phone
  • CPU: Picaxe 18x / Smartphone's 800MHz processor
  • Operating system: Windows Mobile
  • Power source: 3 cell LiPo and Castle Creations regulator
  • Programming language: C# / Picaxe Basic
  • Sensors / input devices: EV-1 sonar (not implemented yet)

This is a companion discussion topic for the original entry at https://community.robotshop.com/robots/show/bluetooth-controlled-robot-updated-new-video

Nice use of the foam, keeps

Nice use of the foam, keeps things light!

Also nice use of the mobile device sensors to control the bot. I’ve started playing around with a droid recently and was going to do something similar. I actually found an app capped amarino which allows you to record data from an arduino to the phone.

I’m currious on how you do your com with the 18x as I ran into an issue with it being busy with other things and wasn’t sure how to get around it. I ended up using a 08m as a purely serial receive then using an interupt and send the command to the 18x. I worked out some of the kinks in this, but if you’ve found a better way, I’d love to hear it!! :slight_smile:

I like where your bot is going, I think this will be where a lot of people start going soon.

Cool. Yeah it seems like a

Cool. Yeah it seems like a lot of robotics stuff gets made for Android, there’s a guy on Trossen using a G1 to control a biped airsoft shooting robot, makes me even more tempted by the Nexus One!

Yeah, the problem is really that there’s only one PWM available, while there are two motors with two pins each to control! If I just set the pins high/low and then leave it then there’s no pause, but PWM runs in the background, so the Picaxe wouldn’t need to constantly loop and then stop for more commands. Actually it should be possible to do if there were two PWM channels, using one for each motor, and then when you wanted to reverse the motor you could set the other pin high and invert the duty cycle on the PWM pin . . .just thinking out loud here. I’m actually getting a dual serial motor controller to get around the problem. I may just link it straight to the Tx line of the Bluesmirf, and then it can take commands straight from that rather than the Picaxe telling it what to do.

Yeah I’d agree, I’ve seen quite a few similar projects and with the extra sensors that are getting built into phones, together with the internet connectivity and GPS etc. I think it’ll become an obvious step for those who already have such devices. It’s too bad that manufacturers don’t include hardware serial lines in the phones connector (the iPhone being the exception, but it’s lines can’t be used without jailbreaking and lots of knowhow) as that would avoid the expensive Bluetooth module if you wanted the phone mounted on the bot for autonomy rather than remote control.

Out of curiosity, have you
Out of curiosity, have you ever played with the cts rts pins on the blue smirf? From what I’ve read, you can use the pins or connect them when not used. I’ve tried looking for the signal on the rts pin but no luck and I’ve run it without having the cts/rts pins connected without issue. I tried looking at a config in the bt device itself but never found one. I tried using one of the other serial profiles called mdm spp but that didn’t seem to work either. Like I said, just thought I’d see if you had any luck or if you tried it.

Hi, no I haven’t tried them,
Hi, no I haven’t tried them, I’ve had them just connected together. Maybe if I got that worked I could use an interrupt when a new command had arrived. I think it’s something that needs to be done in the application that uses the port, you can set the state of the pins your C# program.

I’ve tried through hw and

I’ve tried through hw and just verifying it via the hw, but have gotten nowhere and yes if it worked i’d use it on an int as well…but I never got far enough with it. I’d tried using hw support on the computer site as well as configged on the uProc side but nothing… :confused:

I’ve tried looking for the signal with a configed interupt as well just to see if it was a fast blip, but then that doesn’t make sense. The pin should be pulled high/low until the cts signal also goes high/low.

that was awesome can u give
that was awesome can u give me the c# program

Code
Thanks. I’ll post the program and picaxe code once I get it working a bit better. I can only gaurantee the C# program runs on an Samsung Omnia II running Windows Mobile 6.5, but it should also work on any of their phones supported by the SDK - http://innovator.samsungmobile.com/prd/sym/product.list.do?platformId=2

code please.

can u post the code.