Sie sind auf Seite 1von 17

COURSE CODE : CSE 426

COURSE TITLE : Microcontroller computer peripherals and interfacing Lab

a.Write down definition, description, specification and application of 10 Arduino sensors.

Answer:

1. Automatic Infrared PIR Motion Sensor Switch 12V.


Descriptions:
1. Easy to install.
2. Automatic, convenient, safe and practical.
3. It has the function of power and detection indication.
4. The motion sensor can identify day and night automatically.
5. It has a wide detection range made up of up and down, left and right service
field.
6. This product is a new type of energy-saving lighting switch,
it adopts a high sensitivity detector, integrates circuit and SMT.
7. It utilizes human motion infrared rays as control signal sources
when one enters the detection field, it will start the controlled load at once.

Specifications:
Color: Grey, Black, White
Material: ABS
Working Rotation: 180 Degree
Voltage: DC 12V
Standard: LVD, EMC, CE, RoHS
IP Rating: Indoor application IP44
LUX Setting: 2-2000lux svr adjustable
Size: As shown on the picture
Induction lighting time: 5s~6min adjustable time
Detection distance: Approx 12M, installation 1.5-2.5M High

Application:
 This sensor is use to Human detection.
 Home Automation.
 Intelligent Rode lamp etc.

2. Fingerprint Scanner - 5V TTL (GT-511C1)


Description: 

Fingerprint scanners are awesome. Why use a key when you have one right at the tip of
your finger? Unfortunately, they're usually unreliable or difficult to implement. Well not
anymore! We've found this great fingerprint module from ADH-Tech that communicates
over TTL Serial so you can easily embed it into your next project.

The module itself does all of the heavy lifting behind reading and identifying the
fingerprints with an on-board optical sensor and 32-bit CPU. All you need to do is send it
simple commands. To get started, just register each fingerprint that you want to store by
sending the corresponding command and pressing your finger against the reader three
times. The fingerprint scanner can store different fingerprints and the database of prints
can even be downloaded from the unit and distributed to other modules. As well as the
fingerprint "template," the analyzed version of the print, you can also retrieve the image
of a fingerprint and even pull raw images from the optical sensor!

This is the more economical version of the GT-511 which has a decreased memory
capacity (compared to the GT-511C3). The module can only store up to 20 different
fingerprints and is only capable of 30° fingerprint recognition. If you are on a budget and
need only a small number of fingerprints stored, this is the perfect option for you!
The module is small and easy to mount using two mounting tabs on the side of the sensor.
The on-board JST-SH connector has four signals: Vcc, GND, Tx, Rx. A compatible JST-
SH pigtail can be found in the related items below. Demo software for PC is available in
the documents below, simply connect the module to your computer using an FTDI
Breakout and start the software to read fingerprints!

Specifications:

 High-Speed, High-Accuracy Fingerprint Identification using the SmackFinger 3.0


Algorithm
 Download Fingerprint Images from the Device
 Read and Write Fingerprint Templates and Databases
 Simple UART protocol (Default 9600 baud)
 Capable of 1:1 Verification and 1:N Identification

3. MQ-2 Flammable Gas & Smoke Sensor


Description:
The MQ series of gas sensors use a small heater inside with an electrochemical sensor. They are
sensitive to a range of gasses and are used indoors at room temperature. The output is an analog
signal and can be read with an analog input of the Arduino.

The MQ-2 Gas Sensor module is useful for gas leakage detecting in home and industry. It can
detect LPG, i-butane, propane, methane, alcohol, hydrogen and smoke.

Some modules have a built-in variable resistor to adjust the sensitivity of the sensor.

Note: The sensor becomes very hot after a while, don't touch it!
4. TCRT5000L Reflective Optical Sensor.
Description:
The TCRT5000 and TCRT5000L are reflective sensors which include an infrared emitter and
phototransistor in a leaded package which blocks visible light. The package includes two
mounting clips.

Specification:

• Package type: leaded


