Attempting to run the EmonLib Example on an emonPi

I’m trying to get the EmonLib example of both voltage and current to run but I’m getting weird results.

(EmonLib/voltage_and_current.ino at master · openenergymonitor/EmonLib · GitHub)

I’ve connected it to a hairdryer and below is the following results.

24.32 35.08 117.30 0.30 0.69
-0.16 0.24 0.80 0.29 -0.70
-0.00 0.00 0.01 0.30 -0.70
-0.00 0.00 0.00 10.18 -0.02
-0.00 0.00 0.00 10.16 -0.02
-0.00 0.00 0.00 8.67 -0.03
-0.00 0.00 0.00 0.32 -0.75
-0.00 0.00 0.00 0.30 -0.70
-0.00 0.00 0.00 0.30 -0.70
-0.00 0.00 0.00 0.30 -0.70
-0.00 0.00 0.00 0.30 -0.71
-0.00 0.00 0.00 0.30 -0.71
-0.00 0.00 0.00 0.30 inf
-0.00 0.00 0.00 0.30 inf
-0.00 0.00 0.00 0.30 inf
-0.00 0.00 0.00 0.30 inf
-0.00 0.00 0.00 0.30 inf

Why am I getting these results?

Probably because you have not done everything right that you need to do. But until you tell us exactly what you have done, it’s a bit difficult to help you.

Are you using all the components that are specified on this page in the ‘Learn’ section? Learn→Electricity Monitoring→Current & Voltage→Basic: How to build an arduino energy monitor→How to build an Arduino energy monitor - measuring mains voltage and current
Or if not, what are you using?

Those numbers show a voltage of zero.

The columns are Real Power, Apparent Power, Voltage, Current, Power Factor.

I am guessing you expect to read a power value? You will not measure power if you have no voltage.

This is my setup.

I have the AC to AC power adapter and the CT connected.

The current is being read fine. The voltage is not.

Did you connect the a.c. adapter before, or at the same time as, you put the d.c. supply on to the emonPi?

If you have a multimeter, can you measure the voltage out of the a.c. adapter?

I connected the ac adapter before putting in the dc supply.

I dont have a multimeter but it is straight out the box, shouldn’t be faulty.

I looked at the picture and thought you were referring to the emonPi.

How have you connected the Arduino and a breadboard, which is what you must be using if you’re using the instructions in “How to build an Arduino energy monitor”?

The CT sensor and the power adapter are in the picture. I’m using the emonpi so I don’t need the breadboard

So, have you tried to reprogram the emonPi? I’m struggling to understand why you titled the thread “EmonLib Example”, cited the “Learn” page about building an Arduino + breadboard setup, when you have an emonPi?

I haven’t reprogrammed the Emonpi. Apologies about the title it might be misleading. I just want to get the EmonLib example of the voltage and current to work on the emonpi. The current is showing but the voltage is not.

You are still not making sense. You haven’t reprogrammed the emonPi, yet in your initial post you quoted some output that looked as if it came from the demonstration sketch associated with the ‘Learn’ page, and you want to get that sketch to work on the emonPi, when it has a sketch in it that, while totally different, has the core energy monitoring part that is similar to the demo sketch.

When you got the emonPi, was it new from the shop? Did it record the voltage and power correctly?

N.B. I have changed the thread title from “EmonLib Example” to reflect more accurately the topic.

Ok sorry for not making any sense. I got the emonPi new from the shop. I downloaded the sketch and got it running on the emonPi with a hairdryer. It is not displaying the voltage of the hairdryer. It won’t record the voltage at all.

Can you answer that question fully: did it work properly and did it record the voltage and power correctly before you overwrote the sketch that was in the front end?

The emonPi I bought was new from the shop and it didn’t record any voltage or power when I got it.

In that case, I suggest you email the shop: [email protected], link to this thread and explain that it didn’t work on arrival and that you have overwritten the front end sketch.

1 Like