Archive / Documentation

RSS feed for this section

Terry Riley’s In C for Arduino with the Fluxamasynth

Terry Riley's In C on Arduino

I’m a fan of experimental composer Terry Riley (try some of his organ work like Shri Camel to get started), so it seemed natural to try to adapt his 1964 algorithmic composition “In C” for the Arduino with our Fluxamasynth Shield.

In C was written for 20 to 35 players. Each player works their way through 53 short phrases, listening to the other players and following the rules of the score. The basic structural rules are that a player repeats a phrase as long as they like before moving to the next. Players always move forward through the score, and the piece is finished when everyone reaches the end, which usually takes around 40 minutes at the recommended tempo.


You can get the complete score at the Petrucci Music Library. Or read on to see the Arduino version.

Continue Reading →

By Shawn on October 11, 2016.

Maxbotix Ultrasonic Rangefinder MB1013 (1mm Resolution) Proveout

A month or so ago we decided to carry the Maxbotix’s line of ultrasonic rangefinders (the MB1010, MB1013, and the MB1200 are the models we have currently stocked).  The MB1013 in particular caught our eye in its claim to have a resolution of 1mm, so we decided to put it to the test. We lashed together a test rig with two panels (of plywood) that are raised and lowered by three drive shafts of 1/32″ threaded rod (pictured below).




The board has two holes in the opposite corners that make mounting to a surface a no-brainer. We quickly proved out the analog output using a 5v power supply and a multimeter, but we wanted the most precise measurement. Opting for the serial (digital) output  reading with an Arduino- both methods are covered in the Maxbotix tutorial. For ease of documentation, we hooked up the Arduino to an LCD driven by our LCD117 board, for an easy three wire interface to the LED. This was just handy way to get feedback without a laptop or desktop. Actually the USB cable in the picture below snakes about 10 ft to the nearest desktop in our shop.


Our threaded rod was 32 threads per inch, which is equivalent to 24.4 mm, so one thread represents 32 threads per inch / 25.4 mm per in. or 1.25984 threads per millimeter. This allowed us to index the jig 1.25 turns per unit and not have a lot of error, with an error of .246 threads per 25 turns. In any case we indexed all the way through one inch,

Our results showed that it does indeed have a 1mm resolution, meaning that 1 1/4 turns did actually correspond with a Maxbotix output of 1mm! Our algorithm kept the readings consistent with the range up until around 620mm – where the sensor’s output started to report smaller values than the measured distance, ending up 8-10mm ahead of where it was supposed to be at 582 mm. Maxbotix cuts off the serial output of the sensor at 300mm (11.8″) so one could speculate that the error in the electronics started to be a factor in the measurement, which lead to Maxbotix to cut off the specification at 300mm.



Check out the raw data here.

The max range and cone shapes vary from the sensors we have available. They could be used for things like a parking sensor (found in most modern cars), self-navigating robots, or a suit that helps you navigate blind. Maxbotix has done a great job  of taking ultrasonic measuring technology and pushing itas far as they can in accuracy, range and sensing properties (sensing cones) in these very low-cost sensors. Here’s a line up of the models we carry at Modern Device.

MB1010 LV-MaxSonar®-EZ1 – Least Expensive, good starter ($27.97)

MB1013 HRLV-MaxSonar®-EZ1 – Highest Resolution (1mm)

MB1200 XL-MaxSonar®-EZ0 – Longest Range (300in)


We got in contact with the good people at Maxbotix and showed them our research. They were pleased to see us exhibiting their equipment, and gave us some feedback on our setup…

First, I reviewed your test setup and thought you did a pretty good job. As such there is a variable that can make a big difference in your testing results. This is the temperature compensation and the location of measurement. Going though a vertical column of air is known to typically have temperature variation from the top vs the bottom. This change in temperature can affect the temperature compensation of the sensor and lead to some inaccuracies. For best accuracy, it is recommended to use a MaxTemp mounted half way between the target and sensor so that you have the most accurate temperature reading. Even one or two degrees c will have an effect on the reported range. 

You can view more on the MaxTemp at this link

By Britton on January 28, 2015.

Using the Lots of Pots Board for Raspberry Pi


Here’s how to use the Lots of Pots Board for the Raspberry Pi. The daughterboard (or shield; what are we calling Raspberry Pi add ons these days?) sits on top of the Raspberry Pi and breaks out the various GPIO pins in a useful and labeled manner. It also has an 8 channel MCP3008 analog to digital converter on board, which is hooked up to the hardware SPI pins on the GPIO header. This tutorial will describe the features of the board and cover how to read analog inputs from the ADC.

Continue Reading →

By Shawn Wallace on July 26, 2013.

Talking to the Raspberry Pi’s Serial Console with a Modern Device BUB


A question popped up on the Raspberry Pi forum a little while back asking whether the BUB could be used to connect to the serial port on the Raspberry Pi’s GPIO header. The answer is yes; it works quite well! The BUB is essentially a breakout board for FTDI’s FT232 chip that translates between a USB connection and a TTL-style UART. This is the chip that was on the pre-Uno Arduino (USB translation is handled in software on a second microcontroller on the Arduino Uno). The BUB (and BUB II) are used to communicate with most Modern Device and Jee Lab controllers, except for the BBLeo.

The BUB has a few other features that make it a bit more flexible than Just Another Breakout Board. For example there’s a polyfuse to help protect your computer if you accidentally draw too much current, and a jumper to change logic levels from 3.3 to 5 volts. The BUB I also has a handy breakout area that allows you to reroute the signals to any of the pins on the header. This is useful for connecting to devices with different pinouts like the Raspberry Pi or Parallax Propeller.

Continue Reading →

By Shawn Wallace on May 15, 2013.