The RoboPony – An overview of the hopes and dreams of this artificial miniature equine

Good afternoon, fillies and gentlecolts!

After my successes yesterday with getting the Raspberry Pi to control the servos, I’ve decided to do a bit of a run-down on just what the RoboPony is, and what I hope it will do.

The RoboPony is exactly what it sounds like – A robot pony. A walking, talking, robot pony. Well, hopefully walking. It’ll have articulated legs and head, but I’ll be honest – I’m not 100% certain that I will be able to make it walk. However! As with everything else we make here, the code will be open source – If I can’t make it walk, I’m sure someone will. And the design should be easy enough that even the non-technical people should be able to update the code fairly easily.

I had the concept of the RoboPony a few months ago, but mostly as a “Wouldn’t it be cool to do this?” idea. At that time, I was thinking of using an Arduino and an Emic2 text-to-speech card. At the time, that was easier for me to code and a bit cheaper to work with than, say, a Raspberry Pi.

Then, in November, the Raspberry Pi Zero came out. That literally changed everything. Instead of a $50 Emic board plus whatever Arduino board I would have to create, along with the servo control and sensors, I’d be able to use an off-the-shelf (And free!) text-to-speech program on a $5 computer, along with a companion board that would have all of the additional things anyway. The Raspberry Pi can run Python, which is the only programming language I can claim any sort of proficiency with (Even then, though, I’m not a stellar programmer. I can get Python and Arduino programs to work, but it’s not exactly graceful).

I then began figuring out just what I could do with a Robot Pony. I’ve settled on a few things for it:

  1. PCA9685 I2C PWM/Servo Controller. This allows me to control the 10 servos for the RoboPony, along with the RGB LEDs for the pony’s eyes.
  2. MCP 3008 Analog-to-Digital Converter. This connects to the IR Rangefinder mounted in the RoboPony’s head, and also allows for monitoring the battery voltage levels.
  3. ADXL345 I2C Acceleromoter. Because of the components involved, this will be the Adafruit Board – A few of those components are a bit difficult to solder by hand, and I don’t have the tools to do anything but solder by hand. It’s also an I2C device that has a nice Python tutorial, which should let me get it working fairly easily.
  4. DHT11 Temperature and Humidity sensor. While it’s not I2C, SPI, or any other “Standard” protocol, the DHT11 is fairly easy to interact with using a Raspberry Pi.
  5. DS1307 Real-Time Clock. Being another I2C device made this a lot easier to integrate with the other components.
  6. Two 5-volt regulators – One for the servos, and one for the Pi + everything else. While powering a Pi through the GPIO pins has its issues, these issues can be fixed by a properly designed device. Separating the power to the servos also allows for them to be as noisy as they want to be without causing any issues to the rest of the board. Both regulators are powered by six AA batteries providing anywhere from 6-9v, depending on the type and charge state of the batteries.

There are a bunch of neat things that this is capable of doing. The RoboPony will monitor its battery voltage, and shut itself down if it is too low. It will also be able to tell if it’s been picked up, moved, or fallen over thanks to the accelerometer. It will know the time, the temperature, and the humidity, and will also know when something moves in front of it – or, provided I can get it to move itself, if it’ll run into something.

And, best of all, since it can talk via the Text to Speech program, the RoboPony can say things about all of this. So far, I plan on having it state the time, temperature, and humidity every 15 minutes (Hour, 15 past, half past, 45 past), greet things that approach, yell at things that get too close or stay too close, say something when it’s picked up and/or falls over, and warnings when battery voltage gets too low.

The voice is also software controlled, meaning it can be tweaked to some degree to provide different RoboPony units with different voices. This also extends to what the RoboPony says – These are simple text files that can be easily modified and changed to make the RoboPony speak different things.

It’s been, so far, an extremely fun project and I’m definitely enjoying working on it. My biggest concern right now is that the Raspberry Pi Zero is super popular – They’re out of stock pretty much everywhere. This means that I might have to use a different Raspberry Pi unit, which is significantly more expensive – Between $25-$40 per unit instead of $5. With this in mind, and the fact that the board isn’t complete yet (While writing this, I discovered that one of the voltage regulators was only rated for 6v in. Which simply won’t work), I can’t give an exact price for individual RoboPony units, but I expect it’ll be between $150 and $200. They’re cheaper in bulk, yes, but that’s also a lot more expensive for me to purchase the parts, and a lot more time consuming for me to make. We’ll see how it goes!

And to end off this post, I’ll be giving you an image of the RoboPony Base Board. This is what’ll attach to the Raspberry Pi – There’ll be another board in the head, with the eye LEDs, the speaker, and the distance sensor, along with an audio-out jack if you want to use your RoboPony as, say, a music player.

Lots of tiny circuits.

If at first you don’t succeed – That probably means you did something wrong.

Recently, I’ve had to do a number of complete redesigns of the Version 2 DigiBadge board. Most of them were due to irritating things outside of my control, but I don’t mind too much. Every one of them found another error in the circuit board, and had I actually had those boards printed, I would have needed to re-print them.

