barcode scanner sdk vb.net Reading a PotentiometeR: CReating an inPut We Can VaRy in Real time in Software

Generate QR Code ISO/IEC18004 in Software Reading a PotentiometeR: CReating an inPut We Can VaRy in Real time

Reading a PotentiometeR: CReating an inPut We Can VaRy in Real time
QR Code Reader In None
Using Barcode Control SDK for Software Control to generate, create, read, scan barcode image in Software applications.
Drawing QR Code In None
Using Barcode generation for Software Control to generate, create QR Code 2d barcode image in Software applications.
When a Propeller line is high, it is at 3.3 volts. It switches from high to low at half this voltage, or 1.65 volts. These two facts are the basis for the resistance determination. Our task is to measure the time it takes for the capacitor to go from 3.3 volts to 1.65 volts. We do this by connecting the capacitor to a line of the Propeller. In our program we are using line P19. By making this line an output (high) and waiting a few milliseconds, we charge the capacitor attached to it to 3.3 volts. We then turn the line into an input and turn on a timer immediately. We monitor the state of the input pin. As soon as it goes low (at 1.65 volts), we read the timer again. Because we know the speed of the oscillator, as well as the time it took for the voltage to drop to 1.65 volts, we can get a reading that is related to the value of the resistance. We read the counter twice, immediately after turning the line into an input and immediately after the line switches from high to low. The difference is related to the resistance. The lower the resistance, the lower the time difference. However, even at the lowest resistance it takes time for the various program instructions to execute. This minimum value has to be subtracted from the difference and represents the adjusted shortest time. The highest count read with the potentiometer at one extreme is divided by a number that produces a value of 255. The timer reading at the other extreme potentiometer position represents the various delays the execution of the program instructions create. This value has to be subtracted from the delay count to get the 0 value for the potentiometer. The value you pick for the capacitor should not be too small or too large. If it s too small, you will not get a high enough count to allow a good reading on the potentiometer. It will be too coarse. If too large a value is picked, the conversion will take too long. I used a 10K potentiometer and a 10 mfd (micro farad) capacitor with the circuitry shown in Figure 16-1 for Program 16-1.
Reading QR-Code In None
Using Barcode recognizer for Software Control to read, scan read, scan image in Software applications.
QR Code Creation In C#
Using Barcode drawer for Visual Studio .NET Control to generate, create QR Code 2d barcode image in .NET framework applications.
Analog Inputs
Generate QR Code In .NET
Using Barcode creation for ASP.NET Control to generate, create QR Code JIS X 0510 image in ASP.NET applications.
QR Code ISO/IEC18004 Maker In Visual Studio .NET
Using Barcode drawer for .NET framework Control to generate, create QR Code JIS X 0510 image in Visual Studio .NET applications.
Reading a PotentiometeR
Paint Denso QR Bar Code In Visual Basic .NET
Using Barcode generation for Visual Studio .NET Control to generate, create QR Code image in VS .NET applications.
Creating Code 3 Of 9 In None
Using Barcode drawer for Software Control to generate, create Code-39 image in Software applications.
Assume that we will use a potentiometer with a maximum value of 10K ohms for this experiment. We will use the potentiometer as a voltage divider and read the voltage at the wiper. The voltage represents the analog value we are interested in. For our first exercise, let s take a look at what we would need to be able to take the potentiometer reading with the Propeller chip (see Figure 16-1). In order to do this, we have to set up a simple circuit to charge and then discharge a capacitor. We determine the reading of the potentiometer from the information received from the circuit. Looking at the pin with an oscilloFigure 16-1 Circuitry for scope as we take the readings is very instructive. The reading a potentiometer next section explains this further. with a Propeller chip
Draw Data Matrix 2d Barcode In None
Using Barcode creator for Software Control to generate, create Data Matrix 2d barcode image in Software applications.
Code128 Creation In None
Using Barcode generation for Software Control to generate, create Code 128 Code Set C image in Software applications.
analog inPuts
GTIN - 12 Maker In None
Using Barcode printer for Software Control to generate, create UPC Code image in Software applications.
Making EAN / UCC - 13 In None
Using Barcode creation for Software Control to generate, create EAN-13 image in Software applications.
the details
Identcode Generator In None
Using Barcode generator for Software Control to generate, create Identcode image in Software applications.
Print Barcode In None
Using Barcode drawer for Office Word Control to generate, create barcode image in Office Word applications.
If we charge a capacitor to an arbitrary voltage and then slowly discharge it through a resistor across the capacitor, the time that it takes for the voltage to come down to any specific voltage from the full-charge voltage will be a function of the resistance through which the charge on the capacitor is being drained and the voltage driving the reaction. The apparatus is attached to a port of the Propeller that has been configured to be an output and then set high. In a few moments, this will charge the capacitor to the voltage that the microprocessor provides as the high signal on an output line (3.3 volts DC for the Propeller). Once the capacitor is fully charged, the port is turned into an input, a timer is started, and the system is programmed to monitor the state of the port as the capacitor discharges. As expected, initially the input port will be read as being high. As the capacitor is discharged by the potentiometer, a point will be reached when the port will be read as being low. How soon this happens depends on the resistance that the potentiometer is set to. If we measure the high-to-low time interval with the timer we started, the interval will be a function of the resistance of the potentiometer. This phenomena is used to determine the value of the potentiometer setting. We can assume that if the potentiometer is set to 0 ohms, the capacitor will discharge immediately and the timer will indicate a 0 time interval. If, on the other hand, we set the potentiometer to its maximum resistance, which in our case is 10K ohms, the time of discharge will represent the maximum resistance of the potentiometer. All other values are represented by times between 0 and the maximum time. The relationship is not perfectly linear, but it s linear enough for all practical purposes. For our immediate needs we can consider it to be linear. This is expressed graphically in Figure 16-2. For the sake of technical correctness, the rate at which a capacitor charges and discharges is more accurately represented in Figure 16-3. We can assume a linear relationship because we are seeing a very tiny portion of this curve in our experiment, and for all practical purposes this tiny portion can be looked at as a straight line. We can convert the relationship we have observed to provide a value of between 0 and 255 if we are interested in an 8-bit representation of the resistance of the potentiometer. The value of the capacitor we choose to charge is not critical, but too small a capacitor
Paint GS1 DataBar In Java
Using Barcode creator for Java Control to generate, create GS1 DataBar Stacked image in Java applications.
Generate USS Code 39 In VB.NET
Using Barcode encoder for .NET Control to generate, create ANSI/AIM Code 39 image in VS .NET applications.
Scan ANSI/AIM Code 39 In VB.NET
Using Barcode recognizer for Visual Studio .NET Control to read, scan read, scan image in Visual Studio .NET applications.
Code 39 Full ASCII Creation In Java
Using Barcode printer for Android Control to generate, create Code39 image in Android applications.
Make Barcode In Java
Using Barcode maker for Android Control to generate, create barcode image in Android applications.
DataMatrix Recognizer In Visual C#
Using Barcode decoder for .NET Control to read, scan read, scan image in VS .NET applications.
Copyright © OnBarcode.com . All rights reserved.