Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 11:08 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : MM170 - Voltage Monitoring

     Page 1 of 2    
Author Message
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 871
Posted: 12:56am 06 Jul 2019
Copy link to clipboard 
Print this post

MM170 - How Reliable is Voltage Monitoring?

I have been having problems with power to my remote weather station (MM170 - it has GPS for time, DHT22 for temperature and humidity, plus wind and rain sensors).

I am occasionally seeing reported voltages of between 3.2 and 5.6V (on what is meant to be 5V). This is beyond the range of most of the components but I suspect it may be a false reading rather than power supply issue (the system keeps working - with no smoke).

1) Any suggestions as to what might be happening - is once every 10 seconds too frequent to read the voltage?
2) What is the best way to smooth an input voltage of between 3 and 6 to give a clean 5V?
3) Could it be that my 240V mains have an issue (very old wiring- about??? to be demolished) - how can I check other than standing in the shed with a multimeter (I'm happy to build/buy a device)?

(I have tried a variety of 5V supplies, including an "Official Pi 3" from RS. On the bench they all seem to give 5V (+/- a little).
The 5V is good for the peripherals and a MCP1700 drops the 5V to 3.3 for the MM.

I also take an analogue voltage reading (on pin 24, with a 10K/10K divider and a factor of 1.976). This gives good comparison with a DMM on the bench and every time I check it in the field it is OK.
Every 10 seconds the MM measures voltage on pin 24 and keeps a running value of the maximum and minimum voltages. These are sent via an HC-12 every 10 minutes (along with the current voltage etc).
When I see a weird voltage I use Hyperterm to monitor the messages - to check the veracity of my in-house station - it is reporting OK.)

Cheers,

Andrew
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 01:15am 06 Jul 2019
Copy link to clipboard 
Print this post

If you have enough memory available and the 'mite is not too busy, try reading the voltage every second and storing in an array. Make it as big as you like and then when you see a strange reading, download the last x readings.

This is what I do for a solar panel monitor.

Jim
VK7JH
MMedit
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 871
Posted: 01:27am 06 Jul 2019
Copy link to clipboard 
Print this post

Thanks Jim,
I'm happy to disrupt the "normal" operation by adding sentences.
I can read and download the Voltage every second - and store it on a SD card in the office, along with all other sentences (on a separate MM170 device).

Can you think of any other parameters I should download to the SD?

Cheers,

Andrew
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 01:33am 06 Jul 2019
Copy link to clipboard 
Print this post

Good morning Andrew.

I am not sure how you are monitoring the 5 Volts. You have a 2 x 10k divider on pin 24, is that the only method or is there a second system.
It will be difficult to "smooth" 3.2V to 5V but there are buck boost devices.
But an electro on the point where you measure the voltage may help.

Peter
 
BrianP
Senior Member

Joined: 30/03/2017
Location: Australia
Posts: 292
Posted: 01:35am 06 Jul 2019
Copy link to clipboard 
Print this post

As the system keeps working it's very likely a transient related issue. A smallish (1k) resistor & large-ish ceramic capacitor (47uF) on the measurement pin should help to smooth out the voltage reading. The other very important parameter is a consistent Vref volts on the micro...

Just my 2c worth...

B

edit - PeterB beat me to it...

edit - the electro needs to be a very low leakage type which why I suggested a ceramic.Edited by BrianP 2019-07-07
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 01:44am 06 Jul 2019
Copy link to clipboard 
Print this post

BrianP, Why? (low leakage)

Andrew, If you replace your voltage divider with a 1.5V battery, you can be sure that will not bob up and down.

Peter (that's in case Grogster is reading)
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 871
Posted: 02:17am 06 Jul 2019
Copy link to clipboard 
Print this post

Hi Peter, Brian (and Jim) - many thanks,

I only have the 2x 10k on pin 24 with no other voltage measurements. What more would you suggest I try?

How can I check the voltage on Vref (pin 28) (during operation - its up a pole in the garden. On the bench there is never a problem)?
(At present it is a straight connection to the MCP1700 3.3V with a single 100nF Cap (Ceramic) across it to earth). Geoff uses 2x 100nF - should I add a second?

At this stage I'm not seeking to smooth out any transients on pin 24 but identify where they are coming from, eg is it the power supply or within my circuit/code (then I can smooth them . . .).
I guess your logic is that if the caps smooth it out so it disappears then all is well?

A very real option is to switch from my veroboard construct to one of BigMick's or an Explore 28 - I have a number of each. I was hoping to exclude the power supply before embarking on a redesign.
I'm very open to suggestions . . .

Cheers,

Andrew
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1642
Posted: 02:27am 06 Jul 2019
Copy link to clipboard 
Print this post

The manual says:

  Quote  The measurement of voltage is very sensitive to noise on the Analog Power and Ground pins. For accurate and repeatable voltage measurements care should be taken with the PCB design to isolate the analog circuit from the digital circuits and ensure that the Analog Power supply is as noise free as possible.


Perhaps decoupling the Analogue power supply pin (28) would help. Try 100R and 100uF for a start. A check on the routing of the Analogue ground pin (27) would help. Check that the connection of the zero reference of the voltage that you are measuring goes to pin 27 and not general ground, connecting all grounds to a star point may help. Also a capacitor on the the Analogue input pin should help - an electrolytic or tantalum would be OK.

I can't find it now but I read somewhere that MMBasic takes several readings for an analogue input, discards the maximum and minimum readings and averages the rest so your "weird voltages" cannot be some super short transient?

Bill
Keep safe. Live long and prosper.
 
BrianP
Senior Member

Joined: 30/03/2017
Location: Australia
Posts: 292
Posted: 02:31am 06 Jul 2019
Copy link to clipboard 
Print this post

PeterB wrote:
  Quote  BrianP, Why? (low leakage)

Surely to not load down the measurement pin (in series with 1k resistor)
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1642
Posted: 02:42am 06 Jul 2019
Copy link to clipboard 
Print this post

Re low leakage: We are only looking at DC measurements at tantalum typically has a leakage of 1nA - that's not going to have a significant effect on the reading. I'm with PeterB on this

Bill
Keep safe. Live long and prosper.
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 02:45am 06 Jul 2019
Copy link to clipboard 
Print this post

Brian

But the leakage through any self respecting electro. would have zero impact on the reading. Anyway, he's got the 2 x 10k divider which is 5K.
I'm just trying to pick a fight
I do think replacing every thing with a battery would provide some clarification.

Peter
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 02:54am 06 Jul 2019
Copy link to clipboard 
Print this post

Bill.

At last, somebody agrees with me.
My wife did once, 55 years ago.

Peter
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1642
Posted: 03:24am 06 Jul 2019
Copy link to clipboard 
Print this post

I also agree that replacing the analogue input with a battery connected directly to the AI pin and analogue ground pin (27) could clarify whether the problem is with the analogue input circuitry or elsewhere.

Bill
Keep safe. Live long and prosper.
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 03:50am 06 Jul 2019
Copy link to clipboard 
Print this post

Two in one day, My head is beginning to spin.
Probably because I have a very small brain but I have always found it useful to reduce a system to the minimum that still fails. Having it up a stick is not helpful and that brings me to the idea of putting the temperature sensor under a tank with plenty of air movement and no sun. That was the only way I could get close to the official figures.
Rain gauges do not work well in that place but then they don't work well anywhere.

Peter
 
BrianP
Senior Member

Joined: 30/03/2017
Location: Australia
Posts: 292
Posted: 07:31am 06 Jul 2019
Copy link to clipboard 
Print this post

I completely take the point about tantalum leakage, BUT does it vary much with temp? Could still screw with the readings
I vaguely remember that in the past I found some electros actually generating a small voltage of their own - that certainly would mess with the voltage reading!

B
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 07:44am 06 Jul 2019
Copy link to clipboard 
Print this post

B.

So you do want a fight?
Leakage and your "phantom voltage" may change the reading by a very small amount. Andrew is seeing volts of change.
So there

Peter
 
BrianP
Senior Member

Joined: 30/03/2017
Location: Australia
Posts: 292
Posted: 09:25am 06 Jul 2019
Copy link to clipboard 
Print this post

You win!
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1642
Posted: 09:48am 06 Jul 2019
Copy link to clipboard 
Print this post

Bugger! I was just going to back Peter up.

Anyway Peter I also agree that Cap Sav is good.

Wine is the answer - what was the question?

I stand by my suggestions above and don't forget the 0.1uF monolithic capacitors across the DC and analogue power supply pins.

Bill
Keep safe. Live long and prosper.
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 10:25am 06 Jul 2019
Copy link to clipboard 
Print this post

Rouge Homme to be precise.

Andrew did say that his system is OK on the bench but not up the stick. Is it a function of distance or interference?
I do have a couple of spare small boards that use the 170 and have 3.3V & 5V regulators plus I2C, plus other pins. They are useful for trying things out. I can send one if you (Andrew) would like.
Now, what was the question?

Peter
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2950
Posted: 02:03am 07 Jul 2019
Copy link to clipboard 
Print this post

G’day Andrew, All,

2 questions I have..

What is the maximum power draw through the MCP1700? (It is Rated at 250mA Max)

Do you have the 2 x 1uf ceramic caps fitted? (One input to GND, the other output to GND)

I also recommend fitting some batteries to emulate the power source you are monitoring as you know they won’t fluctuate. If you see fluctuations then it most likely is your code or a, to date, unknown firmware bug.

I would use 3 cells to give 4.5v to get closer to the expected 5v you are trying to monitor.

I would also try using the MuP to see if it does the same as your vero board..

Another thing is the monitoring wires, keep them well clear of any thing that could inject interference or RFI. That could be your problem, try using a 2 core plus shielded cable for this (only GND one end) a shielded cat 5 cable might be the go here.. or a stereo cable.. (red/white RCA audio cable lead)

You do have a wireless transmitter in the unit so it might be injecting noise into your sense lines..

Keep your sense lines as short as possible and the transmitter as far as possible from them (maybe fit a GNDed shield between them)

My 2c worth

Good luck

Regards,

MickEdited by bigmik 2019-07-08
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
     Page 1 of 2    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025