View Full Version : DIY Power Meter (Watt Meter)
Markz
Feb 24, 2004, 10:46 AM
Some time ago, there used to be a good web site with serveral great projects, one of wich was a Watt Meter. This site is nowhere to be found nowadays. I will attemp to revive that project.
Please note that I am NOT the original autor of this project. I don't remeber the original author's name (a frenchmen), but he deserves credit for at least the original version, using a MAX4372H High-Side current sense amp to monitor current. The project was built around a PIC16F876A, wich is convinient for this application. It has a couple of 10bit AD, enough pins left to drive the LCD and Flash program memory for fast software tweaking
Another version that I'm currently working on involves using a Hall Effect current sensor from Allegro (ACS750) (http://www.allegromicro.com/sf/0750/) - that should make the device Brushless compatible!
Fortunately enough I found enough of the original source code left on an old computer to start experimenting. I had to hunt down some missing libraries but it is working now.
I don't have a web site, so I will try to post everything I have on this thread. Keep posted!
Marc
Markz
Feb 24, 2004, 10:56 AM
Here's the source code.
It has originally been designed using the free version of CC5X:
http://www.bknd.com/cc5x/index.shtml
The chip originally used is a PIC16F876, I made all my tests using a PIC16F876A, and I suspect that it will work just fine on a PIC16F876B (Not tested)
Marc
Disclaimer: I'm not the author of this software, an I might have modified it a bit from the original version while experimenting. If you are (or know) the original author, please let me know so that I can give proper credits
simingx
Feb 24, 2004, 11:03 AM
I actually built it but lost the webpage.... :mad:
If I have time I'll try to trace out the schematic...
Markz
Feb 24, 2004, 11:33 AM
This is a preview of the schematics: (Work in progress...)
Markz
Feb 24, 2004, 11:36 AM
I too built it some time ago, but on a breadboard that got used for something else lately.
But it's a great design, so I think it's worth some efforts to bring it back to life
The schematic above came from software reverse-engineering, and some web searching, but it is working - the current sense circuit is missing, since I want to experiment with different methods.
Marc
Jim McPherson
Feb 24, 2004, 07:41 PM
Great stuff! I was just about to put together an Amp Meter using the MAX4372H, but now have swaped over to using the Allegro part. It seems like a great little device. I'm using a PIC16F877 for development, it seems to be working very well. I was worried that the Allegro sensor was -50 to +50 amps instead of 0 to 50. From the data sheet it looks like 0 amps is 2.5 volts and 50 amps is 4.5volts. That is only 2 volts for the A/D. However the 10bit A/D of the PIC16F877 I'm using gives a 122mAh resolution, the stated max resolution of the Allegro sensor is 250mAh so it looks like 2 volts will be fine. Thanks for the great find Marc! Do you have the sensors in hand yet? I've now got a couple samples headed my way.
-Jim
Markz
Feb 25, 2004, 09:00 AM
Hi Jim,
I have requested a few samples of the 50 and 75 amps models, I received an e-mail from them saying the parts would be shipping the next day. This was 5 days ago, but since I'm in Canada that's typical - customs have a hard time dealing with samples
Don't worry I'll let you know as soon as I receive them!
The Pic 16F877 is a very good choice for this application. I just happened to have a 16F876A left from another project that was perfectly suitable for the task (and still in good shape!)
Marc
Markz
Feb 25, 2004, 09:02 AM
Please note also that all 3 allegro parts are exactly the same, except for the 50 that has twice the gain of the two others. From the spec sheets, the 100 are fully rated production parts that undergo a different quality control process than the 75.
Of course, if we want a micro power meter, the best option is still the MAX4372H
Marc
Markz
Feb 25, 2004, 09:14 AM
This would be the power probe, using the ACS750 ic. The bypass cap is missing. Everything will be encapsulated in epoxy
Marc
chaiclis2002
Feb 25, 2004, 09:43 AM
It would be great, if a kit or some simple instructions were available, so people with little knowledge of electronics could build one also.
Greetings, Rudolf.
Markz
Feb 25, 2004, 11:06 AM
Hi Rudolf,
I will post as much info as I as can when it is available.
I am developping this at a verrry slow rate right now. I will debug the whole thing and create a pcb layout soon. This should simplify things a bit
Let me juggle with the idea of putting a kit together...
Marc
MondoMor
Feb 25, 2004, 11:20 AM
This should be no problem with an AVR. 'course I'll have to write my own code, but I need practice!
Thanks for the links, schematics and most of all, letting me know such a device is possible to build instead of buy!
Allegro samples on the way...
Jim McPherson
Feb 25, 2004, 12:21 PM
Markz, What A/D are you planning on using for the voltage sensor? I'm considering the ICL7109 right now but am open to suggestions.
-Jim
stumax
Feb 26, 2004, 04:27 AM
I've been using the ACS750 for about 12 months now in the electric power steering power amp I built at work for our development vehicle. It's a good sensor, but for our use it needs to be calibrated and linearised (then store the values in a lookup table for the micro to read) if you want to achieve better than the 1% or so accuracy they claim, otherwise you may as well just use a 7 bit A/D. I incorporated on into a BLDC controller with a pic16F84 ages ago when I was playing with the early Kokam cells to modify the rx's signal to the esc to keep curent under control to stop the cells from dying at a massive 3C - oh how things have changed! It's one of those things that could easily be added permanently inline with an esc with a small connector coming out to plug into a volt meter so that you can check current in the model without the hassle (and extra losses & voltage spike causing induction) of plugging a Wattmeter in.
Stu.
MondoMor
Feb 26, 2004, 09:17 AM
Markz, about your schematic in post #4. If IC1 is an LM317 (or similar) regulator, shouldn't R1 be connected between the OUT and ADJ pins instead of OUT and GND?
Markz
Feb 26, 2004, 09:49 AM
Jim - I am using the internal ADs of the PIC device. They are 10bit in resolution and adequately accurate for this use. It is currently using Vcc and Gnd as the voltage reference, for sake of simplicity, but I have the option to use an external v ref. The best would be to use one of those 4.096 ref chip to get a 1mv resolution. Not that I need that much bit it is easier to calculate.
Stu - Thanks for pointing this out. Unfortunately I don't have the equipment to calibrate my devices, so I was wishing to get good results by desing using this so-called calibrated part. Too bad. Yep, my goal was to create a meter that would be as transparent as the Sears clamp-on meter for brushless application. Thanks for you feedback!
MondoMor - This is a mistake! Thanks for pointing this out. I have tried many different regulators, LM317, LM1117, LM2941 and finally LP2953, wich if I remeber correctly was the one used in the original desing. It is the best so far - very low drop out, regulates very well down to 3.5 volts. Now the problem is that my LCD is not clear enough below 4.5 volts
BTW the only reason I'm using PICs is that there's an Active Electronics store 1/2 mile from my office which stocks plenty of Microchip devices, no Amtel or anything like that. They still stock Z80 for wathever reason though...
Marc
Markz
Feb 26, 2004, 02:12 PM
Ok I got the Allegro sensors. I *might* be able to test them this week
Marc
Jim McPherson
Feb 26, 2004, 05:51 PM
Markz, thanks for the reply. I guess I'm just missing out on how to measure higher voltages than the 5v maximum of the PICMicro's A/D converter. 5 volts isn't much use on a meter for our use. Is there another way that I don't know about? I'd like to measure above 50 volts and don't want to have to have a precision 50 volt source on board.
-Jim
MondoMor
Feb 26, 2004, 05:55 PM
Jim - voltage divider maybe? Set it up so that your maximum expected voltage = 5V. It would add some weird math to get an output, and would limit your precision, but you'd at least be free of the reference problem.
Perhaps a switch-selectable range system (0-15V, 20-25V, etc.) with different voltage dividers?
Jim McPherson
Feb 26, 2004, 07:24 PM
There's got to be a better way... I think I'll take apart my cheap radio shack DMM and see how it does it. I mean if radio shack can sell me an autoranging DMM that can measure 200 volts for $19.99 SURELY I can build one pretty easily.
-Jim
stumax
Feb 26, 2004, 07:32 PM
Marc, you can use a precision shunt resistor and a voltmeter to get very accurate current readings. Run a test at set current increments on the ACS750 (= 1 LSB of your A/D perhaps) and record what the current actually is (current = voltage drop across the shunt / resistance ). Easy to do and worth the effort when you start measuring lower currents on small motors.
Jim, Mondomor's right, use a voltage divider or several. Be sure to use 0.1% precision resistors and keep them as close together on the board as you can to minimise temp difference.
Stu.
mstone
Feb 26, 2004, 08:19 PM
I've just found this tread.
I have the full set of drawings/code/schematics from the French site if you are missing anything.
I have started doing the same thing with a few exception. Mine are based on AVRs rather than PIC.
I am build two versions of the Wattmeter one for the bench and another smaller one for airbourne applications.
AT90S4433 (EOL) or ATmega8 for the bench the airbourne one will be ATtiny26. I am willing to share code, very easy to port between the two environments.
The bench one is using the Maxim chip at the moment. Has LCD readout and RS232 port for logging to the PC.
The airbourne one is using a Hall Effect sensor and has on board SPI EEPROM for storing Voltage, Current and Throttle position. Attach to PC to down load flight data. May replace onboard EEPROM with SD card and do down loads that way.
Mark
Markz
Feb 26, 2004, 08:39 PM
Jim,
One way to create an autorange meter might be to use an 8 port AD chip with different voltage dividers at each input. in software, you start with the broader range down to the lowest every time the reading gets close to max
For my meter a resolution of 0.1v is good, so one divider is enough for the entire range
Mark- an airborne unit sounds Interesting! It would finally provide real-life data on prop unloading - very good idea to log throttle position along with the other valves
Marc
mstone
Feb 26, 2004, 10:33 PM
Marc - the only problem with the multiple voltage dividers is that the low division ratios can result in too higher voltage on the input pins when a high voltage is applyed.
Maxim make some nice digital pots that allow you to selectively change the ratio. Look at the MAX547X series.
I was originally going to use a current shunt in the airbourne unit until I worked out how physically big the shunt resistor had to be.
Mark
Jim McPherson
Feb 26, 2004, 11:36 PM
Ah....digital pots, EXCELLENT idea. So much easier and I can use the ADC on the PIC. Ordering one right now. Thanks Mark!
-Jim
Jim McPherson
Feb 27, 2004, 12:27 AM
Just got a couple MAX5475's on the way. They should give me greater than 50 volt range. I wonder about thier accuracy though. Have you used these pots in your design Mark?
-Jim
stumax
Feb 27, 2004, 01:02 AM
Jim, I'm not sure they'll be up to it. They have only 5 bit resolution, with up to 0.5LSB non linearity, which is a lot when you only have 5 bits to play with. For precision stuff you can't beat precision metal film resistors. Use a multiplexing IC to feed the voltage thru the correct pair, or use a multichannel A/D. BTW, don't forget to work out how much total resistance you'll need at 50V to keep current low enough.
Stu.
mstone
Feb 27, 2004, 02:20 AM
Jim - I have not used the digipots but was intending too.
Stu - you are right about using precision metal film resistors.
I guess we have to workout what type of accuracy we will be happy with. It is known that some of the wattmeters out on the market are not very accurate.
Again as you have said before if we use the hall effect devices without profiling them we will not get 1% accuracy anyway. Then there is the problem with temperate drift. A small logger in a plane could get quite hot.
So what so accuracy are we going to aim for ?
vintage1
Feb 27, 2004, 05:05 AM
You can build an electronic swith good enough for these purposes using MOSFET switches - these typically have an on resisncae of a few hundred ohms, and an off resistance of a few megohms.
Couple those into a ladder resistor network, and if the A to D sees more than its 'full range' voltage, then progressively switch them on until its 'in range'.
The whole thing hinges on the fact that these FETS are linear and predictable when completely off, with volts across them, or completely on with no volts (or very little) across them.
I used these for audio switching years ago. Very low distortion, and when used in pairs so that one was off while the oher was on you get very good signal reducton. ISTR 100dB on/off ratio, and less than 0.01 distortion at around 80dB S/N ratio.
Pretty sure I used some kind of SSL CMOS FETS in a back. But there are better devices available now I think. This was 30 years ago!
Markz
Feb 27, 2004, 09:12 AM
Personally I think that for the voltage range we're interrested in, a 58mv resolution (60v / 1024) is more than adequate, especially in the noisy environnement we will be doing the acquisition. There's a couple of nice 16bit AD around that could give you a 1mv resolution in the same 60v range. But their range is usually limited to a few volts only. You still need a voltage divider
The problem with autoranging is that it can seriously skew the linearity. Another thing, since the sampling rate is relatively slow, what happens when you have a big voltage spike? It can take a while for the software to select another range, wich can be deadly for the AD internals
I prefer to keep it as simple as possible
Marc
simingx
Feb 27, 2004, 09:16 AM
Why not take an average of say, 1000 samples for the voltage display? And yes, 58mV is more resolution than we really need...
Anyway, I thought I'd bring up a point which seems to have been neglected.. I don't think there are voltage regulators which take input supplies to 60 volts! :D
Markz
Feb 27, 2004, 10:22 AM
That's what I'm currently doing in the software - averaging over 1024 samples for both channels. There's also a simple rc filter at the input for additional filtering.
Good point about the input voltage... I tested my lp2953 up to 40 volts with no adverse effect. I don't know however how long it will last at 60 volts. Mabe in those cases we can use a sep. battery (or ubec???)
Marc
Bruce Abbott
Feb 27, 2004, 05:58 PM
The LM2936HV is rated at 60V.
My wattmeter works down to 3.6V by using a 3.3V regulator, and an ICL7660 to generate -3.3V for the LCD contrast control and current shunt amplifier. The shunt is just a length of copper wire with about 1 milliOhm resistance.
The controller chip is a PIC16F870, driving a 16x1 LCD. At present it only shows Volts and Amps, but I am adding a button to cycle through different display options (Amps+Watts, Volts+mAh etc.), and another button for data hold and reset.
Markz
Feb 27, 2004, 08:44 PM
Bruce,
Nice meter! It really looks like the professional unit in the first photo
Do you mean that driving the contrast pin below 0 volt can increase the contrast of the LCD? That's very interesting! I have to try it
I wasn't aware of the HV line of voltage regs from National. It's a great find! I will get one for sure. How is the PIC behaving at 3.3v? Isn't it a bit too close to the minimum voltage of the device?
Last question: it seems that you are using a low-side shunt. What op-amp have you used to amplify the sense voltage? How good is the linearity? My first attemps using low-side sensing were really innacurate, mainly due to the op-amp operating too close to a supply rail in common mode - Are you powering it from both V+ and V- to avoid that?
Thank you very much for all this information. It's great to see that this project is not at all out of reach.
Marc
mstone
Feb 27, 2004, 08:56 PM
So for mine I will pick a maximum voltage and setup
a divider.
For the current I will do the same thing either varying the version of the Maxim chip between the T,F and H versions. Need to get the power dropped in the shunt resistor right
Mark
Bruce Abbott
Feb 28, 2004, 08:23 PM
Originally posted by Markz
Do you mean that driving the contrast pin below 0 volt can increase the contrast of the LCD?
How to use an LCD at low supply voltage (http://elm-chan.org/docs/lcd/lcd3v.html)
How is the PIC behaving at 3.3v? Isn't it a bit too close to the minimum voltage of the device?
The PIC is fine. The LCD controller is slower at processing commands. I had to double the recommended delays.
What op-amp have you used to amplify the sense voltage?
I used an LTC1051 'zero-drift' opamp, just because I had some lying around. An AD708 also gave good results. I use -3.3V for the negative supply, so that ground is in the middle of the opamp's range. Linearity is very good.
However, I did find that the PIC A/D convertor had some non-linearity close to ground. The error was only a few counts, but I wasn't satisfied, so I worked out how to reduce it.
For Volts, I simply add a small amount to the measurement. This raises the zero point, but is not an issue because 3.6V is the lowest possible reading. For Amps, I inject a small offset current into the A/D input, increasing the no-load reading to about 1 Amp. The meter stores the first reading at startup, and subracts it from subsequent measurements.
Norman Adlam
Mar 01, 2004, 12:58 PM
Guys,
I think I have most of the info that was originally on the French guys site (including schematics etc). Do you want me to hunt them down, and package up what I have and put them on this thread?
Cheers,
Chippie
Mar 01, 2004, 02:44 PM
Norman, that would be an excellent idea :D
Markz
Mar 01, 2004, 04:15 PM
Bruce- Wonderfull! thanks for all the info
Marc
Norman Adlam
Mar 01, 2004, 06:17 PM
Originally posted by Chippie
Norman, that would be an excellent idea :D
OK, Had to split it into 2 separate parts!
First is mainly the source (and hex) files.
Enjoy!
Norman Adlam
Mar 01, 2004, 06:18 PM
Second are Eagle project files!
Enjoy, again!
Jim McPherson
Mar 02, 2004, 10:25 PM
Thanks Norman! I can't wait to have a look at those. I got my Allegro chip in and have got it wired up to the PIC. So far so good. I'm going to do some testing on the Amp vs. Volts out of it tommorow. I really like the Allegro so far. It's super easy to use.
I've given up on the digital pots. 5 bit resolution is fine up to 100 volts or so, the problem is that the pots only have 25% tolerance. That's just not good enough for an accurate watt meter. I went with a Vishay/Dale 0.1% resistor voltage divider network. Using a Maxim MAX4518 multiplexer I can tap different places on the voltage divider and thus get my autosensing done that way. Thanks for the suggestions, this is fun.
-Jim
War Bird Radio
Mar 03, 2004, 09:02 PM
>I prefer to keep it as simple as possible
>
>Marc
I agree Marc! So I built this one pictured below for my parkflyers.
Yeah, it don't have the 1% accuracy but what they heck there just parkflyers! Ya can't get any simpler!
For bigger stuff I have a shunted 50A movment.
Sorry I just had to!
John
niels polfliet
Mar 10, 2004, 10:51 AM
hi guys,
Can you help me, i have a problem on measuring current on my velleman K8000 interface. The AD inputs take max 5 volts, and are accurate to 0.01volt. I now measure the voltage over a large 0.1 ohm resistor, so 0.1 volt =1 amp (U=I*R). This works good, but when i measure 10A, the voltage drop over the resistor is off course 1 volt..when working with 2S lipo cells, this is really a big difference in results. I cant make this less without making the accuraty less. Its for small 50watt motors, so an accuraty of 1 A isn't sufficient. Do you understand the problem?
Can't i use this Allegro hallsensor instead of the resistor?
From what i understand of this sensor, you just put an accurate 5Volts on Pin one (Vcc) and GND (like from an 7805?), let the curent flow between pin4 and 5, and the sensor puts out 2.5V to 5V linair to the current on the output (pin3) right? On the 50A sensor, 50A is 5 volts, on the 75 amp sensor, 75A is 5 volt? Just multiply the results and you have the current? There's no limit in the voltage of the battery pack? Does his make sense?:confused:
If this is correct, is there any problem using the sensor on my interface? (which is comparable to a multimeter that just handles 5 volt max...)
I export all results to Excell, so i can multiply them there to get the exact value...Besides the extra capacitor, no extra components are needed?
I hope this sensor is affordable, and normal European mortals can get it? where did you order it?
thanks a lot,
Niels
Jim McPherson
Mar 10, 2004, 03:29 PM
Niels, I understand your problem. The solution is to use a very very small value precision resistor. I use a .001 ohm resistor and then use a MAX4372H 100x amplifier to increase the voltage to useable levels by my ADC. That way the voltage drop is minimal, the wattage of the resistor is fairly low, and you still get full range on your ADC.
I've been using the allegro sensor for the last week or so and like it a lot. However it is not good for much below 250ma of resolution. If you can deal with 1/4 amp resolution then it works great. I used it in a battery cycler that only needed 1 amp resolution and it works very well.
Hope that helps.
-Jim
Andy W
Mar 10, 2004, 03:47 PM
I'm sort of late to this thread, so this may have been covered, but the Astro whattmeter doesn't use any hall-effect sensor for current measurements. It simply has a length of solid-core wire running from one end to the other, and uses the voltage drop across this to determine current draw.
..a
Jim McPherson
Mar 10, 2004, 03:54 PM
That's dirt cheap and effective, but probably a little on the inaccurate side. I don't have a wattmeter, has anyone checked it's accuracy?
-Jim
Andy W
Mar 10, 2004, 04:00 PM
You can compensate for temperature changes (the only thing that would affect accuracy by much once calibrated at the factory) by using an appropriate compensation component - probably just a resistor mounted physically near to the solid-core wire. The voltage drop is tiny, of course, but enough to get a 3 S.D. measurement of current draw up to 100A (and beyond, actually).
..a
niels polfliet
Mar 10, 2004, 04:02 PM
wow, thanks Jim.
I guess i'll see which solution is the cheapest (I'm a little concerned about prices, because I don't need 10000 of them...).
I definitly like your amplifier idea best, but how and where do you order this? I see a "request sample" on the web site, but can you request samples if you don't own a company? Not to mention shipping overseas...
btw, i'm guessing that piece of solid whire in the astrometer is exactly 17.5cm of 1.5mm² copper wire? Thats just 0.001ohm;). 1 milivolt= one amp.
thanks!
Niels
Markz
Mar 11, 2004, 10:12 AM
Andy,
The reason we were looking at using the hall sensor is to reduce to a minimum the distance between the meter's connectors to be more "brushless-compatible", as some have noticed that using the astro meter with it's long leads could potentially cause problems with the esc (like blowing off the input capacitor). The hall sensor has a very tiny resistance and is not affected by temperatur in our normal operating range.
On my current prototype, the hall sensor will be soldered directly between two deans connectors - no leads at all - and everything will be encapsulated in epoxy. I will post pics as soon as I receive my connectors!
Marc
Jim McPherson
Mar 11, 2004, 11:01 AM
Marc,
Why does brushless/non brushless make a difference? It seems like the ripples caused by long wires would be caused regardless of what is on the other end of the ESC.
-Jim
niels polfliet
Mar 11, 2004, 02:18 PM
Jim, can you please advice me where you ordered the MAX4372H?
I can't find it anywhere in all the electronics e-shops i know..
Thanks,
Niels
mstone
Mar 11, 2004, 06:44 PM
If you only want to measure the current. Here is a link
to an article about using a Hall Effect device to measure current.
You have to pay if you want the whole article.
They use a ferrite core cut in half with the halves glued into
a battery aligator clamp.
They also did a digital version in a box, 0 - 100A.
Silicon Chip (http://www.siliconchip.com.au/cms/A_30669/article.html)
Jim McPherson
Mar 11, 2004, 06:49 PM
Niels, I got them as free samples from Maxim.
-Jim
Markz
Mar 12, 2004, 09:34 AM
Jim,
Good point. I don't even own a big brushless myself - the only one I have is a mpjet 25/25. But I have read a lot about the effects of long cables between the battery and the esc, and the documented problems appeared to be mainly present in brushless applications. I agree that the same problems probably exists with brushed systems. The goal is to minimize the impact of the meter on the system, while keeping the accuracy at an acceptable level. It's also convinient to use one meter to get all the measurments at the same time
It's time to integrate a tach to the desing!!! Complete system analysis from one device
Marc
Jim McPherson
Mar 12, 2004, 11:03 AM
Marc,
We're thinking alike. I've got a tach designed into mine as well(as well as a servo tester so an external RX won't be required to run an ESC). I just got my 0.1% resistors in for the voltage divider network. Should have a chance this weekend to see if I can autorange voltage with the multiplexer.
-Jim
Markz
Mar 12, 2004, 02:24 PM
Jim- you're a genuine creative mind!
I will too add a servo tester in my box, as I still have enough room. Great idea!
mstone- I was about to build something similar to what the article is showing. My idea was to build a closed-loop hall current sensor, just like the Sears clamp-on meter. But then I found the Allegro part while searching for linear hall sensors. There goes the guess work for me
Marc
Markz
Mar 24, 2004, 10:26 AM
Here are some pictures of my power probe desing! Unfortunately I got stuck beacause of a bad LCD but I should be back on track shortly
Marc
Jim McPherson
Mar 24, 2004, 11:20 AM
Looks great Marc, I too got a little stuck in that I blew up my PIC programmer so have been waiting on a new one. Your "probe" looks really nice. Are you going to encase it in Epoxy like you first hoped?
-Jim
Markz
Mar 24, 2004, 02:30 PM
Hi Jim,
Yes I still plan on potting it in epoxy, but I want to throughly test it before it become unrepairable. I used shrink only to avoid accidental shorts - don't ask me how I learned...
I just got my 5 brand new LCDs. I can now burn 4 of them before something stops me again! Sorry to hear that you lost a part, I know how frustrating it can be. I will take this as a good advice and order an extra PIC just in case!
Marc
ohmite
Apr 06, 2004, 02:14 PM
Originally posted by Jim McPherson
I really like the Allegro so far. It's super easy to use.
I went with a Vishay/Dale 0.1% resistor voltage divider network.
Jim,
I agree wholeheartedly, the Allegro chip is great!
Can you provide the P/N for the Vishay/Dale divider network, I'm having a heck of a time finding the part searching through the mound of parts they make.
Thanks,
-Eric
rcmarty
Jul 17, 2004, 05:38 PM
How is this project coming along ? I'm looking to build a watt meter . Really like the idea of the onboard logger for data.
If this is up and running is anyone making a kit ? Or can supply a chip with the nessary programming on it ?
MArtin :)
Markz
Jul 27, 2004, 11:23 PM
Back to this topic- (Bump!)
I think it's time for me to try a different pic for this project. The PIC16F876A I'm using (I have a few of them) gives me very inconsistent results out of the A/D converter. I'm sure there are more accurate models out there. I would like to stick with pics since I made a programmer for them.
Any suggestions?
Thanks Marc
Markz
Jul 27, 2004, 11:26 PM
Martin,
If we ever get to the point where we have a functionnal desing, I'm willing to program pics for the price of the device + shipping. Since we can get free samples from most of the mfgrs, a kit would not be the greates option. I'm sure we could find someone to hack some pc boards as well, that would be great
Marc
Bruce Abbott
Jul 28, 2004, 04:26 AM
Back to this topic- (Bump!)
The PIC16F876A I'm using (I have a few of them) gives me very inconsistent results out of the A/D converter.
AFAIK no PIC has better than 10 bit resolution, so if you want more accuracy then try using a separate A/D chip, eg. MCP3202, TC3401. A dedicated chip works better because its sensitive analog circuitry is isolated from the MCU.
There are few things you can try to maximise the consistancy of your PIC A/D conversions.
Wait for a while between readings and after changing channnels, to make sure the input voltage has stabilized.
Use the SLEEP opcode and wake on Interrupt, to reduce digital noise during A/D conversion.
Connect the reference channel to a stable external voltage reference (eg. TL431), instead of Vcc.
Take several readings a few milliseconds apart, and average them.
Put low-pass filters on A/D and reference inputs.
Some of these techniques can be seen here (http://homepages.paradise.net.nz/bhabbott/wattmeter.html).
MartinFVS
Jul 28, 2004, 04:45 AM
Back to this topic- (Bump!)
I think it's time for me to try a different pic for this project. The PIC16F876A I'm using (I have a few of them) gives me very inconsistent results out of the A/D converter. I'm sure there are more accurate models out there. I would like to stick with pics since I made a programmer for them.
Any suggestions?
Thanks Marc
I have an in-flight data logger using the PIC16F819 with on board 10 bit A/Ds. Does the job and smaller than the ‘F876.
Martin
Markz
Jul 28, 2004, 09:25 AM
There are few things you can try to maximise the consistancy of your PIC A/D conversions.
Wait for a while between readings and after changing channnels, to make sure the input voltage has stabilized.
Use the SLEEP opcode and wake on Interrupt, to reduce digital noise during A/D conversion.
Connect the reference channel to a stable external voltage reference (eg. TL431), instead of Vcc.
Take several readings a few milliseconds apart, and average them.
Put low-pass filters on A/D and reference inputs.
Bruce: Thanks for the link. Very interresting ideas, I will definately try to add a sleep command instead of polling for the ad bit. I will try the voltage ref, however I need to find a low dropout one, since I want to be operating at 6v min.
BTW, is the source code yours? Do I have the permission to use it and modify it for the allegro sensor? I like the idea of programming directly in assembly. The current source base I have is in cc5x, which is limited to 1024 instructions - I constantly struggle with that limitation.
Martin: thanks, I'll have a look at this one
Marc
MartinFVS
Jul 28, 2004, 11:36 AM
I was just reading the datasheet for the Allegro sensor for the first time. Looks like it has a rather high level of noise and is a bit slow to respond to the ESC switching frequency. Could this be the cause of your problems?
There is a faster device available, the ACS752. It may be a better choice.
I’m using a 0.0025 ohm shunt and wonder if it would be worth me trying the Allegro device.
Martin
Bruce Abbott
Jul 29, 2004, 05:04 AM
BTW, is the source code yours? Do I have the permission to use it and modify it for the allegro sensor
Yes, it is mine. All my source code can be freely copied or modified, with no restrictions!
I will try the voltage ref, however I need to find a low dropout one
The TL431 is a shunt regulator that acts like a 2.5V zener diode. In my Wattmeter a 3.3V regulator supplies Vdd, which then feeds the TL431 through a 330 Ohm resistor (the TL431 needs 2mA to operate).
Markz
Jul 29, 2004, 10:09 AM
Cool, thanks Bruce. I now have something to work on. I hope I'll be able to find a TL431 or equivalent at the nearest electronics store. I'll check if they have a PIC16F870 while I'm there, as it has the ASUART which could be used to connect to a pc
Marc
Comatose
Jul 29, 2004, 12:00 PM
Another thing that may help/be necessary is buffering your inputs. Pics have fairly high input impedance to their A/D ports. An op amp voltage follower may make all the bad stuff go away. Also, FWIW, all the pic16s with 10 bit A/Ds have the exact same modules.
rcelectronics
Jul 30, 2004, 02:14 PM
[QUOTE=Bruce Abbott]Yes, it is mine. All my source code can be freely copied or modified, with no restrictions!
I think I missed it, but where is the source at?
david
Chippie
Jul 30, 2004, 05:03 PM
[QUOTE=Bruce Abbott]Yes, it is mine. All my source code can be freely copied or modified, with no restrictions!
I think I missed it, but where is the source at?
david
David,
You will find all the info Brian refers to here:http://homepages.paradise.net.nz/bhabbott/wattmeter.html
HTH Chip ;)
jswayze
Oct 03, 2004, 10:37 PM
[please wait... resurecting thread...]
How's this project going guys? I just started a thread about the Allegro IC and was directed toward this one... should have searched first :o
My grand plan is to build a real-time RF telemetry unit that sends data to a display hooked on to my transmitter. Yes, I just found out that one is commercially available, but what's the fun in that? :) At the minimum I plan to send battery voltage, current draw and temperature, and I'd like to integrate GPS data as well to get altitude, heading, ground speed, etc. Also thinking about making a pitot tube/pressure transducer to get airspeed.
So far I've got voltage and temperature working using a PIC16F88, a voltage divider, and a DS1820 temp sensor. I'm using the LINX tx/rx pair to send the data.
My samples from Allegro should be arriving shortly - it should be a pretty easy task to add the output to my serial data stream I send over the LINX connection.
Any success with the projects mentioned in the previous messages? Any hints or tips for using this guy?
Thanks!
-Jeff
Blackhawk3D
Oct 07, 2004, 10:51 AM
Okay, I would like to build this wattmeter when the design is finished, but I don't know I darn thing about programming, all these chips, how to connect LCd screens, etc. Could someone explain some of this stuff to me, send a pm or give me a link? If so that would be great. I love to tinker and I love to build stuff.
Norman Adlam
Oct 07, 2004, 01:10 PM
AFAIK no PIC has better than 10 bit resolution, so if you want more accuracy then try using a separate A/D chip, eg. MCP3202, TC3401. A dedicated chip works better because its sensitive analog circuitry is isolated from the MCU.
Some of these techniques can be seen here (http://homepages.paradise.net.nz/bhabbott/wattmeter.html).
Bruce,
Can you provide the schematic as an Eagle file as well? I thibnk we'd need the parts / positions / values! :)
Cheers,
johncheng
Aug 18, 2006, 07:05 PM
Anyone still here? I'm building this project for my research group and I'm a bit stuck. I can't seem to get the ACS750 to work. It reads a constant 2.5V when i have it plugged in like so: http://g0su.com/wang/meter.JPG . The heater turns on, and works fine. Using an external ammeter (clamp type), I read 8 amps, but the output of my ACS750 reads 0amps (meaning 2.5V). However, using a simple DC power supply + resistor, the chip works fine. Any ideas? Thanks in advance.
John
Bruce Abbott
Aug 19, 2006, 05:55 PM
With AC input, the ACS750 will output a sine wave centered at half the supply voltage. Most multimeters reject mains frequency when set to DC volts, and will only show the DC component. Since you want to measure the AC component, you should select an AC voltage range on your meter.
meteor
Aug 20, 2006, 09:04 AM
Some of these techniques can be seen here (http://homepages.paradise.net.nz/bhabbott/wattmeter.html).
Wow!
That's exactly the kind of stuff I've been looking for! :D
I'm assuming that the 16F876A is a direct replacement for the 16F870? (pretty sure it is...)
I'm thinking of a design like this, perhaps with a supplementary tach to act as a simplistic on-board data recorder.
With a 16F876A you could use the extra code space as a "data" area to eliminate the need for an external EEPROM. (the 7K or so left over would be lots for most needs...)
Di you happen to run a small batch of your Wattmeter boards?
Thanks,
Brian
Bruce Abbott
Aug 20, 2006, 09:06 PM
It's still in development, and I haven't finished the board layout yet. I am considering including a tachometer probe and data recording functions. Hopefully I will get time to make some progress on this soon!
I have now relocated the current sensor off-board, to shorten the battery wiring length and allow the box to be located further away from the power system. With 3 precision 0.003 Ohm resistors in parallel, the current shunt is much more accurate than the piece of copper wire I was using.
meteor
Aug 21, 2006, 10:15 AM
With 3 precision 0.003 Ohm resistors in parallel, the current shunt is much more accurate than the piece of copper wire I was using.
Where are you sourcing the precision resistors, and how many watts are they?
FYI, I have noodled around with the MAX4372 current sense amplifier and Panasonic precision resistors (0.001 1W 1%), but with the 50x gain version of the MAX4372, you don't get enough voltage at modest current levels. (around 1V at 20A)
I'd like to get the 100x gain version, and combine it with a 2.048V precision reference, and I think that will work well with a PIC A/D input.
As as an aside, I never got a clear answer on this, but assuming that I use a 1.024V reference, do I lose accuracy on the PIC A/D channels by "compressing" the full 10 bits down to a 0-1V range?
This implementation might reduce your parts-count, and increase the accuracy of the current readings...
mmprestine
Jan 16, 2007, 09:15 AM
Complete project posted
Matt
eFlight Motor Analyzer (http://www.rcgroups.com/forums/showthread.php?t=623055)
mongater
Dec 26, 2007, 10:04 PM
Did anyone finish building the Guillaume Wattmeter? I would like to know if it's working. Or not even close to finish?
vBulletin® Copyright ©2000-2009, Jelsoft Enterprises Ltd.