Electronics
Electronics
What is DC Voltage?
in contrast to direct current (DC) which flows only in one direction.
1. Plug your black and red probes into the appropriate sockets (also
referred to as "ports") on your multimeter. For most multimeters, the
black probe should be plugged into the socket labeled "COM," and the
red probe into the socket labeled with a "V" (it might also have some
other symbols). Remember to check out our image gallery, the
Multimeter Overview tab, or your multimeter's manual if you have
trouble identifying the right socket.
2. Choose the appropriate voltage setting on your multimeter's dial.
Remember that most battery-powered circuits will have direct current,
but the setting you select will depend on the science project you are
doing. If you are working with a manual-ranging multimeter, you can
estimate the range you need based on the battery (or batteries)
powering your circuit. For example, if your circuit is powered by a
single 9V battery, it probably doesn't make sense to select the setting for
200V, and 2V would be too low. If available, you would want to select
20V.
3. Touch the probe tips to your circuit in parallel with the element you
want to measure voltage across (refer to the Multimeter Overview tab
for an explanation of series and parallel circuits). For example, Figure 6
shows how to measure the voltage drop across a lightbulb powered by
the battery. Be sure to use the red probe on the side connected to the
positive battery terminal, and the black probe on the side connected to
the negative battery terminal (nothing will be harmed if you get this
backwards, but your voltage reading will be negative).
measure DC voltage (DCV) and the red probe is plugged into the correct port
for measuring voltage (labeled "VΩ" because it is also used to measure
resistance).
1. Plug your red and black probes into the appropriate sockets (also
referred to as "ports") on the multimeter. For most multimeters, the
black probe should be plugged into the socket labeled "COM." There
might be multiple sockets for measuring current, with labels like "10A"
and "mA". Note:It is always safer to start out with the socket that can
measure a larger current. Plug the red socket into the high-current port.
2. Choose the appropriate current setting on your multimeter. Remember
to check if your circuit is direct current or alternating current, and that
almost all battery-powered circuits will be direct current. If your meter
is not auto-ranging, you might need to guess at the scale to use (you can
change this later if you don't get a good reading).
3. Connect the multimeter probes in series to the current you want to
measure (refer to the Multimeter Overview tab for an explanation of
series and parallel circuits). For example, Figure 7 shows how to
measure the current through a lightbulb that is powered by a battery.
Be sure to use the red probe toward the battery's positive side,
otherwise your current reading will be negative.
1. Plug your red and black probes into the appropriate sockets on your
multimeter. For most multimeters, the black probe should be plugged
into the socket labeled "COM," and the red probe should be plugged into
the socket labeled with an "Ω" symbol.
2. Choose the appropriate resistance measurement setting on your
multimeter's dial. If you have an estimate for the resistance you will be
measuring (for example, if you are measuring a resistor with a known
value), that will help you pick the range.
1. Set your multimeter to the continuity check symbol. Remember that this
symbol might not look the same on all multimeters (and some
multimeters do not have it at all), so check out the Multimeter Overview
tab or our multimeter image gallery to see examples.
2. Plug your probes into the appropriate sockets. On most multimeters, the
black probe should go into the socket labeled "COM," and the red probe
should go into the same socket you would use to measure voltage or
resistance (not current), labeled with a V and/or an Ω.
3. Important: Turn off the power supply to your circuit before doing a
Touch two parts of your circuit with the probes. If the two parts of the
circuit are electrically connected with very little resistance between
them, your multimeter should beep. If they are not connected, it will not
make a noise and might display something on the screen such as "OL,"
"OVER," or "1," which all stand for "overload." The easiest way to test
this function with your multimeter is to check it with a single piece of
conductive material (most metals) and a piece of non-conducting
material, like wood or plastic. See Figure 9 for an example.
How do I know which scale to pick for voltage, current, or resistance, and how
do I read the numbers at different scales?
There are two types of LED 7-segment displays: common cathode (CC) and
common anode (CA). The difference between the two displays is the
common cathode has all the cathodes of the 7-segments connected directly
together and the common anode has all the anodes of the 7-segments
connected together.
What is LED?
A light-emitting diode (LED) is a semiconductor device that emits visible light
when an electric current passes through it.
What is PCB?
A PCB is a thin board made of fiberglass, composite epoxy, or other laminate
material. Conductive pathways are etched or "printed" onto board, connecting
different components on the PCB, such as transistors, resistors, and integrated
circuits. PCBs are used in both desktop and laptop computers.
What is breadboard?
A breadboard is a construction base for prototyping of electronics.
Soldering , is a process in
which two or more items (usually
metal) are joined together by
melting and putting a filler
metal (solder) into the joint.
The filler metal having a
lower melting point than the
adjoining metal. Soldering differs from welding in that
soldering does not involve melting the work pieces.
In brazing, the filler metal melts at a higher temperature, but
the work piece metal does not melt
De-soldering is the removal
of solder and components from
a circuit board for troubleshooting,
repair, replacement, and salvage.
For eg,
The input is what sets an electrical circuit in action. Any of the following components can
be used as inputs:
The output is what results from an electrical circuit. Any of the following components may
be used as outputs:
• an LED
• a lamp
• a buzzer
• a piezo
• a motor or stepper motor
• a solenoid
• a relay
• a seven-segment display.
What is sensor?
STEP 1
STEP 2
To begin, you'll need to install the Arduino Programmer, aka the integrated
development environment (IDE).
STEP 3
Connect your Arduino to the USB port of your computer. This may require a
specific USB cable. Every Arduino has a different virtual serial-port address, so
you 'll need to reconfigure the port if you're using different Arduinos.
STEP 4
Set the board type and the serial port in the Arduino Programmer.
STEP 6
To upload new code to the Arduino, either you'll need to have access to code
you can paste into the programmer, or you'll have to write it yourself, using
the Arduino programming language to create your own sketch. An Arduino
sketch usually has five parts: a header describing the sketch and its author; a
section defining variables; a setup routine that sets the initial conditions of
variables and runs preliminary code; a loop routine, which is where you add
the main code that will execute repeatedly until you stop running the sketch;
and a section where you can list other functions that activate during the setup
and loop routines. All sketches must include the setup and loop routines.
STEP 7
Once you've uploaded the new sketch to your Arduino, disconnect it from
your computer and integrate it into your project as directed.
This example shows the simplest thing you can do with an Arduino or
Genuino to see physical output: it blinks the on-board LED.
Hardware Required
Circuit
This example uses the built-in LED that most Arduino and Genuino boards
have. This LED is connected to a digital pin and its number may vary from
board type to board type. To make your life easier, we have a constant that is
specified in every board descriptor file. This constant is LED_BUILTIN and
allows you to control the built-in LED easily. Here is the correspondence
between the constant and the digital pin.
• D13 - 101
• D13 - Due
• D1 - Gemma
• D13 - Intel Edison
• D13 - Intel Galileo Gen2
• D13 - Leonardo and Micro
• D13 - LilyPad
• D13 - LilyPad USB
• D13 - MEGA2560
• D13 - Mini
• D6 - MKR1000
• D13 - Nano
• D13 - Pro
If you want to lit an external LED with this sketch, you need to build this
circuit, where you connect one end of the resistor to the digital pin
correspondent to the LED_BUILTIN constant. Connect the long leg of the LED
(the positive leg, called the anode) to the other end of the resistor. Connect the
short leg of the LED (the negative leg, called the cathode) to the GND. In the
diagram below we show an UNO board that has D13 as the LED_BUILTIN
value.
The value of the resistor in series with the LED may be of a different value
than 220 ohm; the LED will lit up also with values up to 1K ohm.
After you build the circuit plug your Arduino or Genuino board into your computer, start
the Arduino Software (IDE) and enter the code below. You may also load it
from the menu File/Examples/01.Basics/Blink . The first thing you do is to
initialize LED_BUILTIN pin as an output pin with the line
pinMode(LED_BUILTIN, OUTPUT);
In the main loop, you turn the LED on with the line:
digitalWrite(LED_BUILTIN, HIGH);
This supplies 5 volts to the LED anode. That creates a voltage difference
across the pins of the LED, and lights it up. Then you turn it off with the line:
digitalWrite(LED_BUILTIN, LOW);
That takes the LED_BUILTIN pin back to 0 volts, and turns the LED off. In
between the on and the off, you want enough time for a person to see the
change, so the delay() commands tell the board to do nothing for 1000
milliseconds, or one second. When you use the delay() command, nothing else
happens for that amount of time. Once you've understood the basic examples,
check out the BlinkWithoutDelay example to learn how to create a delay while
doing other things.
/*
Blink
Turns an LED on for one second, then off for one second, repeatedly.
Most Arduinos have an on-board LED you can control. On the UNO, MEGA
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
I assume you already have an adruino board, and maybe also a Protoshield.
the 220 Ohm resistors are color coded so: Red, Red, Brown
Since this is a really simple project we only need 3 digital pins and ground.
Put the LED's in the breadboard/protoboard and use the resistors to connect
them to the digital pins,
Green to pin 8
Yellow to pin 9
then connect all the negative pins of the LED's together and to ground.
Again, since this is a really simple project the code is also simple,
just copy it from below and upload it to your board via USB.
void setup()
{
pinMode(greenled, OUTPUT); //Pinmodes of the leds
pinMode(yellowled, OUTPUT);
pinMode(redled, OUTPUT);
}
void loop()
{
digitalWrite(greenled, HIGH); //Green on for 5 seconds
delay(5000);
digitalWrite(greenled, LOW); //Green off, yellow on for 2 seconds
digitalWrite(yellowled, HIGH);
delay(2000);
digitalWrite(yellowled, LOW); //yellow off, red on for 5 seconds
digitalWrite(redled, HIGH);
delay(5000);
digitalWrite(yellowled, HIGH); //Yellow and red on for 2 seconds
delay(2000);
digitalWrite(redled, LOW); //Red and Yellow off
digitalWrite(yellowled, LOW);
}
Here is how the sensor looks. We will see another pictorial representation of
the above sensor and discuss about the details of the part.
void setup()
pinMode(LED, OUTPUT);
pinMode(obstaclePin, INPUT);
Serial.begin(9600);
void loop()
} else
Serial.println("Path is clear");
digitalWrite(LED, LOW);
delay(200);
A motor driver IC is an integrated circuit chip which is usually used to control motors in
autonomous robots. Motor driver ICs act as an interface between microprocessors in
robots and the motors in the robot. The most commonly used motor driver IC’s are from
the L293 series such as L293D, L293NE, etc. These ICs are designed to control 2 DC motors
simultaneously. L293D consist of two H-bridge. H-bridge is the simplest circuit for
controlling a low current rated motor. For this tutorial we will be referring the motor
driver IC as L293D only. L293D has 16 pins, they are comprised as follows:
Ground Pins - 4
Input Pins - 4
Output Pins - 4
Enable pins - 2
Voltage Pins - 2
The workings of the individual pins are explained in detail, later in the tutorial.
Motor Driver ICs are primarily used in autonomous robotics only. Also most
microprocessors operate at low voltages and require a small amount of current to operate
while the motors require a relatively higher voltages and current . Thus current cannot be
supplied to the motors from the microprocessor. This is the primary need for the motor
driver IC.
The L293D IC receives signals from the microprocessor and transmits the relative signal to
the motors. It has two voltage pins, one of which is used to draw current for the working of
the L293D and the other is used to apply voltage to the motors. The L293D switches it
output signal according to the input received from the microprocessor.
For Example: If the microprocessor sends a 1(digital high) to the Input Pin of L293D, then
the L293D transmits a 1(digital high) to the motor from its Output Pin. An important thing
to note is that the L293D simply transmits the signal it receives. It does not change the
signal in any case.
Working Of A H-bridge
H-bridge is given this name because it can be modelled as four switches on the corners of
‘H’. The basic diagram of H-bridge is given below :
In the given diagram, the arrow on the left points to the higher potential side of the input
voltage of the circuit. Now if the switches S1 & S4 are kept in a closed position while the
switches S2 & S3 are kept in a open position meaning that the circuit gets shorted across
the switches S1 & S4. This creates a path for the current to flow, starting from the V input
to switch S1 to the motor, then to switch S4 and then the exiting from the circuit. This flow
of the current would make the motor turn in one direction. The direction of motion of the
motor can be clockwise or anti-clockwise, this is because the rotation of the motor depends
upon the connection of the terminals of the motor with the switches.
For simplicity, lets assume that in this condition the motor rotates in a clockwise direction.
Now, when S3 and S2 are closed then and S1 and S4 are kept open then the current flows
from the other direction and the motor will now definitely rotates in counter-clockwise
Stall Condition:
When the motor is applied positive voltage on both sides then the voltage from both the
sides brings the motor shaft to a halt
Pin
Pin Characteristics
No.
Enable 1-2, when this is HIGH the left part of the IC will work and when it is low the
1
left part won’t work. So, this is the Master Control pin for the left part of IC
2 INPUT 1, when this pin is HIGH the current will flow though output 1
7 INPUT 2, when this pin is HIGH the current will flow though output 2
VC, this is the voltage which will be supplied to the motor. So, if you are driving 12 V
8
DC motors then make sure that this pin is supplied with 12 V
16 VSS, this is the power source to the IC. So, this pin should be supplied with 5 V
15 INPUT 4, when this pin is HIGH the current will flow though output 4
10 INPUT 3, when this pin is HIGH the current will flow though output 3
Enable 3-4, when this is HIGH the right part of the IC will work and when it is low
9
the right part won’t work. So, this is the Master Control pin for the right part of IC
Multimeter
Multimeter is an electronic
instrument used to measure different
electrical parameters such as voltage,
current, resistance etc. It is the
common electronic instruments used
to troubleshoot the faults in all
electrical and electronic devices. Digital multimeters are
most commonly used in electronics lab since they offer
Chapter
Introduction
to Arduino
Basics
GND : Ground.
Connecting a Battery
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.println(digitalRead(3));
delay(250);}
void setup()
{
pinMode(2,OUTPUT);
digitalWrite(2,HIGH);
delay(1000);
digitalWrite(2,LOW);
}
void loop()
{}
pinMode
void setup()
{
pinMode(2,OUTPUT);
pinMode(3,INPUT);
}
void loop() {}
void setup()
{
Serial.begin(9600);
Serial.println("Hello World");
}
void loop() {}
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.println(digitalRead(2));
delay(100);
}
void setup()
{
Serial.begin(9600);
}
Delay
If
void setup()
22
{
Serial.begin(9600);
}
void loop()
{
if (digitalRead(3) == LOW) {
Serial.println("Somebody closed the switch!");
}
}
The if line reads the state of pin 3. If it is high, which it
For
int i;
void setup()
{
int i;
void setup()
{
void setup()
{
Serial.begin(9600);
while(digitalRead(3) == HIGH) {
}
Serial.println("Switch was pressed");
}
void loop() {}
Goto
void setup()
{
Serial.begin(9600);
while(true) {
if (digitalRead(3) == LOW) {
goto wrapup;
}
}
wrapup:
Serial.println("Switch was pressed");
}
void loop() {}
int i;
void setup()
{
pinMode(2,OUTPUT);
Serial.begin(9600);
Serial.println("Welcome to my program");
delay(1000);
Coding Style
Infrared light Is
transmitted and then
reflected back From an
object. Based on the angle
of reflection, the sensor can figure out distance to that object.
Equations for Calculating range(in cm) from Voltage: Volts =
5/1024* Analog_Reading.
Theory:
Ultrasonic Sound is emitted and then
the sensor waits for the sound to bounce
back from an object. The Total round trip
time translates into distance, since the
speed of sound is known. To Transmit
ultrasonic sound, send a 2 μS high pulse.
Equation For calculating range(in cm) from
duration of round trip Range = Round_trip/
29 / 2
Theory:
Sliding Or rotating a potentiometer
changes the resistance at the output pins.
By Inputting voltage and treating the
potentiometer (or pot) as a voltage divider
Note: Some Potentiometers have a linear
relationship between resistance and
position, others do not!