Worksheet 2.3.1

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Worksheet 2.3.

Student Name: Humanshi UID: 21MCA3001


Branch: MCA Section/Group: 21MCA-4A
Semester: 4th Date of Performance: 27-04-2023
Subject Name: Embedded Programming Subject Code: 21-CAH-752

1. Aim/Overview of the practical: (For ODD UIDs)


Design a car having four wheels (DC Motors) using motor-driven IC and interface with Arduino. It will follow
certain conditions

a) All the wheels moving in the forward direction for 3 secs


b) All the wheels will stop for 2 secs
c) Two wheels will be moving in clockwise and the rest will move in anti-clockwise direction

Note:

1. Paste the Screenshots of Every Circuit as per the mentioned case.


2. Screenshot should have your Name and UID (21MCI1234_XYZ)
3. Mention the comments in the programming.

2. Apparatus (For applied/experimental sciences/materials based labs):

Hardware Requirements: Motor, Battery, Wires, BreadBoard, Arduino Uno

Software requirements: TinkerCad

3. Circuit Diagram(TinkerCad):
1. Coding:
#define M1_pin1 11
#define M1_pin2 12
#define M2_pin1 2
#define M2_pin2 3
#define M3_pin1 8
#define M3_pin2 9
#define M4_pin1 5
#define M4_pin2 6

void setup()
{
pinMode(M1_pin1,OUTPUT);
pinMode(M1_pin2,OUTPUT);
pinMode(M2_pin1,OUTPUT);
pinMode(M2_pin2,OUTPUT);
pinMode(M3_pin1,OUTPUT);
pinMode(M3_pin2,OUTPUT);
pinMode(M4_pin1,OUTPUT);
pinMode(M4_pin2,OUTPUT);
}

void loop()
{
// All the wheels move in the forward direction for 3 secs
digitalWrite(M1_pin1,1);
digitalWrite(M1_pin2,0);
digitalWrite(M2_pin1,1);
digitalWrite(M2_pin2,0);
digitalWrite(M3_pin1,1);
digitalWrite(M3_pin2,0);
digitalWrite(M4_pin1,1);
digitalWrite(M4_pin2,0);
delay(3000);

// All the wheels stop for 2 secs


digitalWrite(M1_pin1,0);
digitalWrite(M1_pin2,0);
digitalWrite(M2_pin1,0);
digitalWrite(M2_pin2,0);
digitalWrite(M3_pin1,0);
digitalWrite(M3_pin2,0);
digitalWrite(M4_pin1,0);
digitalWrite(M4_pin2,0);
delay(2000);

// Two wheels move in clockwise & Two wheels move in anticlockwise


digitalWrite(M1_pin1,0);
digitalWrite(M1_pin2,1);
digitalWrite(M2_pin1,0);
digitalWrite(M2_pin2,1);
digitalWrite(M3_pin1,1);
digitalWrite(M3_pin2,0);
digitalWrite(M4_pin1,1);
digitalWrite(M4_pin2,0);
delay(3000);
}
5. Learning outcomes (What I have learnt):
1.

2.

3.

4.

5.
Evaluation Grid (To be created as per the SOP and Assessment guidelines by the faculty):

Sr. No. Parameters Marks Obtained Maximum Marks


1. Worksheet Completion 10 marks
2. Post Lab Quiz Result 5 marks
3. Student Engagement 5 marks
(Simulation/
Demonstrate/Performance
and Pre-Lab Questions))
Total 20 marks

You might also like