Analog-to-Digital Converter Peripheral Labs
5.2.4
5.2.4.1
Lab 2: Audible Temperature Sensor
OVERVIEW
In this lab, the ADC peripheral on the PIC16F690 is used to alter the frequency of
Pulse-Width Modulated Waveform (PWM) in relation to the temperature sensed by a
thermistor connected to the input of the ADC peripheral. The PWM waveform is gener-
ated by simply toggling the RC0 voltage level high and low. The thermistor is used to
create a voltage divider in conjunction with a 1K Ω resistor to vary the voltage into the
ADC input. This thermistor is a Negative Temperature Coefficient type (NTC) meaning
that as the temperature of the device increases, the resistance effectively decreases.
The voltage drop across the thermistor is converted by the ADC and the ADRESH
result then used to manipulate a TMR0 preload value (see GPIO Lab 3) that will be
used in the Timing() to vary the execution speed of the software control loop and ulti-
mately the frequency of the PWM waveform. The PWM will be connected to an
N-Channel MOSFET used to drive the 8 Ω speaker on the PICDEM Lab Development
Board. The schematic for this lab is shown in Figure 5-5.
FIGURE 5-5:
SCHEMATIC FOR ADC LAB 2
V DD
J8
1
2
U2
20
19
J9
R3
100 ?
3
4
18
17
J19
5
6
7
8
9
RC0
RB4/AN10
16
15
14
13
12
SP+
SP-
8 ?
LS1
10
Thermistor
V DD
R1
1K ?
R2
10K ?
11
R4
10K ?
V SS
Q1
IRFD010 N-Channel
MOSFET
V SS
V SS
Referring to the schematic in Figure 5-5, the RC0 connects to the gate of the IRFD010
N-Channel MOSFET Q1. Resistor R4 pulls the gate input low ensuring the transistor
will remain OFF until a high voltage level is present on the RC0 output. When the PWM
transitions high, Q1 is ON and current flows through the 8 Ω speaker. The 100 Ω R3
resistor is used to limit the current through the speaker to maintain manufacturer spec-
ified power ratings. In this way, any change in temperature around the thermistor will
alter the frequency of the PWM, thereby changing the audible frequency emitted from
the speaker.
? 2009 Microchip Technology Inc.
DS41369A-page 85
相关PDF资料
DM164120-1 BOARD DEMO PICKIT 2 LP COUNT
DM164120-3 BOARD DEMO PICKIT2 28-PIN
DM164120-5 BOARD DEMO PICKIT 2 64/80-PIN
DM164123 KIT MANAGEMENT SYSTEM PICDEM
DM180021 KIT STARTER MPLAB FOR PIC18F MCU
DM183022 BOARD DEMO PIC18FXX22 64/80TQFP
DM183032 BOARD EXPLORER PICDEM PIC18
DM240001 BOARD DEMO PIC24/DSPIC33/PIC32
相关代理商/技术参数
DM163035+TEFLCST3 制造商:Microchip Technology Inc 功能描述:KIT PICDEMLAB+FLOWCODE-HOME BUNDLE/ 制造商:Microchip Technology Inc 功能描述:PICDEM, FLOW CODE, LAB, DEV KIT
DM163045 功能描述:开发板和工具包 - PIC / DSPIC PICDEM Lab Dev Kit (with PICkit 3) RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM1-63-C 功能描述:端子 Metric Fem Disc non-insulated RoHS:否 制造商:AVX 产品:Junction Box - Wire to Wire 系列:9826 线规:26-18 接线柱/接头大小: 绝缘: 颜色:Red 型式:Female 触点电镀:Tin over Nickel 触点材料:Beryllium Copper, Phosphor Bronze 端接类型:Crimp
DM1-63M-C 功能描述:端子 Metric Male Disc non-insulated, 0 RoHS:否 制造商:AVX 产品:Junction Box - Wire to Wire 系列:9826 线规:26-18 接线柱/接头大小: 绝缘: 颜色:Red 型式:Female 触点电镀:Tin over Nickel 触点材料:Beryllium Copper, Phosphor Bronze 端接类型:Crimp
DM164 制造商:SITI 制造商全称:SITI 功能描述:8x3-CHANNEL CONSTANT CURRENT LED DRIVER
DM1640 制造商:SANYO 制造商全称:Sanyo Semicon Device 功能描述:16 characters x 4 line Liquid Crystal Dot Matrix Display Module
DM1640-0AL1 制造商:未知厂家 制造商全称:未知厂家 功能描述:Optoelectronic
DM1640-0BL1 制造商:未知厂家 制造商全称:未知厂家 功能描述:Optoelectronic