Week 9, 11/01: Output Devices


It was equal parts fun and frustration this week as I attempted to fulfill the terms of the assignment. Thinking about outputs allowed me to put a lot of thought into my final project. I now know what I plan to do in greater detail than before because one of the larger aspects of the piece, what it's output will be, is now demystified.


The final project will need to combine a light source, LEDs, with a motor, to cause movement. After looking at the specifications of different motors, I decided on a simple DC motor. This would mean using an H-Bridge to help regulate the flow of energy. I also was attracted to the RGB board and wanted to experiment with the colors available in this component. I decided that the ATtiny44 would be sufficient to house both outputs, and I looked at the datasheets to ensure each pin would be able to handle what I would be asking of the microcontroller.


My mind works best when I work things out visually, so I hand drew the board by combining the two example boards.It took a long time in Eagle building the board and figuring out how the traces would map out. When I was finally ready I milled and stuffed the board.



Unfortunately, I came up with a design which turned out to fail.



I chose the wrong LED RBG component in the Eagle library, and it printed out a footprint that way too big. I was able to carefully solder the LED component on, but it was not ideal because it was too close to the edge. When stuffing the board, I accidentally soldered the capacitors on at the wrong orientation, so needed to re-do that part of the board.


I assembled the power source, battery, cord 4 pin female attachment as well as the cord and attachemtn for the DC motor.



Testing them out with a power source showed that the circuit was complete. However, the first time I connected it, it was not grounded, and gave off a bit of smoke and heat, so I quickly disconnected it.



Unfortunately, the board was not recognized by the Arduino IDE. I worked with TA Prashant who was very patient with me in not only debugging this week's board but also the board from the embedded programming week. After trying many different things, including removing an unnecessary resister that was interfering with the rest pins, he suggested I head back to the drawing board, and start off building a board, following the directions implicitly, that will work for sure. Having a working board will help me to debug any future boards, by acting like a sort of placebo. He also recommended downloading AVR Studio, which is better than Arduino and works well for PC users.



I returned to Eagle and made a couple changes in my schematic, including updating the LED RBG footprint, and moved on to the board.



I will mill this new board and also follow Prashant's suggestion until I get this right!



Update:



I've been working on this board design and checked it with TA Amanda. She brought to my attention that I was using an n-mosfet where I needed to be using a regulator. This is why my board did not work. I have updated the eagle schematic and will mill, stuff and test it.




I have finally created a board that will respond to the needs of my final project: set up for RGB LED and DC motor.


I was able to initialize the board for both the RBG LED and DC motor. For the RGB LED, I had to update the code to reflect where the rgb pins were located. Since green was connected to port A, and red and blue were both connected to pins in port B, I had to add a new couple of lines of code to indicate that. I also had to change the .c file to an Attiny 44.




When I ran the commands:

  1. sudo make -f hello.RGB.45.make
  2. sudo make -f hello.RGB.45.make program-usbtiny


It appeared that the board accepted the code, there was no error message in the terminal. However, the LED did not run.




I was not sure to make of this at this stage, since I had worked with Kreg to debug the board for more than an hour. I checked the solder flow, and did re-flow in a couple of areas. I checked each connection with the multimeter to make sure that, since the board was running off a 9V battery, that the regulator was doing its job and only allowing 5V to make it to the microprocessor. It was, there was 5v going across the Attiny44 as well as the H-bridge. We went over the Eagle file to see if there was any issue, and the only thing he though might be causing problems was that in Neil's HBridge board, there was a ground, heat sink pad milled underneath the HBridge. In my file, VCC was running under the HBridge. We googled it to find out whether this could be causing a short, but ultimately decided it should not be affecting the board. I also tried to initialize "blink" through Arduino. Since each of the RGB LEDs are set to a different pin, I tried setting each pin to the program. It is so strange, since it appeared to upload just fine. There was not an error message at all. Alas, the board did not blink. It's confusing that the programs will not run on the board, and yet it is clear that the computer is talking to the board. There is further debugging that needs to occur, but on a positive note, at least I'm getting somewhere: making very slow progress.