[go: up one dir, main page]

0% found this document useful (0 votes)
72 views113 pages

Sinyal Sistem w6 en Projects

Uploaded by

beyza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views113 pages

Sinyal Sistem w6 en Projects

Uploaded by

beyza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 113

Dr.

Aytaç DURMAZ

Signals & Systems


Project Core Learnings

Sensor Connection
Output Programming
Audio-Visual Demo
Course Overview

Getting started:

Installation, Applications and Materials

Electric:

Components, Ohm's Law, Input and Output, Analog and Digital

-----------------------------

Programming:

Divide into groups depending on experience

Fundamentals of Serial Communication:

Troubleshooting and Debugging

Virtual Prototyping:
Schematics and PCB Layout in Fritzing
Arduino Board

Created in Ivrea, Italy

2005 by Massimo Banzi and David Cuartielles

Open Source Hardware

Processor
• Coding is accessible and transferable (C++, Processing, java)
Arduino…

It is an indispensable piece of equipment for artists,


hobbyists, students and anyone with a dream of
tools.
• It was born out of another challenge: How to teach
students how to create electronics quickly?

http://spectrum.ieee.org/geek-life/hands-on/the-making-of-arduino
Getting Started
• SW Installation: Arduino (v.1.0+)
•Fritzing
•SIK Guide Code
•Drivers (FTDI)

• Materials:
• SIK Guide
• Analog I/O, Digital I/O, Serial,
& Fritzing handouts
• Arduino CheatSheet
PWR IN USB
(to Computer)

RESET

SCL\SDA
(I2C Bus)

POWER
5V / 3.3V / GND
Digital I\O
PWM(3, 5, 6, 9, 10, 11)

Analog
INPUTS
PWR IN USB
(to Computer)

RESET

SCL\SDA
(I2C Bus)

POWER
5V / 3.3V / GND
Digital I\O
PWM(3, 5, 6, 9, 10, 11)

Analog
INPUTS
Go ahead and get the board up
and running
Arduino Shields

PCB Built Shield Inserted Shield


Arduino Shields

Micro SD MP3 Trigger LCD


SIK Components

Name Image Type Function Notes


Push Button Digital Input Switch - Closes Polarized, needs
or opens circuit resistor
Trim Analog Input Variable resistor Also called a
potentiometer Trimpot.

Photoresistor Analog Input Light Dependent Resistance varies


Resistor (LDR) with light.
Relay Digital Output Switch driven by Used to control
a small signal larger voltages
Temp Sensor Analog Input Temp Dependent
Resistor
Flex Sensor Analog Input Variable resistor

Soft Trimpot Analog Input Variable resistor Careful of shorts

RGB LED Dig & Analog 16,777,216 Ooh... So pretty.


Output different colors
SIK Components
SIK Components
SIK Components
Using the Breadboard to built a
simple circuit

•Use the breadboard to


connect a single LED
with a 330 Ohm
Resistor (Orange-
Orange-Brown).

Note: The longer leg in the


LED is positive leg and the
shorter leg is negative
Fritzing View of Breadboard
Circuit

•What happens
when you break the
circuit?
•What if you
wanted to add more
than one LED?
Adding controls – let's use
Arduino
and start programming!!
Concepts: INPUT & OUTPUT

Referenced from the perspective of the microcontroller (electrical panel).

Inputs are a The output is any signal that


signal/information that comes out of the board.
enters the card.

Almost all systems that use physical computing will have some form of output
What are some examples of Output?
Concepts: IN and OUT

Referenced from the perspective of the microcontroller (electrical board).

Inputs are a The output is any signal that


signal/information that comes out of the board.
enters the card.

Examples: Button switches, light Examples: LEDs, DC motor, servo


sensors, flex sensors, humidity motor, piezo buzzer, relay, RGB
sensors, temperature sensors... LED
Concepts: Analog and Digital

Microcontrollers are digital devices – ON or OFF. It is


also called discrete.
•Analog signals are anything that can be a full range of
values. What are some examples? More on that later...

5 5
V V
0 0
V V
Turn on Arduino

•Hints:
•For PC Users 
1.Let the installer copy and
move the files to the
appropriate locations, or
2.Create a folder under C:\ For Mac Users 
Program Files (x86) called 1. Move the Arduino
Arduino. Move the entire executable to the dock
Arduino program folder here. for ease of access.
2. Resist the temptation to
run these from your
desktop.
Arduino Integrated Development
Environment (IDE)
Two required functions /
methods / routines:

