Raspberry Pi + CT sensor + MQTT

Hi all.

I have a spare RPi, CT (clip) and a voltage sensor and was wondering if someone managed to make this setup work to measure mains current and voltage. I’m completely lost :confounded:

Unfortunately, to use a voltage or current out CT, you’d need at least one ADC (Analog to Digital Converter). This is why the EmonPi and other such devices have Arduino-type microprocessors in them that make the analog readings, and then send that digitized data to the RPi.

The RPi doesn’t have any ADCs.

1 Like

Thanks for your prompt reply!

Your best off-the-shelf route that will enable you to use the components you have is to purchase an emonTx and a RFM69Pi. And power supplies of course.
The CT and VT will plug into your emonTx; the RFM69Pi will plug in to your Raspberry Pi and turn it into an emonBase. The two communicate by radio. The Pi can run emonCMS and you can store your data on that and view it using a web browser, given a connection - WiFi or cable - to your router.
If you wish, you can leave out the RFM69Pi and use a serial connection to your RPi; but that’s not a standard configuration.

If you want a DIY solution using only the RPi, you’ll need to buy an add-on 2-channel (at least) analogue to digital converter, in front of that you’ll need a development circuit board with some interface electronics, and you’ll need to write your own software for the RPi. I don’t know of any ready-made solutions to all that (though you might find something), so a lot of development work is likely to be necessary.

I have a CT sensor and a spare Arduino UNO so have concluded that my cheapest way to get started is with the emonTx Arduino Shield SMT - Shop | OpenEnergyMonitor ?
I would choose the RF option, then receive the RF on a pi with a cheapo RF receiver.
Cheers

A couple of questions:

  1. What sort of c.t. do you have? If it’s a YHDC SCT-013-000, that’ll plug straight into the emonTx Shield. If it’s anything else, you might need to do some small mods.
  2. “a pi with a cheapo RF receiver.” means a RFM69Pi? Even cheaper would be a direct serial connection, if the Uno and Pi are close together (a few inches).
    EmonTx V3.4 - OpenEnergyMonitor Wiki
1 Like

@Robert.Wall I read this term as the $1 RF transmitter / receiver pairs which are fine for 10m or so.

1 Like

Hi @Robert.Wall and @GeorgeB yes I have the YHDC SCT-013 and the $1 receiver below.
I have a spare pi zero w so serial/USB to arduino sounds like the best approach, therefore no need for RF.

Turns out I may be able to use Home-assistant to read from the Arduino, which is my ultimate aim :slight_smile: https://home-assistant.io/components/arduino/
Alternatively, I will write a script on the PI to send the sensor data over MQTT.

Thanks for your advice, will post updates
image

Yes, but the emonTx Shield already has an RFM69CW on board.