PIC firmware description
General descriptionSchematic description
The Wattmeter is an extremely easy-to-use multimeter, able to performs the Ampere, Volt, and Watt measurements (in this version for DC or slowly changing signals, with a few modifications for any signal type). It is designed for application with absorption up to 75 A, in a voltage range of 0-19 V. By the user point of view, it is mainly composed by:
At the power on the wattmeter have to be leaved unconnected due to the zero-calibration (about 5 second long) of the current transducer. At the end of this automatic operation, that is announced by a countdown on the display, the operator can choose the measurement mode (Ampere, Volt, or Watt) by the trhee position switch.
The schematics for Wattmeter is based on the PIC 16F876 device. The PIC microprocessor has a crystal of 4MHz in order to have a true calculation power of 1 MIPS. There are four other parts, the power supply, the RS232 interface, the input signal conditioning and the display driver.
The wattmeter is equipped by a standard 9 Volt battery and the power supply for PIC and the other components is a linear regulator LM78L05, capable to source 100mA at 5V. The PIC interfaces the PC serial port using a MAX232 that translate the TTL levels to true RS232 levels. The version of the MAX232 used allow the usage of 100N capacitors for charge pumps. The RS232 connection is used for future expansions (PC remote control and monitor, boot loader).
The input voltage is measured by the PIC, via two simple resistors and a MC33201 operational amplifier, that gives a measurement range from 0 to 19 V. The current transducer is the LEM LTS 25 NP with a range of ±25A (the usable range is about 3 times this limit). Another MC33201, with the same configuration used for voltage measurement, is used for current/voltage conversion.
The display driver is an ICM7211 with 4 digits and 3 position for the dot. The display driver requires a BCD input and a digit Strobe.
The display can shows the power (P=V*A) in the form PPP.P watt (resolution 0.1W), the voltage in the form TT.TT volt (resolution 10mV), or the current in the form ±CC.C ampere (resolution 0.1A). The operator can choose one of the previous measure by a three position switch. The central point of two resistance connected in serial mode (the other terminals are connected to +5V and GND respectively) is joined to an analog Pic input. The switch can shunt one of the two resistance (or no one) obtaining a +5V, +2.5 V or 0V input for the AN2 Pic input.
General Description : The PIC microcontroller program is written in assembler using the Parallax-like macro (included in the package). The program structure is quite simple because it is based on a endless loop, that invoke the “sample” routine. Before to enter into the endless loop the program execute the “lemcalib” routine. The aim of this routine is the LEM LTS 25 NP start up calibration. Because of this necessity, at the power on the wattmeter have to be leaved unconnected. The lemcalib routine is about 5 second long. The sample routine execute first the analog 2 input sampling to establish the current position of the “mode” switch. Depending on the selected mode the firmware performs 256 blocks of 64 sampling (for averaging purpose) of An1(current), An0 (volt), or both channels (watt).
Interrupt handler : In the wattmeter assembler is present an interrupt handler but it is unused in this version.
Remote Control : In the current version the PC serial interface is set but not used. The firmware and the hardware are ready to host the remote control and monitor operations, as well as the boot loader features.
The wattmeter is a very easy to build instrument. The user could start to sold the resistors and capacitors not polarized. The next step are the ICs sockets and the connectors (also the dual strip for LCD display). The last components are the current sensor, the electrolitycs capacitors and the voltage regulator. The LCD driver is mounted just under the LCD display.The PCB dimensions are intended to fit the circuit in a TEKO enclosure, code TENCLOS B 880-B .9 or similar (there are different codes for similar enclosures that differs only in height). The polarized components are marked as follows: