Session 3 DIY Moderate Project

Slides:



Advertisements
Similar presentations
V Avon High School Tech Club Agenda Old Business –Executive Committee –LCCUG meeting volunteer(s) –Reward Points Program New Business –Weekly.
Advertisements

Embedded Programming and Robotics
Introduction to Arduino Prepared by R. Lamond.  “Arduino is an open-source electronics prototyping platform based on flexible, easy- to-use hardware.
Embedded Programming and Robotics
The Headphones1 Trainer Training The Headphones. 2 There are three sets of headphones There are three transmitters Transmitters also act as battery chargers.
Electronic. Analog Vs. Digital Analog –Continuous –Can take on any values in a given range –Very susceptible to noise Digital –Discrete –Can only take.
DPNM Lab., POSTECH 1/8 CS490K - Internet of Things (IoT) Jonghwan Hyun DPNM Lab. Department of Computer Science and Engineering, POSTECH
Welcome to Week 4 at the Summer Computer Club Raspberry Pi (contd)
Hacking Minecraft on the Raspberry Pi using Python
Python for intel Galileo GEN2 TYWu. Software Download/Setup "Bigger" Linux Image Download the Arduino IDE for Galileo –
Bonus EV3 Programming Lessons LEGO MINDSTORMS ev3dev and Raspberry Pi IR Light controller.
Final Term Project Hi-Tek Smoke Detektor By: Rohan Sharma.
Embedded Software Design Week V Advanced Python 7- segment Display.
Raspberry Pi Project Control Your Home Lights with a Raspberry Pi.
Simple Circuits 1 st year physics laboratories University of Ottawa
LESSON 05 Using the Touch LED The Touch LED The purpose of this lesson is to introduce students to the Touch LED Sensor and how they can be used on a.
LESSON 05 Using the Touch LED. LESSON 05 Using the Touch LED.
Embedded Software Design Week III Processor Basics Raspberry Pi -> Blinking LEDs & pushing buttons.
Raspberry pi GPIO Basic’s Lecturer: Reza Arjmandi Summer 2016 Preface: This chapter contains some basic recipes for setting up and using the Raspberry.
Zilogic Systems 1 Device Interfacing with Python and ZIO Zilogic Systems.
Zilogic Systems 1 Device Interfacing with Python and ZIO Zilogic Systems.
Application Case Study Christmas Lights Controller
Python with Raspberry PI Kit
Prototyping Home Automation Concepts
Group 29 JUN SUNG LEE, JAE HYUN KANG
Arduino Uno – controlling LED strips
Electronic Control Systems Week 3 – Switches and Sensors
RASPBERRY PI WORKSHOP.
Light Dependent Resistor
IoT 101 with Raspberry Pi and Azure
Prototyping with Microcontrollers and Sensors
Exploring Computer Science Lesson 6-5
REMOTE JAMMING DEVICE.
Device Interfacing with Python and ZIO
1 Button 2 Buttons Light Emitting Diodes LED and Buttons
Model NO: MTZ-A0003.
Computer Bunker Training
Wiring the Breadboard (the right way).
UltraSonic Sensor VCC is the pin that powers the device, connect to 5V. Trigger is the pin that sends out the burst. Echo is the pin that outputs when.
WORKSHOP LED CONTROL.
RASPBERRY PI WORKSHOP.
Building Raspberry Pi Controllers with Python
INTELLIGENT ENERGY SAVING SYSTEM USING PIC MICROCONTROLLER
Computer Bunker Training
Lighting LEDs with a RASPBERRY PI
PWM? K. A. Connor Mobile Studio Project
PWM? K. A. Connor Mobile Studio Project
CS-4540 Robotics Lab 00 - Introduction and OHM's law.
Automatic Cloth Folding Machine
Internet-of-Things (IoT)
Raspberry Pi: External Inputs & Outputs
Motion Controlled Servo Motor
Exploring Computer Science Lesson 6-5
Reading / Writing analogue devices LED + Game-controller
Instructions for creating a template in MS Frontpage
RPi 2/3, I2C, Analog Sensor
Raspberry Pi 2/3 GPIO - LED, Button
RPi 2/3 GPIO + Web(Flask)
Intro to Micro Controllers
Introduction Digital Mood Ring with TI-84 Plus CE and TI-Innovator™ Hub student STEM project Bring science and coding together (no coding experience.
Light Dependent Resistor
Passive Infrared Sensor
ECE Computer Engineering Design Project
Python with Raspberry PI Kit
Arduino Uno circuit basics
Controlling LED with PWM
Interactive Mirror Display
Chapter 7 IoT Physical Devices and Endpoints
A modular robot for use in the RoboSumo lab
Robot and Crickit HAT © Copyright 2019 by Dr. Elizabeth I. Horvath and Dr. Eva A. Horvath 1.
Presentation transcript:

Session 3 DIY Moderate Project Indraneel Mukhopadhyay Skill Level: Moderate Dates: 11th January, 2017 Time: 2:00pm to 5:30pm

Overview This session includes Three Projects: Using Capacitive Module Sensor Using RGB Module Using PIR Module Sensor Overview

Bill of Materials Required for the three Projects Required for all three projects: One (1) Raspberry Pi 3 plus USB cables and power supply Ten (10) Female-Female jumper wires PROJECT D also requires: One (1) Capacitive Module Sensor PROJECT E also requires: One (1) RGB Module Sensor PROJECT F also requires: One (1) PIR Module Sensor Bill of Materials Required for the three Projects

DIY Project D: Capacitive Sensor Using the Raspberry Pi to control a Capacitive Sensor DIY Project D: Capacitive Sensor

Capacitive Module Example: What's Required: One (1) Capacitive Module Sensor (OSEPP-Touch-01) Three (3) Female-Female jumper wires Capacitive Module Example:

How Capacitive Sensor works: The sensor plate and the touch of your finger forms a capacitor. Capacitors store charge. The greater the capacitance, the more charge it can store.. The capacitance of this capacitive touch sensor depends on how close your finger is to the plate. How Capacitive Sensor works:

Direct Connection to GPIO Bus with three Female-Female jumpers Jumper Wire Connections: CapSen GND Pin 1 to GND (Pin 6) CapSen Vcc Pin 2 to 3.3v (Pin 1) CapSen Sig Pin 3 to GPIO-23 (Pin 16)

The CODE (Page 1 of 1) See also: capsensor.txt import time import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) padPin = 23 GPIO.setup(padPin, GPIO.IN) alreadyPressed = False while True: padPressed = GPIO.input(padPin) if padPressed and not alreadyPressed: print "pressed" alreadyPressed = padPressed time.sleep(0.1) The CODE (Page 1 of 1) See also: capsensor.txt

