Maker Faire Bay Area 2017

The Maker Faire Bay Area is this weekend, May 19-21, 2017, at the San Mateo Event Center. MakeHardware had a booth at the Maker Faire last year, but we have been too busy to run a booth for 2017. We do plan to attend for a day to check out what other folks have been busy making!

If you decide to check out the Maker Faire this weekend, make sure you plan for enough time to get there and back. The Maker Faire is huge and even sets up exhibits in the parking lots at the San Mateo Event Center, so parking onsite is not available. There are shuttle buses and public transit, but be ready for a wait during busy times. The Maker Faire is totally worth the trouble, just be prepared!

Here are a couple of pics from our booth last year.

The MakeHardware booth at Maker Faire Bay Area 2016. Do you see our little drone flying inside the enclosure?
Our booth was in the back corner, but we still had plenty of people come check out our PC-drone flying project!

My favorite areas of the Maker Faire include the cooking (last year I bought some great fermentation tools), the crafts and the kid sections. There are lots of electronics, light sculptures, drones, huge metal sculptures, fire art, and tons of crazy creativity!

 

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 .
Arduino_addicore

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

Manual Exposure vs Auto Exposure for ELP 2 MP USB Camera

For our drone flying project, we have been using the ELP 2 Megapixel USB Camera. The auto exposure on this camera works in most situations, but we found that it does not always adjust to bright sunlight. In preparation for demonstrating our computer-controlled drone at the Maker Faire, I wanted to have a plan in case we were outdoors. It was a good thing too, since we were assigned an outdoor booth next to the Drone Combat arena.

We detect the location of our drone by using blob detection on four paper circles that we have taped to the top of the drone. Originally, we were using a medium green color, but we found that under some lighting conditions, our code would confuse the light blue color on the body of the drone with the green circles. I thought about making our blob detection code more robust, but the Maker Faire was quickly approaching! Instead we decided to make our flying area more controlled. We used white poster board as the background for our flying area and I tested some different colors for the paper circles. Red circles were good, except that our code got confused if one of our hands was reaching into the flying area. Black was not good in dim light. In the end, we decided on a dark purple with a blue undertone.

dark_light_104
Testing different circle colors
purple_day_expauto4_101
The winning color: dark purple

OpenCV provides a way to set a webcam’s manual exposure, but there are two problems. The first is that OpenCV is not well-documented. I could find the documentation stating that I should be able to set the exposure value, but it was not at all clear what values to pass! The second problem is that your particular webcam may not support programmatic setting of the exposure. Thus, when your code doesn’t work, it can be difficult to determine if your code is wrong or if your webcam just won’t allow it!

OpenCV’s VideoCapture.set() is the method to use. If you look at the documentation, you will see that there is a property named CV_CAP_PROP_EXPOSURE. It took me some time to discover that depending on the version of OpenCV you are using, the property’s name might actually be CAP_PROP_EXPOSURE.

There is no hint as to what the exposure value should be set to, but luckily for me, I found a mapping for the ELP 2 MP webcam on this page by Joan Charmant. He shows that the exposure values range between -1 and -13. You can programmatically set the exposure in this manner:

vc = cv2.VideoCapture(1)
vc.set(cv2.CAP_PROP_EXPOSURE,-10)

Unfortunately, I could not figure out a programmatic way to set the exposure back to auto exposure. If you know how, please add a comment! Please be aware that for some webcams, such as this one, the manual exposure setting is stored in its on-board memory, which means that turning off your program and even turning off the webcam itself, the manual exposure will still be set!

As a workaround, I found a way to bring up the DirectShow property pages so that I could use the DirectShow GUI to set the manual exposure or to turn auto exposure back on.

directshow2

Here’s the code to launch the DirectShow property page:

vc.set(cv2.CAP_PROP_SETTINGS,0)

During the Maker Faire, our demonstration area was shaded by a tent for most of the day, but around 2 PM our flying area was part sun and part shade. We delayed the inevitable by moving our table back with the shade, but eventually we had to move our table back to the front of the booth and into the sun. On Saturday, the afternoon was mostly overcast, and the camera’s auto exposure worked most of the time. I was surprised that our blob detection code even worked when people walked in front of our booth and made our flying area partly shaded by their shadows.

Sunday was mostly sunny, and the webcam’s auto exposure did not work when it was very bright. At these times, I opened up the DirectShow property pages and set the exposure manually so that our demo would still work. Maker disaster averted!

Blob Detection With Python and OpenCV

WordPress › Error

The site is experiencing technical difficulties.