3 Computer Interfacing
3 Computer Interfacing
INTERFACING
1
WHAT IS COMPUTER INTERFACING
COMPUTER INTERFACING
• A Microcontroller is a wonderful piece
of engineering.
• For it to do many things, it needs to
interact with the outside world(Input
and Output devices).
• The process of connecting devices
together so that they can exchange
the information is called interfacing.
• Cable used for interfacing IoT:
• USB cable
• Parallel cable
• Serial cable (RS 232)
2
COMPUTER INTERFACING
4
BASIC ELECTRONIC COMPONENTS
RESISTOR
• Resistors are used to resist the flow of current or to control the voltage in a circuit.
• The amount of resistance that a resistor offers is measured in Ohms.
• Most resistors have colored stripes on the outside and this code will tell you it’s
value of resistance.
5
BASIC ELECTRONIC COMPONENTS
RESISTOR
6
BASIC ELECTRONIC COMPONENTS
CAPACITOR
• store electricity and then discharges it back into the circuit when there is a drop in
voltage
• capacitor is like a rechargeable battery and can be charged and then discharged
• the value is measured in F (Farad), nano Farad (nF) or pico Farad (pF) range
7
BASIC ELECTRONIC COMPONENTS
8
BASIC ELECTRONIC COMPONENTS
TRANSISTOR
• tiny switches that turn a current on or off when triggered by an electric signal
9
BASIC ELECTRONIC COMPONENTS
10
BASIC ELECTRONIC COMPONENTS
Switch
• Their basic function is to interrupt electric current by turning a circuit ON or OFF
• Switches can come in many forms such as pushbutton, rocker, momentary and
others
11
BASIC ELECTRONIC COMPONENTS
Potentiometer
• A variable resistor is also known as a potentiometer.
• These components can be found in devices such as a light dimmer or volume
control for a radio.
• When you turn the shaft of a potentiometer the resistance changes in the circuit.
12
BASIC ELECTRONIC COMPONENTS
13
BASIC ELECTRONIC COMPONENTS
Diode
• allows electricity to flow in one direction and blocks it from flowing the opposite
way
• diode’s primary role is to route electricity from taking an unwanted path within the
circuit
14
BASIC ELECTRONIC COMPONENTS
Relay
• an electrically operated switch that opens or closes when power is applied
• relay is an electromagnet which controls a mechanical switch
15
BASIC ELECTRONIC
TOOLS
16
BASIC ELECTRONIC TOOLS
Breadboard
• Breadboards are an essential tool for prototyping and building temporary circuits.
• These boards contain holes for inserting wire and components.
• Because of their temporary nature, they allow you to create circuits without
soldering.
• The holes in a breadboard are connected in rows both horizontally and vertically
as shown below.
17
BASIC ELECTRONIC TOOLS
Digital Multimeter
• A multimeter is a device that’s used to measure electric current (amps), voltage
(volts) and resistance (ohms).
• It’s a great for troubleshooting circuits and is capable of measuring both AC and DC
voltage.
18
BASIC ELECTRONIC TOOLS
Wire Cutter
• Wire cutters are essential for stripping stranded and solid copper wire.
19
BASIC ELECTRONIC TOOLS
Soldering Iron
• When it’s time to create a permanent circuit, you’ll want to solder the parts
together.
• To do this, a soldering iron is the tool you would use.
• A soldering iron isn’t any good unless you have solder to go with it.
• You can choose leaded or lead-free solder in a few diameters.
20
BASIC ELECTRONIC TOOLS
Screwdriver
21
BASIC ELECTRONIC TOOLS
PLIERS
22
MICROCONTROLLERS
23
MICROCONTROLLERS
Microcontroller
• Microcontroller is a small and low-cost microcomputer, which is designed to
perform the specific tasks of embedded systems.
• Microcontroller is a compressed micro computer manufactured to control the
functions of embedded systems in:
• office machines
• Robots
• home appliances
• motor vehicles, and
• several other gadgets
24
Applications of Microcontroller
MICROCONTROLLERS
• Light sensing and
controlling
devices like LED
• Temperature
sensing and
controlling
devices
• Fire detection
and safety
devices
• Measuring
devices like
Voltmeter.
25
MICROCONTROLLERS
ARDUINO
• prototype platform based on an easy-
to-use hardware and software.
26
MICROCONTROLLERS
ARDUINO
• Arduino boards can read analog or
digital input signals from different
sensors and turn it into an output such
as activating a motor, turning LED on/off
and many other actions.
• board functions can be control by
sending a set of instructions to the
microcontroller on the board via Arduino
IDE (referred to as uploading software).
• uses a USB cable.
• Arduino IDE uses a simplified version of
C++.
27
MICROCONTROLLERS
28
MICROCONTROLLERS
29
MICROCONTROLLERS
31
LED INTERFACING
WITH ARDUINO
32
LED INTERFACING WITH ARDUINO
Prerequisites
• Knowledge in C/C++ programming
33
LED INTERFACING WITH ARDUINO
Materials Needed
• Arduino Microcontroller
• USB A to B Cable (printer cable)
• 6 pcs LEDs
• 6 pcs Resistor (330 ohms)
• Breadboard
• Small wires/Jumper Wires
34
LED INTERFACING WITH ARDUINO
CIRCUIT DIAGRAM
35
LED INTERFACING WITH ARDUINO
PICTORIAL DIAGRAM
36
LED INTERFACING WITH ARDUINO
SOURCE CODE
37