Monk Makes Plant Monitor - Capacitive Moisture Meter - Temperature & Relative Humidity (ADA5587)

And to my complete surprise the power pack is much worse! Same parameters as before except the horizontal 2ms/div → 20ms/div because there is so much more to see.

3v3 supply still looks good, it shows slightly less ripple but probably due to lower sampling rate.

I’m probably further away from solving this mystery now than I was before!

Hi Mark.
Well this is a good one. For what it is worth 20mSec is 50Hz, Mains frequency. Might be significant might not, just keep it in mind.

At this stage I would transfer my attention to all the other bits. For instance are you using Arduino or RPi.

Monitor that 5V rail and start disconnecting things. There is something going awfully astray here. Have you available a 5V supply with some grunt like about 5A or so. Even more if you have it. I can’t get rid of the feeling there is nothing wrong with your sensor and there is something in your system pulling the power source down in a fashion which is near cyclic but just not cyclic enough to point the finger at any one source.

That yellow trace looks like something turned on to do something for about 100mSec. Do you have any WiFi or RF device powering up for this time?
Cheers Bob

At this stage I would transfer my attention to all the other bits. For instance are you using Arduino or RPi.

It’s an ESP32, running Tasmota, WiFi is always on and for these tests transmitting every 5 seconds.

So, I’ve now brought a pot plant inside to continue testing, and to my surprise all of the plug packs now work. Same results on scope too.

I figured the only change was putting the scope probes on Vin, GND & Vout of the regulator - and that was it. Probes on: and all is good for all plug packs, all cables and power brick, probes off: and only brick works.

Maybe I just need to add 10pF ceramic which is the 10x input capacitance of probe.

That didn’t work, so back to the probes.

In fact it is not the probes themselves but the connection they make from the GND pin to a ‘real’ ground through the scope.

If I remove all but just a single ground connection on probe, all power sources work (scope is off). If I disconnect that connection OR unplug scope from wall socket, back to only brick working.

So at the moment, if I’m using a plug pack GND needs to be really grounded, but if I’m using the brick it doesn’t.

Plug pack grounded - works but some deviations