• Detector type: phototransistor
• Dimensions (L x W x H in mm): 10.2 x 5.8 x 7
• Peak operating distance: 2.5 mm
• Operating range within > 20 % relative collector
current: 0.2 mm to 15 mm
• Typical output current under test: IC = 1 mA
• Daylight blocking filter
• Emitter wavelength: 950 nm
• Lead (Pb)-free soldering released
• Compliant to RoHS directive 2002/95/EC and in
accordance to WEEE 2002/96/EC

APPLICATIONS:

• Position sensor for shaft encoder


• Detection of reflective material such as paper, IBM cards,
magnetic tapes etc.
• Limit switch for mechanical motions in VCR
• General purpose - wherever the space is limited
• Line Following Robot
5.LM35 Temperature Sensor.
Description:

The Temperature Sensor LM35 series are precision integrated-circuit temperature devices with
an output voltage linearly proportional to the Centigrade temperature.

The LM35 device has an advantage over linear temperature sensors calibrated in Kelvin, as the
user is not required to subtract a large constant voltage from the output to obtain convenient
Centigrade scaling. The LM35 device does not require any external calibration or trimming to
provide typical accuracies of ±¼°C at room temperature and ±¾°C over a full −55°C to 150°C
temperature range.

The LM35 series are precision integrated-circuit temperature sensors, with an output Voltage
linearly proportional to the Centigrade temperature. Thus the LM35 has an advantage over linear
temperature sensors calibrated in ° Kelvin, as the user is not required to subtract a large constant
voltage from the output to obtain convenient Centigrade scaling.

Specification:

 Calibrated Directly in ° Celsius (Centigrade)


 Linear + 10 mV/°C Scale Factor
 0.5°C Ensured Accuracy (at +25°C)
 Rated for Full −55°C to +150°C Range
 Suitable for Remote Applications
 Low Cost Due to Wafer-Level Trimming
 Operates from 4 to 30 V
 Less than 60-µA Current Drain
 Low Self-Heating, 0.08°C in Still Air
 Nonlinearity Only ±¼°C Typical
 Low Impedance Output, 0.1 Ω for 1 mA Load
6. Ultrasonic sensor HC- SR04

The HC-SR04 ultrasonic sensor uses sonar to determine the distance to an object like bats or
dolphins do. It offers excellent range accuracy and stable readings in an easy-to-use package. It
operation is not affected by sunlight or black material like Sharp rangefinders are (although
acoustically soft materials like cloth can be difficult to detect). Similar in performance to the
SRF005 but with the low-price of a Sharp infrared sensor.

Specification:

 Operating voltage: +5V


 Theoretical  Measuring Distance: 2cm to 450cm
 Practical Measuring Distance: 2cm to 80cm
 Accuracy: 3mm
 Measuring angle covered: <15°
 Operating Current: <15mA
 Operating Frequency: 40Hz

Applications:

 Used to avoid and detect obstacles with robots like biped robot, obstacle avoider robot,
path finding robot etc.
 Used to measure the distance within a wide range of 2cm to 400cm
 Can be used to map the objects surrounding the sensor by rotating it
 Depth of certain places like wells, pits etc can be measured since the waves can penetrate
through water
7. DHT11 DIGITAL TEMPERATURE HUMIDITY SENSOR MODULE

Description:

The DHT11 is a commonly used Temperature and humidity sensor. The sensor comes with a


dedicated NTC to measure temperature and an 8-bit microcontroller to output the values of
temperature and humidity as serial data. The sensor is also factory calibrated and hence easy to
interface with other microcontrollers.

The sensor can measure temperature from 0°C to 50°C and humidity from 20% to 90% with an
accuracy of ±1°C and ±1%. So if you are looking to measure in this range then this sensor might
be the right choice for you.

Specifications:

 Operating Voltage: 3.5V to 5.5V


 Operating current: 0.3mA (measuring) 60uA (standby)
 Output: Serial data
 Temperature Range: 0°C to 50°C
 Humidity Range: 20% to 90%
 Resolution: Temperature and Humidity both are 16-bit
 Accuracy: ±1°C and ±1%

