cover photo

COURSEWORK

Vibha's AI-ML-001 course work. Lv 1

Vibha HAUTHORACTIVE
This Report is yet to be approved by a Coordinator.

Level 0 Report

20 / 7 / 2024


TASK 1: 3D PRINTING

This task was surprisingly simple, and I finished it with the help of the D&P coordinator, Sudeep, along with a fellow batch student in the D&P domain. I understood how to obtain a model to 3D print off of Thingiverse sliced it using Cura, tweaked various settings such as the nozzle/bed temperatures, the thickness and density of the filament, and so on.

  • Bed Temp: 60°C
  • Nozzle Temp: 210°C
  • Speed: 75mm/s
  • Fill Density: 10%

3D Printing Image 1 3D Printing Image 2


TASK 5: KAGGLE

Followed a Kaggle tutorial to learn how to create a notebook, write code and make a submission to the Titanic ML competition, then successfully submitted the same.

Kaggle Image 1 Kaggle Image 2 Kaggle Image 1


TASK 6: WORKING WITH PANDAS AND MATPLOTLIB

First, I went to the Windows command center and updated Pandas using pip (already had it installed). Further, I created some random dataset for the plots and the code is as follows:

import pandas as pd
import matplotlib.pyplot as plt

# Not real data
data = {
    'Student': ['Aarav', 'Bhavna', 'Chirag', 'Divya', 'Esha'],
    'Math': [85, 78, 92, 88, 76],
    'Science': [91, 82, 89, 94, 78],
    'English': [78, 74, 85, 90, 80]
}
df = pd.DataFrame(data)

# For ze line graph
# Set Student as the index
df.set_index('Student', inplace=True)

# Plot off
df.plot(kind='line')

# label everything
plt.title('Student Grades')
plt.xlabel('Student')
plt.ylabel('Grades')

# Show the graph
plt.show()


# Scatter Plot (Math vs Science)
df.plot(x='Math', y='Science', kind='scatter')
plt.title('Math vs. Science Grades')
plt.xlabel('Math Grades')
plt.ylabel('Science Grades')
plt.show()


Line Scatter

TASK 9: TINKERCAD

Learnt how to use Tinkercad, the features present, pre-existing circuits rigged, and also learnt about the basics of ultrasonic sensors and so on. Circuit and code as shown:

TinkerCad Sensor

#include

#define trigPin 8
#define echoPin 9

long duration;
int distance;

Servo myservo;

int calculateDistance()
{
  digitalWrite(trigPin,LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin,HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin,LOW);
  duration = pulseIn(echoPin, HIGH);
  distance = duration*0.034/2;
  return distance;
}

void setup()
{
  pinMode(trigPin , OUTPUT);
  pinMode(echoPin, INPUT);
  myservo.attach(11);
  Serial.begin(9600);
}


void loop()
{
 int i;
 for (i=15; i<=165; i++)
 {
  myservo.write(i);
  delay(15);
  calculateDistance();
  Serial.print(i);
  Serial.print(",");
  Serial.print(distance);
  Serial.print(".");
 }
 for(i=165; i>=15; i--)
 {
  myservo.write(i);
  delay(15);
  calculateDistance();
  Serial.print(i);
  Serial.print(",");
  Serial.print(distance);
  Serial.print(".");
  
 }
}

TASK 10: SPEED CONTROL OF DC MOTOR

Motor Driver: L293D/L293N
Board: Arduino UNO

Schematic Circuit:

Schematic and The Other Thing

Simulation+Code:

// int enable2 = 9;
int in3 = 10;
int in4 = 11;

void setup() {
  pinMode(enable2, OUTPUT);
  pinMode(in3, OUTPUT);
  pinMode(in4, OUTPUT);
  Serial.begin(9600); // Initialize serial communication for debugging
}

void loop() {
  Serial.println("Running at half speed, forward direction");
  analogWrite(enable2, 127); // Half speed
  digitalWrite(in3, HIGH);
  digitalWrite(in4, LOW);
  delay(10000); // Wait for 5 seconds

  Serial.println("Running at full speed, reverse direction");
  analogWrite(enable2, 255); // Full speed
  digitalWrite(in3, LOW);
  digitalWrite(in4, HIGH); // Reverse direction
  delay(5000); // Wait for 10 seconds
}

TASK 12: SOLDERING

I perused the assistance of the provided article on the resource page, a fellow MARVEL student and a coordinator to solder the terminals of a cell onto a board. Following are the images of the same.

I began by desoldering an old LED, using a copper wick, and then soldering the cell holder to the two extreme terminals.

