Marco's Corner

Just another Software Developer's Musings

Some Halloween Impressions

No comments

P1000454-1024P1000455-1024Halloween is always a time for me to try different things. So I tried to take some photos and videos of this years displays. Unfortunately, it rained pretty much the whole time, so I had to water-proof the things and did not want to go back in there to fix things:-( But it looked that most things survived the day outside;-)

The first picture is just a static display with some LEDs, EL-Wire and a UV lamp overhead. You can’t hear the sound;-) Speakers and an old CD-walkman are hidden under the cloth;-) This image on the door is a scary fridge;-)

The second image is a skeleton lounging on our bench with just a couple of LED tea lights for illumination. The big spider in the window is probably not happy that there is no juicy flesh left;-)

P1000460-1024The third image is of a little scary grave yard. It’s normally dark until people come by. Then the candles come on one after the other and the eyes of the grave diggers and the skeleton start to glow. The skeleton gets it’s heart beat back;-) and starts moving it’s arms. All of that is surrounded by some nice Halloween sounds. All of that is controlled by two Arduinos, one dedicated only to the sound. I found that the sound shield and the PWM for the RC servos did not play together nicely:-( The candles are the little LED tea lights, but instead of the normal batteries, I soldered wires to the LEDs. The lights are normally driven by 4.5 volts (3*1.5V batteries), but they work just fine on a digital pin on the Arduino;-) The lights got a 4″ nail hot-glued to the bottom, that works pretty well as lawn spike;-) I tried to make a little video outside but there is not too much to see. So I’ll also include a video from an inside test-run;-) I’ll upload the Arduino sketches somewhere, but it looks like I’m doing more and more of those. So I might start a repo or something. Especially since I will probably want to reuse those next year again.

I actually added some potentiometers after that test to dim the eyes a bit;-)

The next little video is of a bush by the side of our driveway. I added some LED eyes into it and some nice sounds of a lion and some kittens which will play randomly. It’s very dark again, so I have a outside clip and again on from a test run. Last year, I tried something similar but with smaller speakers and that was simply too little volume for the outside. This display is again controlled by one Arduino and using a Adafruit sound shield with amplifier. The speakers were 2* 4Ohm, 3W. That was loud enough.

Both displays use passive IR (PIR) sensors to detect people and only start up when somebody is around. They slowly play out when no motion is detected any longer.

As always, have fun playing;-)

— Marco

OK, I got a set of YubiKey‘s some time ago and I use one to supplement my Linux desktop login. But I wanted to lock my screen automatically when I remove my YubiKey-Nano. So I wrote a little Python daemon which is auto-started on login and watches for USB remove events. Once the USB-subsystem reports that `any’ YubiKey is removed, the screen is locked. Maybe you spotted the little problem here, the USB stuff does not know which key was removed. But since I don’t think I’ll let too many other keys connect to my laptop, it is only a little problem;-)

My little program is here:

I’m using KDE, so for me, I dropped this into ~/.kde/Autostart/ , just make sure it’s executable by the user;-) But other desktop environments should have a similar location.

This little program can easily be modified to do other things triggered by USB (or other) udev events.

As always, have fun,

— Marco

P1000269_1024OK, so we saw and played a bit with the MaKey MaKey at the Bay Area Maker Faire and it’s a fun little piece to play with. I have a fifth-grade teacher in the family, so the plan is to enrich the class room a bit;-)


P1000265_1024P1000268_1024I always want to look a bit behind the scenes to understand how things work. So after a bit of google-ing, I found that it should not be too hard to implement a DIY MaKey MaKey  with an Arduino Leonardo, some resistors and some alligator clip cables. I did have the Leonardo and some resistors (1 MΩ – a little bit smaller than the 22 MΩ suggested around the web) and found the cables at the local RadioShack. I found the original(?) sources in the sparkfun github ( and tried to adapt it a bit. I pushed my changes to a fork: Overall, the setup worked pretty well, I guess not as sensitive as the original, but OK for mostly parts-bin parts.

So, overall, I would suggest to buy the original MaKey MaKey when you’re interested in something like that or want to attract kids to electronics. I don’t think, the DIY version would save you anything. It’s just a way to see what’s `in the box’ ;-) It’s some thing to read specs but it’s a different thing to be able to create a working setup.

As always, have fun exploring;-)

— Marco