To Run the Sensor at Terminal > sudo python capsensor To Run the Sensor at Terminal > sudo python capsensor.py Output Screen -> In actual applications, the 'pressed' output would be used to initiate other actions in other parts of a larger program

DIY Project E: RGB Module Using the Raspberry Pi to colour control a RGB Module Sensor DIY Project E: RGB Module

RGB Sensor Module Example: What's Required: One (1) RGB Module Sensor (XINDA 3-Clr) Four (4) Female-Female jumper wires RGB Sensor Module Example:

The RGB colour model is an additive colour model in which red, green and blue light are added together in various ways to reproduce a broad array of colours. The name RGB comes from the initials of the three additive primary LED colours: red, green and blue. What is RGB Sensor

Direct Connection to GPIO Bus with four Female-Female jumpers Jumper Wire Connections: RGB B Pin 1 to GPIO-27 (Pin 13) RGB G Pin 2 to GPIO-18 (Pin 12) RGB R Pin 3 to GPIO-17 (Pin 11) RGB GND Pin 4 to GND (Pin 6)

The CODE (Page 1 of 5) See also: rgb.txt # Import the modules used in the script import random, time import RPi.GPIO as GPIO # Set GPIO to Broadcom system and set RGB Pin numbers RUNNING = True GPIO.setmode(GPIO.BCM) red = 17 green = 18 blue = 27 # Set pins to output mode GPIO.setup(red, GPIO.OUT) GPIO.setup(green, GPIO.OUT) GPIO.setup(blue, GPIO.OUT) The CODE (Page 1 of 5) See also: rgb.txt