17:00:32.039 MQT: [{"wetness":40, "] ...
17:00:37.066 MQT: [{"wetness":38, "] ...
17:00:42.065 MQT: [{"wetness":50, "] ...
17:00:47.065 MQT: [{"wetness":52, "] ...
17:00:52.066 MQT: [{"wetness":51, "] ...
17:00:57.066 MQT: [{"wetness":53, "] ...
17:01:02.070 MQT: [{"wetness":53, "] ...
17:01:07.066 MQT: [{"wetness":52, "] ...
17:01:12.067 MQT: [{"wetness":42, "] ...
17:01:17.067 MQT: [{"wetness":52, "] ...
17:01:22.068 MQT: [{"wetness":52, "] ...
17:01:27.068 MQT: [{"wetness":50, "] ...
17:01:32.320 MQT: [{"wetness":49, "] ...
17:01:37.319 MQT: [{"wetness":38, "] ...
17:01:42.319 MQT: [{"wetness":37, "] ...
17:01:47.070 MQT: [{"wetness":49, "] ...
17:01:52.070 MQT: [{"wetness":52, "] ...
Brick, no ground - works and results are consistent

17:03:07.117 MQT: [{"wetness":44, "] ...
17:03:12.170 MQT: [{"wetness":43, "] ...
17:03:17.177 MQT: [{"wetness":43, "] ...
17:03:22.180 MQT: [{"wetness":43, "] ...
17:03:27.179 MQT: [{"wetness":43, "] ...
17:03:32.181 MQT: [{"wetness":43, "] ...
17:03:37.180 MQT: [{"wetness":43, "] ...
17:03:42.180 MQT: [{"wetness":43, "] ...
17:03:47.182 MQT: [{"wetness":44, "] ...
17:03:52.182 MQT: [{"wetness":44, "] ...
17:03:57.181 MQT: [{"wetness":43, "] ...
17:04:02.182 MQT: [{"wetness":43, "] ...

Hi Mark

What do you mean by that? Scope traces good or still bad.

No. More likely the earth clip. You need to go over all your ground connections thoroughly. You are either fixing a problem with the earth clip or creating another one which cancels out the original.

Try with only the earth clip connected. If all OK under these conditions you should be able to remove the earth clip while the system is running and observe results.

I assume your scope connects to earth via the mains plug and it is not a battery tablet type.

As a point of interest I might be considered a bit naughty but I run my scope with the mains earth disconnected. I do this with a short bit of mains (300mm) extension cable with the earth wire hanging out to be obvious. If I want to reconnect the earth I just remove this short bit of cable.

I have found over the years particularly with Television you can often introduce problems that are not really there just by using the mains earth. In your case just the opposite seems to be the go. You fixed your problem.
Cheers Bob

Exactly

Hi Mark.
OK so you have just done what I suggested. Good.

Now we will “clutch at a couple of straws”. Where do you live. Are you on the power grid or a rural set up where you generate your own power. If the latter you could have any sort of strange set up.

I have actually dealt with a set up where they sometimes used our australian style of power socket. They generated their own power but had to accommodate both 120VAC and 240VAC equipment. Easy, they just centre tapped the 240VAC supply and connected that to earth. If you need 240VAC you connect between active and neutral. If you need 120VAC you connect between active (or neutral) to ground. Worked but caused some headaches.
Similar situation on board some ships with the added problem of 400Hz mains.
Cheers Bob

We are rural but on power grid, we are the only ones at the end of the transformer which is about 40m from house

Hi Mark
Methinks you have a bit of sleuthing to do.
You may have just found a bit of a problem you knew nothing about.
If I may make a suggestion. Don’t put a “band aid” on this by just connecting an earth wire to where the scope lead has been connected. Of course this might be the problem but it could also be a problem somewhere else that you will just cover up. You might do well to have your whole premises checked.

I can’t think there is a lot more that can be done remotely without actually sighting what you have unfortunately.
Cheers Bob

Power checks out, had an electrician go through it a while ago. Just checked that GPO myself, all good with my 240V tester and DMM.

Makes no sense though. USB power pack outputs are isolated from mains side.

I’m convinced it’s something to do with capacitance. On battery power really good consistent results and not much drift. On plug pack ok results ONLY if grounded.

I’ll investigate more at a later time. Thanks for your help so far @Robert93820

Hi Mark
One thing we have not seen.
Can you post a circuit of EXACTLY what you have and EXACTLY how it is all connected please. Just on the off chance that a fresh (as fresh as 88 YO can get anyway) pair of eyes might spot something not right.
Running out of ideas
Cheers Bob

Hi Bob,
Back on board now, had to drop everything yesterday to prepare for evacuation due to fires, all good now.

From yesterday, circuits
1A, 2A - oscillates, data corrupt
1B, 2B - get readings but std dev is high
1C, 2C - seems perfect perfect


Today I remove the regulator and tried circuit 1D, which was my very first starting point with tissue paper. The results similar to 1B and 2B, so I checked and earth is connected between GPO earth and GND on plant monitor through the PC & USB hub.

I think I’ve also found another issue with the monitor, but just lost the logs. What I saw on the chart before accidentally resetting it was that the wetness shot up from about 30% to 100% as soon as the temp dropped below about 10-20 degrees and then in the morning as it warmed back up readings went back to normal. I’ll capture again to be sure, but I’m thinking maybe the environment hit the due point.

And a final test circuit, same as 1C but no USB cable. 5V provided from bench lab supply (linear) connected directly to Vin and GND on dev kit. And I can confirm that the supply is isolated, no ground connection. Results look perfect.

Hi Mark
This is a worry. When you used your bench supply that is what I meant by another 5V supply with a bit of grunt.

it is “dew” (as in dew on the ground) not “due” but that is trivial. You are probably correct. When this happens you will get a rapid rise in moisture even if it is on the ground surface it probably would be detected by your sensor.

Now to the other bits.
I assume the sketches are EXACTLY as drawn with absolutely nothing else connected.
I think you have proven your set up is OK. as by connecting battery or isolated lab supply everything looks normal.
Your problems seem to happen when you power from anything plugged into the mains socket, this includes your PC. This still points to something funny back on the mains side of things. This is going to some sort of extreme but being rural I don’t suppose you would have a battery and sine wave inverter would you. If so you could try running your set up with that to attempt to pin point your problem. This probably needs to be a SINE WAVE inverter as the approximation type inverters are just that, very approximate.

Also another check. Can you try another GPO. I assume your GPO tester checks for things like reversed active and neutral. If you are using a double adaptor take this out of the equation. Don’t know about these days but some of these things reversed A and N on one side. Clutching at straws here but I am running out of ideas
Cheers Bob

I have one more idea
Councils have a system where off peak hot water, street lights etc are controlled by a “ripple” signal on the power lines. At my place it is large enough to cause my LED bedside lights to flicker quite annoyingly. Usually on the half hour after 10.30PM is most noticeable. Off peak water systems have a “ripple receiver” on premises. It does not matter if you have something like this or not, the signals are there.

I would have thought though the power supplies would have absorbed this but you never know. My lamp doesn’t.
You could try something. Do you have a 12V power source that plugs into the GPO, NOT your lab supply or battery. Feed this through a linear voltage regulator like a 7805 and power everything from this. The 7805 will supply about 1A continuous and will remove any signal ripple on the 12V mains supply. The sine wave inverter will do similar as there will be no signalling on that.

You have had a linear 3.3V regulator on the moisture sensor but any ripple could be upsetting your controller. If you can input 3.3V to your controller putting your linear regulator before everything might fix it.

EXACTLY

I do, I’m not sure if output is sine wave, I’ll go find it. I’ll also try the petrol powered generator, which I know has sine wave output.

Yep. Checked all GPO’s I tried, 2 different circuits in house and one in shed that’s about 50m from house. Power boards taken out of equation yesterday.

If I stop responding all of a sudden I haven’t lost interest but are probably evacuating or fighting fire. Emergency evacuation in progress real close to us in the Macedon Ranges ATM.


We could do with some DEW

Hi Mark
Understood. Beat of luck there I saw that on TV and Computer news yesterday and when I got your post Re fires I thought that might be where you are.
Had a couple more possibilities above . Post crossed over.
Cheers and hope you are all OK.
Bob

Thanks Bob,

Wow, never knew that.

I can try that.

Very unlikely. The dev board has it’s own 3.3V reg, the ESP32 is 3.3v. If there was a hiccup DUE to power supply problem it would be doing a lot more than changing a few bits in a UART stream, consistently. In any case the ESP32 does a great job of reporting low power conditions, I’ve tripped it many times in other projects, usually by introducing a high load on the power bus.

Yer so I looked around to determine earth connections. On the pole I can see that the transformer has a connection to a ground stake. Under our meter box, 50m away, I can see a ground stake, it looks old. Some years ago I put in a separate ground stake connected to my lightening protection for ADSL. Prior to this a lot of equipment got destroyed due to lightening on our long haul ADSL. Anyway I thought I would check the difference between that an a GPO earth. My DMM showed >10M ohm, DC voltage was 0 whilst AC voltage was 62mV. Not sure if this info is helpful?

Hi Mark
I would have expected a hell of a lot less than 10MΩ. 62mV in 240V is not much. I have not got too many ideas on how significant that is. The electricity authority will have a procedure for measuring these earths but I do not know any details. If you have a contact or an electrician mate they will have more of an idea. A nice new earth stake would not do any harm.

Two different earth systems can differ quite a bit. I was once at a TV transmitter installation where there existed a “mains” earth and a “technical” earth which was far superior. The difference, about 80VAC. The roofers picked that up. The roof sheeting was connected to technical earth and the electric drill being used was connected to mains earth. Every time the drill was withdrawn from the roof, BITE, enough to get quite a surprise and possibly fall off the roof.
Cheers Bob

Busted open test lead on DMM. Values are actually 800 ohms 350mV AC

The inverter says ‘modified sine wave’, but I’ll try anyway. The generator is a Honda EU10i but no mention in specs about waveform type.

In order to run these test consistently, I’ll take 100 samples at 5 seconds apart and calculate std dev. Yesterday, circuit 1A would have had a std dev of about 40 due to oscillating between extremes.

TEST 0: Battery → Inverter → USB Plug Pack and the rest wired as in circuit 1A. std dev 3.2. Looks good.

But for comparison I’ll first need to baseline the worst configuration, which is circuit 1A plugged into the mains, and guess what, it is now behaving better!!! Ahhhhh. Base-lining Circuit 1A just now gave a std dev 4.1 not 40. So I tied another plug pack and good results, and then a third that finally gave poor results. And again to be sure I’ll retest them all.

Test    Type          std dev
1       Belkin 12W     4.1
2       Apple 10W      3.2
3       Anko 15W      21.0
4       Belkin 12W    15.0   mainly due to two outliers
5       Apple 10W      2.1   improved slightly
6       Jackson 45W    2.7
7       Anko 15W       6.2   improved substantially
8       Anko 15W       5.5

So what has changed? I effectively shortened the connecting wires from 40cm to 3cm earlier this morning, but it is exactly circuit 1A, 4 wires connecting the two modules, nothing else.



Obviously this has improved the system substantially, but doesn’t explain the variation with the same plug pack tested only minutes apart. Unless it is something that varies on the mains, as you suggested Bob.

I’ll continue testing, using only one plug pack variant. L7805 has 100n on input, 10u tantalum on output

Test    Type                                std dev
9       Power Brick                           0.7  still best result, no variation over time
10      Battery -> Inverter -> Belkin 12W     4.4  but not a true sine wave
11      Mains ->  Belkin 12W                  5.2
12      Mains ->  Belkin 12W                  4.8  350 samples this time
13      Generator  ->  Belkin 12W             1.7  best USB solution we've seen
14      Mains ->12V 1A PP -> L7805            2.3  looking good but poorly wired
15      Mains ->12V 1A PP -> L7805            1.3  soldered on now
16      7.2V LiPo -> 7L805                    0.48 the winner, it is only changing between 59 and 60 (in 1000 samples)
 

I suppose I’ll have to conclude

  1. Poor power wiring was a major factor
  2. The earthing fix was a furphy, covering up problem number 1
  3. USB plug packs don’t filter the mains well, pity, they’re a great power feed for many projects
  4. Something is lurking in the 240V mains
  5. The 5V → 3.3V regulator on the dev board is not a factor
  6. My Apple 10W USB appears to be the best in my collection
  7. Best power source via USB connection: Power brick
  8. Best mains solution: Plug pack and regulator
  9. Best overall solution: Battery and regulator, makes sense as these devices are most likely to be used remotely.
  10. @Robert93820 , I’m sure you have more to add…
  11. I must also conclude, importantly, that the Monk Makes Plant Monitor appears to work well and is stable but needs a VERY clean power source.

Hi Mark
Well, that is pretty comprehensive.
We will start with the inverter. “Modified” sine wave was the word I was looking for when I said approximation. Modified is right as it usually looks like a cross between a square wave and a sine wave with about 100% 2nd harmonic distortion. Not usually recommended for sensitive circuits. but we tried.
Your conclusions:
1, 2: Probably.
3, 4: I still think there is something about your mains that the plug packs don’t like. The difference between them and your lab supply is plug packs are switch mode and lab supply is linear (analog). The analog supply seems to handle any crap far better which I suppose is why these things are still linear supplies, a lot cleaner. Still a case for analog in this digital world I think.
7: You seem to have proven that.
8: 7805 is OK for 12V or 9V plus pack. This IC has a drop out voltage of 2V or a little more. This means that at about 7V input it will start to lose control.
9: If using a nominal 7.2V (2S 18650?) the 7805 will be a bit marginal. Change to a “low drop out” regulator such as a LM2940CT-5.0. This is a fixed 5V regulator good for 1A and a drop out voltage of 500mV which you can get down to about 6V input with full control. Available Jaycar cat no ZV1560.

The linear regulator is very good at removing ripple and any crap that stays above the drop out level. If such interference is so bad or the regulator is operated close to drop out it will allow lower voltage excursions to pass through. I don’t think anything would stop something this bad but your battery has an extremely good chance of staying clean.

I would still do some investigation of your mains supply. Load up those plug packs to about 0.5A and see if you can get some bad scope screen shots. Or even feed the mains into a low voltage transformer terminated with a resistor and this should display something like what the mains look like. Time of day will play a part here if the problem is off peak ripple signals. If you can find the right ear to bend you might have a case for an investigation by the electricity authority. Check with your friendly electrician. Others may well have problems also.
Cheers Bob

20 hours of data and it’s still looking good in the hot house. Just don’t use measurements taken at night, due to dew.