20 / 7 / 2024
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.
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.
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()
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:
#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(".");
}
}
Motor Driver: L293D/L293N
Board: Arduino UNO
// 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
}
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.
Rigged up the circuit of an astable multivibrator using IC 555 timer and got the output on CRO.
Understood and revised the fundamentals of Karnaugh maps and how to derive logic circuits from the same. Process as follows:
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:
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).
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:
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).
PIN | LABEL | FUNCTION |
---|---|---|
1 | 1, 2 EN | Enable i/p for left side of IC, pins 1 to 8. (Enabled if set to high, disabled if set to low). |
2 | 1A | i/p 1 (non-inverting, connected to one of the motor terminals of motor 1). |
3 | 1Y | o/p 1 (connected to the other motor terminal of motor 1). |
4 | GND | Ground and heat sink to reduce thermal resistance. |
5 | GND | Ground and heat sink to reduce thermal resistance. |
6 | 2Y | i/p 2 (non-inverting, connected to one of the motor terminals of motor 1). |
7 | 2A | o/p 2 (connected to the other motor terminal of motor 2). |
8 | Vcc2 | >5V input for running the motor drivers. |
9 | 3, 4 EN | Enable i/p for right side of IC, pins 9 to 16. (Enabled if set to high, disabled if set to low). |
10 | 3A | o/p 3 (connected to the other motor terminal of motor 2). |
11 | 3Y | i/p 3 (non-inverting, connected to one of the motor terminals of motor 2). |
12 | GND | Ground and heat sink to reduce thermal resistance. |
13 | GND | Ground and heat sink to reduce thermal resistance. |
14 | 4Y | i/p 4 (non-inverting, connected to one of the motor terminals of motor 2). |
15 | 4A | o/p 4 (connected to the other motor terminal of motor 2). |
16 | Vcc1 | 5V input for running the IC. |