I have a pyranometer with 0-350 mv output and would like to log its output. At the moment I’m using a datalogger, but would like to monitor the insolation through an emonTX, which I use for power and temperature logging. I have a spare CT input but i think these are setup for an AC input if I understand correctly. Is there any easy way to get this DC signal logged?
You definitely cannot use the CT inputs, without removing most of the components.
But it is possible. The first problem is that you cannot have temperature sensors that have their power switched on and off under software control.
There is one analogue input available - ADC5. In the standard configuration and sketch, it is used as a digital output (D19) to provide switched power the temperature sensors.
It’s input range is the normal 0 - 3.3 V = 0 - 1023 counts, and here is your second problem. You will be using only 10% or so of the available range, so your insolation values will be in roughly whole number percentages as you will only be using the bottom 108 steps of the ADC. Is that adequate? If it is, then you must disable everything in the sketch that relates to D19, and use it as an analogue input. You can have your temperature sensors, but you’ll need to connect the temperature sensor power direct to the 3.3 V on the terminal strip. Your pyranometer output will reference GND and the output will go to ADC5/D19 on the terminal strip.
Then of course you will need to edit the sketch to read and calibrate the value, and include it in the radio data package that goes to wherever. There’s no point in making it other than a byte value as you can only get integer values in the range 0 - 108 or so.
OK - probably not enough resolution. I guess I could use a low power instrumentation amplifier to increase the output but I don’t want to increase the power consumption of the TX, and also not comfortable with editing the software yet.
How accurate is your sensor? That is something to take into account. If it is much better than 1%, then you have a good reason for adding an amplifier. I didn’t mention it because it is difficult to amplify direct voltages with any degree of accuracy/stability, and as you say it will cost current - you would probably need to arrange a separate 5 V power supply and the inbuilt one from the a.c. adapter might not have any spare capacity (that depends on your a.c. adapter and the supply voltage).
It is stated as ± 5%, so probably not a lot lost in using the reduced ADC span. Full output (350 mV) corresponds to 1750 W/sq m, so with 108 steps that would mean about 16 W/sq m resolution which is probably OK for my purposes. Currently I have an emonTX V3 with only a single temperature sensor connected through the RJ45, and I gather that means the D19 isn’t used (if I understand correctly, it is used for sensors connected via the terminal block). So I could use your suggestion I think.
My desire is to have insolation, temperature and house power consumption all managed through the emonBase, rather than a couple of different systems cobbled together.
Is editing the sketch the same as normal Arduino - ie use the IDE and upload?
Believe it or not, I’ve never had anything to do with an Arduino. As far as I know, it’s the same. Certainly, the Arduino IDE and FTDI programmer works for me.