Presentation is loading. Please wait.

Presentation is loading. Please wait.

I/O Experiments Assignment 1.

Similar presentations


Presentation on theme: "I/O Experiments Assignment 1."— Presentation transcript:

1 I/O Experiments Assignment 1

2 Electronic Circuits, Voltage and Current
Electronic circuits can be of three types- closed, open and short. Closed circuit forms a loop and the electricity flows in this loop from the given start and end points. Open circuit on the other hand, electricity does not move at all. A short circuit though can be a little risky because there is a direct connection between the + and – on the battery. Voltage is the amount of force that pushes electricity around a circuit and it is measured in volts(V). Current is the amount of electrical charge in a circuit. It is current that makes things happen, like lightening an LED. It is measured in amps. The resistance of a circuit limits the amount of current that flows and protects components. It is measured in ohms. Resistors have color-coded stripes that indicate the amount of resistance that they put in a circuit.

3 Solderless Breadboards
They provide an easy way of connecting components temporarily.

4 The gpio header A 40 pin GPIO header is located on the top left side of the Pi. The pins are numbered from left-to right, but odd-numbered pins are on the lower row. The even numbered pins are on the top- row. Each of these have varied uses.

5 Basic output Here we are making an LED work.
We will be making a circuit using a LED and ohm resistor. We will learn to setup the GPIO pin to the output. We will also aim for making an LED work from the terminal window.

6 Basic input Here we focus on detecting whether a switch is open or closed. We use the 4- terminal tactile push buttons for this purpose. We use the concepts of pull-up and pull-down resistors. In a normal circuit consisting of switch and a resistor, when the switch is open electricity flows through the resistor and into the GPIO pin. So when switch is open, the GPIO pin is high. This is pull-up resistor. Pull-down resistor works in the opposite way: when the switch is open, the GPIO pin is tied to ground and is low. But when the switch is closed, electricity flows into the GPIO pin and it is high. We show this execution with the terminal window in Pi.

7 Communication between 3.3V and 5V devices
This can be done in two ways. Using voltage Divider and using a Diode and pull-up resistor. In the voltage divider principle, the two resistors form a potential divider. This divides the voltage and allows enough of it to pass to the ground so that the GPIO pin only receives around 3.3V. Diodes are passive components that allow electricity to flow in one direction

8 Serial Peripheral interface (spi)
The SPI is a serial data protocol that is used by microcontrollers and small electronic devices to exchange information. The term “serial” means that each bit of a binary number(for example, the number 255 is made up of eight bits in binary ) is sent one at a time, on the same wire. SPI divides devices into two categories: masters, slaves. The master is the device that starts the communication. The slave receives instructions from the master and does what is told. A master can talk to many slave devices, nut usually only one at a time. SPI usage needs 4 pins- MOSI(Master Output, Slave Input), MISO(Master Input, Slave Output), SCK(Serial Clock) and SS(Slave Select).

9 I2c communication It is a serial communications protocol that uses fewer wires precisely. The master device controls I2C communications, and you connect all slave devices to the same wires. Each slave device has a unique number and it only responds to messages that it receives which specify this address. The two I2C lines are called SDA and SCL. You need to use pull-resistors on these lines. I2C can be convenient on Pi because one has to only convert the logic level of the SDA wire to interface with 5V devices. Any GPIO pins can be used for I2C, if you want to write all of the code. But it is a more complicated protocol to implement from scratch. To use prebuilt I2C libraries and modules, the two I2C wires are pin 3 and pin 5 of the GPIO header.


Download ppt "I/O Experiments Assignment 1."

Similar presentations


Ads by Google