Output device
this week assignement are:
- Add an output device to a microcontroller board you've designed and program it to do something.
Choosing the Output
for this week project i decided to use a Vibration motor , made for smartphone , it's a standard DC motor, with a counterweight in it.
For Using a motor you have to add to your circuit three other component.
A free-wheeling diode. a free-wheeling diode like the name say it,block the current made by a motor turning by itself caused by the inertia of the motor.
the second component is a capacitor, is used to smooth out current spikes caused when controlling a motor speed using digitally-controlled PWM signal.
more here
and the third one is a transistor, for using a motor, with low or high voltage, using a transistor is necessary, for beeing sure to not having any Parasite of the motor into the ATtiny.
When you understood how to make it you can start to make your new board.
i used my documentation of last week for making my Output board. i decided to keep the flex sensor and the led, like that it's my own echo helloboard.
Making your schematics
![](images/w12/schematic.png)
So i changed the way i connect my Flex sensor, the tension divider was into the Ground line before. now is into the vcc circuit. for the led i'm using it like an idicator led. when i have some doubt about my code. or the Board fonctionnality . i'm sending a blink in it.
![](images/w12/board.jpg)
![](images/w12/fabmodule.jpg)
![](images/w12/heroshot.jpg)
the code
When the board is finish we have to upload the code to it.
Like i did in Embeded programming Week
i am using an arduino as an ISP. it's working great.
- Pin13(arduino) to SCK
- pin12 (arduino) to MISO
- Pin11(arduino) to MOSI
- Pin 10(arduino) to RESET
- 5V to VCC
- Gnd TO Gnd
![](images/w12/TRACEOUT.png)
GO on file> example>arduinoISP
Upload the file into your arduino. then choose the Attiny 44 into the board manager, choose the internal clock to 8Mhz, change the programmer to Arduino as isp.
![](images/W11/arduino.png)
![](images/W11/blink.jpg)
file of the week.
here you'll find the file of the week
For downloading
right click and save as
- Brd file (Eagle board file)
- sch file (Eagle Schematic file)
- Ino file (RIGHT CLICK - SAVE AS)