Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
university:courses:engineering_discovery:lab_6 [22 Jun 2016 23:47] Jonathan Pearsonuniversity:courses:engineering_discovery:lab_6 [04 Sep 2019 20:32] (current) – add alternate inductor options from kit Doug Mercer
Line 1: Line 1:
 ===== A Simple Magnetic Proximity Sensor===== ===== A Simple Magnetic Proximity Sensor=====
-{{ analogTV>VIDEO NUMBER HERE}}+{{ analogTV>5032143786001}}
  
 ==== Introduction ==== ==== Introduction ====
Line 9: Line 9:
 The AD22151 magnetic field sensor operation is based upon the //Hall effect// The Hall effect is a phenomenon in which a voltage (the //Hall voltage//) is developed across a material when current flows through the material with a magnetic field present.  The Hall voltage is due to the electric field produced by deflection of the moving charges by the magnetic field via the Lorentz force.  With the magnetic field pointing vertically with respect to the current, the Hall voltage is perpendicular to the direction of current flow with the positive side to the left of the conventional current flow.  (Note that conventional current flows in the opposite direction to that of electron flow.)  The Hall effect can clearly be used to measure currents with frequencies down to DC (which is not possible with magnetic-flux-based transformer current sensors) by using a sensitive voltage detector to measure the voltage across the conductor as an indication of current flow.  The Hall effect can also be used to measure magnetic fields by producing a constant current in the material and measuring the Hall voltage as a function of the magnetic field.  We will use a Hall effect sensor to detect the presence of a magnetic field, as well as see how to deal with some of the non-ideal behaviors in the sensor. The AD22151 magnetic field sensor operation is based upon the //Hall effect// The Hall effect is a phenomenon in which a voltage (the //Hall voltage//) is developed across a material when current flows through the material with a magnetic field present.  The Hall voltage is due to the electric field produced by deflection of the moving charges by the magnetic field via the Lorentz force.  With the magnetic field pointing vertically with respect to the current, the Hall voltage is perpendicular to the direction of current flow with the positive side to the left of the conventional current flow.  (Note that conventional current flows in the opposite direction to that of electron flow.)  The Hall effect can clearly be used to measure currents with frequencies down to DC (which is not possible with magnetic-flux-based transformer current sensors) by using a sensitive voltage detector to measure the voltage across the conductor as an indication of current flow.  The Hall effect can also be used to measure magnetic fields by producing a constant current in the material and measuring the Hall voltage as a function of the magnetic field.  We will use a Hall effect sensor to detect the presence of a magnetic field, as well as see how to deal with some of the non-ideal behaviors in the sensor.
 ==== Objective ==== ==== Objective ====
-To study magnetic field generation and detection.  To use a solenoid shaped electromagnet to generate the magnetic field the AD22151 linear Hall-effect-based magnetic field sensor to detect the magnetic field.  To use the principles of magnetic field generation and detection to build a simple proximity detector and observe how the detector output voltage increases as the electromagnet moves closer to the sensor.  To review bias current, offset voltage, and noise that are present in all electronic circuits.  To use a comparator to turn the linear output of the sensor into a binary output, indicating whether or not the electromagnet has passes a particular position threshold, and illuminate a LED as an indication of the electromagnet passing through the threshold.  Upon completion of this lab you should be able to describe magnetic field generation, give a basic description of the Hall effect and how it can be used to detect magnetic fields, describe bias current, input offset voltage, and noise in electronic circuits, have a basic understanding of hysteresis and at least one reason it is used, and explain the operation of a simple magnetic proximity detector.+To study magnetic field generation and detection.  To use a solenoid shaped electromagnet to generate the magnetic field and the AD22151 linear Hall-effect-based magnetic field sensor to detect the magnetic field.  To use the principles of magnetic field generation and detection to build a simple proximity detector and observe how the detector output voltage increases as the electromagnet moves closer to the sensor.  To review bias current, offset voltage, and noise that are present in all electronic circuits.  To use a comparator with hysteresis to turn the linear output of the sensor into a binary output, indicating whether or not the electromagnet has passes a particular position threshold, and illuminate a LED as an indication of the electromagnet passing through the threshold.  Upon completion of this lab you should be able to describe magnetic field generation, give a basic description of the Hall effect and how it can be used to detect magnetic fields, describe bias current, input offset voltage, and noise in electronic circuits, have a basic understanding of hysteresis and at least one reason it is used, and explain the operation of a simple magnetic proximity detector.
 ==== Materials and Apparatus ==== ==== Materials and Apparatus ====
   * Data sheet handout for the AD22151 magnetic field sensor   * Data sheet handout for the AD22151 magnetic field sensor