void setup()
{
// runs once
}

void loop()
{
error & status messages // repeats
}
Settings: Tools  Serial Port
Your computer communicates
with the Arduino
microcontroller through a serial
port through a USB-to-Serial
adapter.
•Check to make sure the drivers
are installed correctly.
Ayarlar:  Araçlar Panosu

•Then, double-check that the appropriate card is selected under the


Tools Dashboard menu.
Arduino and Arduino Compatible Boards
digitalWrite()
BIG 6 CONCEPTS

analogWrite()

digitalRead()

if() statements / Boolean

analogRead()

Serial communication

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License .
Let's talk about coding...

Project #1 – Blink
The "Hello World" of Physical Computing
•Psuedo code – how should this work?

Turn Turn Rinse


LED Wait LED Wait &
ON OFF Repeat

Loop Döngüsü
Structure of Arduino code

Before proceeding to the setup function,


int pin = 1; 1. Define Variables
constant variables must be defined

void 2. Setting up The setup function is run once when the


setup() functions microcontroller is turned on or reset.
{}

After the setup function, the processor moves


void to run the code within the loop function. The
loop() 3. Eternal loop
code function in the loop will be run repeatedly
{} until the microcontroller is turned off.

• The code must have both setup() and loop()


functions
Arduino C – Basic functions

pinMode(var1, var2) The pinMode functions set the mode of the given pin.
Var1 is the pin number and var2 is the mode (IN,
INPUT_PULLUP, OUTPUT)
digitalWrite(var1, var2) digitalWrite changes the state of the pin. Var1 is the pin
number and var2 is the status (LOW, HIGH).

IMPORTANT TO NOTICE:
Depending on whether the pin is set to OUTPUT or INPUT, the actual effect of

digitalWrite() is different

digitalRead(var1) digitalRead returns the current status (LOW, HIGH) of the


pin. Var1 is the pin number.
Arduino C – Basic functions

analogRead(var1) AnalogRead returns a 10-bit value (by default) equal to


the voltage of the pin based on the analog reference
voltage.
analogWrite(var1, var2) AnalogWrite sets a pin (var1) to a voltage equal to a
value of 8 bits (by default) based on the analog
reference voltage.
analogReadResolution(var1)/ Changes the resolution of the corresponding function
analogWriteResolution(var1) to var1.

map(var1,var2,var3,var4,var5) It maps the value var1 to the interval var2, var3 linearly
to the interval var4, var5. It also works with negative
numbers.
Arduino C – Basic functions

attachInterrupt(var1,var2,var3) Adds a cut to a pin. Var1 is determined by


digitalPinToInterrupt(pin). Var2 is the function to
execute. Var3 is the trigger mode of the interrupt.
detachInterrupt(var1) Separates cutting. Var1 is also determined by
digitalPinToInterrupt(pin).

noInterrupts() Disables interruptions. For example, it is used


when running time-sensitive code

interrupts() Enables interrupts that are disabled by


noInterrupts().
Writing your first program

Basic blinking
LED
int ledPin = 13; //Variable to store the pin number

void setup()
{
pinMode(ledPin, OUTPUT); //set ledPin as output
}

void loop()
{
digitalWrite(ledPin, HIGH); //LED ON
delay(1000); //Wait 1000ms (=0,1s)
digitalWrite(ledPin, LOW); //LED OFF
delay(1000); //Wait 1000ms (=1s)
}
Installation of the program

1. Click Verify
The program
is checked 2.
1.
2. Click Upload
The program
is uploaded to
the Arduino
mCu board
Breadboard

The terminals with blue and red stripes are called


power buses and are connected horizontally to each
other.

The terminals in the middle are connected vertically


to each other. The space in the middle separates the
two sides.
Basic Components

Passive components Active components

Resistor LED

Capacitor Transistor

Push button Integrated circuit (IC)

Inductor
Example 1 – Push Button

Reading digital input


Example 1 - Polling

Reading digital input (Using push button)


byte ledPin = 13;
byte buttonPin = 2;

void setup()
{
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, LOW); //set ledPin off as default
pinMode(buttonPin, INPUT); //set buttonPin as input
digitalWrite(buttonPin, HIGH); //set the default state of the pin to HIGH (+5V)
}