Applications:

 Measure temperature and humidity


 Local Weather station
 Automatic climate control
 Environment monitoring
8. ANALOG CAPACITIVE SOIL MOISTURE SENSOR MODULE

Specification:

 Operating Voltage: 3.3 ~ 5.5 VDC


 Output Voltage: 0 ~ 3.0VDC
 Interface: PH2.0-3P
 Dimension: 98mm * 23mm (3.86in x 0.905in)
 Weight: 15g

Applications

 Garden plants
 Moisture detection
 Intelligent agriculture

9. TOUCH SENSOR MODULE TTP223B.

Description:
The Touch Sensor is based on a touch-sensing IC (TTP223B) capacitive touch switch module. In
the normal state, the output module low, low power consumption; When a finger touches the
corresponding position, the high output module, if not touched for 12 seconds, switch mode
down-power.
Jog type: the initial state is low, high touch-sensitive, no touch is low (similar to the touch of a
feature button)the module can be installed in such as plastic surface, glass of non-metallic
materialsin addition to the thin (non-metallic) paper that covers the surface of the module, as
long as the correct location of the touch, you can do hidden in the walls, desktops and other parts
of buttons.
Specification:

low energy consumption


power supply for 2 ~ 5.5 V DC
can replace the traditional push of a button
four M2 bolts positioning holes for easy installation

10. RFID-RC522 RF IC CARD SENSOR MODULE.

Description:
MF RC522 is used in highly integrated 13.56MHz contactless communication card chip to read
and write, of NXP for “three” and the application launched a low voltage, low cost, small size,
non-contact card chip to read and write, intelligent instruments and portable handheld devices
developed better.

The MF RC522 use of advanced modulation and demodulation concept completely integrated in
the 13.56MHz all kinds of passive contactless communication methods and protocols. 14443A
compatible transponder signal. The digital part handles the the ISO14443A frames and error
detection. In addition, support Quick CRYPTO1 encryption algorithm, the term verification
MIFARE series. MFRC522 support MIFARE series of high-speed non-contact communication,
two-way data transfer rates up to 424kbit / s.

As 13.56MHz highly integrated card reader series chip new family, the MF RC522 MF RC500
MF RC530 there are many similarities, but also have many of the characteristics and differences.
Communication between it and the host SPI mode, helps to reduce the connection, reduce PCB
board volume and reduce costs.

Specification:
1. Operating Current :13-26mA/DC 3.3V
2. Idle Current :10-13mA/DC 3.3V
3. Sleep Current: <80uA
4. Peak Current: <30mA
5. Operating Frequency: 13.56MHz
6. Supported card types: mifare1 S50, mifare1 S70, mifareUltraLight, mifare Pro,
mifareDesfire and mifare Classic
7. Environmental Operating Temperature: -20-80 degrees Celsius
8. Environmental Storage Temperature: -40-85 degrees Celsius
9. Relative humidity: relative humidity 5% -95%
10. Data transfer rate: maximum 10Mbit/s
11. Size: RFID-RC522 Module:3.9 x 6 cm The Standard S50 Blank Card :8.5 x 5.4 cm
12. Diameter of S50 special-shaped card: 3.1(max)

a. Briefly describe about 9 essential embedded microcontroller peripherals.


Answer:
1. Timers: Timing is a crucial part of any embedded system, be it controlling the
blinking rate of the LEDs or controlling the sampling rate of the ADCs, or a
simple delay on the source code. This need for timing is usually handled by
devices called timers. 

Timers can operate in 2 modes 

1. One time mode and 


2. Periodic mode

One-time mode:
In One-time mode, we can set the timer to go off after a particular time duration,
say 10 ms. Once started, the timer counts down and once it runs out it notifies the
core through a mechanism called interrupts (discussed later in this article)and the
timer gets disabled. This action is very similar to using a stopwatch in count down
mode.

