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.

 

Intel Arduino Schematics

 

Some links to make it easier to find the design information for these Intel boards.

Intel Galileo (Gen 2, July 2014)

Intel Galileo Gen 2 – Arduino

Arduino IDE and form compatible board based on Intel Quark SoC X1000 processor.

Schematic

Intel Galileo (Gen 1, Oct. 2013)

Intel Galileo Front
Intel Galileo Back

Arduino IDE and form compatible board based on Intel Quark SoC X1000 processor.

Schematic 

PCB Design Files (Cadence Allegro)

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″?>
<cleye>
<item name=”mode” value=”advanced” />
</cleye>

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.

The Shenzhen-FBA (Fulfillment by Amazon) business model

Someone asked me how all those electronics vendors in the Huaqiangbei make money. There are so many vendors, and many of them seem to sit there all day with relatively few customers coming by. Many vendors are too busy looking at their laptops or phones to even care if you look at their products (friendly customer service is not a strong concept here).  In fact, the truth is that the one or two piece orders from hobbyists like myself are a distraction to their main purpose which is to sell to other businesses.

Most of the kiosks in the market represent a factory somewhere in China, and their primary goal is to sell large orders to other business.  Throughout the market, you’ll see visitors from India, America, or Europe working with vendors and negotiating large orders so that they can import and resell them. Many of these kiosks also sell through Aliexpress, Taobao, or Alibaba.com, and there is always the sound of packaging tape being used to tape up boxes for shipment for orders placed through these channels.

As you may have noticed from my previous post, a great many of the products in Huaqiangbei are also available on Amazon.  So how do they get there? Let’s take an example:

Bluetooth bamboo keyboard
Bluetooth bamboo keyboard, mouse, and calculator.  They quoted me 240 RMB ($38) for the keyboard.

The photo above is from a booth that sells electronics products that are made out of bamboo.  There are mice, keyboards, Bluetooth speakers, calculators, and many other products.  The finish and quality are actually quite impressive, and there is quite a variety of products.  More products are shown on their website.

Bamboo Electronics Products

Bamboo Electronics Products from Shenzhen Hoyatech website

Suppose you find some products here and decide you want to make some money re-selling.  Here’s what to do:

Step 1: Setup Fulfillment by Amazon (FBA)

The process is a bit complicated, but it’ll save you time and headaches in the long run.  If you’re successful at this, the last thing you want to be doing is packing and shipping boxes every day.

Step 2: Make a bulk order

Contact the factory and negotiate a bulk order (which will probably have a minimum order value of several thousand dollars). Most all of the kiosks here will give you a business card with some sales director to talk to.  Many of the vendors work with FBA companies all the time, so they’ll know exactly what to do with regards to packaging and shipping. Reading and writing Chinese is a big help in this phase.

Step 3: Profit.

There are lots of companies doing this already (two examples in the table below),  you’ll want to differentiate by developing a brand and maybe even your own storefront to maximize your profits.

Sourcingbay 100% Bamboo Wireless Handcrafted Keyboard Eco-friendlyBluetooth keyboard and mouse
Impecca Full Bamboo Wireless Keyboard and Mouse (KBB600CW)Bluetooth keyboard and mouse

It is obviously quite a competitive business area, but at least some folks are making money out of it.

 

 

The Amazing Shenzhen Electronics Market

Shenzhen China has been getting some notice lately as a great place for makers who are building electronics.  I recently had a chance to visit there, and it is truly an amazing place if you love electronics.  You can buy lots of finished electronics (including name-brands as well as knock-offs), but what makes this place special is all the component vendors.

My favorite spot was the two entire floors of LED lighting vendors in the mall located approximately here. There was LED bulbs of all types, as well as ribbons of LEDs, christmas lights of all kinds, and all sorts LED controllers. Here is some of the goodies I came home with.

RGB LED rope (5 meters) with controller, remote control, and 60W power supply

This is a 16.4ft long string of SMD LEDs that comes with a controller and remote that can change it to many different colors.

LEDs when color is set to green
LED rope when set to Green color
LED rope blue
LED rope when set to Blue color
LED Rope (5m) with a LED controller, remote control, and power supply
LED Rope (5m) with a LED controller, remote control, and power supply: 65 RMB ($10.50)
SMD LED Rope
Close-up on the LEDs when not lit