Line 28: Line 28:
   * (1) 0.1 μF capacitor (marked "104") from the ADALP2000 Analog Parts Kit   * (1) 0.1 μF capacitor (marked "104") from the ADALP2000 Analog Parts Kit
   * (1) 10 μF capacitor from the ADALP2000 Analog Parts Kit   * (1) 10 μF capacitor from the ADALP2000 Analog Parts Kit
-  * (1) 100 μH inductor (marked "101"from the ADALP2000 Analog Parts Kit+  * (1) inductor from the ADALP2000 Analog Parts Kit, either 100uH (marked 101), 1mH (102), 10mH (103)
 ==== Procedure ==== ==== Procedure ====
   - Construct the following electromagnet circuit on the solderless breadboard{{ university:courses:engineering_discovery:lab_6_image_1.png?400 }}   - Construct the following electromagnet circuit on the solderless breadboard{{ university:courses:engineering_discovery:lab_6_image_1.png?400 }}
-  - **Note that the 100 Ω resistors get very hot due to Joule heating, so avoid coming in contact with them**+  - **Note that the 100 Ω resistors get very hot due to Joule heating, so avoid coming in contact with them** Using 1mH or 10mH inductor will draw less current and make stronger magnetic field.
   - Refer to the illustration below for one way to install the components in the solderless breadboard{{ university:courses:engineering_discovery:lab_6_assembly_image_1.png?900 }}   - Refer to the illustration below for one way to install the components in the solderless breadboard{{ university:courses:engineering_discovery:lab_6_assembly_image_1.png?900 }}
   - Add the following Hall effect sensor circuit to the solderless breadboard{{ university:courses:engineering_discovery:lab_6_image_2.png?800 }}   - Add the following Hall effect sensor circuit to the solderless breadboard{{ university:courses:engineering_discovery:lab_6_image_2.png?800 }}
Line 38: Line 38:
   - Update M1K firmware, if necessary   - Update M1K firmware, if necessary
   - Connect the M1K to the circuit as indicated in the schematic   - Connect the M1K to the circuit as indicated in the schematic
-  - Set up PixelPulse to measure voltage on Channel A and deselect repeated sweep mode in the tools menu+  - Set up PixelPulse to measure voltage on Channel A
   - Observe and record the DC voltage on Channel A with the electromagnet far from the sensor chip and define this as V<sub>OUT,Z</sub>   - Observe and record the DC voltage on Channel A with the electromagnet far from the sensor chip and define this as V<sub>OUT,Z</sub>
   - This voltage is ideally mid-supply, which is 2.5V on a 5.0 V supply, but it will differ from mid-supply due to DC offsets in the sensor and op-amp that get multiplied by the op-amp closed-loop gain; the output offset voltage may be changed by adding a resistor R4 between the 5.0 V supply and the op-amp summing node on Pin 6.   - This voltage is ideally mid-supply, which is 2.5V on a 5.0 V supply, but it will differ from mid-supply due to DC offsets in the sensor and op-amp that get multiplied by the op-amp closed-loop gain; the output offset voltage may be changed by adding a resistor R4 between the 5.0 V supply and the op-amp summing node on Pin 6.
   - Refer to the following schematic for the placement of R4, but do not install any resistor here at this time{{ university:courses:engineering_discovery:lab_6_image_3.png?800 }}   - Refer to the following schematic for the placement of R4, but do not install any resistor here at this time{{ university:courses:engineering_discovery:lab_6_image_3.png?800 }}
   - Calculate the op-amp closed-loop gain   - Calculate the op-amp closed-loop gain
-  - Our objective is to place the sensor output voltage with no applied magnetic field as close as possible to the lower end of its linear range, which is 0.5 V.  We calculate the value of R4 in the next few steps.  It's important to note that the 5.0 V supply will actually be at about 4.8 V due to the IR drop (internal to the M1K) that is produced by the 150 mA current that drives the electromagnet and that the resistor values are limited and have +/-5% tolerances, so the final voltage will not be perfect.  We will therefore use 2.4 for the mid-supply voltage. +  - Our objective is to place the sensor output voltage with no applied magnetic field as close as possible to the lower end of its linear range, which is 0.5 V.  We calculate the value of R4 in the next few steps.  It's important to note that the 5.0 V supply will actually be at about 4.8 V to 4.9 V due to the IR drop (internal to the M1K) that is produced by the 150 mA current that drives the electromagnet and that the resistor values are limited and have +/-5% tolerances, so the final voltage will not be perfect.  We will designate V<sub>SUPPLY</sub> as the supply voltage and V<sub>MID</sub> as the mid-supply voltage. 
-  - In order to calculate R4 it is necessary to know the currents flowing in and out of the op-amp summing node.  The current through R2 is defined as I<sub>R2</sub> Under ideal conditions this current would be zero since the voltage on each side of it would be mid-supply, but there is a small offset voltage between the internal Hall effect sensor output voltage with zero field and the internally buffered V<sub>REF</sub> For small gains this voltage can in many instances be ignored, but it must be considered in high-gain circuits such as this one.+  - Measure and record V<sub>SUPPLY</sub> using the M1K 
 +  - In order to calculate R4 it is necessary to know the currents flowing in and out of the op-amp summing node.  The current through R2 is defined as I<sub>R2</sub> Under ideal conditions this current would be zero since the voltage on each side of it would be V<sub>MID</sub>, but there is a small offset voltage between the internal Hall effect sensor output voltage with zero field and the internally buffered V<sub>REF</sub> For small gains this voltage can in many instances be ignored, but it must be considered in high-gain circuits such as this one.
   - Use the M1K to measure and record the voltage at Pin 7 and define it as V<sub>REF</sub>   - Use the M1K to measure and record the voltage at Pin 7 and define it as V<sub>REF</sub>
   - Use the M1K to measure and record the voltage at Pin 6 and define it as V<sub>CM</sub>; this is the common-mode voltage at the op-amp input, and is driven to be very close to the output of the internal Hall effect sensor by negative feedback   - Use the M1K to measure and record the voltage at Pin 6 and define it as V<sub>CM</sub>; this is the common-mode voltage at the op-amp input, and is driven to be very close to the output of the internal Hall effect sensor by negative feedback
Line 54: Line 55:
   - Calculate the amount of additional current, I<sub>SHIFT</sub>, required through the feedback resistor R3 to shift V<sub>OUT,Z</sub> to 0.5 V as I<sub>SHIFT</sub> = V<sub>SHIFT</sub>/100 KΩ; note that this is a negative quantity because V<sub>SHIFT</sub> is negative   - Calculate the amount of additional current, I<sub>SHIFT</sub>, required through the feedback resistor R3 to shift V<sub>OUT,Z</sub> to 0.5 V as I<sub>SHIFT</sub> = V<sub>SHIFT</sub>/100 KΩ; note that this is a negative quantity because V<sub>SHIFT</sub> is negative
   - The current flowing into the summing node through R4, I<sub>R4</sub>, that is used to create the desired offset is in the opposite direction to that of I<sub>SHIFT</sub>, so we can write I<sub>R4</sub> = -I<sub>SHIFT</sub>, which is a positive quantity   - The current flowing into the summing node through R4, I<sub>R4</sub>, that is used to create the desired offset is in the opposite direction to that of I<sub>SHIFT</sub>, so we can write I<sub>R4</sub> = -I<sub>SHIFT</sub>, which is a positive quantity
-  - Calculate the value of R4 by noting that the voltage across R4 is the difference between the supply voltage, which we determined to be 4.8 Vand V<sub>CM</sub>, as R4 = (4.8 V - V<sub>CM</sub>)/I<sub>R4</sub>+  - Calculate the value of R4 by noting that the voltage across R4 is the difference between V<sub>SUPPLY</sub> and V<sub>CM</sub>, as R4 = (V<sub>SUPPLY</sub> - V<sub>CM</sub>)/I<sub>R4</sub>
   - Select a resistor from the kit that is closest to this value for R4; unless the calculated value is very close to a value available in the kit, round up in order to make any error result in a higher output voltage   - Select a resistor from the kit that is closest to this value for R4; unless the calculated value is very close to a value available in the kit, round up in order to make any error result in a higher output voltage
   - Place R4 in the circuit as shown in the schematic above   - Place R4 in the circuit as shown in the schematic above
Line 76: Line 77:
   - Can you explain why there are two different threshold voltages and how having two threshold voltages provides an advantage in this binary proximity detector?   - Can you explain why there are two different threshold voltages and how having two threshold voltages provides an advantage in this binary proximity detector?
 ==== Theory ==== ==== Theory ====
-Most magnetic-field-based proximity sensors use strong permanent magnets to generate the magnetic fields that are sensed, and therefore the sensors only require modest gains in order to output a reasonable voltage.  In this lab we generate a relatively weak magnetic field using an electromagnet carrying about 150 mA, and thus require a fairly large gain in the op-amp contained in the Hall effect sensor.  Having large op-amp gain introduces a few practical problems.  One problem is that the output noise is large.  This happens because the noise at the input to the op-amp gets multiplied along with the desired signal in the op-amp and appears at the op-amp output.  Another similar problem is DC offset, in which a small offset at the input to the op-amp gets multiplied by the op-amp and appears as a DC offset on the output voltage.  The op-amp itself has an input offset voltage, imperfectly matched input bias currents that get converted to voltages which are reflected to the op-amp output voltage, and the internal Hall effect sensor output offset and internally generated and buffered reference voltage, REF, are not exactly the same.  These all contribute to the output offset voltage, and are the reasons why the output voltage is not exactly at mid-supply when no magnetic field is present.  We can compensate for these offsets, and even shift the output offset voltage wherever we need to (within the limits of the part) by summing in an offset voltage at the op-amp's summing node.+Most magnetic-field-based proximity sensors use strong permanent magnets to generate the magnetic fields that are sensed, and therefore the sensors only require modest gains in order to output a reasonable voltage.  In this lab we generate a relatively weak magnetic field using an electromagnet carrying about 150 mA, and thus require a fairly large gain in the op-amp contained in the Hall effect sensor.  Having large op-amp gain introduces a few practical problems.  One problem is that the output noise is large.  This happens because the noise at the input to the op-amp gets multiplied along with the desired signal in the op-amp and appears at the op-amp output.  Another similar problem is DC offset, in which a small offset at the input to the op-amp gets multiplied by the op-amp and appears as a DC offset in the output voltage.  The op-amp has an input offset voltage, and imperfectly matched input bias currents that get converted to voltages, and these are reflected by the op-amp gain to the op-amp output voltage. Additionally, the internal Hall effect sensor output offset and internally generated and buffered reference voltage, REF, are not exactly the same.  These all contribute to the output offset voltage, and are the reasons why the output voltage is not exactly at mid-supply when no magnetic field is present.  We can compensate for these offsets, and even shift the output offset voltage wherever we need to (within the limits of the part) by summing in an offset voltage at the op-amp's summing node.
  
 The summing node of the op-amp contained in the AD22151 is made available on Pin 6, and the non-inverting op-amp input is internally biased at approximately +2.5 V, so it is possible to inject positive or negative current into the summing node in order to shift the output offset level.  In this case we desire to shift the output offset down, which requires an injection of current into the summing node.  This can also be viewed as summing a positive voltage into an inverting op-amp summing amplifier configuration.  With zero magnetic field applied, the voltage across the op-amp gain resistor R2 is ideally zero since the reference voltage VREF and the output of the Hall effect sensor would be the same -- note that the voltage on the op-amp inverting input is driven to be essentially the same as the voltage no the non-inverting input by negative feedback, so the voltage on the inverting input can be viewed as essentially the same as that of the Hall effect sensor output, neglecting the op-amp input offset voltage.  The voltage that is essentially common to both op-amp inputs is referred to as the "input common-mode voltage."  There is, however, a small voltage across R2 due to the mismatch between VREF and the op-amp input common-mode voltage.  Even though this is a small voltage, it is applied across a small resistance and produces an appreciable current that flows through a large-valued feedback resistor to produce an appreciable shift in output voltage.  This is how op-amps work to amplify signal voltages, and why the inverting gain of an op-amp is proportional to the feedback resistance and inversely proportional to the gain resistance.  We can determine the current flowing though R2 by measuring the voltage across it and dividing by its value.  Most of this current flows through the feedback resistor R3, but a small amount flows into the op-amp inverting input; this small current is the input bias current, and is the reason why the current through R2 is not exactly equal to the current through R3. The summing node of the op-amp contained in the AD22151 is made available on Pin 6, and the non-inverting op-amp input is internally biased at approximately +2.5 V, so it is possible to inject positive or negative current into the summing node in order to shift the output offset level.  In this case we desire to shift the output offset down, which requires an injection of current into the summing node.  This can also be viewed as summing a positive voltage into an inverting op-amp summing amplifier configuration.  With zero magnetic field applied, the voltage across the op-amp gain resistor R2 is ideally zero since the reference voltage VREF and the output of the Hall effect sensor would be the same -- note that the voltage on the op-amp inverting input is driven to be essentially the same as the voltage no the non-inverting input by negative feedback, so the voltage on the inverting input can be viewed as essentially the same as that of the Hall effect sensor output, neglecting the op-amp input offset voltage.  The voltage that is essentially common to both op-amp inputs is referred to as the "input common-mode voltage."  There is, however, a small voltage across R2 due to the mismatch between VREF and the op-amp input common-mode voltage.  Even though this is a small voltage, it is applied across a small resistance and produces an appreciable current that flows through a large-valued feedback resistor to produce an appreciable shift in output voltage.  This is how op-amps work to amplify signal voltages, and why the inverting gain of an op-amp is proportional to the feedback resistance and inversely proportional to the gain resistance.  We can determine the current flowing though R2 by measuring the voltage across it and dividing by its value.  Most of this current flows through the feedback resistor R3, but a small amount flows into the op-amp inverting input; this small current is the input bias current, and is the reason why the current through R2 is not exactly equal to the current through R3.
  
-Additional current can be added through the feedback resistor in order to shift the output voltage down to the lower end of its linear range of 0.5 V.  The amount of current necessary for this can be calculated by taking the difference between the existing output voltage and the desired output voltage and dividing by the feedback resistance.  This value of current is then injected into the op-amp summing node through an offset injection resistor R4.  The value of R4 is calculated as the difference between the voltage on the input side of R4 (we used 4.8 for this) and the op-amp input common-mode voltage divided by the required injection current.+Additional current can be added through the feedback resistor in order to shift the output voltage down to the lower end of its linear range of 0.5 V.  The amount of current necessary for this can be calculated by taking the difference between the existing output voltage and the desired output voltage and dividing by the feedback resistance.  This value of current is then injected into the op-amp summing node through an offset injection resistor R4.  The value of R4 is calculated as the difference between the voltage on the input side of R4 (V<sub>SUPPLY</sub>) and the op-amp input common-mode voltagedivided by the required injection current.
  
 The op-amp is set up as a non-inverting amplifier to the voltage that is output from the Hall effect sensor element.  The gain of a non-inverting op-amp, A<sub>V,NI</sub>, is the ratio of the feedback resistance to the gain resistance plus one.  In terms of the reference designators used in the lab, this is A<sub>V,NI</sub> = 1 + R3/R2.  Note that VREF is also summed in an inverting fashion in order to place the output nominally at mid-supply (it is close to mid-supply for the typical small gains that are used when permanent magnets are used as the sources of the magnetic fields).  The gain of an inverting op-amp, A<sub>V,I</sub>, is the negative of the ratio of the feedback resistance to the gain resistance, or A<sub>V,I</sub> = -R3/R2.  The output level with no magnetic field present has been defined by the gain, circuit offsets, VREF, and the offset injection circuitry.  The AD22151 output voltage, V<sub>O</sub>, due to the Hall effect sensor element output voltage, V<sub>H</sub>, is therefore simply The op-amp is set up as a non-inverting amplifier to the voltage that is output from the Hall effect sensor element.  The gain of a non-inverting op-amp, A<sub>V,NI</sub>, is the ratio of the feedback resistance to the gain resistance plus one.  In terms of the reference designators used in the lab, this is A<sub>V,NI</sub> = 1 + R3/R2.  Note that VREF is also summed in an inverting fashion in order to place the output nominally at mid-supply (it is close to mid-supply for the typical small gains that are used when permanent magnets are used as the sources of the magnetic fields).  The gain of an inverting op-amp, A<sub>V,I</sub>, is the negative of the ratio of the feedback resistance to the gain resistance, or A<sub>V,I</sub> = -R3/R2.  The output level with no magnetic field present has been defined by the gain, circuit offsets, VREF, and the offset injection circuitry.  The AD22151 output voltage, V<sub>O</sub>, due to the Hall effect sensor element output voltage, V<sub>H</sub>, is therefore simply
Line 92: Line 93:
 A comparator can be viewed as a one-bit analog-to-digital converter that produces one binary state on its output when its input voltage is above a particular threshold and the other state on its output when its input is below the threshold.  Simple comparator designs operate by applying a fixed voltage threshold to one of the comparator inputs and applying the input signal to the other.  For simplicity, we'll place the threshold on the inverting input.  When the input voltage that is applied to the non-inverting input exceeds the threshold voltage on the inverting input by a small amount, the output voltage quickly moves to the high logic state.  This happens because the comparator has very high gain and it does not take much voltage across its inputs (often called //overdrive//) to move the output voltage to either of its limits.  As a simple example, applying a sine wave to a comparator with its threshold set exactly at the baseline of the sine wave produces a square wave at the comparator output.  Though it may seem that a conventional op-amp could be used as a comparator, this is not recommended for a number of reasons including the fact that op-amp designs include internal compensation that is optimized for closed-loop operation, and that op-amps do not produce standard logic levels on their outputs. A comparator can be viewed as a one-bit analog-to-digital converter that produces one binary state on its output when its input voltage is above a particular threshold and the other state on its output when its input is below the threshold.  Simple comparator designs operate by applying a fixed voltage threshold to one of the comparator inputs and applying the input signal to the other.  For simplicity, we'll place the threshold on the inverting input.  When the input voltage that is applied to the non-inverting input exceeds the threshold voltage on the inverting input by a small amount, the output voltage quickly moves to the high logic state.  This happens because the comparator has very high gain and it does not take much voltage across its inputs (often called //overdrive//) to move the output voltage to either of its limits.  As a simple example, applying a sine wave to a comparator with its threshold set exactly at the baseline of the sine wave produces a square wave at the comparator output.  Though it may seem that a conventional op-amp could be used as a comparator, this is not recommended for a number of reasons including the fact that op-amp designs include internal compensation that is optimized for closed-loop operation, and that op-amps do not produce standard logic levels on their outputs.
  
-When the comparator input signal is moving very slowly, noisy, or both, the output can //chatter// between logic levels as the input bounces above and below the threshold.  This is an undesirable situation, and can be avoided using //hysteresis// Hysteresis is a technique that uses two thresholds instead of one.  One threshold is for an increasing input signal and the other is for a decreasing signal.  When an increasing signal crosses through its threshold, the threshold immediately changes to a lower threshold, preventing the input signal from re-crossing the threshold due to noise or other fluctuations as long as the difference between the two thresholds is larger than the input fluctuations.  Similarly, when a decreasing signal crosses through its threshold, the threshold immediately changes to a higher threshold.  The difference between the two thresholds is defined as the //hysteresis voltage// The change in comparator output state used to change the thresholds, and the connection between the output and one of the inputs constitute a form of //positive// feedback.  The thresholds are derived from a voltage divider that is placed between the comparator output and a reference voltage.  Often the reference voltage must be derived using an available supply and Thevenin equivalent voltage divider network.+When the comparator input signal is moving very slowly, noisy, or both, the output can //chatter// between logic levels as the input bounces above and below the threshold.  This is an undesirable situation, and can be avoided using //hysteresis// Hysteresis is a technique that uses two thresholds instead of one.  One threshold is for an increasing input signal and the other is for a decreasing signal.  When an increasing signal crosses through its threshold, the threshold immediately changes to a lower threshold, preventing the input signal from re-crossing the threshold due to noise or other fluctuations as long as the difference between the two thresholds is larger than the input fluctuations.  Similarly, when a decreasing signal crosses through its threshold, the threshold immediately changes to a higher threshold.  The difference between the two thresholds is defined as the //hysteresis voltage// The combination of the change in comparator output state used to change the thresholds with the connection between the output and one of the inputs constitutes a form of //positive// feedback.  The thresholds are derived from a voltage divider that is placed between the comparator output and a reference voltage.  Often the reference voltage must be derived using an available supply and Thevenin equivalent voltage divider network.
  
 Referring to the comparator circuit above, the reference voltage is generated by the Thevenin equivalent circuit comprised of the 2.5 V supply and the 2.2 KΩ and 4.7 KΩ resistors.  The Thevenin equivalent of this circuit is a Thevenin voltage source of approximately 1.7 V in series with a Thevenin resistance of approximately 1.5 KΩ.  We can replace the voltage divider with the Thevenin equivalent as shown Referring to the comparator circuit above, the reference voltage is generated by the Thevenin equivalent circuit comprised of the 2.5 V supply and the 2.2 KΩ and 4.7 KΩ resistors.  The Thevenin equivalent of this circuit is a Thevenin voltage source of approximately 1.7 V in series with a Thevenin resistance of approximately 1.5 KΩ.  We can replace the voltage divider with the Thevenin equivalent as shown
Line 98: Line 99:
 {{ university:courses:engineering_discovery:lab_6_image_5.png?800 }} {{ university:courses:engineering_discovery:lab_6_image_5.png?800 }}
  
-The two thresholds can be determined by calculating the voltage on Pin 3 for each of the comparator output states.  We will use 3.5 V for the output high state and 0.2 V for the low output state.  Using the voltage divider rule, the high threshold is approximately 2.0 V and the low threshold is approximately 1.4 V, giving about 600 mV of hysteresis.+The two thresholds can be determined by calculating the voltage on Pin 3 for each of the comparator output states.  We will use 3.5 V for the high output state and 0.2 V for the low output state.  Using the voltage divider rule, the high threshold is approximately 2.0 V and the low threshold is approximately 1.4 V, giving about 600 mV of hysteresis.
  
 When moving the electromagnet close to the sensor, the LED should abruptly turn on with no chatter, and abruptly turn off when the electromagnet is moved away from the sensor.  The comparator output on Pin 8 can be monitored with the M1K to verify this.  The thresholds can also be experimentally verified by observing the voltage on Pin 3 while moving the electromagnet close to the sensor and away from the sensor.  As would be expected, the actual thresholds will deviate somewhat from the calculated values due to uncertainties in the comparator output voltages and resistor values. When moving the electromagnet close to the sensor, the LED should abruptly turn on with no chatter, and abruptly turn off when the electromagnet is moved away from the sensor.  The comparator output on Pin 8 can be monitored with the M1K to verify this.  The thresholds can also be experimentally verified by observing the voltage on Pin 3 while moving the electromagnet close to the sensor and away from the sensor.  As would be expected, the actual thresholds will deviate somewhat from the calculated values due to uncertainties in the comparator output voltages and resistor values.
 ==== Observations and Conclusions ==== ==== Observations and Conclusions ====
   * A magnetic field can be generated using a solenoid as an electromagnet   * A magnetic field can be generated using a solenoid as an electromagnet
 +  * The Hall effect is a phenomenon in which a current passing through a material in the presence of a magnetic field generates a voltage that is transverse to the direction of the current
   * Magnetic fields can be sensed using a Hall effect sensor   * Magnetic fields can be sensed using a Hall effect sensor
   * A magnetic-field-based proximity sensor can be designed using a magnetic field source and magnetic field detector   * A magnetic-field-based proximity sensor can be designed using a magnetic field source and magnetic field detector
Line 114: Line 116:
   * Operational amplifiers should not be used as comparators   * Operational amplifiers should not be used as comparators
   * Hysteresis can be added to a comparator to prevent chattering that occurs with noisy slow-moving input signals   * Hysteresis can be added to a comparator to prevent chattering that occurs with noisy slow-moving input signals
 +
 +**Return to [[university:courses:engineering_discovery|Engineering Discovery Index]]**
university/courses/engineering_discovery/lab_6.txt · Last modified: 04 Sep 2019 20:32 by Doug Mercer