Arduino Forum

Using Arduino => General Electronics => Topic started by: lennon-pledge on Dec 06, 2018, 08:03 pm

Title: 2 Questions on how to use digital and analog pins (for specific scenarios)
Post by: lennon-pledge on Dec 06, 2018, 08:03 pm
How's it going? I am ordering a couple custom circuit cards that will be able to fit on to an Arduino Mega 2560. 

I have 2 LM35s going to A2 and A3 analog input pins on Arduino.
I have an encoder going to input A15.
I have an LCD going to pin 14 (TX3).


Here's the first question:

In order to get the best readings out the LM35s, should I pull low all other analog pins to prevent random noise?



And the second:

When testing a demo board, I destroyed pin A15 and (consequently) the whole bus.  To counter a scenario like that happening again, I decided to put 2 separate solderable jumper pads going to distinct digital and analog pins in the event one pin breaks.
So, my trace for the LCD has the original input to 14, plus a jumper to 16 and 18.  If 14 fails, solder the jumper to 16 and use that instead.

Is that a good counter to the problem of destroying pins?



Thanks,
Anthony
Title: Re: 2 Questions on how to use digital and analog pins (for specific scenarios)
Post by: PaulRB on Dec 06, 2018, 08:27 pm
First question: No. As long as the unused analog pins are not read by the sketch, unused analog pins will not cause extra noise in the analog pins that are used.

Second question: No. Arduino pins are only destroyed by badly designed circuits. They don't randomly destroy themselves. So don't have cards made containing badly designed circuits. Then no jumper pads will be needed. To avoid having cards made with badly designed circuits, prototype them first on breadboard or prototype board, and post the circuits here for review.
Title: Re: 2 Questions on how to use digital and analog pins (for specific scenarios)
Post by: JohnRob on Dec 07, 2018, 06:28 am
Regarding the 1st question:

If you assign them an output function there will be no noise to be concerned about.  At least not from the other Ax pins.  I would also plan on some RC filter at the board for the LM35 signal(s).
Do you plan on the LM35 going below 2°C?


Regarding your 2nd question:

The processor is a single chip for all the functions.   "Destroying" one input or output will damage the chip and may render the remainder suspect.

When you say "custom circuit boards"  do you have control of the design?  If so I would be inclined to add protection components for all the I/O you plan to use plus some extra.

Title: Re: 2 Questions on how to use digital and analog pins (for specific scenarios)
Post by: Grumpy_Mike on Dec 07, 2018, 11:13 am
Quote
The processor is a single chip for all the functions.   "Destroying" one input or output will damage the chip and may render the remainder suspect
While agreeing with you, in practice it has been found from personal experance and those on the forum that localised damage to a single pin can leave the rest of the processor apparently unscathed.

However I wouldn't use that processor in anything other than a test / development role.
Title: Re: 2 Questions on how to use digital and analog pins (for specific scenarios)
Post by: wvmarle on Dec 09, 2018, 04:35 pm
Confirmed, you can destroy single pins and not destroy the whole thing in the process.

Works even better for me with the ESP8266 than with the ATmega328p. Probably the first simply has more fragile inputs (5V through a 10k resistor is apparently enough).

I just tossed out affected boards as too often the broken pin gets in the way and I don't trust the board itself any more anyway. Luckily they're cheap.
Title: Re: 2 Questions on how to use digital and analog pins (for specific scenarios)
Post by: MarkT on Dec 10, 2018, 01:40 am
You can also destroy pins and take out the entire device - though that's more likely with over voltage events,
Overloading a pin causes local overheating on the die as the output FETs for the pin struggle, which if it
exceeds 175C or so will being to degrade the integrity of the device.  My suspicion is that if you overload a
pin and it fails locally, there may be degraded performance in nearby pads  (on a chip a "pad" is the input/
output circuitry associated with a single I/O pin)