This was the favorite item I picked up during this trip.  It is sold at multiple kiosks, so it’s not a rare item, but it’s good quality and very fun to play with. It cost 65 RMB, which works out to about $10.50 US.  (35 RMB for the 5 meters of rope, 30 RMB for the power supply and controller). I’m still trying to come up with a good project to use this in.  It seems to be used quite commonly in various maker projects on the web, like for lighting up this quadcopter.

Quadcopter-LED-Light-Kit-300x300

Like many items in this market, you can buy the LED Rope and Controller on Amazon also.

Extremely Bright LED flashlight with aluminum housing, Li-Ion batteries, and charger

Skyfire LED flashlight
This is an extremely bright three LED flashlight.

If you’re a security guard looking for a flashlight that can be used to blind someone, then this is the place to come. There are many vendors selling an assortment of flashlights.  I liked this one because it is extremely bright and has a very sturdy aluminum housing. The brightness is impressive – this one has 3x LED chips but they actually sell a version with 7x or 10x  LEDs.  My retinas feel pained just imagining how bright it is.  It runs off of 18650 Li-Ion batteries which I purchased with it as a set and came with a charger.  Total cost was 160 RMB ($26).

They sold me a set of 4 batteries, but it turns out the flashlight runs very happily with just 2, or 3 cells (they are all in connected parallel inside.

Charger for Li-Ion flashlight batteries
Charger for 18650 Li-Ion flashlight batteries. Yes, the batteries are really branded with the name Ultrafire.

Is Ultrafire really the best name for a Li-Ion battery where the primary safety concern is that it could overheat and start a fire?  It’s like naming an airplane BigCrash.

The flashlight itself is made by a manufacturer called Skyray, and it is also sold on Amazon by various resellers. See my next post where I describe how all this stuff ends up for sale on Amazon.

Here are some good blogs that give an overview of this market:

There is also a nice article in the June Make Magazine.

Tools

I’ve been lucky enough to always work at companies that have been relatively generous in providing nice electronics bench equipment to work with.  So, I’ll admit this has spoiled me, and when it comes to setting up my own home workbench, I have little patience for the cheap and crappy stuff.  Here’s a run-down of what I like.

Oscilloscopes

Picoscope 3406D (newer model)PICO TECHNOLOGY PICOSCOPE 3406D OSCILLOSCOPE, 4 CHANNEL, 200MHZ, 1GSPS, WITH AWG (ARBITRARY WAVEFORM GENERATOR)
Picoscope 3406B (older model)PICO TECHNOLOGY PICOSCOPE 3406B OSCILLOSCOPE, PC, 4CH, 200MHZ, 1GSPS, WITH AWG (ARBITRARY WAVEFORM GENERATOR)

My previous experience with some low-end 2-channel USB oscilloscopes was not so good.  The Picoscope is completely different.  The software interface is excellent, and very responsive with good refresh rate. The scope also has good FFT features so you can do some spectrum analysis (although the scope itself has some spurs). Make sure you connect it to a PC with a USB 3.0 port though. This model has a nice AWG also, and there is another MSO option that adds digital logic analyzer capability.

The small size is great.  I put it in my laptop bag and travel with it, and have found that using this scope with a PC and displaying it on a 50″ TV screen to be a terrific tool for demos and training classes.

Rigol DS1054Z4-channel oscilloscope

The Rigol DS1054Z is already widely discussed, all I can do is confirm that it’s a good deal. You’re not going to get a better 4-channel scope for the same price.

This website will help you unlock it so it becomes a 100MHz bandwidth scope. http://gotroot.ca/rigol/riglol/

My only additional point is that Ultrascope USB-PC software interface is hard to get working, and it’s pretty poor in terms of refresh time.  There are some helpful directions here, but you probably don’t want to use this scope if you want to connect it to a PC.

Multimeter

Fluke 115 Multimeter

Fluke 115 Compact True-RMS Digital Multimeter

There is nothing more basic, but also nothing more useful.  There are a lot of cheaper options, but the Fluke’s are very accurate and very durable.  I recently purchased a new one and expect it to last long enough for me to pass it on to my kids.  The only reason I had to get a new one is because I lent out my previous one and never got it back.

Spectrum Analyzer

Tektronix USB Spectrum Analyzer

Tektronix RSA306 6.2 GHz USB Spectrum Analyzer

OK, so not everyone is going to need this.  In fact, I haven’t even thought of a project where I truly need this, but I wanted to share this anyway because I think it’s great that manufacturers are coming out with great USB equipment. The software interface is good, and the noise floor is good enough for most uses. There’s a great review and video here: