ECE 3450 M. A. Jupina, VU, 2016 Capacitance Sensor Project Goal: Creation of a digital capacitance...

9
ECE 3450 M. A. Jupina, VU, 2016 Capacitance Sensor Project Goal: Creation of a digital capacitance sensor circuit where a variation in capacitance changes the frequency or period of oscillation of a timer circuit. An Arduino Uno then measures this change in the time period and displays an integer value between 0 to 99 (base 10) to indicate the amount of capacitance. A capacitance value of C min would be indicated by a value of 0 and a value of C max would be indicated by a value of 99. The current maximum value will be stored by the sensor circuit and displayed on the serial monitor of a laptop connected to an

description

Application of Your Capacitance Sensor Assume that you are designing an impact sensor for a boxing glove where you want to capture only the maximum impact of the glove on a boxing bag during a training session. For a range of possible impacts, assume that no impact on the capacitance sensor is a value of C min, whereas the maximum possible impact on the capacitance sensor by a boxer such as Mike Tyson would be a value of C max. The display on the glove would indicate a value of 0 for no impact and a value of 99 if Mike Tyson hit a boxing bag with the glove. A reset button will also be available to clear the sensor so that the maximum impact value can again be captured. ECE 3450 M. A. Jupina, VU, 2016

Transcript of ECE 3450 M. A. Jupina, VU, 2016 Capacitance Sensor Project Goal: Creation of a digital capacitance...

Page 1: ECE 3450 M. A. Jupina, VU, 2016 Capacitance Sensor Project Goal: Creation of a digital capacitance sensor circuit where a variation in capacitance changes.

ECE 3450 M. A. Jupina, VU, 2016

Capacitance Sensor Project

Goal: Creation of a digital capacitance sensor circuit where a variation in capacitance changes the frequency or period of oscillation of a timer circuit. An Arduino Uno then measures this change in the time period and displays an integer value between 0 to 99 (base 10) to indicate the amount of capacitance. A capacitance value of Cmin would be indicated by a value of 0 and a value of Cmax would be indicated by a value of 99. The current maximum value will be stored by the sensor circuit and displayed on the serial monitor of a laptop connected to an Arduino Uno.

Page 2: ECE 3450 M. A. Jupina, VU, 2016 Capacitance Sensor Project Goal: Creation of a digital capacitance sensor circuit where a variation in capacitance changes.

Capacitance Sensor Project

555 Timer

variablefrequency

or period

d

r oCdA

2

lneffC Hba

H

a

b

Sports Applications Tank Application

ECE 3450 M. A. Jupina, VU, 2016

Page 3: ECE 3450 M. A. Jupina, VU, 2016 Capacitance Sensor Project Goal: Creation of a digital capacitance sensor circuit where a variation in capacitance changes.

Application of Your Capacitance Sensor• Assume that you are designing an impact sensor for a

boxing glove where you want to capture only the maximum impact of the glove on a boxing bag during a training session.

• For a range of possible impacts, assume that no impact on the capacitance sensor is a value of Cmin, whereas the maximum possible impact on the capacitance sensor by a boxer such as Mike Tyson would be a value of Cmax. The display on the glove would indicate a value of 0 for no impact and a value of 99 if Mike Tyson hit a boxing bag with the glove.

• A reset button will also be available to clear the sensor so that the maximum impact value can again be captured.

ECE 3450 M. A. Jupina, VU, 2016

Page 4: ECE 3450 M. A. Jupina, VU, 2016 Capacitance Sensor Project Goal: Creation of a digital capacitance sensor circuit where a variation in capacitance changes.

Specifications of Your Capacitance Sensor• Assume that the capacitance of the sensor varies as a linear

function of the impact applied to the boxing glove.• The maximum capacitance that can be measured by the

sensor is Cmax = 4 Cmin

• Therefore, the range of capacitance that is to be measured is

C = Cmax - Cmin = 3 Cmin

• When C=Cmin, the period of the timer circuit will be Tmin, whereas when C=Cmax the period of the timer circuit is Tmax since the period of the timer circuit increases as the RC time constant time increases. The timer circuit will be a 555 timer.

ECE 3450 M. A. Jupina, VU, 2016

Page 5: ECE 3450 M. A. Jupina, VU, 2016 Capacitance Sensor Project Goal: Creation of a digital capacitance sensor circuit where a variation in capacitance changes.

Implementation of Your Capacitance Sensor• Use the following Cmin values depending on your lab station #:

o Cmin = 0.001 F, for lab stations 1, 4, 7, 10, 13, & 16

o Cmin = 0.01 F, for lab stations 2, 5, 8, 11, 14, & 17

o Cmin = 0.1 F, for lab stations 3, 6, 9, 12, 15, & 18• To measure the period of oscillation of the timer circuit, use pulseIn() in

your Arduino sketch and a digital input pin to measure the output signal of the timer circuit. Store only the maximum value of the timer’s measured period of oscillation.

• Use one of the analog input pins to read in a voltage from a voltage divider circuit that represents the offset value of Cmin. Use a variable resistor (pot) in the voltage divider to get the exact offset. The A/D converters on the Arduino are 10 bits so the digital value varies from 0 to 1023 as the analog input voltage varies from 0 to 5V (resolution is 5V/1023 or 4.89 mV). The digital offset value is then used to “zero” the system output.

ECE 3450 M. A. Jupina, VU, 2016

Page 6: ECE 3450 M. A. Jupina, VU, 2016 Capacitance Sensor Project Goal: Creation of a digital capacitance sensor circuit where a variation in capacitance changes.

Arduino Uno

ECE 3450 M. A. Jupina, VU, 2015

Page 7: ECE 3450 M. A. Jupina, VU, 2016 Capacitance Sensor Project Goal: Creation of a digital capacitance sensor circuit where a variation in capacitance changes.

Block Diagram of the Capacitance Sensor

- SerialMonitor

on laptopf, T

Max

Per

iod

Alg

orith

m

OFFSET Voltage

When C = Cmin, Output = 0When C = Cmax, Output = 99

Reset

ECE 3450 M. A. Jupina, VU, 2016

0 to 99

digital input

analog input

ARDUINO

Page 8: ECE 3450 M. A. Jupina, VU, 2016 Capacitance Sensor Project Goal: Creation of a digital capacitance sensor circuit where a variation in capacitance changes.

Prelab AssignmentPre-Lab i. Go to https://www.arduino.cc/en/Main/Software to download the Arduino

software.ii. Go to https://www.arduino.cc/en/Tutorial/BuiltInExamples for examples

of code for the Arduino.iii. Provide a circuit diagram showing how your Arduino is to be connected to

the timer circuit and voltage divider. Show all details (pin numbers, resistor values, etc.)

iv. Based on the background info in slide 5, write code to implement the Arduino-based capacitance measurement system. After testing of the your code, submit a print-out of your code.

ECE 3450 M. A. Jupina, VU, 2015

Page 9: ECE 3450 M. A. Jupina, VU, 2016 Capacitance Sensor Project Goal: Creation of a digital capacitance sensor circuit where a variation in capacitance changes.

Lab Measurement Details1) Repeat the measurements on the Arduino-based design.2) Make a table showing the C value, T value, and the output

value shown on the display. Demonstrate through calculations that the C, T, and the output values are correct. If slight differences exist, what are the possible sources of error? How do these measured values compare with the values obtained from the DE2- based design.

3) Demonstrate that if the capacitance value is reduced, the output display does not change (i.e., only the max value is displayed). After pressing the reset button, does the display now show a value consistent with the current capacitance value?

ECE 3450 M. A. Jupina, VU, 2016