P1000224_1024I was thinking about a more flexible sprinkler controller for a very long time. We have circuits which would benefit from different patterns, from the normal lawn watering to drip circuits for some flower/veggie beds to some pots and even some soaker-hoses for trees.

When I saw Daniel’s setup @ Garden Automation, I knew that this is a setup I would like;-) (Daniel is an organizer/marshal @ RobotGarden in Livermore, were I hang around once in a while.)

I looked a bit more into OpenSprinkler and especially into the different setups. I liked the `real OS’ setups better than the Arduino-like version. And in the end, it came just down to availability. When I was ready, the BeagleBone Black was just on it’s way to the revision facelift. It was not in stock anywhere.  So I settled on the Raspberry Pi as base-board. I have both running here already, so it did not make a big difference;-)

So the current setup consists of the Pi, the OpenSprinkler Pi with a zone extension board, a SainSmart LCD Module For Arduino 20 X 4 with I2C daughter board and an USB WiFi dongle. The WiFi dongle is inside the box as indented, but the LCD module did not fit:-( I might look at a higher version of that box eventually. For now, it’s kept in place by two rubber bands;-) I want to use the LCD to display status info. It currently displays the hostname, the IP address and the current date/time. Eventually it should also display info about the running/upcoming program & station etc.

The WiFi connection is not as reliable as I would have liked:-( So I’ll have to play with that a bit more. But I’m not sure, if it’s the Pi or the access point:-( Something between the two. I saw times, when I could not ping the Pi from my laptop but it would answer to pings from the AP (the laptop was used to log into the AP’s web interface, so it could talk just fine to it).

I needed to control 11 sprinkler circuits, so I had to get the Zone Expansion Board. But the extra 16 zones looks like a bit of overkill;-)

P1000215-1024P1000219-1024The OpenSprinkler Pi board (from V1.2, I believe) also includes a 4-channel ADC (8 bit) and an relay. So I want to use one channel connected to a photo resistor and the relay to control the lights outside our garage. even while the relay is rated for it, I did not like the idea of running mains power into the OpenSprinkler box. So I control another relay (in the old mechanical timer box) with the included relay. That seems to work ok.

P1000216-1024I also added an AM2301 temperature/humidity sensor along with the existing rain sensor.  I hope to use that eventually in calculating the watering needs. So far, I can just get reasonable looking values from it with the Adafruit library;-)

So overall, the bits & pieces work together. I’ll need to get some cable fasteners next time I hit Home Depot. Unfortunately, we don’t have any of the blue wall colour left over, so the footprint of the old sprinkler controller will stay for now:-(

Now it’s just up to writing/adapting the software to do what I want;-)

As always, it’s good when you can control your own world;-)

— Marco


Update: I got some blue paint;-) So the setup looks a bit more finished now. P1000228_1024Also, that image shows the info on the display a bit better. The software is still not at the state wher I would be happy, but I have a working setup, so that will probably move slower now:-(



Update 08/20/2014: OK, a collected order from Digikey included a new case and my LCD display has a final place. It fits pretty good. I only had to remove the two top screw holes. Some more pictures as it looks right now.



UNI-T UT61E and Linux

No comments

For a long time, I was working with a very cheap multimeter, that I picked up somewhere at a sale. But I decided, it is time to upgrade to a bit better tool;-) Of course, when you look at electronics testing/measuring equipment, everybody knows about Fluke. But for me this is just a hobby, so those things are a bit out of my price range.

After long days thinking about it and searching the net, I eventually found the UT61E, which looks like a very nice tool. It also supports data logging to a computer which might come in handy at times;-) So that’s what I settled on.

After I got the DMM, pretty much the first thing I tried, was the connection to my Linux laptop via the UNI-T USB cable. I saw before, that it should work. But it turned out a bit more involved than expected. The best resource was probably Rainer Wetzel’s page to the UT61E . But I was also running into the `suspend’ problem. So the next page is UT61 , which has the trick with the suspend.

But overall, I did not like the idea to run everything as root as both pages suggest/require. So I wrote a little udev rules file, with seems to take care of both problems;-)

# UNI-T USB Adapter
# This file should be installed to /etc/udev/rules.d so that you can access the Adapter without being root
# type this at the command prompt: sudo cp 99-UNI-T.rules /etc/udev/rules.d
SUBSYSTEM=="usb", ATTR{idVendor}=="1a86", ATTR{idProduct}=="e008", MODE="0666", ATTR{power/level}="auto", ATTR{power/autosuspend}="0"