Among the errors I found:

  • TFT screen’s reset tied to the microcontroller reset. This has to be set to a pin in order to have the screen work.
  • Power switch only worked for AAA battery. If there was a LiPo battery, it would have simply powered the board regardless of switch setting.
  • A battery selection jumper was unneeded – Connecting in a different fashion allows it to be completely removed.
  • The “Universal” programming connector was the wrong size (Largely irrelevant now, though. See later!)

There’s probably a few other errors I’ve missed, but they were relatively minor ones.

I have also found some wonderful devices that’ll let me burn the bootloader and program the microcontrollers without soldering them to the board. This makes the Universal Programming Board and Universal Breakout Board a little obsolete – They were primarily for me to be able to program the boards without soldering extra pins on. Getting rid of these also makes it easier for the end user to reprogram them. They don’t need any additional special hardware from me – For the DigiBadge, there’ll be an FTDI header just like the Version 1. It won’t come with any pins soldered on, but they’ll be easily added. For the Pendant, there’s be a spot to solder on a six-pin ICSP header.

Now, the Pendant and DigiBadge have also been changed completely from their previous versions.

I was having some issues getting the WS2812 LEDs to work with the version of the Pendant I had. It turns out that I was missing a few components. While I could have added them on fairly easily, there wasn’t exactly a lot of space on the pendant to put them. I began looking around and found two things that were great: the ATTiny 861 microcontroller and an RGB LED that fit quite a few specifications.

For the ATTiny861, it has 15 I/O pins. I lose one of these because I need an analog reference to pull the analog input from the sensors. One or two more will go to sensor readings. The last 12 will go to the LEDs – Four of them, placed in the corners. While with the WS2812 LEDs I could get a theoretically-unlimited number with two pins, standard LEDs require one pin per color. This means I can get a maximum of 4 LEDs if I want any inputs at all. However, this isn’t all negative – I can fit the larger microcontroller onto the board easier, and four LEDs instead of three increases the battery life. Additionally, it’s fewer components to solder on to the board, making it easier to assemble.

For the LEDs, I found some really good ones – Their operating voltage for the Blue and Green channels is 3.0v, meaning I don’t have to put any current-limiting resistors on those two channels. This removes 8 components I’d otherwise need for a normal RGB LED. I’ll still need a resistor for the Red channel, but I’d have needed a capacitor for each of the WS2812s anyway, so this isn’t an issue.

With the DigiBadge reorganizations, it allows for, well, a LOT. And it also makes things a lot easier for everyone.

I was originally trying to shove everything onto one board, and being marginally successful at it, too. But there was a lot of stuff, and not a lot of board. I had to go back and forth with the manufacturer for the latest version, as there was always SOMETHING too close to something else. I eventually decided to cancel that order and re-design it, when I went back to an idea I had way at the beginning: Backpacks for the batteries. There’d be a LiPo backpack, and a AAA backpack. They’d be able to be swapped out super-easily via headers, and those same headers would allow for people to build their own add-ons to the board. Both the LiPo and AAA backpacks will break the additional pins for the ATMega328 chip out to empty headers, so users can solder their own header pins on, or attach wires directly.

One of the reasons I hadn’t taken this approach at first was both cost and size. The header pins of the type I need to use aren’t typically carried by my US source of components, but I managed to find another source that’s selling them for a good price, making it possible to do. Additionally, I’ve found that I can purchase the LiPo batteries I need for the Plus boards to be completely LiPo-powered in quantities greater than 2, meaning I don’t have to worry about making the Plus boards compatible with both LiPo AND AAA. This does make them a little more expensive, but I think it’s worth it.

I’ve also decided that the DigiBadge V2 will forego the different microcontrollers and simply use an ATMega 328. This, combined with the backpacks, makes things a TON easier for me. While I’m still waiting on the BronyCon vendor decision (That won’t be until the end of this month), I’ve been running numbers and things. Before, I’d have to know how many of each type of board I’d be making – The Plus boards with their LiPo chargers, SD card slots, and voltage regulators would have to be completely separate from the Basic boards. Now, though, all boards are “Basic” boards – The Plus part is simply an add-on. So I can make a bunch of Basic boards, and then make a bunch of Plus backpacks. If someone wants a Plus board, they get the Basic with a Plus pack. It’s no difference for my assembly, and keeps inventory and other things really simple.

As far as size of the DigiBadge goes, I think I can work some tricks in and hopefully cleverly arrange things so that instead of the batteries sitting on the outside of the board like they did for the Version 1, they’ll be sandwitched between the two circuit boards. It’s something I’ll have to play with and see how it works and how I like it.

Currently, I have one version of the Pendant, a version of the Temperature/Humidity monitor, and a simple test project that should be on their way to me soon and in my hands in a few days. I’ll post an update once I’ve got them and had a chance to test them!

For now, though, I’m going to go back to coding RoboPony. Try not to break anything while I’m distracted.