littleBits Arduino: More observations

Back with a few more quick observations as I get started with the littleBits Arduino module. (Please see my first review.)

I decided to see how much stuff I could cram around the littleBits Arduino. (Click on the image below for full resolution.) This configuration starts with the power module on the left hand side. The power module is connected to a 9V 1500mA (1.5A) center positive power adapter with a 2.1mm plug. As I mentioned in my previous post, this is the same adapter that I use with my Arduino UNO. Already, I like the power switch on the power module — a very handy touch.

arduino_full_up

The power module drives three input modules (a button and two dimmers) via the fork module which is included in the Arduino Development Kit. The button module is connected to Arduino digital input D1 and the dimmer modules are connected to the Arduino analog inputs A0 and A1.

The Arduino D5 output is connected to a dimmer module that adjusts the volume (amplitude) of the signal sent to the synth speaker module. Yep, the synth speaker module has a volume control of its own. It’s that little trim pot in the lower left corner of speaker module. I find it difficult to adjust the tiny trim pot. Trim pots are designed for “set and forget” applications and have a limited rotational life (number of cycles). So, I splurged and inserted a dimmer module on the input to the speaker module.

I love the bargraph. You can use it as a poor man’s volt meter or logic indicator. I connected the bargraph module to Arduino output D9. Before I forget, the switches for D5 and D9 are set to the “analog” position.

I didn’t connect anything to Arduino digital output D1. A good first sketch would be blinking the on-board D1 LED on and off. So, I left the bitSnap empty.

The knobs on the dimmer modules are my own doing. The knobs do not come with the dimmer modules. I have a dozen or so of these basic knobs. The equivalent knobs are:

  • Multicomp CR-BA-7C6-180D ($0.35 per knob through MCM Electronics)
  • Sparkfun COM-08828 (now retired)

Knobs just make life easier and make things a little more dressed up.

I was hoping that littleBits had preloaded a sketch to the Arduino module and they did. The preloaded sketch makes the bargraph “breathe.” The sketch repeatedly ramps up the output voltage from zero volts to the MAX (5 volts) and ramps the voltage back down to zero volts. The dimmer connected to A1 controls the ramping speed, i.e., how fast the bargraph breathes.

I wish that littleBits made the preloaded sketch available on their web site. I couldn’t find it. Quite frequently, it’s handy to have a known-good sketch for testing purposes. I’m a stickler for testing and diagnostic programs. Too much emphasis on coding, not enough emphasis on testing, I say.

The littleBits site has a good introduction to installing and using the Arduino Integrated Development Environment (IDE). If you’re confused about the “analog” and “pwm” switch settings, be sure to scroll down into the comments section on this page. There is a good explanation. A short bit of advice: If you need to send an analog signal that varies anywhere from 0 to 5 volts, then put the switch into the “analog” position. If you need to send a purely digital signal (ON: 5V, OFF: 0V), then put the switch in the “pwm” position. (A pulse chain is, of course, a type of digital signal.)

If you’ve taken a look at the Arduino module schematic, you know that the switch enables (or disables) two extra stages of low pass filtering. The low pass filters (when enabled) generate an analog signal by smoothing out a PWM signal. This is essentially a poor man’s digital to analog converter (DAC) although it isn’t very hi-fi.

The littleBits web site has ten sketches to get you started. This part of their site could use a little polishing. First, I couldn’t find the source code for the sketches! At last, I realized that the link to a sketch is under the “ADDITIONAL FILES” section on the right hand side of the page — beneath the relatively huge “ADD ALL TO CART” button. Ah, sales before service. Beginning users may not realize that this is the link to the code. They may not know that the “ino” file extension refers to an Arduino IDE code file! Maybe kids are less confused than adults, but details like this could easily turn off a youngster who is lacking self-confidence.

The sketch file names are a little whack and don’t always directly refer to the section or page titles on the sketch web pages. Here is a correspondence table that I put together:

Example                     Source code file
--------------------------  ------------------------------
Blink                       blink.ino
Hold An On/Off State        buttonRead_stateChange.ino
Blink Speed Control         analogRead_digitalOutput.ino
LED Fading Effect           analogRead_analogOutput.ino
Servo Sequence Recorder     Sequence_Recorder_Starter.ino
DIY Etch A Sketch           etchasketch_arduino.ino
Analog Pong                 analog_pong_arduino.ino
DIY Computer Mouse          mouseMoveNClick.ino
Play A Melody               toneMelody.zip
Change The Pitch            tonePitchFollower.ino

Again, littleBits need to reduce the frustration barrier especially since kids are involved or teachers who have suddenly been assigned to computer science.

In my first review, I mentioned how mounting boards are essential for building mechanically robust and electrically reliable littleBits systems. Definitely true. However, littleBits still have room for improvement. The current mounting boards have quite a bit of flex in them and the pegs still pop out easily. I had a heck of a time getting the system (pictured above) to stay firmly put in the mounting board. It’s takes a lot of pressure to get a big system into a mounting board. I’m afraid that the pressure will weaken the board connections. Perhaps things will get better with practice or use…