The CODE (Page 2 of 5) See also: rgb.txt Freq = 100 #Hz # Setup all the LED colors with an initial # duty cycle of 0 which is off RED = GPIO.PWM(red, Freq) RED.start(0) GREEN = GPIO.PWM(green, Freq) GREEN.start(0) BLUE = GPIO.PWM(blue, Freq) BLUE.start(0) # Define a simple function to turn on the LED colors def color(R, G, B, on_time): The CODE (Page 2 of 5) See also: rgb.txt

The CODE (Page 3 of 5) See also: rgb.txt def color(R, G, B, on_time): # Color brightness range is 0-100% RED.ChangeDutyCycle(R) GREEN.ChangeDutyCycle(G) BLUE.ChangeDutyCycle(B) time.sleep(on_time) # Turn all LEDs off after on_time seconds RED.ChangeDutyCycle(0) GREEN.ChangeDutyCycle(0) BLUE.ChangeDutyCycle(0) print("Light It Up!") print("Press CTRL + C to quit.\n") print(" R G B\n---------") The CODE (Page 3 of 5) See also: rgb.txt

The CODE (Page 4 of 5) See also: rgb.txt # Main loop try: while RUNNING: for x in range(0,2): for y in range(0,2): for z in range(0,2): print (x,y,z) # Slowly ramp up power percentage of each active color for i in range(0,101): color((x*i),(y*i),(z*i), .02) # If CTRL+C is pressed the main loop is broken except KeyboardInterrupt: RUNNING = False print "\Quitting" The CODE (Page 4 of 5) See also: rgb.txt

The CODE (Page 5 of 5) See also: rgb.txt # Actions under 'finally' will always be called # regardless of what stopped the program finally: # Stop and cleanup so the pins # are available to be used again GPIO.cleanup() The CODE (Page 5 of 5) See also: rgb.txt

To Run the Sensor at Terminal > sudo python rgb To Run the Sensor at Terminal > sudo python rgb.py Output Screen -> Although we the terminal displays the RGB outputs here as (x,x,x) where "1" shows the LED as ON and "0" as LED OFF - which would be usable to inform other parts of a larger program - merely looking at the RGB Module shows the output results.

DIY Project F: PIR Sensor Using PIR Sensor with Raspberry Pi DIY Project F: PIR Sensor

PIR Sensor Module Example: What's Required: One (1) PIR Sensor (HC-SR501) Three (3) Female-Female jumper wires PIR Sensor Module Example:

PIR stands for Passive InfraRed PIR stands for Passive InfraRed. This motion sensor consists of a fresnel lens, an infrared detector and supporting detection circuitry. The lens on the sensor focuses any infrared radiation present around it towards the infrared detector. Our bodies generate infrared heat and as a result this gets picked up by the motion sensor. The sensor outputs a 5V signal for a period of one minute as soon as it detects the presence of a person. What is PIR Sensor:

When the PIR motion sensor detects a person, it outputs a 5V signal to the Raspberry Pi through its connection to the GPIO. The sensor is highly sensitive and offers a tentative range of detection of about 6-7 meters.. How it works:

Direct Connection to GPIO Bus with three Female-Female jumpers Jumper Wire Connections: PIR Pin 1 to 5v (Pin 02) PIR Pin 2 Output to GPIO-04 (Pin 7) PIR Pin 3 to GND (Pin 6)

The CODE (Page 1 of 1) See also: pirtst.txt import RPi.GPIO as GPIO import time GPIO.setwarnings(False) GPIO.setmode(GPIO.BOARD) GPIO.setup(07, GPIO.IN) #Read output from PIR motion sensor while True: i=GPIO.input(07) if i==0: #When output from motion sensor is LOW print "No intruders",i time.sleep(0.1) elif i==1: #When output from motion sensor is HIGH print "Intruder detected",i The CODE (Page 1 of 1) See also: pirtst.txt

To Run the Sensor at Terminal > sudo python pirrrr To Run the Sensor at Terminal > sudo python pirrrr.py Output Screen->

Questions ? End of Session 3