void loop()
{
if(digitalRead(buttonPin) == LOW)
{
digitalWrite(ledPin, HIGH); //LED ON
}
else
{
digitalWrite(ledPin, LOW); //LED OFF
}
}
Example 1 - Interrupt

Using an interrupt for the same job


byte ledPin = 13;
byte buttonPin = 2;
bool ledState = 0;

void switchLED()
{
ledState = !ledState;
digitalWrite(ledPin, ledState);
}

void setup()
{
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, LOW); //set ledPin off as default
pinMode(buttonPin, INPUT_PULLUP); //turn on the internal pullup
attachInterrupt(digitalPinToInterrupt(buttonPin), switchLED, CHANGE); //creates
the interrupt
}

void loop()
{
//waiting for interrupt
}
Caution!

Microcontrollers typically operate at low voltages (0-


5V). Still, you should be careful when connecting
devices.
Know the electrical limits of the microcontroller: Uno
can handle a maximum of 5V/40mA per I/O pin
•Always double-check the cables! If you see smoke,
it's too late!
P=U*I M U=R*I
To prevent overloading of a pin or a component with
an overcurrent, you need to use a resistor
Example: Using LEDs – Calculating the required
resistance size
Operation voltage for LED: 5V
Recommended current 23mA
• U=R∗I→R=U/I=5V/0.023A≈220Ω
PWM (Pulse Width Modulation)

• Basic terms

• Duty cycle = Pulse Width / Wave Period


Duty cycle

• 100 %

• 75 %

• 50 % ←Ideal Square Wave

• 25 %

• 0%
PWM Applications

Servomotor angle control


DC motor speed control
LED Dimming
Audio reproduction
• Digitally generating analog voltages (requires
filtering)
Uno ile PWM

A total of 6 pins with PWM (~ symbol)


PWM frequency
Pins 5 and 6: default: 980Hz ~1kHz
(62.5 kHz base, 64 as prescaler)
Pins 3,9,10,11: default 490Hz ~0.5kHz
(31.25 kHz base, 64 as prescaler)
setPwmFrequency() (30Hz-62.5kHz);
http://playground.arduino.cc/Code/PwmFrequency
• CAUTION: delay() affects milis() and Servo functions
Example 2 – Control PWM LED

Using an analog input to control a PWM LED

Longer pin
Example 2 - Analog I/O
Potentiometer controlled PWM LED
int ledPin = 3; //Variable to store the pin number
int potPin = A0; //Variable to store the pin number

void setup()
{
pinMode(ledPin, OUTPUT); //set ledPin as output
pinMode(potPin, INPUT); //set potPin as input
}

void loop()
{
int potValue = analogRead(potPin); //Read the value of the potentiometer
int ledValue = map(potValue, 0, 1023, 0, 255); //map to correct range
analogWrite(ledPin, ledValue); //Read the value of the potentiometer
delay(10); //To run the loop ~100 times a second
}
Comments

Comments are for you – programmer and your friends... or any


human who can read your code.
This is for one-line comments
It's good to put a description at the top and before anything
'difficult'
/* This is for multi-line comments
Like this...
And this....
• */
comments
Here are three commands you need to
know...
• pinMode(pin, INPUT/OUTPUT);
• ex: pinMode(13, OUTPUT);

• digitalWrite(pin, HIGH/LOW);
• ex: digitalWrite(13, HIGH);

• delay(time_ms);
• ex: delay(2500); // delay of 2.5
sec.

• // NOTE: -> commands are CASE-sensitive


Project #1: Wiring Diagram

Move the green