If you’re interested in the backstory about the littleBits Arduino module, then read this article.

MidiVOX: An appreciation and review

They just don’t make ’em like they used to. In the case, of the Narbotic Instruments MidiVOX shield for Arduino, I really mean it!

The MidiVox is a bit of a blast from the past as Narbotic no longer manufacture and sell the MidiVOX shield kit. Major bummer. Luckily, I purchased one of these little gems from the MakerShed when the shields were available a few years ago. Narbotic kindly maintain the design information and code on their Web site.

To me, the MidiVox is a most logical combination of a MIDI IN port and a 12-bit digital-to-analog converter (DAC). The MIDI port incorporates a 6N138 optocoupler for electrical isolation and a 5-pin DIN connector. The port is connected through a “PGM/MIDI” switch to Arduino digital pin D0, also known as the serial receive (RX) pin. The PGM position connects the serial pin the usual way in order to download to the Arduino. The MIDI position connects the Arduino serial RX pin to the MIDI IN circuitry. The switch component is robust and is easily accessible when the MidiVOX is on top of the Arduino and/or other shields.

The 12-bit DAC is a Microchip Technology MCP4921. This DAC is used in several other audio shield designs including the Adafruit Wave Shield and the Nootropic Design Audio Hacker Kit. The MCP4921 connects to the Arduino SPI port through digital pins D13 (SCK), D11 (MOSI), and D9 (chip select/slave select). Conventional practice recommends using D10 as slave select (SS), but it isn’t a big deal to use D9 instead as this is mainly a software issue. Slave Select (called “chip select” in the MCP4921) chooses and enables communication with the slave device. This capability is essential when more than one device is connected to the same SPI interface as in the case of the Nootropic Audio Hacker shield.

Although it seems like a no-brainer to connect all SPI devices to the Arduino SPI pins, the Adafruit Wave Shield does not follow this approach. It connects the SD card interface to the SPI pins, but connects its MCP4921 to three ordinary digital pins. The Wave shield software bit-bangs the digital pins to transfer data to its DAC. I’m not a fan of this approach, preferring to use standard libraries instead of possibly buggy, poorly documented bit twiddling code.

The MidiVOX shield implements a 2-stage, passive filter following the DAC output. The MidiVOX sends a mono signal through an on-board trim pot into a 3.5mm audio output jack. Trim pots are usually rated for a relatively small number of operating cycles, so it’s best to set this level once and make volume adjusts at an external mixer, preamp, or whatever.

The MidiVOX shield provides a DATA LED controlled by digital pin D7. The shield also has a RESET button (momentary contact switch) connected to digital pin D6. This button is ACTIVE LOW, meaning that the button pulls D6 to ground when it is pressed. Therefore, the pin mode should be configured as INPUT_PULLUP such that D6 is pulled up internally when the button is not pressed (i.e., the momentary contact switch is open).

Construction was easy. The resistors have five color bands, but don’t let this throw you off. The construction directions give the correct color code and you can (and should!) always check resistor values with a meter before insertion and soldering. I replaced the basic header pins with “stackable headers” (two 8-pin and two 6-pin). Stackable headers provide a way to make easy external connections to the shield stack from a breadboard, etc.

The completed board is shown in the photo below. The MidiVOX is stacked on an Arduino UNO with the USB, audio and MIDI cables, and is ready to go.

MidiVox

I wrote a diagnostic sketch to check out the different parts of the MidiVOX. I wish manufacturers would provide check-out sketches instead of relying on somebody’s possibly flaky application sketch for smoke testing. If something is busted, it’s important to find it early through a directed test that isolates the failure. Fortunately, everything checked out OK the first time!

The MidiVOX diagnostic program is an Arduino sketch to check out parts of a Narbotic Instruments MidiVOX shield. Rename the “loop” functions and rebuild in order to test a particular section of the shield.

Since the MidiVOX is discontinued, we’re all out of luck if we want to get (another) one. However, I strongly recommend studying the MidiVOX design. When I first got started with Arduino and MIDI, I borrowed the MIDI IN circuitry and the low pass filter design. These are simple, solid circuits and are good basic building blocks for other designs and applications.

Where to next? My dream is to build a low-cost 60s combo organ with the era-appropriate look and sound. The organ would look like a Vox Continental with a Z-shaped chrome stand and bright red Tolex covering. It would sound like either a Farfisa or a Vox — nothing too nuanced with all of the drawbars or tabs turned on. I’d like to use a cheap and lightweight MIDI controller as the keyboard. The controller would drive a low-cost (Arduino-based?) sound generator. I’m hacking out a prototype using an Arduino UNO and the MidiVOX shield. More to come…