1 / 50

Raspberry Pi Applications

Raspberry Pi Applications. Interfacing & Working Principles. Applications of Raspberry Pi. Number of Applications are possible to interface to Raspberry Pi IoT Development Board. Here we interface very few Important Applications. Those we are going to implement same to our Laboratory.

guido
Télécharger la présentation

Raspberry Pi Applications

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Raspberry Pi Applications Interfacing & Working Principles

  2. Applications of Raspberry Pi Number of Applications are possible to interface to Raspberry Pi IoT Development Board. Here we interface very few Important Applications. Those we are going to implement same to our Laboratory.

  3. Few Important Applications : • Interfacing Relay Switch to Control AC Appliances. • InterfacingUltrasonic Sensor (SR-04) to find out Exact Distance From the object. • Interfacing IR Sensor to find out Obstacles. • Interfacing Alcohol Sensor (MQ-135) to Find out Drunk and Drive Persons.

  4. Interfacing Relay to Raspberry Pi Table of Contents: • Overview. • A Brief Note on Relay. • How to Control a Relay using Raspberry Pi? • Circuit Diagram. • Programming Implementation. • Applications of Relays.

  5. Overview: • Home Automation is one of the popular DIY (Do-It-Yourself) Projects those hobbyists and electronics enthusiasts love to work on. Part of such home automation projects is to control an electrical load like a light bulb or a ceiling fan. • The main concept of Home Automation using Raspberry Pi is to control different electrical loads using Raspberry Pi.

  6. What is Relay? • Relay is a simple electro-mechanical device that consists of a coil and few electrical contacts. When the coil is energized, it acts as an electromagnet and closes a switch. • If the coil is de-energized, the coil loses its magnetic nature and releases the switch. • The following image shows a typical 5V Relay. It has 5 pins namely: NO (Normally Open), NC (Normally Closed), COMM (Common) and two coil terminals.

  7. Relay Driver: Even though the Relay Coil needs a small current in order to get energized, driving it directly from Raspberry Pi is not a good idea. A simple way is to drive the Relay Coil through a Transistor. The following image shows the connections required with respect to a Relay.

  8. Control a Relay using Raspberry Pi • If you understood the concept of a relay, then it might be clear that all you need to do is to control the coil of the relay. • if the Raspberry Pi wants a load to be turned ON, and then activate the relay by energizing the coil (sending a HIGH signal from Raspberry Pi). • Similarly, if the Raspberry Pi wants to turn the load OFF, then de-energize the coil by sending a LOW signal.

  9. Circuit Implementation: The following image shows the connections with respect to the project of How to Control a Relay using Raspberry Pi.

  10. Application Program: The Raspberry Pi Supports all the programming languages but the manufacturers choice to prefer python language because it is a open source to implement the applications very easy.

  11. Cont...

  12. Applications of the Relays: • By controlling a Relay with Raspberry Pi, you can control different electrical loads like: • Lights • Fans • LED Strips • Also, you can implement a Home Automation Project using Raspberry Pi with an additional feature of controlling the load from the internet.

  13. Interfacing Ultrasonic Sensor (SR-04) to Raspberry Pi Table of Contents: • Overview. • A Brief Note on Ultrasonic Sensor (SR-04). • Circuit Diagram. • Programming Implementation. • Applications.

  14. Overview: • Ultrasonic distance sensors (SR-04) are designed to measure distance between the source and target using ultrasonic waves. • We use ultrasonic waves because they are relatively accurate across short distances and don’t cause disturbances as they are inaudible to human ear.

  15. Ultrasonic Sensor(SR-04): • HC-SR04 is a commonly used module for non contact distance measurement for distances from 2cm to 400cm. It uses sonar (like bats and dolphins) to measure distance with high accuracy and stable readings. • It consists of an ultrasonic transmitter, receiver and control circuit. The transmitter transmits short bursts which gets reflected by target and are picked up by the receiver. • The time difference between transmission and reception of ultrasonic signals is calculated. Using the speed of sound and ‘Speed = Distance/Time‘s equation, the distance between the source and target can be easily calculated.

  16. HC-SR04 ultrasonic distance sensor module has four pins: • VCC – 5V, input power. • TRIG – Trigger Input. • ECHO – Echo Output. • GND – Ground.

  17. Working Principle: • Provide trigger signal to TRIG input, it requires a HIGH signal of at least 10μS duration. • This enables the module to transmit eight 40 KHz ultrasonic burst. • If there is an obstacle in-front of the module, it will reflect those ultrasonic waves.

  18. 4. If the signal comes back, the ECHO output of the module will be HIGH for duration of time taken for sending and receiving ultrasonic signals. 5. The pulse width ranges from 150μS to 25mS depending upon the distance of the obstacle from the sensor and it will be about 38ms if there is no obstacle as shown below the protocol structure.

  19. Voltage Divider • The ECHO output is of 5V. The input pin of Raspberry Pi GPIO is rated at 3.3V. So 5V cannot be directly given to the unprotected 3.3V input pin. • Therefore we use a voltage divider circuit using appropriate resistors to bring down the voltage to 3.3V. • The following equation can be used for calculating resistor Resistor values ,“Vout = Vin x R2/(R1+R2)”

  20. Circuit Implementation:

  21. Distance Calculation: Time taken by pulse is actually for to and fro travel of ultrasonic signals, while we need only half of this. Therefore Time is taken as Time/2. • Distance = Speed * Time/2 • Speed of sound at sea level = 343 m/s or 34300 cm/s • Thus, Distance = 17150 * Time (unit cm) • For accurate distance readings the output can be calibrated using a ruler. In the below program a calibration of 0.5 cm is added.

  22. Application Program:

  23. Cont..

  24. Cont..

  25. Output

  26. Applications: • Dam water level measurement. • Exact distance calculations’. • Radar object and distance detection • Garbage Monitoring. • Water tank level measurement…..etc

  27. Interfacing IR Sensor toRaspberry Pi Table of Contents: • Overview. • A Brief Note on IR Sensor. • IR Sensor Interface to Raspberry Pi. • Circuit Diagram. • Programming Implementation. • Applications.

  28. Overview: • Infrared Sensors or IR Sensors are one of the frequently used sensor modules by electronics hobbyists and makers. • They are often used as Obstacle Detecting Sensors or Proximity Sensors. • IR Sensors emit and receive Infrared radiation. • They are often used as Proximity Sensors i.e. detect and alarm if an object is close to the sensor.

  29. Infrared Rays (IR) Sensor: An IR Sensor Module basically consists of three parts: 1) IR Transmitter. 2) IR Detector. 3) Control circuit. • Usually, an IR LED is used as an IR Transmitter and a Photo Diode or a Photo Transistor (less often) is used as an IR Detector. The control circuit consists of a Comparator IC with necessary components. • Based on the application and requirement, IR Sensors can be implemented in two ways.

  30. In the first method, both the IR Transmitter and the IR Detector are placed side-by-side. In the second setup, the IR Transmitter and the IR Detector are placed facing each other. The IR Sensor used in this project is a Reflective Type IR Sensor. You can easily build this type of IR Sensor as a DIY (Do-It-Yourself) Project as the circuit is very simple.

  31. Working Principle: If there is an object in between the Transmitter and Detector, then there will be an obstruction to the infrared light and the control circuit will detect this and produces appropriate output.

  32. Circuit Implementation:

  33. Working Principle: The IR Sensor Module has only three Pins: VCC, GND and Data. Connect the VCC and GND pins of the IR Sensor to +5V and GND pins of the Raspberry Pi. Then connect the Data pin of the IR Sensor to GPIO23 i.e. Physical Pin 16 of the Raspberry Pi. In order to indicate the alarm, I have used a simple 5V Buzzer. Connect one terminal of the buzzer to GND of Raspberry Pi and the other terminal (usually marked +) to GPIO24 i.e. Physical Pin 18 of Raspberry Pi.

  34. Application Program:

  35. Cont..

  36. Applications: • Contactless Digital Tachometers. • Line follower Robots. • Obstacle avoiding Robots. • Edge Avoiding Robots. • Mobile Phones. • Automobiles like Vehicles…..etc

  37. Interfacing Alcohol Sensor (MQ-135) toRaspberry Pi Table of Contents: • Overview. • A Brief Note on MQ-135 Alcohol Sensor. • MQ-135 Sensor Interface to Raspberry Pi. • Circuit Diagram. • Programming Implementation. • Applications.

  38. Overview: • The MQ-135 gas sensor senses the gases like ammonia nitrogen, oxygen, alcohols, aromatic compounds, sulfide and smoke. • MQ-135 gas sensor can be implementation to detect the smoke, benzene, steam and other harmful gases. • has potential to detect different harmful gases. • The MQ-135 gas sensor is low cost to purchase. The basic image of the MQ-135 sensor is shown in the below figure.

  39. Alcohol Sensor (MQ-135) Sensor: • The air quality sensor is also a MQ-135 sensor for detecting venomous gases that are present in the air in homes and offices. The gas sensor layer of the sensor unit is made up of tin dioxide (SnO2). • It has lower conductivity compare to clean hair and due to air pollution the conductivity is increases. The air quality sensor detects ammonia, nitrogen oxide, smoke, CO2 and other harmful gases.

  40. The air quality sensor detects ammonia, nitrogen oxide, smoke, CO2 and other harmful gases. The air quality sensor has a small potentiometer that permits the adjustment of the load resistance of the sensor circuit.

  41. 3. The air quality sensor is a signal output indicator instruction. It has two outputs: analog output and TTL output. The TTL output is low signal light which can be accessed through the IO ports on the Microcontroller.

  42. 4. The analog output is an concentration, i.e. increasing voltage is directly proportional to increasing concentration. 5. Generally the sensor O/P gives 5 Volts But the raspberry Pi concern it sense only low voltage level i.e. 3.3V to avoid excess voltage we can divide the voltage using voltage divider network. 6. This sensor has a long life and reliable stability as well.

  43. Voltage Divider • The MQ-135 Sensor output is of 5V. The input pin of Raspberry Pi GPIO is rated at 3.3V. So 5V cannot be directly given to the unprotected 3.3V input pin. • Therefore we use a voltage divider circuit using appropriate resistors to bring down the voltage to 3.3V. • The following equation can be used for calculating resistor Resistor values ,“Vout = Vin x R2/(R1+R2)”

  44. Characteristics of MQ-135: • Good sensitivity to harmful gases in wide range. • It has long life and low cost. • Possesses high sensitivity to ammonia, benzene, sulfide gases. • It is a simple drive circuit.

  45. Circuit Implementation:

  46. Working Principle: • The MQ-135 Sensor Module has four Pins: VCC, GND, AO and DO. Connect the VCC and GND pins of the IR Sensor to +5V and GND pins of the Raspberry Pi. • Then connect the DO pin of the MQ-135 Sensor to GPIO24 i.e. Physical Pin 18 of the Raspberry Pi. In order to indicate the alarm, I have used a simple 5V Buzzer. • Connect one terminal of the buzzer to GND of Raspberry Pi and the other terminal (usually marked +) to GPIO4 i.e. Physical Pin 7 of Raspberry Pi.

  47. Application Program:

  48. Cont..

  49. Applications: • Air Quality Monitor. • Alcohol level detection in Drunk & Drive. • Detection of Harmful gases in the Sensitive Areas. • Air pollution Detection in automobiles. • Industrial Pollution Detection. • Toxic Gases detection in Bathrooms…..etc

More Related