Soldering Image 1 Soldering Image 2 Soldering Image 3 Soldering Image 4


TASK 13: ASTABLE MULTIVIRATOR USING IC 555 TIMER

Rigged up the circuit of an astable multivibrator using IC 555 timer and got the output on CRO.

555 1 555 2 555 3


TASK 14: K-MAP AND LOGIC CKT:

Understood and revised the fundamentals of Karnaugh maps and how to derive logic circuits from the same. Process as follows:

K-Map Task


TASK 15: ACTIVE PARTICIPATION

Cerfeeteecats


TASK 16: L293D DATASHEET REPORT

The L293 seems to be a motor driver that can drive a DC motor (or any inductive load, such as a relay or stepping motors) in either direction (clockwise/anticlockwise), drawing a current of up to 600mA (peak being 1A per channel), at potentials between 4.5V to 36V. The IC is built to function within 0–70°C. Generalized, we can say that this driver is used for any load that:

  • Draws high current across high potentials.
  • Requires positive supply (as opposed to negative supply loads, such as biasing circuits or inverters).

This device is capable of driving inductive loads in opposite directions by virtue of its quadruple half-bridges (or put simply, two H-bridges). An H-bridge is a circuit consisting of four switches (either mechanical or solid-state) in the shape of an H (image from Wikipedia below).

H-bridge from Wiki

The datasheet says that each output is a complete totem-pole drive circuit, with a Darlington transistor sink and a pseudo-Darlington source. Drivers are enabled in pairs, with drivers 1 and 2 enabled by 1,2EN and drivers 3 and 4 enabled by 3,4EN. What this means is:

  • Totem-pole drive for o/p: Basically converts one voltage level into another, sort of like a transformer, but with high/low instead of specific values. It is called this because it looks like a totem pole. It consists of two transistors in a push-pull config (one PNP, one NPN so they complement each other). By controlling the base of each transistor, it’s possible to switch the output between high and low states. In the case of this driver, it can act as a sourcing side and a sinking side (stopping motor/starting motor, slowing motor/speeding up motor respectively).
  • Darlington transistor: Pairs of transistors cascaded so that we get high current gain. So pseudo-Darlington would give us high current gain, but without the multiple transistor cascading. This is present in the driver IC in order to handle the current flowing from the motor when it is being slowed down or turned off, since this abrupt action could damage our device.
  • EN: Stands for enable signals. Fairly self-explanatory. Drivers are enabled in pairs to ensure coordination.

Another detail mentioned in the datasheet is the type of packaging, which is PDIP. This stands for Plastic Dual-Inline Packaging. What this means is that the IC comes in a rectangular plastic body, and has metal pins (usually soldered) on both sides in line. This is one of the most common types of packaging. The size of the IC is mentioned to be 19.80 mm × 6.35 mm.

Let’s take a more detailed look:

We may divide the IC into two segments – the left and the right side. Each side has 8 pins, meaning that the L293D is a 16-pin IC. Each side has two inputs, and their respective outputs. Each side also has two grounding pins used as a heat sink. There are two Vcc pins, one on each side. One Vcc pin (Vcc1) is used to supply power to the IC for internal logic translation (basically, for our circuit itself to work), and the other (Vcc2) is used to power our motor drivers (the things that act as the middle-man between our IC and our connected motor).

PINLABELFUNCTION
11, 2 ENEnable i/p for left side of IC, pins 1 to 8. (Enabled if set to high, disabled if set to low).
21Ai/p 1 (non-inverting, connected to one of the motor terminals of motor 1).
31Yo/p 1 (connected to the other motor terminal of motor 1).
4GNDGround and heat sink to reduce thermal resistance.
5GNDGround and heat sink to reduce thermal resistance.
62Yi/p 2 (non-inverting, connected to one of the motor terminals of motor 1).
72Ao/p 2 (connected to the other motor terminal of motor 2).
8Vcc2>5V input for running the motor drivers.
93, 4 ENEnable i/p for right side of IC, pins 9 to 16. (Enabled if set to high, disabled if set to low).
103Ao/p 3 (connected to the other motor terminal of motor 2).
113Yi/p 3 (non-inverting, connected to one of the motor terminals of motor 2).
12GNDGround and heat sink to reduce thermal resistance.
13GNDGround and heat sink to reduce thermal resistance.
144Yi/p 4 (non-inverting, connected to one of the motor terminals of motor 2).
154Ao/p 4 (connected to the other motor terminal of motor 2).
16Vcc15V input for running the IC.

UVCE,
K. R Circle,
Bengaluru 01