Chika Makes Things 2016
Week 11: Output Devices
Goal: Add an output device to a microcontroller board you've designed and program it to do something
Process: I decided to design a board using the ultrasonic module HC-SR04 distance sensor as an input and white LEDs as an output. My final project involves creating lighting for an interactive doll house and I hoped to incorporate distance sensors into each room so that when a doll entered the room the lights would turn on. I started with reviewing the datasheet for the white LEDs in stock and determining the minimum resistance needed for each LED. Using an online calculator to double check my KVL calculations, I determined that a 91 ohm resistor would do the trick and went with the next closest thing in stock : a 100 ohm resistor.
I designed the board in eagle by adapting the board used for electronics design week, which used an attiny44 AVR processor, to include 2 additional resistors (100 ohm), 2 white LEDs, and the distance sensor. Creating traces for the sensor was a struggle because it did not appear to be located in the fab library folder. I ended up googling until I found an available download for an eagle library containing this part and a few other sunfounder components.
I was able to output the board as a 600 dpi monochrome image and mill without major problems.
I noticed 2 potential problems at the end of the process. The trace for one of the header pins and attiny44 pins were fused together. I fixed this pretty quickly with an exacto knife. The other thing that became an issue was the fact that I milled the traces for the sensor without pads. This made it really hard to securely connect the sensor to the board.
In the end I ended up soldering wires to these traces and just connecting the wires to the sensor.
Now the biggest problem arose when it came to programming the board. Below is arduino code I adjusted from an instructables guide
to turn on an LED when an object is a specified distance from the sensor.
I had already tested my programmer on one of Neil's designs and knew that it worked. However, for some reason, my board refused to program. I visually inspected the connections and checked them with the multimeter. I also checked the directions of the LEDS and plugged in my board while using the multimeter to make sure it was getting power. I am pretty confused about what the problem is and ran into this same issue during input devices week. My other guess is that I may have fried one of the components while soldering or there is some unknown issue with the design of the pcb. My next step is to start from scratch using one of Neil's boards as reference to redesign everything in eagle with a simple switch and LED.