I have a project of which I have 5 units in use. One has had the A0 die. It no longer reads more than 50 with Analog read regardless of the voltage up to 5V applied to it.
The board is a pro mini. The A0 is connected to a physical pullup of 10kohm, then there are three accesories attached to it, the pro mini code recognises the accesory based on the reading on A0 when attached. One accesory uses a 0ohm to ground, one a 10kohm to ground and one a 47k to ground.
this normally gives a good range of values that are clearly distinguishable from each other, and the code has no issue determining which accesory is attached.
However, on one of the units, with the 0ohm to ground accesory attached for a prolonged period of time, A0 has ceased to work as expected, and the values only range from 1 to 45 on the ADC when 0 and 5V are applied.
Does anyone think that my use case may have damaged the pin?
If not, then I am stuck with two alternatives,
someone connected something else to the pin and isnt telling me
it just became defective (not sure how liklely this it)
It is an sparkfun 5v-16mhz Arduino Pro mini. (in theory) I say in theory because all of the ones I have are labelled as 5V on the packaging and there is a place in the silk screen on the reverse that indicates 5V or 3.3V.
The one with the dead A0 pin does not have markings on the silk screen and the packaging is long since thrown away.
I have however tested on a new one and the PCB cleaner I use to get rid of the flux residue removes the marking on the silkscreen which appears to be made with a sharpie. So I think its safe to assume it was marked as 5V.
I can measure the voltage via the pullup to 5V, but the 5V comes from a regulator elsewhere, so should be good. It is the same 5V source being used to power the Arduino
Is it possible your "voltage from elsewhere" for the pullup deviated from 5V? For example, was mis-plugged to 12V, or whatever voltage you're feeding Vin? Or, that regulator failed, and has been replaced? Because that would surely damage the AO input structure.
The 5V regulator is powering two Pro minis, and several other analog pins are being pulledup via 10kohm resistors to the same power source, none of the other pins are damaged, both arduinos run ok.
It may have fluctuated, but there is no way to tell unless it happens again. For now it is outputting the correct voltage.
of the pins being pulled up via the 10kohm to 5V, this is the only one damaged, but it is also the only one that is then later pulled to ground by accesories as explained in the original post.
Is it possible the external regulator was powered and providing 5V, while the Arduino wasn't powered? It's not a guarantee to damage the processor, given the 10k resistor, but certainly one should not apply power to Arduino pins when the processor has no power - that forward biases protection diodes internal to the chip, and can damage them through overheating; I'm not sure if 10k, in this case, is enough resistance to limit the current to safe levels.
that is a possibility.
the unit is battery powered, the arduino code monitors the battery and blocks the code when the power is low, but there is not autoshutdown yet.
This particular unit was left to self discharge several times. IE the battery was left connected but the unit was in theory powered down. I am currently checking what parasitic drain there is in this scenario, but I think that its more likley that the unit was left powered up.
in any case, the battery is LIPO and the BMS shut off the output. What effect this has on the 5V regulator I do not know. Perhaps some spiking?
in the simple event that the 5V regultor powering the arduino browned out, that could have had some part to play, however it poweres the pullup and the arduino itself.
maybe a cap discharging on the 5V line as the BMS shuts off?
D12 is connected to another PCB which regulates the battery charging, its connected to a GPIO on that pin which pulses to indicate charging, when the unit is left charging and the power switch off, the battery charger is still able to be powered, and this GPIO will output its signal with the arduino off, I have them connected with no resistor at all as the voltage is always under 5V.
Is there any connection to D12 and A0 internally on the pro mini? I had been using a portenta h7 in the past and some pins were multiplexed internally which caused issues using certain analog and digital pins at the same time.
Electronics do not make choices to work or not work. "Someone" is 97% cause of failure. 2.9??% is indirectly caused by "someone." The rest is "...units failing per billion operating hours..."
Op also said "using 10k pullup resistor" which to me means just one thing.
So before you start condemming peoples comments, best you familiarise your self with the Arduino terminology.
Apart from that, just another reson to read the forum requirements and provide as much info as possible.
In this instance a schematic and code.
What you say here has to be the cause, I have replaced the arduino pro mini, left it testing for weeks and it was fine, then I left the unit charging whilst powered off.
The scenario is that the battery charging PCB has a flashing LED to indicate status, the Arduino knows the charger is connected when A0 is grounded, and changes functionality accordingly. then the pulse of the GPIO pin coming from the charger PCB is interpreted in code.
However, when the main power switch is off, and the charger is connected, the arduino is totally powered down, but receiving 5V pulses on D12. I checked there is no power supply voltage to the arduino at all, the Ground connection is cut along with the positive via the main dpdt power switch. There are no aditional milliamps running through the battery when comapred to it being disconnected from the arduino.
Therefore, it is the case, that when the switch is off, the arduino has no power at all, yet receives this 5V pulse, there can be no voltage differential across the pin as there is no ground connection.
Could this do the damage as described in the scenario you lay out in your previous post? Ie damage a pin? I am investigating now to see which pin has again been damaged, but i deliberately left the arduino in this situation, IE receiving the pulse for 7 days whilst powered off to see if it could be that which caused the damage, and it is damaged.
That, unfortunately, is knowledge only a chip designer could really comment on authoritatively. Variables to be considered include, voltage, duration, heat dissipation vs heat buildup(considering either requires knowledge of chip topology, heat conduction to ambient, etc. etc.), none of which I have any knowledge of.
However, I do know the manufacturers do publish datasheets that itemize tolerances and conditions for each type of pin. A maximum of "VDD + some value" is to be taken seriously, because it's not there just as page filler - they know that there are bad things that happen when that condition is exceeded.
That being said, there are countless examples of these limits being exceeded without, seemingly, repercussions. I've always presumed that that happens because a manufacturer needs to be conservative in the ratings published, so some or all of the product will tolerate much worse, but all of the product will tolerate the specified exceedance.
Sorry, I can't be definitive, it's just something to be wary of.
By the way, this is one of my reasons for using on-chip pullups when possible to do so - there's no chance of the on-chip pullup being powered when the chip isn't, after all, so this form of risk is eliminated.
yes, i have used LOW logic throughout the code to be able to use onchip pullups where possible, however i didnt find them stable when actually using them , so i have implemented the external pullups to stabilise everything,
I have to investgate to find what has actually been damaged, there is no point speculating about it any further, however it seems that its a similar scenario to the first, in the only way that I could think of possibly causing an issue based on your previous comment, and it died, so it seems likely to be the case.
I will increase the series resistor and see how high I can take it and still get a reliable Digital read on the pin, and possibly add a small transistor to cut the 5V singal in question until the arduino is booted up.
Thanks for the comment, it gave a good clue as to what is happening, I have read elsewhere that VDD +0.3V is a max on other MCUs, I am hunting that for this one, but I am at VDD +5v, so its safe to say its a problem I didnt previously know existed.