wire from the
power bus to pin 13
(or any other
Digital I/O pin on
the Arduino board.

Image created in Fritzing


A few simple challenges
Let’s make LED#13 blink!

• Challenge 1a – blink with a 200 ms second


interval.

• Challenge 1b – blink to mimic a heartbeat

• Challenge 1c – find the fastest blink that the


human eye can still detect…
• 1 ms delay? 2 ms delay? 3 ms
delay???

Try adding other LEDs


Programming Concepts: Variables
Variable Scope

•Global
•---
•Function-level
Concepts: Analog and Digital

•To create an analog signal, the microcontroller uses a


technique called PWM. By changing the duty cycle, we
can emulate an "average" analog voltage.

•Pulse Width Modulation (PWM)


Project #2 – Fading
Meet a new command...

•analogWrite(pin, val);

•pin – ÇIKIŞ pinini
ifade eder (3, 5, 6, 9,
10, 11 pinleriyle
sınırlıdır.) – ~ sembolü
ile gösterilir

•val – 8 bit value (0 – 255).


• 0 => 0V | 255 => 5V
Move one of your LED pins to
Pin 9

• In Arduino, open up:


• File  Examples  01.Basics  Fade
Fade - Code Review
Fade - Code Review
Project# 2 -- Fading

Challenge 2a – Change the fade rate in and out.


There are at least two different ways to do this –
can you figure them out?
• Difficulty 2b – Use 2 (or more) LEDs – so that
one goes out while the other goes out.
R G B

Color Mixing
Tri-color LED

• In the SIK, this is a standard –


Common Cathode LED

• This means the negative side


of the LED is all tied to Ground.
Project 3 – RGB LED

• Note: The longest


leg of the RGB
LED is the
Common
Cathode. This
goes to GND.

Use pins 5, 6, & 9


How many unique colors can you
create?

Use Colorpicker.com or try it


on your own.
Choose a few colors that you
want to try recreating for a
lamp or lighting screen...
Play around with this with
the analogWrite()
command.
RGB LED Color Mixing

• int redPin = 5;
• int greenPin = 6;
• int bluePin = 9;

• void setup()
• {
• pinMode(redPin, OUTPUT);
• pinMode(greenPin, OUTPUT);
• pinMode(bluePin, OUTPUT);
• }
RGB LED Color Mixing

• void loop()
• {
• analogWrite(redPin, 255);
• analogWrite (greenPin, 255);
• analogWrite (bluePin, 255);
• }
Project: Mood Lamp / Light
Sculpture
Driving Motors or Other High
Current Loads

• NPN Transistör (Ortak Verici "Amplifikatör" Devresi)

to Digital
Pin 9
(Input)

Input is any signal that enters an electrical system.


Both digital and analog sensors are input formats
Input can also take many other forms: keyboards, mouse,
infrared sensors, biometric sensors, or just flat voltage from a
circuit
Project #4 – Digital Input

• In Arduino, open up:


• File  Examples  02.Digital  Button
Digital Sensors (a.k.a. Switches)
Pull-up Resistor (circuit)

to Digital Pin 2
Digital Sensors (a.k.a. Switches)
Add an indicator LED to pin 13

This is just like our 1st


circuit!
Digital Input

Connect the digital input to your Arduino using pins #0 – 13


(although pins #0 and 1 are also used for programming)
Digital Input needs a pinMode command:
pinMode (pinNumber, INPUT);
Make sure to use ALL CAPS for INPUT
To get a digital reading:
int buttonState = digitalRead (pinNumber);
• Digital Input values are only HIGH (On) or LOW (Off)
Digital Sensors

Digital sensors are simpler than Analog


Regardless of the sensor, there are only two settings: On and
Off
Signal always HIGH (On) or LOW (Off)
The voltage signal for HIGH will be slightly less than 5V on
your Uno
• The voltage signal for LOW will be 0V on most systems
Programming: Conditional
Statements
if()
Programming: Conditional Statements
if()
• void loop()
•{
• int buttonState =
digitalRead(5);
• if(buttonState == LOW) DIG
• { // do something INPUT
• }
• else
• { // do something else
• }
•}
Boolean Operators

<Boolean> Description
( ) == ( ) is equal?
( ) != ( ) is not equal?
( ) > ( ) greater than
( ) >= ( ) greater than or equal
( ) < ( ) less than
( ) <= ( ) less than or equal
Trimpot (Potentiometer)
Variable Resistor

fixed
end

wiper

fixed
end
Analog Sensors
3 Pin Potentiometer = var. resistor (circuit)
a.k.a. Voltage Divider Circuit

wiper

fixed
ends
1.0 V 1.0 V
Ohms Law… (just the basics)
Actually, this is the “voltage
divider”

analogRead()

• Arduino, 10 bitlik bir A/D Dönüştürücü kullanır:

• Bu, 0 ile 1023 arasında giriş değerleri aldığınız


anlamına gelir (2^10)
0V0
5 V  1023
•Ex:
• int sensorValue = analogRead(A0);
Using Serial Communication

The method used to transfer data between two devices.

Data is transferred between the computer and Arduino


via the USB cable. Data is transmitted sequentially as
zeros ('0') and ones ('1').

Arduino, Dijital G/Ç pini # 0'ı alıcıya ve Dijital


G/Ç pimi #1'i iletmeye ayırır.
Seri Monitör ve analogRead()

Initializes the Serial


Communication

9600 baud data rate

prints data to serial bus


Serial Monitor & analogRead()

Opens up a Serial
Terminal Window
Analog Sensors
2 Pin Analog Sensors = var.
resistor
•Get two sensors - Use the
Series Monitor and find the
range of input values you get
for each sensor.

•MaxAnalogRead = _________

•MinAnalogRead = _________
Analog Sensors

Examples:

Sensors Variables
Mic soundVolume
Photoresistor lightLevel
Potentiometer dialPosition
Temp Sensor temperature
Flex Sensor bend
Accelerometer tilt/acceleration
Additional Serial Communication
Sending Messages

void loop ( )
{
Serial.print(“Hands on “) ;
Serial.print(“Learning ”) ;
• Serial.println(“is Fun!!!”) ;

}
Serial Communication:
Serial Debugging
void loop()
{
int xVar = 10;
Serial.print ( “Variable xVar is “ ) ;
Serial.println ( xVar ) ;
}
Serial Communication:
Serial Troubleshooting
void loop ( )
{
Serial.print (“Digital pin 9: “);
Serial.println (digitalRead(9));
}
Projects!

Use Arduino to complete a project


All projects must have at least one input and one
output signal
Systems must be coded
Real Results are bonus points!
A report should be prepared
Reports should include the coding and wiring
diagram
• A presentation will be made to the class (maximum
4 minutes)
Report Table of Contents

Report Title
Name – Surname Number (Max teams of 3)
Purpose of the Project
Theoretical Explanation
Bill of Materials Used
Wiring Diagram
Working Procedure
Discussion and comments
Appendix -1 Codes
Appendix -2 Demo
• Appendix -3 Project Presentation
tomatic pot watering
nnect Components: Connect the humidity sensor, water pump, and relay to the Raspberry Pi.
st the Moisture Sensor: Write a Python script that will read the data from the sensor and
ure the moisture level of the soil.
mp Control: Write a Python script to control the pump via relay. Start the pump when the
dity is low.
4. Automation: Set the script to run at specific intervals or configure it to check the
humidity level in a continuous cycle.

https://www.youtube.com/watch?v=s_Ecar_yMBM

https://www.instructables.com/
Arduino-Plant-Watering-System/

https://docs.arduino.cc/hardware/
plant-watering-kit/
2) Alarm Clock
1. Bileşenleri Bağla: Buzzer, butonları ve ekranı Raspberry Pi'ye bağla.
2. Saat Fonksiyonu: Şu anki zamanı ve alarm zamanını gösterecek bir Python
scripti yaz.
3. Alarm Kurma: Kullanıcının alarm zamanını ayarlamasını sağlayacak butonlar
için script yaz.
4. Alarmı Tetikle: Ayarlanan zaman geldiğinde buzzer'ı çalıştıracak ve kullanıcı
alarmı durdurana kadar çalmaya devam edecek bir sistem kur.

https://projecthub.arduino.cc/
tittiamo68/alarm-clock-057133

https://www.instructables.com/
Arduino-Alarm-Clock-3/
art Mirror
nnect Components: Connect the touchscreen and camera to the Raspberry Pi.
er Interface: Create an interface where users can choose clothes.
oto Capture: Write a function that will take a photo of the user using the camera.
4. Outfit Selection and Display: Set up a system to overlay the selected outfit on the user's photo.

https://projecthub.arduino.cc/
mohammadsohail0008/smart-mirror-
5cec0a
hgate
nnect Components: Connect the servo motor, PIR sensor, and buttons to the Raspberry Pi.
tion Detection: Write a script that will read the data from the PIR sensor and open the door.
or Control: Develop a system to open and close the door using the servo motor.
4. Manual Control: Set up a control system for the buttons to open and close the door
manually.
eractive LED Display
nnect Components: Connect the LED strips and microphone module to the Raspberry Pi.
ce Detection: Write a Python script that will collect audio data from the microphone.
D Control: Set up a system that will change the way the LEDs light up and color based on the
d data.
4. PWM Control: Enhance the visual impact by adding a function to adjust the brightness
of the LEDs.
FID Door Lock
onnect Components: Connect the RFID reader, electronic lock mechanism (servo or
noid) to the Raspberry Pi.
ID Reading: Write a Python script that will recognize authorized RFID tags.
ck Control: Develop a system that activates the lock mechanism when an authorized tag is
cted.
4. Security: Add a layer of security to log unauthorized access attempts and alert
when necessary.
7) Traffic Light Control
1. Connect Components: Connect the red, yellow, green LEDs and buttons to the
Raspberry Pi.
2. Traffic Light Logic: Write a Python script with timing and transition logic for each light.
3. Manual Control: Add a feature that allows you to manually switch between lights at the
push of a button.
4. Safety Features: Design a safety mechanism that will make all the lights red for
emergencies.
8) Burglar Alarm
1. Connect Components: Connect the PIR sensor and buzzer to the Raspberry Pi.
2. Motion Detection: Write a Python script that will be activated when motion is detected from
the PIR sensor.
3. Alarm Trigger: Set up a system that will activate the buzzer when motion is detected and
keep it ringing for a certain period of time.
4. Mute: Add a button to mute the alarm, giving the user control.
Zero W Security Camera
onnect Components: Connect the camera module to the Raspberry Pi Zero W.
ve Streaming: Write a Python script that will stream live video.
otion Detection (Optional): Add motion detection to notify the user when motion is
cted.
4. Data Retention: Use local memory or network space to store detected motion or
continuous video streaming.
Environmental Monitoring Station
onnect Components: Environmental sensors (air quality, temperature, humidity, etc.) Connect it
our Raspberry Pi.
Data Collection: Write a Python script that will collect and process data from sensors.
isualization: Develop a user interface to visualize the collected data in real-time.
4. Trend Analysis: Set up a system that can analyze long-term environmental changes by
recording data.
Time-lapse Camera
Connect Components: Connect the camera module to the Raspberry Pi.
Photo Shoot: Write a Python script that will automatically take photos at regular intervals.
Video Creation: Develop a system to create a time-lapse video by combining captured photos.
4. Auto-Save: Set up a mechanism to automatically save and store the generated videos.

