Teambuilding with robotic insects!

I manage a team of electrical engineers, and at the end of every year I like to run a team building event.  Last year I bought everyone a mini-drone, and we had a lot of fun flying them around a conference room.  This year, I bought a bunch of remote control insect toys and the activity was to assemble them and then have teams compete in races and other games.

These are the robotic insect competitors. From left to right – a Kamigami Goki robot, the Hexbug Battle Spider, and a Hexbug Fire Ant.

I have a team of nine people, so we divided into 3 teams of 3.  Each team received one Kamigami robot, one Battle Spider, and one Fire Ant.  The first activity was to assemble the robots.

Kamigami Robot
These Robots are available in 4 models and can be controlled via Bluetooth from iOS and Android devices.  These robots have light and IR sensors, and IR transmitters. The apps for these robots are written very well and allow you to play various games such as “freeze tag” and make up your own games as well.
Hexbug Battle Spider

The little guys move slowly, but they are quite fun to drive around.  The turret on the top rotates and allows you to “shoot” IR beams at other spiders so you can play a laser tag game.

Hexbug Fire Ant

These little guys are simple and fun to drive.  They move very fast, but are a bit difficult to control, especially on carpets.

The Kamigami is manufactured out of a flat flexible plastic laminate which you have to fold like origami to create the robot’s legs and body. Assembling it took each team about 45 minutes. I wouldn’t say it was “simple” (there is no chance my parents would ever do it), but the online directions were good, and the pieces were precisely cut and fit together very well. For most engineers this will be fun.

The other robots didn’t require any assembly. The one tricky thing is that if you want to run multiple Battle Spiders, you have to make sure that each one is synchronized to a different remote controller channel. There are four possible channels, so you can run up to four spiders at a time. For the Fire Ant, there were only two possible channels, so you can only run two Fire Ants at a time.

For our competitions we setup a simple U-shaped race course and put some small cardboard boxes as obstacles.  None of the robots can really climb over any significant obstacles, but just steering them around obstacles or through a narrows space is challenging enough.

Probably the most fun event we had was a Sumo competition where we put all of the robots on a table and then had them try to push each other off, with the winner being the robot that stayed on the longest.  A large number of contestants ran off the edge of the table on their own. The Battle Spiders had a significant edge in this event because they were heavier, grip the table better, and since they move slower they were also less likely to be driven off by mistake.

At the end of the event, everyone got to take home one of the robots.  The winning teams got to choose which robots to take first. A good time was had by all.  Or, at least that’s what they said to me, but I’m the manager, so who knows what they really thought.

I enjoyed the Kamigami Robots so much, so I bought two for myself my daughters.  They’re definitely more fun to play with when you have two.


The Next Tivo DVR Might Look a Lot Like a Tablo

According to tech blogger Dave Zatz, the next Tivo OTA DVR might have an architecture that is a lot more similar to the Tablo series of OTA DVRs. What this means is that the Tivo DVR named “Mantis” would no longer connect directly to the TV, instead it would “transcode” video to a streaming device such as a Roku, Apple TV, or Amazon Fire, or a table or phone.  The benefit of this approach is that one box can stream to multiple TVs or devices and it can be significantly cheaper in a household with multiple TVs. Previously, multiple TV households wanting to have DVR features would need a Tivo mini for each TV.

This type of device definitely seems like it might appeal to the growing number of households that already have a full array of streaming devices everywhere. As others have noted, streaming services are not perfect – they can be laggy, and are particularly prone to crashing during major live sporting events.  Purchasing something like the Mantis would give them benefit of having lag-free OTA broadcasts and commercial skipping capability throughout their house.  Hopefully the acquisition of Tivo by Rovi doesn’t delay or interfere with this product launch!

OTA-only households growing

A recent survey has found that the number of OTA-only households in the US has grown from 15% in 2015 to 17% in 2016.  I think that this is a reflection of several factors:

  1. Many households find cable/satellite too expensive for what it offers
  2. Streaming services still cost money, and as this NYTimes article pointed out, there are some drawbacks.
  3. Broadcast TV signals can provide high quality HD images and in many ways still provide a better user experience that is easier to use and has less lag.

Interestingly, the number of households that were Internet streaming also grew from 4% to 6%.  In terms of percentage, it is definitely much faster growth, but it’s interesting to consider that the number of OTA only households is almost three times as large.

