AC / AC Adapter @ Arduino Uno

Hello,

I build the electronic schematic for measure the AC voltage of my grid.

But it dont work, the voltage with my arduino sketch is totally random and not correct. Is the schematic correct?

 

Robert Wall's picture

Re: AC / AC Adapter @ Arduino Uno

Yes, that is correct.

But what do you mean by "totally random"? I'm prepared to bet that if you sample often enough and study the numbers you get carefully, then plot them on a graph against time, you will see something like you see in this post: http://openenergymonitor.org/emon/node/824

Where did you copy the schematic from? I think you need to go back there, or look in the Building Blocks section of this website, and look for an example sketch that shows you how to convert the samples values that you are reading into meaningful numbers. "Measuring AC Voltage with an AC to AC power adapter" looks to me as if it might help.

JumpY's picture

Re: AC / AC Adapter @ Arduino Uno

The schematic is from this page, but they use other resistors for the voltage devider, but that can't be the problem.

I will test it with your link next days, but my sketch shows me 40V - 200V random, so it is not correct ;)

Robert Wall's picture

Re: AC / AC Adapter @ Arduino Uno

Your schematic should work OK. I think the problem is with your sketch. That is why I suggest you make sure that your sketch is doing everything it needs to do to measure an alternating wave.

JumpY's picture

Re: AC / AC Adapter @ Arduino Uno

Here is my test, it don't work :/ I soldered the AC-AC System and one current system.  I tested the current system with a normal Sketch --> emon1.current(1, 29); , and the results are very good. I use a sct-030-013, ~ 0,5% tolerance.

Then I tested the current & voltage sketch -> no work, current did not work in this sketch and voltage, too....

Here is the print of the link you show me. First only voltage connectet, second voltage connected and current with no Amps on the wire (0A), and third with current and voltage connected and 5.5Amps current.  Where could be the mistake??

 

In NORMAL mode ...

SUPPLYVOLTAGE = 5143, V_RATIO = 1.48, I_RATIO = 0.39
millis() now = 11
recordingMayStartAt 5011
4
3
2
1
0
<recording data ...>

cycleCount 252,  samplesDuringThisMainsCycle 74
|   c                                                                           |
|     c                                                                         |
|      c                                                                        |
|       c                                                                       |
|        c                                                                      |
|         c                                                                     |
|         c                                                                     |
|          c                                                                    |
|          c                                                                    |
|          c                                                                    |
|          c                                                                    |
|         c                                                                     |
|         c                                                                     |
|        c                                                                      |
|       c                                                                       |
|     cv                                                                        |
|    c                                                                          |
|   c                                                                           |
| c                                                                             |
vc                                                                              |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
|c                                                                              |
| c                                                                             |
|  c                                                                            |
minVoltage 0,  maxVoltage 148,  minCurrent 0,  maxCurrent 146
millis() now = 57088
recordingMayStartAt 62088
4
3
2
2
1
0
0
<recording data ...>

cycleCount 652,  samplesDuringThisMainsCycle 24
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
minVoltage 0,  maxVoltage 4,  minCurrent 0,  maxCurrent 0
millis() now = 84454
recordingMayStartAt 89454
4
3
2
1
0
<recording data ...>

cycleCount 952,  samplesDuringThisMainsCycle 74
|vc                                                                             |
|v c                                                                            |
| vc                                                                            |
|  c                                                                            |
|  c                                                                            |
|  c                                                                            |
|  c                                                                            |
|  c                                                                            |
|  c                                                                            |
| cv                                                                            |
| cv                                                                            |
|cv                                                                             |
|cv                                                                             |
cv                                                                              |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
c                                                                               |
vc                                                                              |
vc                                                                              |
minVoltage 0,  maxVoltage 50,  minCurrent 0,  maxCurrent 51

Robert Wall's picture

Re: AC / AC Adapter @ Arduino Uno

You cannot have built the same circuit that you have drawn. The waves should be centred on the display (as in here), not up against the left hand side. Measure the d.c. voltage at the top of R1 - that should be 5 V. Measure the d.c. voltage at the junction of the two 100 kΩ resistors R1 & R2 - that point should be at 2.5 V, or very near. Is the capacitor C1 the correct way round? - the connection marked with a thick bar and "-" signs should go to the GND connection. Check for a short circuit between the junction of the two 100 kΩ resistors and GND - that includes checking C1. Check that R1 is connected and is not open circuit. Check that both R1 and R2 really are 100 kΩ. After applying power, have you waited a few seconds before running the test sketch?

 

JumpY's picture

Re: AC / AC Adapter @ Arduino Uno

Hi,  I found my mistake this night, two wires were broken. They were never used, so I did not check them. I soldered it again with other wires and it works!!!

Thanks for your help, but I still have one question to my wave:

One wave is negative, one is positive. Should I change the wires at my current sensor? When it's done, I have to calibrate the system and then it's okay I think. :)))

 

MANY THANKS!!

Robert Wall's picture

Re: AC / AC Adapter @ Arduino Uno

You can change the wires, or you can reverse the current transformer on its mains cable. Either will invert the current wave.

Normally, we say power imported is positive, power exported is negative, but that is only our standard. What you have in your screenshot is negative power, so we would expect to see that on the output of your PV or wind generator (if you one!).

calypso_rae's picture

Re: AC / AC Adapter @ Arduino Uno

I'm always pleased to see my RawSamplesTool being used to check out new hardware.  As Robert has said, the sense of the current waveform (with respect to the voltage) can be inverted by reversing the orientation of the CT, or by moving it to the other 'live' cable. 

When using that sketch, the voltage trace will always start off by moving to the right because the logic waits for that part of the waveform to occur before starting to gather and display its data.

Comment viewing options

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