emonTx connecting to arduino IDE using programmer

Great, thanks Rob.

Hi Rob, the emonTx has stopped communicating again. I’ve asked somebody on site to turn it off and on again, but am concerned this has happened twice within a few days.

Do you know if there is a way to ensure communications (would that be just by connecting directly to the emonbase using one of these cables for example USB to TTL Serial Cable– The Pi Hut ?) I can do that for 2/3 of my emonTx’s

The emonbase is powered using usb. Do you think it would be better to power it using a 3 pin plug? I’m wondering if that is losing power and then not reconnecting to the Tx

What, the emonTx, or the Base, or both? Turning the power off to the Raspberry Pi unnecessarily is definitely a bad idea as it can lead to corruption of the SD Card.

I don’t understand what you mean there. To begin with, what do you mean by “emonbase”? Is it a Raspberry Pi with a RFM12Pi or RFM69Pi https://shop.openenergymonitor.com/rfm69pi-433mhz-raspberry-pi-base-station-transceiver/ attached? That needs a 5 V d.c. USB power supply, it could be from a https://shop.openenergymonitor.com/5v-dc-usb-power-adapter-uk-plug/ or you could use battery-backed supply designed specially for the Raspberry Pi. Eventually, power must come from the mains supply.

Just the emonTx. I’ve had issues switching off the emonbase before!

