PopPet is a robot kit developed by Jaidyn Edwards. In collaboration with Jaidyn, I’ve been working on an app for use with PopPet. This app was designed for use with PopPet 2.0, but I’ve been testing it with my modded Kickstarter PopPet.
You can find out more about PopPet here: http://www.poppettherobot.com/
The app lets you:
– Drive PopPet around (app works like a remote control)
– Give PopPet voice commands
– Tell PopPet to drive around autonomously and explore
The artwork in the app was created by Jaidyn Edwards.
Jaidyn will be demonstrating this and PopPet 2.0 at the “Adelaide Mini Maker Faire” (in Australia) this weekend (Sun 1 Nov, 2015). So, go check it out if you can!
Where to Get the Code
You can get the Arduino code from GitHub:
You can get the app itself from Google Play:
Some Technical Details
The app is based on the stuff I did with my MobBob and Sphero Companion projects, so it shares some similar features.
For anyone familiar with how MobBob works, MobBob’s Arduino code accepts text-based commands over bluetooth. For example, the command to walk forward 1 step looks like this <FW,1>.
To support PopPet (and other wheeled robots!), I wrote a new Arduino program that accepts a new wheel-based command set:
<DW,#,#> – Drive Wheels where the parameters are motor speeds for each wheel
<LW,#> – Set the speed of the left wheel only
<RW,#> – Set the speed of the right wheel only
I’ve also added commands for some of PopPet’s Ultrasonic Sensor:
<UA,#> – Turns the Ultrasonic Sensor on/off
<US> – Requests an ultrasonic sensor reading.
And I’ve also added a command for the explore mode.
<XA,#> – Turns explore mode on/off
While explore mode is activated, PopPet will send the following response codes to let the app know what’s going on:
<XO> – Encountered an obstacle
<XC> – Changing direction just for fun (got bored going straight)
Initially, I didn’t put the explore mode in the Arduino code. I first tried to do it all on the app. The app would receive regular sensor readings, and then adjust PopPet’s course.
After some testing, I found that doing it that way had too much lag… Sometimes PopPet would hit the wall before he received the commands to back up and turn. I’m pretty confident the lag can be reduced by tweaking some of my delays between sending/receiving commands. (I’m probably overly paranoid about not spamming the serial port with commands… I think it can handle much more than what I’m throwing at it.) If I play with these settings, an app-side explore mode should work fine.
However, I decided to change tactics and put the explore mode into the Arduino-side code. This has a few advantages:
- PopPet can continue to explore even if you turn off your phone (after you’ve started the explore mode)
- The app is freed from driving and can do other stuff! While in Explore Mode, PopPet sends status codes <XO> and <XC> to the app to let it know what’s going on. Since the app isn’t busy driving PopPet, it has time to handle these status codes and react. In the current version, I have PopPet occasionally saying something (E.g. “Something’s in my way”, etc) in response to these codes. I found this can be a bit annoying, so I also added an option to turn off the explore mode narration! 🙂
Because this command set is pretty generic, it should be applicable to most differential drive robots… So, this Arduino code and the App should work with other differential drive robots!
If you are using a Dagu Mini Driver as the microcontroller, you can probably run my code as is and it’ll work… If you are using a different microcontroller and motor-controller, you may need to make some small changes to the pins, etc.
You’ll also need to have a bluetooth module connected to your microcontroller!
The Android app is based off a similar code-base to my other apps. I’ve tested with Nexus 5, Nexus 6 and a Samsung S6. It should work with other phones too.
You need to have the phone language sent to English for the voice recognition to work. Also, if voice recognition is not working, check if voice recognition is working in Google Now’s voice search. (If it’s working there, it should work in the app.)
This project was done for Jaidyn’s PopPet, and the artwork matches PopPet’s web page, etc.
However, since the Arduino code and App are compatible with most differential drive robots, I will be releasing a non-PopPet-specific version of the app at some point (when people request it, or when I need it for my own projects… whichever comes first).
This work provides an easy way for robot builders to add a remote control and voice recognition to their robots! 🙂
As always, feel free to post comments if you have any questions or would like more information! 😀