For what it’s worth, my household has been OTA-only since 2012, and I’m a big fan of having an OTA DVR and of not paying any subscription fees.  

How to Control Your Drone From a Computer

After reading my post about how I used my computer to fly a Cheerson CX-10 drone, several people have asked me if it is possible to control other drones in a similar way.  It is in fact pretty straightforward, and in some cases you can re-use exactly the same hardware that I used to control the Cheerson CX-10 – the Arduino UNO and the Addicore nRF24L01+ Wireless Kit .

Component Description
Arduino Microcontroller Board Arduino UNO R3 Board Module With DIP ATmega328P(Blue)
Nordic Semiconductor 2.4GHz Wireless Card Addicore nRF24L01+ Wireless AddiKit with Socket Adapter Boards and Jumper Wires

It turns out that a large number of toy drones use the same nRF24L01+ compatible RF chips.  The word compatible is necessary because most of them seem to not use the Nordic Semiconductor chipset, but rather something like the XN297 from Panchip. . . . Continue Reading

Microsoft Putting Xbox DVR features on Hold

Back in August 2015, Microsoft announced they would be adding DVR features to the XboxOne.  This was an exciting announcement for many of us, because it meant that DVR, serious gaming, and streaming could be combined into a single piece of hardware. Well, those hopes have ended by the recent announcement that they will be putting the DVR features “on hold.”

It’s hard not to wonder if Microsoft’s DVR strategy has been influenced by the growth of Sony’s PS Vue service and it’s “Cloud DVR.”  From a revenue perspective, the attractiveness of the monthly subscription model for streaming must have turned some heads at Microsoft.  I’m guessing that Microsoft will be attempting to come out with a streaming service and Cloud DVR to compete head on with the PS Vue rather than a DVR than runs locally.

This announcement doesn’t change the fact that you can still use your Xbox to watch OTA TV if you just buy an antenna and tuner, but you won’t be able to record it.

See these links below for more info and discussion:


Teach your PC to fly a Mini-Drone!

A few months ago, I watched this TED talk where they setup an indoor arena and did some amazing things with drones.  It got me thinking, and it inspired me to build something like that for myself – but on a much smaller and cheaper scale.

In the video they use an expensive real-time infrared motion tracking system (I am guessing something like these Optitrack systems) to measure the position of the drones, and then uses a computer to calculate and send control signals to coordinate the drones. At a high level, my setup works in a similar way, as shown in this diagram:

Here’s a photo of what my setup looks like:

drone setup
Photo of the first working setup.

This is a list of the items needed to build this:

Component Description
USB Camera ELP 2megapixel Hd Free Driver USB Camera Support Mjpeg Linux Android Windows Developing Board,usb Camera Module
Arduino Microcontroller Board Arduino UNO R3 Board Module With DIP ATmega328P(Blue)
Nordic Semiconductor 2.4GHz Wireless Card Addicore nRF24L01+ Wireless AddiKit with Socket Adapter Boards and Jumper Wires
Cheerson CX-10 Mini-Drone Cheerson CX-10 Mini 29mm Diameter 4CH 2.4GHz 6 Axis Gyro RC Quadcopter UFO RTF Green
2 blade guards for the Cheerson CX-10 Upgrade Cheerson Cx-10 Propeller Prop Blade Guard Cover Bumper Protection Protector Green White

Total cost for these items was around $85. In addition to the above, you might also need a folding table and stack of books to hold up the webcam as I did, but you can probably think up something more refined!
Here is a video of it working:

Here are some links to further information on how this all works:

  1. Setting up the programming environment on your PC
  2. Detecting the circles from the webcam
  3. Finding a low-latency web camera

Source code:

  1. nrf24_cx10_pc  – The source code for the Arduino to send 2.4GHz wireless signals to the drone
  2. pc-drone – The Python / OpenCV code used to track the drone and decide on how to adjust the drone controls

We will also be sharing this project at the Bay Area Maker Faire from May 20-22, so please stop by the booth and check it out!

What is an OTA DVR and why would I want one?

OTA DVR stands for Over-the-air Digital Video Recorder. Basically, this is a digital video recorder (think Tivo) system that allows you to record programs from over-the-air broadcast signals.

