View Full Version : Discussion Bruce Abbott's Wattmeter Project
plane_spotter
Oct 02, 2008, 07:17 AM
Hi all, has anyone built Bruce Abbott's Wattmeter project. Have 95% of the parts so would like to give it a go. There is little in way of documentation so would like to hear from anyone who has had success. Would try Bruce direct but he has no email contact, and not sure if he still reads the threads here.
http://homepages.paradise.net.nz/bhabbott/wattmeter.html
Cheers
Ash
mmprestine
Oct 02, 2008, 11:04 AM
Have a look at mine. I am updating it now with more features.
http://www.rcgroups.com/forums/showthread.php?t=623055&highlight=motor+analyzer
Bruce Abbott
Oct 03, 2008, 06:46 AM
So far nobody has admitted to building my wattmeter, though a few people have asked questions about it. Please have a go - I'll be here if you need help.
not sure if he still reads the threads here. :rolleyes:
plane_spotter
Oct 06, 2008, 06:42 AM
Thankyou both, will try Bruce's first then the other.
regards
Ash
dpeng678
Feb 02, 2009, 09:13 AM
Hi Bruce and all,
I want to build this wattmeter badly. :cool:
Questions:
- Got a PIC 16F876A on hand. Can I program the hex code of 16F870 to it and be still working? Google search said it's OK but like to reconfirm.
- Mylar 100n caps OK? Or Ceramic?
- How do you build the 0.001 Ohm shunt for such a small size?
- How do you calibrate using R13 and R14?
- I made a tachmeter using infrared emitter and receiver. Is it doable to route the signal to the "rpm input" of the PIC?
- How do you use S1, S2, and S3? Which should be placed on the front panel next to the LCD display and which inside the box?
- Parts list available?
- How accurate can I expect from it?
Thanks Bruce for your sharing. I've done a precision PIC based LC meter and another frequency counter with success. I really wish to hit it again with your wattmeter project.
Best wishes from Taiwan. :D
Bruce Abbott
Feb 03, 2009, 07:17 AM
- Got a PIC 16F876A on hand. Can I program the hex code of 16F870 to it and be still working? Google search said it's OK but like to reconfirm.
The register addresses seem to be the same, so I think it would work. However, in case there is some difference, I have compiled a 16F876 version for you :)
- Mylar 100n caps OK? Or Ceramic?
I used ceramic caps, but mylar should be OK.
- How do you build the 0.001 Ohm shunt for such a small size?
Crude way:- Length of thick copper wire.
Better:- Precision shunt. If you can't get a 0.001 Ohm shunt then parallel several higher values (I used 3 x 0.003 Ohms).
- How do you calibrate using R13 and R14?
Measure input Volts with a multimeter, and adjust R13 to get the same reading on the Wattmeter. Connect a load resistor to the output, in series with the multimeter (set to 20A scale) and measure Amps. Adjust R14 to get the same reading on the Wattmeter.
- I made a tachmeter using infrared emitter and receiver. Is it doable to route the signal to the "rpm input" of the PIC?
Yes. The rpm input just needs a logic level pulse stream with one pulse per blade pass.
- How do you use S1, S2, and S3? Which should be placed on the front panel next to the LCD display and which inside the box?
S1: Momentary push-button. Press to change number of blades.
S2: Toggle On/Off. ON to hold readings, OFF for continuous update.
S3: Momentary push-button. Press to change display page.
- Parts list available?
No, sorry!
- How accurate can I expect from it?
Volts and Amps have 0.01 resolution, but may change by +-1 count due to noise, and there is also some non-linearity. For best accuracy you should calibrate with a voltage and current close to what you expect to measure (eg. 10V, 20A). Obviously it cannot be more accurate than the standard that you calibrate it from. I have 3 good multimeters and a Watts Up Meter, and none of them read the same!
jh2rc97
Feb 03, 2009, 08:10 AM
For a good precision current sensing shut I have used the Isotek ones:
http://www.isotekcorp.com/productDisplay.asp?CatID=1&SubCatID=
dpeng678
Feb 03, 2009, 07:21 PM
Now we are cooking! Bruce and jh2rc97, Thanks a lot.
It's gonna take a few days for parts collecting and breadboarding. Will get back to you then either with success or be warned... more questions. :D
Happy flying.
ElectoPete
Feb 04, 2009, 06:44 AM
Hi,
I built Bruce's Wattmeter just a few weeks ago. I used the PCB layout and the components, presented by Bruce.
I used the PIC 16F88. As a shunt I used three 0.003 ohm resistors in parallell.
I had to increase R5 a little, since the R14 range wasn't enough.
I have not tried the RPM input yet, but I will.
Everything worked fine. Thanks for a nice design!
/Pete
dpeng678
Feb 04, 2009, 11:04 AM
pete,
Any suggestion for R5 value? Thanks.
ElectoPete
Feb 05, 2009, 11:49 AM
I had to use 180k. This will depend on the actual value of your currect shunt (R15).
You will have to test your set-up. If you are out-side the range of the pot (R14), you will have to change R5 until you are in range and can adjust the current setting exactly.
/Pete
Bruce Abbott
Feb 06, 2009, 03:24 AM
I had to use 180k.That doesn't sound right. I'll just check my code to make sure that the external 2.5V reference is properly selected on the 16F88...
.
.
.
Oops!
Must remember that all symbols are case-sensitive, ie. '__16f88' is NOT the same as '__16F88' :censored:
Updated HEX file attached (please remove '.txt' extension before use).
ElectoPete
Feb 06, 2009, 01:23 PM
Bruce,
I tested the new hex-file, but there was no change.
(The reference voltage was probably OK from the beginning - the voltage reading has been correct all the time)
My amp reading is correct as long as I use R5 = 180K.
I also tested the RPM input - with an old optical sensor from my Graupner MC20 Tx.
It seems to work - at least in-house with 50Hz lights it shows 3000 rpm.
I was a little concerned since the Wattmeter only utputs 3.3 volts - but it seems to work OK. I will test outside in daylight later.
/Pete
dpeng678
Feb 07, 2009, 08:15 PM
Hi Bruce and all,
While waiting for LM2936-3.3 and TL431 to be delivered, I breadboarded only the 16F876A (programmed with your tailored hex code) and LCD display circuitry using +5V supply. OSC1 and OSC2(pin 9 and 10 on 876A respectively) were also connected according to the schematics. What I saw was upper 16 all black out and lower 16 all blank. It seems that LCD routine was not running and LCD was not initialized. Does it sound normal to you? :confused:
Did some internet reading and realized there is the infamous issue with pin 24, the RB3/PGM of 16F876A. :eek:
Used caution I programmed the 876A hex code from the following:
http://www.voti.nl/blink/index_1.html
It worked and the LED was blinking.
I then again programmed the RTC876.HEX from the following:
http://pagesperso-orange.fr/fabrice.sincere/cm_electronique/projet_pic/RTC/RTC_I2C.htm
It also worked with only the 16F876A, the oscillator, and LCD display connected. I was able to read the message "Fabrice Sincere" on the display. :)
Note that the circuitry uses the infamous RB3/PGM driving the RS Register Select to the LCD display and it is working alright.
Back to our project, I programmed the 876A back to your hex and tested the LCD initialization. Still no go.
I will route the circuitry all over again when I get the rest parts.
Your advices are greatly appreciated if you see something wrong of what I had gone so far.
Thanks again for your sharing.
Daniel
dpeng678
Feb 07, 2009, 08:39 PM
Bruce,
I tested the new hex-file, but there was no change.
(The reference voltage was probably OK from the beginning - the voltage reading has been correct all the time)
My amp reading is correct as long as I use R5 = 180K.
...
/Pete
Pete,
How the voltage accross the shunt resistor is sampled will affect the gain needed by R5 and R14 et al. R7 and Source 0V leads should be soldered as close to R15 (the shunt) as possible. ;)
Daniel
ElectoPete
Feb 08, 2009, 02:55 PM
I have checked the connection to the shunt - it is OK.
I get 2 mV at 0 amp and 6 mV at 5 amps into the amplifier (pin 3) - that is what is expected (there is some offset from R21).
There is one thing I don't understand:
I suppose Bruce has used full scale for the measurment, and that he uses 2.5 V as a reference for the ACD.
That means that 50 amps should generate 2.5 V into the PIC (= full scale of the ADC)
Since the amplification in the op-amp is about 23 (100/4.7 +1 =23), 108 mV input from the shunt is needed for full scale.
But.... The shunt only generates 50 mV at 50 amp (50* 0.001 = 0.050 V) ??
Is there something wrong in my calculation??
I am not good at assembler, so I can't check how the transformation is made to amps in Bruce´s program.
Please comment!
/Pete
dpeng678
Feb 08, 2009, 08:18 PM
I have checked the connection to the shunt - it is OK.
I get 2 mV at 0 amp and 6 mV at 5 amps into the amplifier (pin 3) - that is what is expected (there is some offset from R21).
There is one thing I don't understand:
I suppose Bruce has used full scale for the measurment, and that he uses 2.5 V as a reference for the ACD.
That means that 50 amps should generate 2.5 V into the PIC (= full scale of the ADC)
Since the amplification in the op-amp is about 23 (100/4.7 +1 =23), 108 mV input from the shunt is needed for full scale.
But.... The shunt only generates 50 mV at 50 amp (50* 0.001 = 0.050 V) ??
Is there something wrong in my calculation??
I am not good at assembler, so I can't check how the transformation is made to amps in Bruce´s program.
Please comment!
/Pete
Pete,
Check out this url:
http://www.daycounter.com/Calculators/Op-Amp/Op-Amp-Voltage-Calculator.phtml
Let's say R14 in mid position it'd be 2.5K. Add it with R17 3.9K then parallel with R6 3.3K, the equivalent resistor would be 2.12K. Input this value into the calculator as R1.
R2=100K, R3=10000K, R4=4.7K, V1=0V, V2=2.5V, Vp=3.3V, Vn=-3.3V. You get the gain inverting=-47.2.
Or using your simple formula, substitute 4.7K (were you thinking of R7?) with 2.12K you get:
1+100/2.12=1+47.17=48.17 ;)
Given more thought on the shunt precision, it is easy to shorten the lead between R7 and R15 the shunt but rather difficult to do the same between the source and the shunt. I will run certain amount of current, say 10A, through the shunt and measure the voltage drop between the shunt and the GND point of the source(it'd be the GND right on the PCB inside the power supply). This way I can cut short my home-made 12-AWG wire shunt resistor to make exact 0.001 ohm. Well, not so exact but closer. :)
Daniel
Bruce Abbott
Feb 09, 2009, 02:14 AM
I programmed the 876A hex code from the following:
http://www.voti.nl/blink/index_1.html
It worked and the LED was blinking.
I then again programmed the RTC876.HEX from the following:
http://pagesperso-orange.fr/fabrice.sincere/cm_electronique/projet_pic/RTC/RTC_I2C.htm
It also worked with only the 16F876A, the oscillator, and LCD display connected. I was able to read the message "Fabrice Sincere" on the display.Those examples use a 20MHz crystal. My code requires a 4MHz crystal. If the clock frequency is too high then the LCD won't initialize.
Note that the standard 16F876 is not guaranteed to operate from a power supply voltage of less than 4V (the low power 16LF876 is specified down to 2V). Mine works fine on 3.3V, but I doubt that it would run at 20MHz!
Bruce Abbott
Feb 09, 2009, 02:27 AM
Since the amplification in the op-amp is about 23 (100/4.7 +1 =23), 108 mV input from the shunt is needed for full scale.
But.... The shunt only generates 50 mV at 50 amp (50* 0.001 = 0.050 V) ??
Is there something wrong in my calculation??
Your calculations are not wrong, but you might be working from an older version of the circuit. Please vist my website again and download the latest files. You may need to refresh the page, to make sure that your web browser is not just showing an older version held in its cache!
ElectoPete
Feb 09, 2009, 08:10 AM
This explains everything!! :) :)
Now T see - I have the older layout :(
I will check this evening and modify my circuit.
/Pete
ElectoPete
Feb 09, 2009, 01:43 PM
I modified the circuit by changing component values and rearranging them according the new circuit.
Now everything works OK :) :)
Thanks!
/Pete
dpeng678
Feb 10, 2009, 06:35 PM
Those examples use a 20MHz crystal. My code requires a 4MHz crystal. If the clock frequency is too high then the LCD won't initialize.
Note that the standard 16F876 is not guaranteed to operate from a power supply voltage of less than 4V (the low power 16LF876 is specified down to 2V). Mine works fine on 3.3V, but I doubt that it would run at 20MHz!
When testing wattmeter circuitry, no external crystal was used as shown in your schematics. I thought the PIC uses internal oscillator, correct?
Experiments were all carried out with +5V Vdd.
Anyhow, I figured if I can get a 16F88 it will certainly help clarify. I did. LCD initialized successfully upon first shot! For just one night, I had completed breadboarding test and thanks to Bruce's sharing, I will be soldering and boxing today to finalize this project.
Excellent work. Many, many thanks. :D
Bruce Abbott
Feb 11, 2009, 01:08 AM
When testing wattmeter circuitry, no external crystal was used as shown in your schematics. I thought the PIC uses internal oscillator, correct?Sorry for the confusion, perhaps I should draw up another circuit diagram for those who want to use the PIC16F87xx (which does not have an internal oscillator option!).
dpeng678
Feb 14, 2009, 06:53 PM
I have one Fluke 77 and one Fluke 73, both give same voltage reading(well, the instrument circuit is exactly the same). I am able to calibrate Bruce's design so that it reads exactly the same like those Flukes around 5V and plus/minus .01V at lower voltage and up to 12V.
In regards of current readback, with 12 AWG homemade .001 ohm shunt, what I do is adjusting the pot so that at lower range(around 0.3A) Bruce's readback is the same to Fluke 77. Doing so you can observe at higher current range(like 7.8A when driving two 50w Halogen lamps in parallel at 12V), Bruce's readback falls behind Fluke 77 for 0.05A at the beginning and gradually catching up and equals to Fluke's after 90 secs(bear with me I don't recall very well exactly how long) or so and stablizes with the reading 0.02A higher than Fluke's in another 60 secs. It is because of the thermal effect of the 12 AWG wire shunt.
A twisted pair of thin wires were used for the shunt's mV fetch to MCP6022(I use 6023). An 18 AWG ground wire is also used in parallel from the shunt to the ground point as close to MCP6022 as possible. The extra ground wire is crucial. It greatly reduces the flipping readings between 0.00 and 0.01 Amp.
If you have any recommendation to better things, I am all ears to hear you. :-)
Bruce Abbott
Feb 15, 2009, 02:22 AM
That is very good accuracy, certainly quite good enough for most purposes. The native resolution of the PIC's 10 bit A/D convertor is 0.025V and 0.05A, and your meter is operating well within those parameters.
Originally I set the display resolution to 0.1 Volts/Amps, which was very stable but wasn't quite enough to achieve the accuracy I wanted. I now use 64 times oversampling, which generates enough bits to get a resolution of 0.01 on the display. This only works because there is some noise in the circuit, which dithers the signal to produce the 'in-between' values. My own meter has a bit too much noise on the Amps side, so it sometimes jumps around by 1 or 2 counts. However this is still a lot better than 10 counts (1 count at 0.1 display resolution).
A simple copper wire shunt will be noticeably affected by self-heating and ambient temperature, so this is one thing could be improved. However, unless you need exceptional accuracy it will probably be OK. Most 'budget' multimeters are only guaranteed accurate to about 2% on Amps. I have a couple of cheap meters with 20A ranges, and both of them show significant drift at high current.
I made a precision shunt by soldering three 0.003 Ohms surface mount resistors in parallel. I then wired this to the meter via a twin shielded coax cable (ex CDROM drive audio cable). The two center wires plus shield feed power (Volts), shunt (Amps) and Ground into the meter. This makes the Battery to Load connection very short, which keeps inductance down (very important with brushless controllers) reduces insertion loss and allows the meter to be positioned a good distance away from the circuit being measured.
dpeng678
Feb 15, 2009, 09:43 AM
Originally I set the display resolution to 0.1 Volts/Amps, which was very stable but wasn't quite enough to achieve the accuracy I wanted. I now use 64 times oversampling, which generates enough bits to get a resolution of 0.01 on the display. This only works because there is some noise in the circuit, which dithers the signal to produce the 'in-between' values. My own meter has a bit too much noise on the Amps side, so it sometimes jumps around by 1 or 2 counts. However this is still a lot better than 10 counts (1 count at 0.1 display resolution).
Ah... knowing how you had improved the accuracy makes me feel very grateful. Thank you! :) I like accuracy/precision as well.
Yes if I want to improve this meter, will certainly use shielded cable for mV readback. Also will put two power lines together to mutually cancel the current induced magnetic fields.
Does your .003x3 shunt suffer any thermal variation in resistance? Another question: how does TL431 ref voltage have to do with the meter accuracy?
Bruce Abbott
Feb 16, 2009, 04:49 AM
Does your .003x3 shunt suffer any thermal variation in resistance?I used Vishay Dale part# WSL3637, which has a temperature coefficient of +-50ppm/ēC. To cause a 1% change in the reading, It would have to heat up by 200ēC! (ignoring thermocouple effects).
Another question: how does TL431 ref voltage have to do with the meter accuracy?The TL431 has very good temperature stability (much better than the 3.3V regulator supplying power to the PIC). Reference stability is further enhanced because the TL431's power supply is already stabilized by the 3.3V regulator (which has a small but significant output voltage variation when battery voltage changes). Using the PIC's internal A/D reference would be simpler, but since this is just Vcc and Ground it would be much noisier and less stable.
Using a 2.5V reference also allows the opamp to be powered from the stabilized low voltage supplies (+-3.3V), otherwise it might need a higher supply voltage to drive the A/D converter to full scale (this does not apply to the MCP6022 because it has rail-to-rail output).
vBulletin® Copyright ©2000-2009, Jelsoft Enterprises Ltd.