Periodic mode
In periodic mode, once the timer runs out, it notifies the core, then instead of
getting disabled, it automatically reloads the initial value and starts counting down
again. Basically, all this mode does extra compared to the One-time mode is just
the auto-restart! 

There are several types of timers that can be present in an embedded system.
Examples cam include general-purpose timers, watchdog timers, and SysTick
timers. Each of these is useful in specific scenarios. You can read this article to
learn more about timers

2. Pulse Width Modulation (PWM) controllers:


These are special kinds of timers that are directly able to control the voltage
output at a given GPIO pin.

The microcontrollers are digital devices that can only deal with binary voltage
levels, level 0 and level 1. Level 1 can be 1.8v or 3.3v or 5v depending upon the
microcontroller design and Level 0 is usually 0v. If we need some other voltages
in the middle, let’s say 0.45v, the only way to accomplish this is by turning on
and off the pins continuously at a very fast rate so that the average voltage
becomes 0.45v.  The device that does this is called PWM controllers.
For example, say we have a microcontroller with voltage levels of 0v and 5v and
we need 2.5v output. We can use the PWM controller to do that for us by asking it
to keep the pin at 0v for 1ms and 5v for 1ms and just alternate between the 2 for
as long as we need this 2.5v output.

The duty cycle and period are the 2 most important parameters when designing
the chip. Duty cycle is the ratio of On-time to Off-time and the period of a PWM
output is simply the time duration of one period as shown in the image above.

The most common application of PWM is to drive the LEDs to variable


brightness. Other examples include controlling motors, audio amplifiers, and
power supplies.
3. Digital to analog converters(DAC):
They take integers (digital numbers) as input and produce an equivalent
analog signal as output. PWM controller discussed above does something
similar to it, but not exactly, the difference being the fact that it can only produce
digital voltage signals. That is, it cannot produce analog signals.
For example, let’s say we need to create a sine waveform signal, then we need to
give the DAC a set of numbers as input one by one in with a fixed time interval.
Let’s use a 16 point sine wave to accomplish this. Sine function can take input
from 0 to 2π, so the 16 points we need are sine(0), sine(π/8), sine(2π/8),
sine(3π/8) … sine(15π/8). ( sine(16π/8) becomes sine(2π) which is same as
sine(0).
The results are multiplied by 1000 and added with 1024 to get the integers that we
need to send to the DAC controller (more details about this conversion in the next
section). DACs simply take in this input number and hands it over to its holding
module which holds the output voltage of the DAC proportional to the input
number. Since we are using a constant interval transmission, we end up with a
stepped sine wave as in the picture

4. Serial communication Controllers:


To talk to the external peripherals, some sort of communication protocol is
needed. This is taken care of using devices called serial communication
controllers. The most common examples of serial communication protocols
include UART, I2C, and SPI. There are several others like I2S, USART, USB,
Ethernet, Bluetooth, Wifi and so on. In essence, almost all of the communication
protocols we use these days are serial in nature.

5. Interrupt controllers:
Interrupt controllers listen to the peripherals for events and reports to the
processor once an event occurs.
Lets first talk about what interrupts are by considering some real-life examples of
interrupts.

 you are sleeping and in the morning the alarm you set goes off and wakes
you up  (by interrupting your sleep)
 You are reading a book and your phone rings to alert you of a call (by
interrupting your reading session.)
These are 2 examples of day to day interrupts experienced by us humans. 

This concept has been ported to embedded systems using special devices called
interrupt controllers. I like thinking of them as event listener peripherals. Their
main job is to listen to the events generated by the other peripherals and report
them to the processor. 

6. Direct Memory Access Controller:


The 3 main types of operations a microprocessor perform include arithmetic
operations, logical operations and data move operations. By data move
operations I mean transferring data from one memory location to another, for
example from UART buffer to the RAM and vice versa.
Imagine you own a courier company and you hire an awesome programmer
for 100 bucks per hour. His main job includes, of course, creating awesome
code for your courier website.

But he is getting constantly interrupted by customers coming in all day with


parcels, and he is wasting his time collecting those parcels and keep them in
storage for transport later. So you decide to hire another person, for say, 20
bucks/hour to take care of these simple parcel reception duties, while your
awesome programmer can focus on the job he is good at, this way your
overall productivity will increase immensely and so will your revenue!

This analogy is perfect for describing DMA. Here the microprocessor is your
awesome programmer, the customer coming in is say UART interrupts to the
microprocessor, UART data is the parcels and the second person hired is the
DMA controller.

c) Write down the functions of ADMUX and ADCSRA.

