Keiichi Onishi

MAS.863 How to Make (Almost) Anything

Output Devices

This week's assignment was "add an output device to a microcontroller board you've designed and program it to do something"

Overall progress

This week I wanted to make a small progress towards my final project, laptop theif prevention device, making a circuit board with accelerometer. The final project needs speaker and LED as output devices, so I decided to put both of them on my PCB. I burned two speakers due to my misunderstanding about pin assignment, but finally I managed to beep speaker.

  • What: Speaker and LED
  • Components: hello.speaker.44 board; Red LED; Speaker
  • Design tool: Eagle

OUTPUT 02
Step 1: Design PCB

I modified Neil's board design using Attiny44 and adding red LED with resistor. I milled PCB without any issues. At this moment, I didn't read through data sheet of ATTiny44 confirming which pins would allow me to use PWM, which was the worst mistake I would be able to make for designing circuit board!

OUTPUT 03
Step 2: Soldering PCB

I soldered PCB, and made speaker unit and battery unit. Now I have PCB and sensors. There are two kinds of MOSFET, which are N-type and P-type. For my design, I needed N-type.

OUTPUT 04
Step 3: Programming Attiny44 and burning speaker

I connected everything and programmed IC. It seems running perfectly in the beginning. But it was not true. I saw smoke from my speaker..."Let it smoke~, Let it smoke~," I recalled that song. As LED was on, I suspected that something wrong only with speaker section of circuit boards and/or program. After checking pin assignment for speaker section, I noticed that I connected N-type MOSFET to PA1 pin that doesn't have PWM function. I was trying to use the pin physically on circuit board and in program. Due to time constraint, I decided to jump wire connection using wire between PA7 and MOSFET. This mistake came from my laziness of reading data sheet.

OUTPUT 01
Step 4: Final product

Finally I successfully programmed my board and it worked! For the sound creation part, I will edit my program to create beep sound which is needed for my final project. I will also create a circut board with accelerometer based on this circuit design. Here is a video of my final product.