Install that little file into /etc/udev/rules.d/ and restart udev and the next time you plug the cable in, it should just work without being root;-)

I hope this little gem helps the next guy;-)

Have fun,

— Marco

Just some photos from last night’s lunar eclipse. I was mostly lucky, the high clouds did not materialize as much as feared;-) I did only stay up until about the peak of the eclipse. That was long enough for me;-)



makers   beginnersOK, nobody knew what to expect for our Arduino Day event. But about 20 makers had a good time @ Robot Garden;-) Most knew their way around. But we also had a couple of kids who were new to the idea of `hardware hacking’ and liked the idea of an easy start. So instead of a big presentation, I gave them some 1-2-1 time;-) That worked pretty well.

Just for reference, my prepared presentation as LibreOffice ArduinoDay.odp & ArduinoDay.pdf files;-)

table2table1Some photos (not taken by me;-)

As always, have fun exploring;-)

— Marco

Arduino Day 2014We will have our own event @ Robot Garden in Livermore, CA to celebrate the 10th Birthday of Arduino – The little computer that can;-) I brought it up, so naturally, I got to organize the event;-)

More information is available at the meetup page for the event.

I hope, we will have some interesting people and some good demos, but as always, the Arduino ecosystem lives from the participation of individuals;-)

I hope to see you there;-)


Scale - TestsScale - In BalanceOK, the “Compound Machines” event @ Science Olympiad is a closed event comprised of a written part and a more practical part, where the team needs to use a pre-built “scale” to determine an unknown mass with the help of a known mass. So I don’t have a real video or images of the event. All the pictures were done afterwards. The rules for the scale are in the official rulebook;-) I’ll just try to collect some “lessons learned” and some pictures for reference.

  • Use the longest levers which still fit into the rules. With longer levers, the significance of the limited accuracy of the length measurements decreases.
  • Find at least some parts with with “nice round” values. In our setup, the active length of the second class lever was 45 cm and the fixed side of the first class lever was 11.25 cm. That made the equation somewhat easier;-) Mu = 4 (a/d) Mk
  • Try to find good bearings;-) Brass bushings with brass washers on both sides worked kind of OK.
  • Make sure, you calibrate the apparatus with the hooks.
  • Include the masses of the attachment hooks where you hang the masses in your calculations!! We missed that part during the preparation and so the results were somewhat off during the competition:-(

Scale - DetailScale - Bushing So overall, the Millennium team was not very successful in this event. But there is always next year;-) I hope, the kids learned something regardless. Just to keep track of the spreadsheet: Scale – Spreadsheet

Have fun;-)

OK, this year, it was the second place for our team in the Maglev event in the San Joaquin County competition. I only saw the runs of our vehicle and there the problem was, that it was way too fast. The target time was set at 12 seconds. The successful runs were around 3.7 seconds:-( Way too fast. But trying to slow the car down and it would not start at all:-( So there is probably a better way. If next year has similar rules, I guess we need to experiment with side magnets to keep the car from twisting?! But at least the moving weight of 1950 grams (weight limit was 2000 grams) helped the score;-)

Maglev VehicleSome more details of Maglev Vehicle from the frontthe car. One of the EDF from last year (GWS GW/EDF55-300H’s) had to do all the work alone. A little bit a bigger battery, a two cell LiPo (7.4 V) with 5000 mAh just for the extra weight.

The maglev magnets were built out of  8*4 of the Kelvin maglev magnets each. That was partially needed to float the weight, but also to as weight low in the vehicle. They were glued together and to a steel profile at the top.  There was a little box between the magnet assemblies to keep them parallel to the sides. It was also used to add more weight low in the vehicle. All of that was attached to the plywood base via the usual Velcro strips.

Magnets separated from the baseMostly taken apartWe experimented with a 1.5 Ohm 20W potentiometer (actually a 3 Ohm potentiometer parallel to a 3 Ohm resistor, both rated at 20 watts). But that did not work so well. It worked as expected to slow the motor down. But even minimal slowing was too much to get the car started reliably:-( More to experiment with next year;-)

The blue rectangles in the last image are extra weights which were normally under the battery to come close the the weight limit;-)

Al always, have fun exploring.