Ariel Ekblaw - HTMAA Portfolio

Circuits with Output Devices

This week, I am continuing work on my accelerometer/magnetometer board for the self-assembling tiles final project. To see the work up to this point, please see Circuits with Input Devices

Though my "output" is relatively simple initially (just an LED), I have designed the board to be primarily a sensor (aka input) device, with flexibility for testing new sensors in the future, and a responsive LED to indicate information about the status of the sensors and final project tile neighbors. By choosing a modular design and separating the processor from sensor via a breakout board, I am able to rapidly test new sensors without redesigning and fabricating a new board each time. My output LEDs give important status information for two things initially: a red LED for power status (post voltage regulator) and a green LED on digital pin 13 (I'll explain the mapping between chip pins and Arudino "digital pins" below) for programmable function based on scripts loaded onto the board. This programmable function can be dependent on the sensor data, thus offering a visual mode of interpretation.

Finishing up Board Design Steps & Soldering

Continuing from where I left off in the Inputs week, I needed to first re-design the sensor board, mill and stuff it. I realized after making the initial design and milling an early sensor board, that I had not flipped the directionaliy of the pins as required for proper mating with the female headers on the chip board. You can see the redesigned sensor board below, freshly milled, partially "stuffed" and fully stuffed:

A tip for soldering on pin headers that will need to match precisely with the distance of the receiving (female) pins: In eagle, make sure the distance between the two rows of pins/female headers is the same on each board. Then, when soldering, solder on both sets for one board and only one of the matching sides for the second board. Connect the two boards gently, and get a visual idea for where the final piece will need to be soldered for good alignment.

A note on soldering the 6 or 9DOF LSM packages. These sensors have very tiny pads on the underside of the "package", making them quite difficult to solder. The technique that worked for me (luckily the first time) was to "tin" the board layout where the chip should be placed, gently lower the chip over the cold solder pads with proper orientation, and bring the heat gun in until the solder melts and the chip bonds to the board. You'll want to be careful that you don't hold the heat gun on too long, lest you fry your board, but this technique seems to be the most reliable method of firmly soldering on these sensor packages. Thanks to Caroline Jaffe for the tip on this one!

Now, for assembly of the "modular" chip board + sensor board:

With both boards milled and the soldering complete, we can first test the connections via the continuity setting on the multimeter and then test the modular function. I carefully checked each board for shorts (there were none, yay!) and checked that the pins on the microcontroller that had traces going under the chip were properly connected. You can see that the boards fit together nicely, below:

Programming the board!

There are many approaches you can take for programming the chip on a homemade board. I chose to treat my chip like an arduino, and wanted to be able to load sketches directly onto my board via the ardunio IDE. This saves some of the pains of the straight C file approach, though both have their merits.

Programming Steps for ATMEGA 328p

Reading sensor output

Now that your board is able to receive new programs, you can begin reading data from your sensors. It's helpful to start with a sample sketch for your sensor, if you have picked a sensor for which there are adafruit tutorials (such as the LSM303dlhc, that I'm using on this breakout board set). To get started, you'll also want to download the arduino/adafruit libraries for the sensor in question, if they're available. I downloaded the generic Sensor and LSM303DLHC-specific adafruit libraries, and saved the unzipped folders to the proper Arduino "libararies' folder in your application's data files. In addition, it's helpful to know that Arduino programs have their own numbering systems for the 328p pins, as seen below:

Below, you can see the sample arduino sketch that prints out the X,Y, and Z coordinates of the accelerometer data to the serial output window (behind the Tools menu selection pane), and what this output looks like. The output for the magnetometer is quite similar.

When you first open the serial output window, make sure the baud rate is set to match what is defined in the script. .

"Outputs" for this ciruit

Because I am using this week to continue design work on my final board, I did not explore more complex "output" options like servos. I am most interested in outputing sensor data from the self-assembling geodesic dome and analyzing this properly. I did however include an extra output LED on digital pin 13 to be able to communicate status visually, either based on sensor data (what it's currently programmed to do) or based on an independently defined function that uses this output (say, to blink only when all the tiles have joined and assembled correctly...presaging my work in the networking week).