Accéder au contenu principal

Microcontroller, JFET form low-cost, two-digit millivoltmeter

 

Microcontroller, JFET form low-cost, two-digit millivoltmeter

(This article has been accepted and published in June 22nd, 2006)

https://www.edn.com/microcontroller-jfet-form-low-cost-two-digit-millivoltmeter/


Noureddine BENABADJI

benanour2000@yahoo.com

L.A.A.R. Laboratory, Department of Physics , University of Sciences and Technology - Oran ,

B.P. 1505 , El M’nouar, ORAN, ALGERIA , Fax : (213) 041.42.15.81 , Telex :22 701

 

            The circuit in Figure 1 offers an inexpensive alternative to commercial digital voltmeters. Although it has only two digits, it provides considerable flexibility and thus lends itself to customization by means of a microcontroller and its software. As one of Microchip's least expensive offerings, the PIC16F84A lacks an internal ADC. However, you can use a classic RC time-delay circuit to implement an analog-to-digital conversion by connecting capacitor C3 between lines RB7 (output) and RA4 (input) and in series with an equivalent “unknown” resistor consisting of Q3's drain-to-source on-resistance, plus R4, plus R5. Q3, a BF245A JFET, presents the on-resistance. Q3's “A” suffix is important because it corresponds to an on-resistance of 200Ω to 2 kΩ for a gate-to-source voltage of 0 to 1V (Figure 2 ). Other devices in the BF245 family exhibit a less pronounced change of resistance versus gate-to-source voltage. To correct the measurement nonlinearity inherent in Q3's gate-to-source voltage versus drain-to-source on-resistance transfer, the microprocessor's software includes a 100-point look-up table that provides correction for a two-digit display.

 Figure 1: Low-cost 2 digits programmable millivoltmeter

 For an application requiring the display of readings of 0.01 to 0.99V, you can use a 4-MHz crystal and Microchip's PIC16F84A microprocessor for IC1. To display the rightmost three digits of readings in the 0.001 to 0.999V range, use a 20-MHz crystal and a PIC16F84A-20 microprocessor. Choose 15- to 33-pF values for capacitors C1 and C2, which the PIC's data sheet describes. Listing 1 includes the full assembler source code for the PIC16F84A. The most critical portion of the firmware comprises a subroutine that provides a precision time delay according to the following steps:

  1. Configure RA4 as an input to sense the voltage across C3 during the charging interval. When you configure RA4 as an input, it serves as a Schmitt trigger with 1.6V low-threshold and 3.2V high-threshold voltages when drain-to-drain voltage is 5V.
  2. Configure RB7 as an output and set it high to begin charging C3. Initialize a counter (register 0CH) to its maximum value of FFH
  3. Decrement the counter in a loop until RA4 senses a low state. At that time, C3 charges to nearly 66% of the power-supply voltage.
  4. Use the time it takes to produce a low on the RA4 input as a jump value in the linearity-correction look-up table to extract a value for the two-digit LED readout.
  5. Configure RB7 as an input and set it low to discharge capacitor C3.
  6. After a time delay, repeat Step 2.

To round out the design, another software subroutine solves the problem of driving a two-digit LED display at adequate visibility with a minimum amount of current. Although an LCD would use less current, LCDs aren't visible in darkness. The display subroutine examines the eight bits of the units and tens—registers 11H and 12H—and tests each one in sequence; if the subroutine sets a bit, then the subroutine puts a short-duration high state on its corresponding segment-driver line, RB. Doing so lights only one LED segment at a time, and, consequently, the maximum current consumption of the circuit remains relatively constant even if you add a third LED display to build a 999-count millivoltmeter.

Figure 2 : drain-source resistance as a function of gate-source voltage.


Persistence of vision eliminates the need to keep the displayed digits continuously visible, and maintaining the segments on for approximately 33% of a 1-sec refresh interval allows a good and sufficient display effect. Transistors Q1 and Q2 are never simultaneously on, and only one display segment lights at a time. You can further optimize the hardware by removing current-limiting resistors R6 through R12, lifting the emitters of Q1 and Q2 from ground, and inserting a single 560Ω resistor between the emitters and ground. 

 

Commentaires

Posts les plus consultés de ce blog

How to minimize the number of lines to drive a multiplexed four 7-segment digit display

NoureddineBENABADJI L.A.A.R. Laboratory ( DTL team 2 ), Faculty of Physics,  University of Sciences and Technology - Oran, B.P. 1505, El M’nouar, ORAN, ALGERIA,   phone: (213) 041.42.15.81 Briefly, in order to drive a multiplexed four 7-segment digits display, we need 7 + 4 = 11 lines (asuming the decimal point is not used) as shown in figure 1 . The references [1] [2] [3] may be useful to be read for full and detailed explanations. Previous EDN design ideas [4] [5] [6] show solutions to minimize the number of lines, to be able to use pin-limited microcontrollers. But those solutions require, in general, one (or more) additionnal digital integrated circuit(s), which increase components count, PCB footprint and cost. This article shows a solution to reduce the number of 11 lines downto 8 lines only, keeping the same number of components count . Figure 2 shows that mixing common-anode and common-cathode type, with PNP and NPN bipolar transistors require 7 + 2 = 9...

PICmicro + servomotor = big galvanometer

NoureddineBENABADJI L.A.A.R. Laboratory ( DTL team 2 ), Faculty of Physics,  University of Sciences and Technology - Oran, B.P. 1505, El M’nouar, ORAN, ALGERIA,    phone: (213) 041.42.15.81 The following circuit ( Figure 1 ) shows a home made non conventional galvanometer I designed a while ago to sense slow variable physical parameters, like temperature, humidity, atmospheric pressure, etc..., as I was definitively fed up after looking for a big analog galvanometer in local stores (not available, or very expensive…). I have build this prototype to add robustness (classic galvanometer are not suitable for harsh environments) and modularity for maintenance purpose (if the internal coil of a classic galvanometer is damaged, you have to throw it). Small servomotors are used for precision positioning , generally in robotics. They are driven with pulses of 1ms to 2 ms duration (critical), over a period of 20 ms (not critical). The maximum angle is 90° for the ...