HOME UNIT 1 UNIT 2 UNIT 3 UNIT 4 UNIT 5
What is Raspberry Pi?
Short for RPi, it is a credit-card-sized single-board computer built by the Raspberry Pi Foundation in association with Broadcom in the United Kingdom. It can do most of the things your typical desktop does, such as handling spreadsheets, word-processing, and games.
Raspberry Pi also has the capacity to play videos in high-definition. It can run several versions of Linux and is used to teach kids worldwide how to program. In fact, that was one of the biggest reasons why the idea of Raspberry Pi was conceived. But more on that later.
In addition, it has inputs and outputs for sensors so that you can attach all sorts of hardware to it. The General Purpose Input/Output (GPIO) pins on Raspberry Pi allow you to connect status lights, switches, analog signals, and more. You can use C++ or Python to control the board to sense or control devices attached to it.
Invented to stimulate the teaching of basic computer science in schools, Raspberry Pi has since then been used in many applications, including hobbyist projects, hardware platforms for electronics design, embedded devices, and robotics.
- Creating an interactive environment
- Network of devices connected together
Sensor
Electronic element - Converts physical quantity into electrical signals.
- Can be analog or digital
Actuator
Mechanical/Electro-mechanical device
- Converts energy into motion
- Mainly used to provide controlled motion to other components
System Overview
Sensor and actuator
- interfaced with Raspberry Pi Read data from the sensor
- Control the actuator according to the reading from the sensor
- Connect the actuator to a device
Example:
Temperature Dependent Auto Cooling System
A Temperature Dependent Auto Cooling System using a Raspberry Pi can automate the process of cooling when the temperature reaches a certain threshold. The system can activate a fan (or another cooling device) when the temperature exceeds a specified limit.
Here's a step-by-step guide on how to create this system:
Components:
- Raspberry Pi (with Raspbian OS installed)
- DHT11 or DHT22 temperature sensor
- Relay module (to control the fan)
- Fan (or any cooling device)
- Breadboard and Jumper wires
Circuit Diagram:
DHT11:
- VCC to Raspberry Pi 3.3V
- GND to Raspberry Pi GND
- Data pin to a GPIO pin (e.g., GPIO 17)
Relay Module:
Steps:
Set up the Raspberry Pi:
- Install Raspbian and set up the necessary tools.
- Enable GPIO pins by running
- Install the DHT library:
Write the Python Script: The following Python script will:
- Read the temperature from the DHT11 sensor.
- Activate the relay to turn on the fan when the temperature exceeds a set threshold (e.g., 30°C).
Explanation:
- Sensor Reading: The temperature and humidity are read from the DHT11 sensor using the
Adafruit_DHT
library. - Relay Control: The relay controls the fan. If the temperature is above the threshold (e.g., 30°C), the relay is triggered to power on the fan. When the temperature falls below the threshold, the fan is turned off.
- GPIO Control: The
GPIO.output(RELAY_PIN, GPIO.LOW)
turns the fan ON, whileGPIO.HIGH
turns it OFF.
How to Run:
- Save the script (e.g.,
temp_auto_cooling.py
). - Run the script with:
Optional Enhancements:
- Change the Threshold: You can modify the
TEMP_THRESHOLD
value in the script to adjust the temperature at which the fan turns on. - Fan Speed Control: If you want to control the speed of the fan, you can use a PWM (Pulse Width Modulation) module to adjust fan speed based on temperature.
- Real-time Monitoring: Integrate an LCD display or use a web dashboard to monitor the temperature and fan status in real-time.
IoT uses of Raspberry Pi :
Raspberry Pi computers feature a set of General Purpose Input Output (GPIO) pins that provide connections to external electronic devices and therefore the development of IoT solutions.
These GPIO pins can be connected to external sensors using either jumper wires or a ribbon cable. These subsequently connect the Pi to a breadboard (a solder-less, plug-and- play electronics board), enabling various application possibilities.
One such application is a Raspberry Pi IoT server. “With an in-built quadcore processor, Raspberry Pi can serve as the ‘Internet Gateway’ for IoT devices”, says Sanam Malhotra from Oodles AI.“Powered by a cloud network, Pi acts as a web server for uploading and transiting sensor data on IoT platforms.
Custom code, an operating system, a Python library, and a cloud network are all it takes to use Pi Computer as a web server.
Comments
Post a Comment