https://www.instructables.com/
Arduino-Time-Lapse-Photography/
) Digital Photo Frame
Connect Components: Connect the LCD screen to the Raspberry Pi.
Photo Display: Write a Python script that will automatically load and display photos from local
orage or network sources.
User Control: Design a simple user interface that allows you to switch between photos.
4. Customization: Add options to customize features such as display time, transition effects,
etc.

https://www.tomshardware.com/how-to/raspberry-pi-photo-frame
Voice-Activated Light
onnect Components: Connect the microphone module and relay/LED strips to the Raspberry Pi.
oice Detection and Processing: Write a Python script that will detect and process voice
mmands.
ght Control: Develop a control mechanism that will turn the lights on and off according to voice
mmands.
4. User Interface: Provide an interface that can customize system settings.

https://projects.raspberrypi.org/en/projects/google-voice-
aiy

https://www.instructables.com/Raspberry-Pi-Voice-
Controlled-Home-Automation/
Speaker & Bluetooth
onnect Components: Connect the Bluetooth module and speaker to the Raspberry Pi.
luetooth Connection: Set up to connect the devices to the Raspberry Pi via Bluetooth.
Music Playback: Write a Python script that will stream music from the connected
ice.
4. User Control: Add basic control features such as music playback, stop and
skip.