The pi with the RFM69Pi attached. I’m currently powering it with a usb cable into a usb socket (something like this https://uk.rs-online.com/web/p/plug-sockets/1953564/?cm_mmc=UK-PLA-DS3A-_-google-_-PLA_UK_EN_Fuses_%26_Sockets_%26_Circuit_Breakers_Whoop-_-Plug+Sockets_Whoop-_-1953564&matchtype=&pla-301957763671&gclid=Cj0KCQjwyN-DBhCDARIsAFOELTk00TmmEMknuBN25RXVmOoJb5mZ6AJOWoayX2em5bE_uYk8Wq8EfIEaAlrjEALw_wcB&gclsrc=aw.ds)

I’m looking at getting a PiZero for the other locations in case this keeps happening. Would you recommend getting the WH version with the soldered Header?

Ouch. I don’t think I would trust one of those to power a Pi. They might be OK, and they are probably OK for charging phones overnight, but how clean the 5 V is would be a matter of concern.

However, if re-starting the emonTx only was enough to get it communicating again, then the problem has to be the emonTx end. And the only way I’ve succeeded in locking up an emonTx is with a dodgy power supply - if the power dips far enough to screw up the radio, but not far enough to cause it to reset even though the main sketch has, then it can lock up, because the hardware reset on the radio is not used. If that’s what is happening, then I suggest either powering it with a clean 5 V USB supply, or return to a variant of Plan A, i.e. direct serial connection to the Pi’s GPIO, and disable the radio in the sketch. I can’t vouch for the serial-USB connector. I would expect it to be OK, but I’ve never used one.

Neither am I a Pi Zero expert, @borpin is best placed to advise you on that.

It looks as though re-powering the emonTx hasn’t worked. I’m still not receiving anything through emoncms.org, so maybe it is the emonbase power supply. I have a plug socket available so i’ll try using that instead of the usb option.

I would like to try connecting via serial to the emonbase though as it sounds more robust (although i’ll still have rf connectivity for one of my emonTx’s on site). Can you confirm that the sketch you built doesn’t need any modifications (except switching off rf) when I connect via serial? I’m assuming I can connect per this wiki - EmonTx V3.4 - OpenEnergyMonitor Wiki. It would also be good to understand what I would need to do if i’m connecting to 2x emonTx with a single emonbase. Could I connect one via serial and one via rf or would it be better to do both via rf and have some delay in the signal?

@borpin - Rob, has suggested you might be the right person to speak to regarding PiZero connectivity?? I’m looking to connect a PiZero to an emonTx per this thread 4 CT emonBase using emonTx and Pi Zero W My question is do you know if there will be sufficient power for me to run the PiZero off the emonTx and also use a usb/Ethernet adapter to connectro to the LAN network? Thanks

I run a serially connected PiZero / EmonTX combo, where the PiZero is powered by the EmonTX which itself is just powered by an old Phone charger without issues (I do have an AC/AC PS as well). It is Wi-Fi but don’t see an ethernet dongle being an issue. Turn off Wi-Fi on the Pi to reduce consumption further.

There are several threads here about connecting up serially.

I’d do 2 PiZeros with one just running emonhub and sending data to the other (or a completely separate instance of EmonCMS).

Thanks for your help @borpin.

Unfortunately i only have one Ethernet connection across the two cupboards that the emonTxs are stored. So I think i’ll need at least 1x RF connection to the emonbase.

The other way to do it is use a USB TTL and plug both into the EmonTX - again there has been discussion about this method.

The drawback (IIRC) is that you need to bind a specific USB device to a specific port so after a reboot the inputs are not switched.

[edit]
Yes, look at this thread. Using 3 No. EmonTX with EmonBase - #24 by AntiGrav

sorry @borpin i wasn’t very clear. I have two cupboards on either side of a large room. One has an Ethernet connection and the other doesn’t. My current thinking is to use a single emonBase and connect via serial into one emonTx and RF into the other one in the other cupboard. They are only about 20m apart so RF signal shouldn’t be a problem.

1 Like

I had the following connected yesterday:

emonTx serial connected to PiZero
PiZero power connected to mains via USB
PiZero Ethernet connected via adapter dongle (a blue light comes on when plugged in)

I managed to get emonpi on the browser and was trying to get the serial communications to work when everything just shut down.

The adapter dongle no longer displays a blue light.

I’m wondering if I should have had power from the mains as well as from the emonTx going into the PiZero or if this is usually fine. It seems like I have blown the adapter??

Power only from the emonTx wasn’t sufficient to get it up and running. The green light by ‘ACT’ never came on.

At first sight, that appears to be a possibility.

Did you have the programmer and the PiZero both connected to the same Rx/Tx lines? If you did, there’s your problem - you must never connect together two ports that are both driving an output.

If you didn’t do that, then you need to know that there is a limit to the output current that the programmer can supply - 450m mA (it’s documented on the Programmer’s page in Learn). I would have expected it to shut down on overcurrent, but I can’t see a mention of how it is protected, or indeed if it is. So that too might have damaged the programmer.

I suggest you try the programmer on its own, looping Tx to Rx, and see if you get the same data back as you send.

Thanks @Robert.Wall I have sent the adapter back, fingers crossed they’ll send me a new one. The SD card seems to have been fried too. Can’t remember exactly what I did as I was trying all sorts out.

I’m set up on the Pi4 now and getting there (i’ve asked you a question on another thread about the sumPower you helped me with before)

I’ll be sure not to connect to the same lines next time!

Hi @Robert.Wall i’m looking to get these CT clamps mV Split Core Current Transformers | Hobut specifically the 120A and 250A. Do you know if these will work with the emonTX and will I have to make any changes to the calibration.

Those c.t’s (they are not “clamps” - that’s something I use when I glue pieces of wood together) are 0.333 V output, so the answer is, yes, they’ll work, but you’ll only use a third of the input voltage range of the emonTx, plus you’ll need to remove the burden resistor inside the emonTx, or you’ll get even less voltage out of it. What that means in practice is, the ability to measure at low currents is impaired. If you’re not interested in anything less than about 10% of rated current (i.e. 3% of the emonTx’s input range), you might get away with it. It’s probably worth an email or phone call to see what the accuracy and phase error curves look like. Otherwise, and sadly, because they’re a good local firm, they are definitely not recommended.

If you do go with them, the calibration constant is the primary current that would give 1 V at the emonTx’s CT input.So for the 250 A version: 750 with the emonTx’s burden resistor removed.

Thanks @Robert.Wall do you mean a call with Hobut or yourself? I’d love to be able to discuss this with you as to be honest i’m not sure what the best option would be. I’m struggling to find c.t’s with 250A input and 50mA output as you suggested. I tried getting ones from the ‘Use in N.America’ page, but they have the same output of 0.333V

I meant phone Hobut - they should know more than I do about their c.t’s. The question I’d ask would be, is it possible to remove the internal burden (I’d guess not because it looks moulded in, and no way to get inside other than destructively) and if it is, what’s the current ratio without the burden? Or, do they do / are they likely to do a 1 V version or a current output version?

I’ll put it to Glyn & Trystan that the 0.333 V output is a recognised standard, and a local firm that does that range - which, let’s face facts - is pretty useful for domestic monitoring as well as small industrial, is an additional argument for a 1 V or 1.1 V ADC input range, rather than the 3.3 V range we have at present.

What about this: Learn→Electricity Monitoring→AC Power Theory→Use in North America→YHDC 100A/200A/400A Split core current transformer SCT023R

That says the 200 A version is good to 300 A, and if you get the full data sheet, there’s a graph that shows, with a 100 Ω burden, it’s linear up to around 500 A, with a voltage output of about 22 V. So I think from that you should be OK with a burden of (ideally) 17.6 Ω, which means adding an 82 Ω resistor in parallel with the one on board the emonTx, to bring the voltage down a little below 1.1 V rms @ 250 A. I think it deserves a second look.

Note: The core is steel (not ferrite) so it’s even more important that the c.t. has a burden at all times it is on an energised conductor. (The 82 Ω should be enough to prevent damage or danger.)

Thanks again @Robert.Wall

@glyn.hudson & @TrystanLea do you have any experience working with >100A c.t’s with the emonTx? If so could you recommend a particular c.t?

I’d prefer not to have to start adding additional hardware like resistors if possible.

I don’t really understand your problem. This c.t. has flying leads, you need to get those into a 3.5 mm plug (which could be very tight), or you need a junction box to change the wire size, which is where you’d mount the parallel second burden.

The problem is, there’s a very limited choice of c.t’s that have the equivalent output to the “standard” YHDC SCT-013-000. Or put the other way round, the emonTx is designed for that one c.t. and so has a very particular input requirement and no easy way to get around that.

If you want zero hardware change, the only choice I know of is the 400 A version of the SCT0023R, and then you’re working it over only a little more than half it’s rated current - the effect of that will be to almost double the current below the accuracy falls away. You know your application, all I know is what you’ve written. If that won’t be a problem to you, then the SCT023R - 400 A version would be my recommendation.

Hi @Robert.Wall i don’t have experience of mounting burden resistors or connecting flying leads. I also want to reduce the risk of installing something that could be dangerous, which is why i would prefer an ‘off the shelf solution’ if it is available. If its not, and so far you and i haven’t found anything, then i may have to go down that route.