Individual Assignment:

   Add an output device to a micro-controller board you've

   designed,and program it to do something

  Group assignment:

   Measure the power consumption of an output device my

   contribution in this is to measuring values

   Group work link

key learning from this Week

1 Understanding output devices

2 Controlling motor from a program code

Files for this Week

1 eagle schematic and board file

2 PNG file for tracing , drilling and cutting

3 program code

For this week i have used the same board which i used in last week as i as i have both input and output pins in board and for output i have  DC motor which i am using in this week as output device.

Components which i add in board for this Week

1 l293d- IC for controlling Dc motor.

2 DC jack for external power supply

3 5.5 v LDO - this is used as a voltage regulator

Here i am using some pin hole component i.e l293d IC as smd IC  is not available in city but i recommend you to use smd ic for your project

Task for this week

As i am using DC Motor for my final project so i choose dc motor to power in output week and i also want to see that when i put hand over ldr sensor than only motor start rotating as I Want to make rotating table for 360 view of 3d printed model

Fabrication and Designing of board is done in week 11 refer week 11 for this

Explanation of board schematic for Output devices


In this board the green pads are for through hole component, i have connected motor for output which is to be connected at jp1 pin header ,i connect 5.5 v voltage regulator so it will supply power to all other component in circuit which are operated at 5.5 v 0r less than that .

How to Connect 12v dc motor with attiny 44 micro controller board

For connecting 12v dc motor with board you need h bridge made of two mosfet or you may use IC l293d which i used in my circuit for connection you may refer pin-out diagram for this , with one ic you can connects 2 Motors with your board one each side of this ,  connect pin 2 and pin 7 of ic  to board pin ( i/o pins) and PWM Input i.e Pin 1 to 5v and Pin 3 and pin 7 output pin of l293d to motor header , i used only one motor so i connect every thing on one side for another motor connect things in the similar way ,this thing better explained in diagram

Connection layout for Connecting Arduino to Board

Here i use Arduino for programing my board this 10, 11, 12 ,13 are pin on arduino board are programing pins and the pins of  6 pin header are in same order as shown in diagram connect respective pins having same name.

Connecting output devices with the board

i have given 2 pin pinhole header for connecting motor at back side of my board as shown in image for testing this i have taken power from arduino board as my motor will run at  5v also

Programming the board

If you are programing with Arduino you first need to upload ardunio as isp in arduino than connect all pins and upload program , if you are using fabisp  , you can write program and directly upload using fabisp but don't forgot to change settings


int ledPin = 5;

int ldrPin = 0;

void setup () {

pinMode(ledPin, OUTPUT);

pinMode(7, OUTPUT);

pinMode(6, OUTPUT);

pinMode(ldrPin, INPUT);}

void loop() {

int  ldrStatus = analogRead(ldrPin);

if (ldrStatus <= 600) {

digitalWrite(ledPin, HIGH);

digitalWrite(6, HIGH);

digitalWrite(7, LOW );


else {

digitalWrite(6, LOW);

digitalWrite(7, LOW);

digitalWrite(ledPin, LOW);







// i used for initializing  ledpin to in pin number 5

// i used for initializing  ldrpin to pin number 0

// it is a function which we use for assigning pin to output / input as this will tell

   controller that at what pin you are using input and output

//   this are for assigning input and output to pin

// this is function in which we write code for what your program will do

// we initialize a variable ldrstatus which will save value on ldrpin



// we check this value if less than 600 the code in if loop will execute otherwise it

   directly jump to else condition

// 6 and 7 are motor pin for running motor you need to assign one pin high and one pin low


// when both pin are low your motor will stop


Output devices in the final project

For My final project i made a board which is modified shashakit micro board and i made shield which is for driving four dc motor

in which i am controlling using mobile application , all the eagle files Process of making board, programing  is documented in project development page if you want more understanding on controlling motor you may Refer Project development Page

also Week 13