Long ago, before there was such a thing as cable or satellite TV, everyone watched TV by attaching antenna to the television set and pulling in a signal that transmitted by a rabbit ear antenna.

These signals are still being broadcast in most of the country, although the format and the quality are much improved.  Instead of fuzzy analog images like before, stations are now broadcasting in 720p or 1080i high definition digital signals.  In many case, the bandwidth and image quality is equal or even better than what your cable or satellite provides.  Plus the antennas don’t look as dorky anymore (hopefully you have a better TV too!)

Why Do I need a DVR if I have Streaming?

When I first cancelled my cable subscription (“cut the cord”) and setup an antenna way back in 2011, the main thing I missed was the DVR that was previously provided by the cable provider.  I could still get all the local broadcast networks (ABC, CBS, Fox, NBC, PBS). When ESPN became available through streaming on Sling TV (it’s also now available on Sony’s Vue), then I had access to pretty much everything I needed. However, I still missed my DVR because:

  1. I couldn’t skip commercials anymore!  Basically, if you’re streaming, they can force you to sit through as many commercials as they want.
  2. The skip-forward/skip backward functions are pretty crappy in every streaming app I’ve ever seen, especially compared to the responsiveness of a DVR.  I’d rather watch a recorded TV show from a broadcast channel versus from a streaming service just because of this.
  3. Not all streaming channels work that well, especially when watching live sports events.  There are glitches, dropouts, and sometimes the resolution gets lower (and I have 100Mbps internet service). At least in my case, the reliability of the streaming signal is not as good as the reliability of the antenna signal.  The Antenna signal is slightly less reliable than a cable signal, but the antenna is free, so I find it to be a good compromise.

Anyway, that’s my rant about why DVR’s are still nice to have. If you got this far, then you’re probably want to know how to get your own OTA DVR.  Checkout my guide here. 


Finding a low-latency webcam

When trying to use a webcam in a computer vision application as part of a real-time control system, the latency is often just as important as the frame rate. Unfortunately, the latency for a webcam is often not specified, especially not for low-cost webcams.

One simple way to measure the webcam latency is to point the camera at a computer screen that is displaying the view from the camera and also printing the current time on the screen.  You end up with infinite recursion images like this:

Latency Test Images
Measurement of ELP-USB500W02M-L21 webcam latency
Measurement of ELP 5mp webcam latency
Measurement of ELP-USBFHD01M-L36 webcam latency
Measurement of ELP USB high-speed webcam latency
Measurement of PS3 Eyecam Latency
Measurement of PS3 Eyecam Latency

The difference between the time which is overlaid on the image (the largest type) and the time shown in the image from the webcam (the next largest) is the latency.  The Python / OpenCV2 code I used to capture these screenshots is up on Github.

Here are the results for three cameras I measured:

Camera Model No. Latency (ms) Frame-Rate (fps)
ELP USB with Camera 2.1mm Wide Angle Mjpeg 5megapixel Hd Camera USB for Industrial, Machine Vision ELP-USB500W02M-L21  ~115 to ~130  10
ELP 2megapixel Hd Free Driver USB Camera Support Mjpeg Linux Android Windows Developing Board,usb Camera Module ELP-USBFHD01M-L36  ~105  30
PlayStation Eye PS3 Eyecam ~75  60

All cameras were set to capture at 640 x 480.  The above cameras are all consumer grade cameras, costing about $45 for the ELP models, and only $5 (!) for the PS3 Eyecam.  As a comparison point, $280 would get you the Slim-3U from Optitrack which is specifically designed for motion capture and has a 8.33ms latency. Let me know if you find any other sub-$100 cameras that perform better!

ELP 5 Mega-pixel USB camera with 2.1mm Wide Angle Lens

This camera has a nice image quality, but the frame rate is slow and the latency was inconsistent.  The lagginess of this camera is very evident upon first usage of the camera.

ELP 2megapixel USB Camera with 3.6mm lens

This camera had good image quality, tolerable latency, and a 30fps rate.  I tested the version with a 3.6mm lens, but the base camera model USBFHD01M is also available with a  170degree fisheye lens or 2.1mm lens.  There is a nice review of this camera here.

This is the camera that I ultimately chose for my computer vision project.

