PDA

View Full Version : ammeter with the pic16f876A



lutherblisset
- 28th September 2007, 16:05
i want built a ammeter with the analogic ports of the pic16f876A,i found this schematic from a commercial kit but i dont know how it work,somebody can help me?

chuck
- 28th September 2007, 18:21
I've had a quick look at it and basically the op-amp is acting has an amplifier, the voltage drop across the resistor is only milli-volts and the pic will not see this hence the op-amp.

example: say it was in a power supply and it had a load of 5amps then the voltage drop across the resistor was 120MV then op-amp would say have a gain of say 10 so you times the .120Mv by 10 and this would give you an output voltage of 1.2V you then scale it in your software so your display reads 5amps.

the other part for reading the voltage is not the best way the zener diode can cause problems with readings. The best way is similar to other part of the op-amp but this time has divider, so if you put 25 volts in you divide it by 10 and the output to the PIC is 2.5V same thing again you scale it to read 25 volts on your display.

The voltage reading I gave above is only has a sample I have not gone that far into detail working out the calculations but it should give you a rough idea how it works

You can do a search on op-amps set up has amplifier or divider, the pots on there are used has a calibration part or you can use it so that the output voltage never exceeds 5 volts

Hope that helps

Asmith
- 28th September 2007, 19:01
Someone please correct me if I'm wrong on any of this.

Your ammeter is used to measure electric current flowing through a circuit. This can be done a lot of different ways. The way your schematic is set up is using a shunt to provide an very small voltage drop which you can measure. A shunt is just a very low resistance resistor with a high power level as all of the current to your outside system has to flow through this. You want to pick a very small resistor (Typically 0.01 ohms) so you ensure the drop is small enough to not take away power from anything you are trying to run. Now you have to read the drop across this known resistance. Typically the drop is very small, in the mV range. That is why you see operational amplifier on the output of the shunt otherwise your pic will never be able to read the voltage. All of these parts really depend the upper limit you are trying to read current to, but the sch you have should work out ok.

Wiring it up-

+Vin/Vout is the plus side of the power supply
-Vin is the negative terminal from the extrnal item you are trying to read current from
-Vout is the negative termial of the power supply

It looks this the schematic you are using is also used measure the voltage, which is maybe what "tensione" means. I agree with chuck on the voltage reading though, as those zeners get closer to thier max voltage the output becomes less linear giving you a not so perfect reading. I didn't actually go through all of the circuit and figure out each of the points, but this is a typical design for reading current. They do have IC's now that you can place over a trace or run the current through that do everything for you. Maybe look at those if it's low currents your looking for. I hope this helps.

Anthony

RYTECH
- 30th September 2007, 06:11
I've used a Maxim 4172 to read various ranges of current. This IC uses a sense resistor to measure various ranges of current.

RussMartin
- 30th September 2007, 14:59
This does not appear to me to be a conventional metering circuit; it looks instead like a monitor for device voltage and current. U2 likely provides a reference voltage (it's a 3-terminal device, though, but is not used in any typical configuration).

I suspect that the two variable resistors are used to calibrate the circuit, and the zener diode (DZ1) provides overvoltage protection on RA0.

If you seek only to measure current, there are simpler circuits.

Acetronics2
- 30th September 2007, 15:05
Hi,

All details can be found here :

http://www.gpekit.com/pdf/mk3980.pdf

This is lots easier to understand how it works !!! ... an if reading Italian, ... The Nirvanna

Alain

lutherblisset
- 30th September 2007, 18:55
and what is the easier way to measure the current with the analogic ports of the 16f876?

Acetronics2
- 30th September 2007, 20:11
and what is the easier way to measure the current with the analogic ports of the 16f876?

You have the whole schematics ... and the kit explanations.

What further do you need ??? the program for free ???

Alain

BigWumpus
- 30th September 2007, 21:23
Where is the problem ?

1. You must know the maximum current.
2. You can choose your shunt (don't forget the heat!!!!)
3. You use a OPAMP as an amplifier for the voltage to maximum 5V for maximum current trough the shunt. I use an LT1490 (rail-to-rail) for 5V-supply and good quality.
4. Measure the voltage !
(I use the lm385-2.5 as a reference. I measure the voltage of one port an the voltage of a port with the lm385 on it to calculate the correct voltage, because the supply-voltage may be incorrect or spread widely. The normal 7805 is worse, I use a 78M05CDT instead.)

lutherblisset
- 1st October 2007, 00:29
can be the INA138 a good idea instead of the operational?it is a "High-Side Measurement Current Shunt Monitor, Current Output",it directly convert voltage to current