ADMUX Register

This Register is used to select :

1. Reference voltage source to ADC (AREF)


2. Analog port channel to used for conversion (PC0.....PC5)
3. How the result will be stored in Data Register either Left justified or Right justified.
                                                           Since the Digital value of corresponding Analog vary from 0 to 1024, value
can't be stored in a single register that's why two registers (ADCH & ADCL) are used to store that digital value.

REFS1 and REFS0 (REFerence Selection bit 1 to 0) : this bits are used to determine what reference voltage source
to be used for AD Conversion. It can be either internal 2.56 V or through external AREF (Analog REFerence) pin,
following table sows the bit configuration for different reference source :

Click on the link below to see schematic of different type reference source

 0, 0      AREF, Internal Vref turned off


 0, 1      AVcc with external capacitor at AREF pin
 1, 1       Internal 2.56 V Voltage Reference with external capacitor at AREF pin 
ADLAR (ADc Left Adjusted Result) : Once the conversion is completed result is stored in ADCH & ADCL
Register, this result can be either left justified or Right justified if ADLAR bit is set (means written 1) then it's left
adjusted and clearing it will right justify the result. By default bit is cleared and right justified.
 if ADLAR = 0 Result is right justified

 if ADLAR = 1 Result is left justified.

MUX3 to MUX0 (multiplexer) : This bits are used to select particular analog input channel. The table shows bits to
be set to enable any particular pin (ADC5 ....ADC0)

Note that bit 4 (MUX3) is not used in Atmega8 as there are only 6 analog pins (three bits are  sufficient to point the
address). However there are another AVR device which have more than 8 analog pins for which the fourth bit is
utilized, Also note that if bits are changed during a conversion, the change will not go in effect until conversion
completes 
ADCSRA Register
                                                                 The main use of this Register is to enable the  ADC features in AVR's I/O
Port, Starting the conversion of analog, Enabling Interrupt, Setting a flag bit after conversion, Declaring mode either
it will be free running or Single Conversion mode, and defining the Prescaler 

      

     ADEN (ADc ENable) : This bit of this register is used to enable the ADC feature in Atmega8's I/O Port (PC0 to
PC5) otherwise these pins will work as GPIO (general purpose input output) pins.

     ADSC (ADc Start Conversion) : Writing a logical 1 to this bit will start a conversion of analog data of that
selected I/O pin. (ADMUX Register is used to select the pin for conversion. We will study ahead) In Single
Conversion Mode, this bit will remain cleared until the conversion completes.

     ADFR (ADc Free Running) : Writing a logical one to this bit enables the Free Running Mode where the ADC
samples and updates the Data Register continuously. Clearing this bit will terminate this mode.

     ADIF (ADc Interrupt Flag) : when the conversion is finished and Data Register is updated this bit is set to 1
automatically thus it is used to check whether conversion is completed or not

     ADIE  (ADc Interrupt Enable) : when this bit is set to 1 and the global interrupt ( I bit in SREG) are enabled the
ADC interrupt is activated and the ADC ISR (Interrupt Service Routine)  is called when conversion completed.

     ADPS2 to ADPS0 (ADc Prescaler Select) : this bit determines the division factor between AVR clock frequency
and the ADC clock frequency the following table describes the setting of this bits...

Das könnte Ihnen auch gefallen