3 Voltage and 3 Current readings sketch

Hi,

I'm just starting play with arduino and current/voltage measurement, and found your project, it is amazing!

What I want to do is to read exactly the value of current and voltage on a three phase system. In fact without the approximation of a single ac-ac transformer used by you, I don't care about invasivity of the project ;-)

Is there already any example sketch of an arduino reading 3 analog and 3 current? I was starting editing one of your example but then I think that, maybe, I can start from an already working example ;-)

I know that, theorically, I will able to do 30 measurement per cycle, but for now is enough, next i'll want to extend it with a more powerful ADC, but it will be another story ;-)

 

Thank you a lot!

Robert Wall's picture

Re: 3 Voltage and 3 Current readings sketch

I don't know of an example sketch that does that, because our hardware has only one voltage input. That's because a 3 phase domestic supply is extremely rare in the UK. You could stack 3 x emonTx V2, as in Martin Robert's design or (what I suspect you want) design your own front-end interface and write your own sketch - which will be quite simple, the major change you'll need is to the library to allow the voltage pin to be defined so as to pair with a c.t. pin on the same phase. The rest of the sketch would be almost unchanged.

calypso_rae's picture

Re: 3 Voltage and 3 Current readings sketch

I posted a sketch last year which measures two current paths on each of two phases.  This could be easily changed for measuring one current path on each of three phases.  I used strip-board for the front-end sensors and a standard Arduino Uno.

Details are in the zip file some way down this thread (posted 17/10/14)

 

sette's picture

Re: 3 Voltage and 3 Current readings sketch

Thank you both! I'll take a look on calypso_rae sketch and I'll going to edit it to adapt it to my need...

calypso_rae's picture

Re: 3 Voltage and 3 Current readings sketch

OK, sette, send me a PM if you need any help.

sette's picture

Re: 3 Voltage and 3 Current readings sketch

Thanks Calypso,

now i'm trying to calibrate my arduino setup, i'm using an AC-AC 9v industrial trafo and one allegro ACS712 to measure current.

I want to compare this with professional meter and see if it will be good enough.

Until now i've some problem on "centering" the 0 of ACS712, the inputs always fluctuate between 510-515.... This afternoon i'll check it with an oscilloscope...

 

Bye!

calypso_rae's picture

Re: 3 Voltage and 3 Current readings sketch

Until now i've some problem on "centering" the 0 of ACS712, the inputs always fluctuate between 510-515.... 

If the ADC in your Arduino has its maximum range set to 5V, each step of the ADC will correspond to just 1 mV.  The fluctuation that you are seeing is therefore only 5 mV.  Do you think you'll be able to see this reliably on your oscilloscope? 

If you do connect an oscilloscope to the input signal, it may be worth checking that the ADC's output has not been affected.  The analogue input pins on the Atmega processor are very sensitive.

sette's picture

Re: 3 Voltage and 3 Current readings sketch

It should be 5 mV each ADC's step, and so less or more 20-25 mV, I think that i'll be able to see it....

you said "The analogue input pins on the Atmega processor are very sensitive.", is there somethign that i can do? like a circuit to stabilize it? or to remove this "noise"?

calypso_rae's picture

Re: 3 Voltage and 3 Current readings sketch

Sorry, my mistake; the ADC is indeed 5mV per step.

I've never had much success measuring these inputs with a scope.  All I know is that the amount of noise on a supposedly quiet channel is usually very small.  I wouldn't expect to see more than a couple of steps between the min and max values.  Unless any background signal is correlated with the mains voltage, the calculated power in the signal will be very small.

What happens to your readings if you earth the analogue input pin?

sette's picture

Re: 3 Voltage and 3 Current readings sketch

Hy calypso_rae,

sorry for the delay but i was out for work.

Today i did all the try, with input connected to earth it read 0, correctly. I've connect the oscilloscope and i i've a lot of noise, and the peak/peak voltage is 30mV! amazing, arduino read exactly the same value (it's float between 5-6 number)!

Now i'm making some testing using a normal CT with burder resistor and DC bias and on another input the ACS712. With little voltage ACS has a lot of noise, these famous 25-30mV... and i think that this give me problems also on reading correctly the power factor.

With a capacitor on DC bias i've a very good voltage waveform, but in current it is not so good. Have you got an idea on how i can calculate the capacitor for that?

thanks

kurtkr's picture

Re: 3 Voltage and 3 Current readings sketch

Hi there

I have already made a PCB with the following specs:

1. 3 phase current input from f.ex. 3 phase solar inverter.
2. 3 phase current input from the grid
3. 3 voltage input for measuring grid voltage
4. 2 burglar alarm inputs
5. 2 alarm outputs for light and siren.
6.  pot for calibration adjustment.

the PCB is designed as a shield for Arduino Mega 2560.
I think that it will also interface to Arduino Due with ARM processor.

I am a very experienced PCB high speed designer, but a "new bee" in programming.

I will kindly ask if anybody had made a sketch (software) for a system like this or similar.

thanks 

boelle's picture

Re: 3 Voltage and 3 Current readings sketch

Robert Wall's picture

Re: 3 Voltage and 3 Current readings sketch

That is 3 sketches running on 3 processors, hardly a sketch, and not all that helpful (sorry, Bo).

I think, Kurt, you need to look at the "continuous" monitoring sketch for the emonTx V3 (in emonTxV3 > RFM12B > Examples > emonTxV3_continuous ) because I think it will be easier to merge the alarm inputs into that one. You will need to extend the code to handle your 3 voltage and 6 current inputs, plus the alarm inputs.

The sketch is quite advanced in terms of the techniques it uses, but expanding it should be fairly straightforward, once you understand that the analogue input is working independently of the main loop, so at each step you are setting the ADC up for the next step but processing the last one.

Out of interest, why do you think you need a pot for calibration?

[Edit]
Robin Emley, who is the author of the continuous monitoring sketch, has pointed out that he thinks this http://openenergymonitor.org/emon/node/2917 (already linked to further up this thread) and the sketch in the file http://openenergymonitor.org/emon/sites/default/files/NZ_project.zip (in a post about half-way down that thread) would be a better starting point.

kurtkr's picture

Re: 3 Voltage and 3 Current readings sketch

Hi
Thank you for the responses.

Sorry for the late answer, but I have been away a few days.
You are right Robert, I cannot use node 1170, as you said this is a design for 3 sketches, but very nice and neat.
I will look into your suggestions and I will come back later with the result.

By the way, the pot is for calibration, I want to make a calibration sketch for setup of all constants and place them in the EEPROM area.
I think it is in the end easier to make readjustments, when changing's occur.

Is it possible to get an email when someone is responding on a topic where you is participating?

Thank you in advance

 

Robert Wall's picture

Re: 3 Voltage and 3 Current readings sketch

"Is it possible to get an email when someone is responding on a topic where you is participating?" I believe that is broken, and has been for a long time.

I think you would be better not relying on a pot with mechanical adjustment. What is there that is likely to change? There is little that is likely to drift far with age, once the uncertainty in the initial component values is accounted for (and a pot wouldn't help with the main cause of variation - temperature changes).

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.