PlayStation Eyecam

For a cost of $5, this is a very interesting camera.  The latency of this camera was the most consistent, and it is also capable of higher frame rates.  In order to use it on a Windows system, you will want to purchase a driver from Code Laboratories at a cost of $2.99 (it works very well). One tip, you may need to create a cleye.config file and save it in “C:\Program Files\Code Laboratories\CL-Eye Driver” to get greater than 30fps from the camera/driver.  This file contains this text:

<?xml version=”1.0″ encoding=”UTF-8″?>
<item name=”mode” value=”advanced” />

The image quality from this camera was not that great though (you can see it’s image is more blurry than from the other two camera), so that is why I did not choose this camera for my project.  It would be great for applications where there is fast motion and image quality is not as critical.

Industrial cameras and other links

In addition to the Optitrack camera mentioned above, here are a few more cameras I found discussed on Reddit that offer low latency. These are higher cost industrial cameras:

This is a project that measured latency using the same technique shown here using a Pi camera on a Raspberry pi.

How to Get Your Boss to Buy You a Quadcopter

Every year my boss asks for suggestion for a teambuilding activity to have with his staff.  Past activities have included thrilling activities like bocce ball and an indoor trampoline park (tip: this is a great idea if your team consists of 8 year-olds). This year I suggested that he buy everyone some drones and that we run some drone races. My suggestion was rejected – we went bowling instead.
Well, I took matters into my own hands. I manage a team of engineers myself, and I was determined to do something a little different this year.

Step 1. Plan

Instead of the usual holiday lunch, I bought everyone on my staff a Cheerson CX-10 quadcopter.  These are tiny little things – only about 2.5″ across, and they’re great for flying around indoors.  Best of all, they only cost about $16 on Amazon. I gave them to everybody during a staff meeting, and scheduled another “meeting” about 3 weeks later to give everyone time to practice.  Encourage them to practice – most likely they’ll need it.

The original basic version of the Cheerson CX-10.
$16 on Amazon. 

Step 2. Execute

At this next “meeting,” we had two events on the agenda:

Obstacle course

We put 5 foam pads on the ground and on some tables.  Most of them were about 8″x 8″, but one was about 4″ x 4″ for an extra challenge.  The goal was to take off and land on each of the foam pads and return to the starting point.  A successful landing on the large landing pad earned 50 points or 100 points for the smaller one. We had a time limit of 3 minutes to complete the course.  Any crashes or other mishaps that require the pilot to touch the quadcopter (such as flipping it back upright) to were penalized with -30 points.

Foam landing pad. 50 points!


We setup a simple race course using a few poles as markers to make a loop.  We had heats with 4 quadcopters flying at a time.  Going around in a loop is harder than it looks.  In both heats, the winner was the one who managed to fly three laps without crashing.  Practice helps.


During the 3 weeks of practice, about 1/4 of my team managed to damage their quadcopters, so make sure that you have some spare parts available. Refer them to this repair guide.

Step 3. Profit

In addition to having a fun afternoon, I got to introduce a bunch of my coworkers to flying quadcopters, and we still fly them around sometimes (when no one else is watching).

Don’t forget this final critical step: Record your expenses and submit them under the category “Internal Meeting / Meal / Entertainment.”

Next year I think we’ll scale things up and go for a larger quadcopter we can fly outside – maybe a Hubsan X4.

3D Printed Spaceship Blade Guards for the Cheerson CX-10

If you’ve got access to a 3D-printer, or are just looking for an excuse to use one, these little blade guards are a neat project.  Making your quadcopter look like a spaceship seems to be quite the thing, here’s links to some examples.

Starship and Millenium Falcon Propeller guards.  This Thingiverse project has designs for both the Hubsan Q4 and Cheerson CX-10 – make sure you choose the right one!
Millenium Falcon Bladeguard for Cheerson CX-10
Millenium Falcon Bladeguard for Cheerson CX-10. I think this may have been the original one, the others may have been variants.
Millenium Falcon Spaceship Cheerson CX-10 bladeguard Remix
Millenium Falcon Spaceship Cheerson CX-10 bladeguard Remix
Cheerson CX-10 Quadcopter Wheels
This project is called “quadcopter wheels”, but it could pass for a rudimentary Tie-Fighter too.