Line: 1 to 1 | |||||||||
---|---|---|---|---|---|---|---|---|---|
![]() Lecture 3: Switches CSC 321: Embedded SysytemFirst Semester 2020/2021 | |||||||||
Line: 113 to 113 | |||||||||
• Also if you connect a PIR(passive infrared sensor) to a digital input, it can detect the infrared (IR) light radiating from objects in its field of view. | |||||||||
Changed: | |||||||||
< < | • MicroPython makes it just as easy to use a pin digital inputs as it does outputs. | ||||||||
> > | • MicroPython makes it just as easy to use a pin digital inputs as it does outputs. | ||||||||
The Push Button | |||||||||
Line: 193 to 193 | |||||||||
• Infrared in this range will not pass through many types of material that pass visible light such as ordinary window glass and plastic. • However it will pass through, with some attenuation, material that is opaque to visible light such as germanium and silicon. | |||||||||
Changed: | |||||||||
< < |
| ||||||||
> > |
| ||||||||
PIR Sensor Features | |||||||||
Line: 226 to 227 | |||||||||
PIR Sensitive Crystal | |||||||||
Changed: | |||||||||
< < | ![]() | ||||||||
> > | ![]() | ||||||||
There are two important materials present in the sensor:
| |||||||||
Line: 263 to 264 | |||||||||
| |||||||||
Changed: | |||||||||
< < |
| ||||||||
> > |
| ||||||||
| |||||||||
Added: | |||||||||
> > |
|
Line: 1 to 1 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() Lecture 3: Switches CSC 321: Embedded SysytemFirst Semester 2020/2021 | |||||||||||||||
Line: 9 to 9 | |||||||||||||||
Switches are essentially binary devices: they are either completely on (“closed”) or completely off (“open”). | |||||||||||||||
Changed: | |||||||||||||||
< < | A Switch simply can make or break an electrical circuit. | ||||||||||||||
> > | A Switch simply can make or break an electrical circuit. | ||||||||||||||
Changed: | |||||||||||||||
< < | Every electrical and electronics application uses at least one switch to perform ON and OFF operation of the device. | ||||||||||||||
> > | Every electrical and electronics application uses at least one switch to perform ON and OFF operation of the device. | ||||||||||||||
Switches are a part of the control system and without it, control operation cannot be achieved. | |||||||||||||||
Changed: | |||||||||||||||
< < | When the contacts of a switch are closed, the switch creates a closed path for the current to flow and hence load consumes the power from source. | ||||||||||||||
> > | When the contacts of a switch are closed, the switch creates a closed path for the current to flow and hence load consumes the power from source.
Types of Switches• Switches exist in various incarnation. • A Switch object is used to control a push-button switch. • There are the simple mechanical switches: on/off or push button switches • There are also switches than turn on or off with various external conditions: • Temperature • infra red radiation (e.g. the Passive Infrared Sensor or PIR sensor) • Hall switches detecting magnetic field • microphone switches which turn on when a certain noise level is detected | ||||||||||||||
Types of SwitchesToggle Switches | |||||||||||||||
Line: 35 to 53 | |||||||||||||||
or “unpressed,” position, for momentary operation.
| |||||||||||||||
Added: | |||||||||||||||
> > | Types of Switches | ||||||||||||||
Selector Switches![]() | |||||||||||||||
Line: 63 to 83 | |||||||||||||||
An inexpensive temperature-sensing mechanism is the “bimetallic strip:” a thin strip of two metals, joined back-to-back, each metal having a different rate of thermal expansion. | |||||||||||||||
Added: | |||||||||||||||
> > | The Push Button & PIR
Digital InputsWhen you try to use a microcontroller to detect activity in the physical world, the simplest activity you can perceive is whether an activity is True or False.
![]() ![]() through the resistor or through the microcontroller. When the switch is closed, the current will follow the path of least resistance, to the microcontroller pin, and the microcontroller can then read the voltage. The microcontroller pin will then read as high voltage or HIGH. When the switch is open, the resistor connects the digital input to ground, so that it reads as zero voltage, or LOW. • A digital input is a board pin which can read if it sees a high (on) or low (off) logic level connected to it. • For example if you connect a button to a digital input you can detect when it's pressed and released. • Also if you connect a PIR(passive infrared sensor) to a digital input, it can detect the infrared (IR) light radiating from objects in its field of view. • MicroPython makes it just as easy to use a pin digital inputs as it does outputs. The Push Button• The push button switch is usually used to turn on and off the control circuit, and it is a kind of control switch appliance that is widely used. • This is very similar to switching a LED on or off. • A single GPIO line is used. • The pin in programmed as a digital input and we can add a pullup or pulldown resistor:_PB_PIN = 22 pushButton = Pin(_PB_PIN, Pin.IN, Pin.PULL_UP)• Once the pushButton pin is defined we can get its current state with: state = pushButton.value() Pull-up Resistors• Pull-up resistors are very common when using microcontrollers (MCUs) or any digital logic device.` • The value of the pull-up resistor needs to be chosen to satisfy two conditions: • When the button is pressed, the input pin is pulled low. The value of resistor R1 controls how much current you want to flow from VCC, through the button, and then to ground. • When the button is not pressed, the input pin is pulled high. The value of the pull-up resistor controls the voltage on the input pin.![]() Interrupts• Interrupts are useful for making things happen automatically in microcontroller programs | ||||||||||||||
Added: | |||||||||||||||
> > | • With interrupts you don’t need to constantly check the current pin value.
• When a change is detected, an event is triggered (a function is called).
• When an interrupt happens, the processor stops the execution of the main program to execute a task,
and then gets back to the main program
• This is especially useful to trigger an action whenever motion is detected or
whenever a pushbutton is pressed without the need for constantly checking its state.
Interrupt MethodThe irq() method accepts the following arguments:
The PIR Sensor• PIR sensors allow you to sense motion, almost always used to detect whether a human has moved in or out of the sensors range. • They are small, inexpensive, low-power, easy to use and don't wear out. • They are often referred to as PIR, "Passive Infrared", "Pyroelectric", or "IR motion" sensors. • PIR is an electronic sensor which detects the changes in the infrared light across certain distance and gives out an electrical signal at its output in response to a detected IR signal. • It can detect any infrared emitting object(Objects that generate heat) such as human beings or animals if it is the range of the sensor, or moves away from the range, or moves within the range of the sensor. • The radiation of the infrared object should be strongest at a wavelength of 9.4μm. • Infrared in this range will not pass through many types of material that pass visible light such as ordinary window glass and plastic. • However it will pass through, with some attenuation, material that is opaque to visible light such as germanium and silicon.
| ||||||||||||||
Added: | |||||||||||||||
> > | PIR Sensor Features
Repeatable(H) modeIn Repeatable(H) mode the output pin Dout will go high (3.3V) when a person is detected within range It goes low after a particular time (time is set by “Off time control” potentiometer). In this mode the output pin will go high irrespective of whether the person is still present inside the range or has left the area. The sensitivity can be set using the “sensitivity control” potentiometerNon- Repeatable(L) modeIn “I” mode the output pin Dout will go high (3.3V) when a person is detected within range It will stay high as long as he/she stays within the limit of the Sensors range. Once the person has left the area the pin will go low after the particular time which can be set using the potentiometer. The sensitivity can be set using the “sensitivity control” potentiometerPIR Sensitive Crystal![]()
PIR to MCU• A single GPIO line is used. • The pin in programmed as a digital input and we can add a pullup or pulldown resistor:_IR_PIN = 16 pir_sensor = Pin(_PB_PIN, Pin.IN, Pin.PULL_UP)• Once the pushButton pin is defined we can get its current state with: state = pir_sensor.value() | ||||||||||||||
%SLIDESHOWEND% | |||||||||||||||
Line: 73 to 262 | |||||||||||||||
Comments | |||||||||||||||
Added: | |||||||||||||||
> > |
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Added: | ||||||||
> > |
![]() Lecture 3: Switches CSC 321: Embedded SysytemFirst Semester 2020/2021Slide 1: SwitchesA Switch is a device which is designed to interrupt the current flow of electrons in a circuit. Switches are essentially binary devices: they are either completely on (“closed”) or completely off (“open”). A Switch simply can make or break an electrical circuit. Every electrical and electronics application uses at least one switch to perform ON and OFF operation of the device. Switches are a part of the control system and without it, control operation cannot be achieved. When the contacts of a switch are closed, the switch creates a closed path for the current to flow and hence load consumes the power from source.Slide 2: Types of SwitchesToggle Switches![]() Pushbutton Switches![]() Selector Switches![]() Joystick Switches![]() Pressure Switches![]() Temperature Switches![]() -- ![]() Comments |