https://www.instructables.com/DIY-Google-Home-With-
Bluetooth-Speaker-on-Raspberr/

https://www.instructables.com/Raspberry-Pi-Bluetooth-
Speaker/
Voice Changer
onnect Components: Connect the microphone and speaker to the
pberry Pi.
udio Capture: Write a Python script that will capture the sound from the
rophone in real-time.
udio Processing: Set up a processing system that will make changes to
captured audio (pitch, speed, equalizer settings, etc.).
4. Output: Develop a mechanism to extract the processed sound
from the speaker.
16) Arduino Gas Leak Detector with Alert System

Objective:
To develop an Arduino-based system capable of detecting the presence of hazardous
gases, such as propane or methane, and alerting the user both visually and audibly to
ensure safety in environments prone to gas leaks.

Hardware Requirements:
1. Arduino Uno Board: Serves as the central processing unit for controlling other
components.
2. MQ-2 Gas Sensor: Detects various gases including methane, butane, LPG, and smoke.
3. Buzzer: Emits an audible alert when gas concentrations exceed safe levels.
4. LEDs (Red and Green): Red LED indicates a hazard (gas detected), while green LED
shows system status (operational).
5. Resistors: For LED connection to limit current and prevent damage.
6. Jumper Wires: For connections between the Arduino and other components.
7. Breadboard: For prototyping the circuit without soldering.
8. Power Supply: Either via USB or an external 9V battery.

