Circuits with Sensor Inputs
This week, we explore "inputs" for circuits, or sensors that read data from environmental conditions on/in/around the circuit and send results over serial data connection for use in later analysis.
In keeping with the goal of making progress on the final project, I tried to make this week's circuit applicable for the self-assembling buckyball project, modeled and printed below (where each tile will include a cutsom PCB):
Each tile will include surface mount circuitry, enabling an emergent functionality when all tiles have been successfully connected. I began this week's (extensive) design process by selecting a 6DOF acceleromter/magnetometer sensor. In the final design, I would like to measure the linear and angular position data of the tiles, as they tumble in zero gravity in a LEO orbit, the temperature (in both the sun and out-of-sun portions of the orbit), and magnetic field (via magnetometer). This will likely require a 9DOF sensor, that includes both an accelerometer and gyro, but there were no 9DOF sensors stocked in the lab. Both the 6DOF sensor and 9DOF sensor typically come with an extra temperature sensor embedded (per their data sheets), so I will not need a separate temp sensor. I decided to use the LSM303DLHC stocked in Fab Inventory.
To prepare for flexibility to receive data from other sensors (perhaps the 9DOF sensor, if later ordered), I decided on a modular approach. I designed the sensor on a breakout board that could be replaced by a new breakout board, when I later wish to upgrade the sensor. For the brains of the circuit, or the main "chip board", I selected the ATMEGA 328P, primarily for the number of pins and readily available firmware code from many adafruit/arduino tutorial projects.
Sensor schematic and original sensor board (separated into a breakout board for modularity):
I later realized that my sensor board needed to be flipped differently to properly mate with the header pins on the main chip board, requiring the redesign below. When preparing this file for milling, because the pads on the sensor are so close together, I removed pixels in photoshop until the space between traces was sufficient to match the milling resolution of the modela. Alternatively, you can edit the sensor part in Eagle and save this with narrower pads.
Chip (aka the brains) schematic and board (adapted with my required voltage reg, resonator and header pins for the sensor)
Attempt at milling--first pass tool path for modela (clearly not clean enough). You can see from the image below that certain pads of the 328p chip are blending together, which would short those connections on the board. To fix this problem, I went back into Eagle and found a version of the 328p chip from the Fab library that had narrower pads.
Finally, after several milling attempts and an exploration into even finer bits than 1/64" (which I later realized were not necessary), I was able to get a cleanly milled chip and sensor board, with distinct traces for the delicate ATMEGA328P chip legs and the LSM303DLHC sensor pads.
Notes on circuit design considerations
- How to choose the right FTDI cable: There are two values of voltage to consider in your circuit. First, what the board components need for power and second, what the logic pins are expecting. I have designed my circuit to run 3.3V logic and 3.3V powered components. However, most power over USB is at 5V due to standard USB specs. This means I'll need a voltage regulator to step down my power from 5V input to 3.3V. Now that those expectations are set, when I choose my FTDI cable, I need one that outputs 5V power (pretty standard, since it's over USB) and 3.3V logic. I highly recommend the adafruit FTDI friend, as it is a reconfigurable FTDI where you can set whether it gives 5V or 3.3V for board power, and 5V or 3.3V for board logic.
- Although my current sensor design doesn't require the Interrupt Pins, I have connected them anyway for future flexibility. I am, however, limited to using sensors that communicate over I2C, as those are the lines (SDA and SCL) that connect to the breakout board.
- When stuck on how to route the circuit, remember zero ohm resistors! These can be used as non-conductive bridges that lie over other traces, and allow you greater flexibility in routing the board (since we are already confined to a one-surface milling).
- Use the Eagle and CBA/Fab-specific DRC checks at the end of designing your circuit, before milling. These will predict trouble errors for the mill, where the traces are not millable by our Modela standards.