Software Requirements:
1. Arduino IDE: To write and upload code to the Arduino board.
2. Libraries: Specific libraries for the MQ-2 sensor to facilitate interfacing and data
reading.

Development Steps:
1. Assemble the Circuit:
- Connect the MQ-2 sensor to the Arduino using jumper wires according to the sensor's
pin layout.
- Attach the buzzer and LEDs to the Arduino, ensuring correct resistance values are
used for the LEDs.
- Arrange all components on the breadboard and ensure secure connections.

2. Programming the Arduino:


- Initialize the MQ-2 sensor library and define pin outputs for the buzzer and LEDs.
- Write a function to read gas concentration levels from the MQ-2 sensor.
- Implement logic to activate the buzzer and red LED when gas levels exceed
predefined thresholds.
- Use the green LED to indicate that the system is active and monitoring.

3. Testing and Calibration:


- Test the circuit in a controlled environment with known gas concentrations to calibrate
the sensor.
- Adjust the threshold values and sensor sensitivity based on the calibration data.
- Ensure the system reliably detects gas and triggers the alert mechanisms.

4. Finalization and Deployment:


- Secure the assembled circuit in a casing to prevent damage and reduce interference.
- Place the system in a strategic location where gas leaks are likely, such as near a
kitchen stove or in industrial areas.
- Regularly test and maintain the system to ensure ongoing reliability.
Ek Dökümantasyon
Nerden Alınır, Ne Alınır?
Rapor Şablonu
Kapak Sayfası
- Proje Başlığı
- Öğrenci(ler)in Adı ve Numarası
- Ders Adı
- Öğretim Üyesinin Adı
- Teslim Tarihi
İçindekiler Tablosu
- Otomatik oluşturulan sayfa numaraları ile birlikte raporun bölümlerini içerir.
Özet
- Projeyi kısa ve öz bir şekilde tanımlayan bölüm. Projenin amacı, ana bulgular, teknikler ve
sonuçlar burada yer alır.
Giriş
- Projeye genel bakış sunar ve projenin önemini, arka plan bilgisini ve genel hedeflerini açıklar.
Literatür Taraması / Araştırma
- Projenin konusuyla ilgili önemli çalışmaları ve mevcut literatürü inceleyen bölüm.
Proje Tanımı ve Tasarımı
- Projeyi ve projenin nasıl gerçekleştirildiğini detaylı bir şekilde açıklayan bölüm.
- Proje gereksinimleri, kullanılan teknolojiler ve sistem mimarisi gibi detaylar burada yer alır.
Uygulama
- Proje geliştirme sürecini, karşılaşılan zorlukları ve nasıl üstesinden gelindiğini içerir.
- Kod örnekleri, devre şemaları ve kullanılan araçlar hakkında bilgi verilir.
Test ve Değerlendirme
- Projenin nasıl test edildiği ve elde edilen sonuçların nasıl değerlendirildiği ile ilgili bölüm.
- Test senaryoları, başarım testleri ve kullanıcı geri bildirimleri burada ele alınır.
Sonuçlar ve Tartışma
- Projeden elde edilen sonuçların sunulduğu ve projenin başlangıçtaki hedeflere ulaşıp
ulaşmadığının tartışıldığı bölüm.
- Karşılaşılan zorluklar, çözümler ve öğrenilen dersler burada paylaşılır.
Gelecek Çalışmalar
- Projeyi genişletme veya geliştirme yolları hakkında önerilerin sunulduğu bölüm.
Kaynakça
- Rapor boyunca atıf yapılan tüm kaynakların listelendiği bölüm. APA veya IEEE gibi standart
bir atıf formatı kullanılmalıdır.
Ekler
- Proje ile ilgili ekstra belgeler, kodlar, devre şemaları gibi detayların eklendiği bölüm.

You might also like