Unused Pins on Arduino 's & Raspberry 's

You can talk about anything flight (simulation) related here

Moderators: russ, Ralph

Message
Author
User avatar
nnyerges
Posts: 81
Joined: Sat Jun 18, 2022 6:28 pm

Unused Pins on Arduino 's & Raspberry 's

#1 Post by nnyerges »

There is a lot opinnios about if unused pins on Arduino's and Raspberry's boards must be set as input, outputs, held to ground or vcc, especially with "analog" pins that can be sources of noice. I particually program all unused analog pins of Arduinos to INPUT PULLUP and somecases, just as simple unused OUTPUT. This can be done by software if your programming your own sketch and communicate with Air Manager using MessagePort.

But how about Arduino and Raspberry devices managed directly by Air Manager/Air Player scripts? How does Air Manager/Player mannage the unused pins? Do we need to connect unused pins to ground, vcc or?

Thanks!
Chief Technology Officer (CTO) at 360ATC Aviation Training Center
Electronic Engineer. Control & Software Specialist

User avatar
jph
Posts: 2853
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Unused Pins on Arduino 's & Raspberry 's

#2 Post by jph »

I am shocked!
Most certainly not at you of course, as you had the wherewithal to ask,, but at the sad state of the utter garbage and total bollocks that is posted on some sites where the order of the day is the blind leading the blind over a cliff and most self proclaimed experts being educated at the university of google garbage copy and paste having left school with half an O oevel, a stale conker and a budgerigar and are currently unemployed whilst holding out for a senior technical management position. Frightening :o :(

ABSOLUTELY NOT ! in answer to your last bit.
Also, there are only 'a lot of opinions' of what to do with unused pins if you read a lot of sites with extremely clueless people on them.

The safest state for an unused pin is as an INPUT - NOT EVER - IN ANY REALITY - EVER - ATTACHED to GND or VCC -

NEVER EVER EVER attach an IO pin directly to GND or VCC. That is patently rubbish, ridiculous and stupid information so wherever you have read that then block that site from your browser. :?

As the micro DEFAULTS to it's pins being inputs unless otherwise told differently you need to do absolutely NOTHING AT ALL.
Joe. CISSP, MSc.

User avatar
nnyerges
Posts: 81
Joined: Sat Jun 18, 2022 6:28 pm

Re: Unused Pins on Arduino 's & Raspberry 's

#3 Post by nnyerges »

👍🏻
Chief Technology Officer (CTO) at 360ATC Aviation Training Center
Electronic Engineer. Control & Software Specialist

User avatar
nnyerges
Posts: 81
Joined: Sat Jun 18, 2022 6:28 pm

Re: Unused Pins on Arduino 's & Raspberry 's

#4 Post by nnyerges »

jph wrote: Mon Oct 10, 2022 6:07 pm I am shocked!
Thanks for the crudeness and in theory a good explanation. Has i comment in my first post, I use to declare unused Analog pins as INPUT_PULLUP when you can via sketch. Still dont know how Air Manager deals with those pins, and by your answer, indeed, no deel's about it. And that coincides with the fact that in the last week I had an Arduino Mega connected to Air Manager with 4 potentiometers connected as hw_adc_input_add on A0, A1, A2 and A3. AND YES, touching any other unused analog pins (A4 to A15), produced false and ramdom reads callback's on A0, A1, A2 with direct LUA script with Air Manager. SORRY.

The only way to solve it, was by holding A4 to A15 to ground using a 10k on each pin. So that was my question about mister JPH!. Good day.

P.S: Sorry for the lot's of edits, but i was in my granddaughter birthday party.
Chief Technology Officer (CTO) at 360ATC Aviation Training Center
Electronic Engineer. Control & Software Specialist

User avatar
nnyerges
Posts: 81
Joined: Sat Jun 18, 2022 6:28 pm

Re: Unused Pins on Arduino 's & Raspberry 's

#5 Post by nnyerges »

Anecdote
Has you say...
jph wrote: Mon Oct 10, 2022 6:07 pm As the micro DEFAULTS to it's pins being inputs unless otherwise told differently you need to do absolutely NOTHING AT ALL.
Don't know about Raspberry's, but Arduinos boards (specially third party boards), they tend to have the bad habit of creating strange noises, especially in analog inputs and ESPECIALLY IF THEY ARE INPUTS BY DEFAULT. So if you don't know how Air Manager handles it, it is best to put a 10K resistor to ground on the unused pins to avoid problems and make the system more stable. Obviously each case is particular. Adding a resistor to ground means more power. But that escapes my initial question. Good job JPH.
Chief Technology Officer (CTO) at 360ATC Aviation Training Center
Electronic Engineer. Control & Software Specialist

User avatar
nnyerges
Posts: 81
Joined: Sat Jun 18, 2022 6:28 pm

Re: Unused Pins on Arduino 's & Raspberry 's

#6 Post by nnyerges »

Another by the way...
jph wrote: Mon Oct 10, 2022 6:07 pm The safest state for an unused pin is as an INPUT
That its all about my question in how Air Manager direct LUA script handles unused pins. As inputs PULLUP, or simple INPUTS? (and thats for Arduinos). Raspberry pins are totally another day dilema :D . Good night jph
Chief Technology Officer (CTO) at 360ATC Aviation Training Center
Electronic Engineer. Control & Software Specialist

User avatar
Corjan
Posts: 2939
Joined: Thu Nov 19, 2015 9:04 am

Re: Unused Pins on Arduino 's & Raspberry 's

#7 Post by Corjan »

Hi,


The Arduino itself will leave them High-Z, no pull up or pull down.


Corjan

User avatar
jph
Posts: 2853
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Unused Pins on Arduino 's & Raspberry 's

#8 Post by jph »

nnyerges wrote: Wed Oct 12, 2022 3:54 am Don't know about Raspberry's, but Arduinos boards (specially third party boards), they tend to have the bad habit of creating strange noises, especially in analog inputs and ESPECIALLY IF THEY ARE INPUTS BY DEFAULT. So if you don't know how Air Manager handles it, it is best to put a 10K resistor to ground on the unused pins to avoid problems and make the system more stable. Obviously each case is particular. Adding a resistor to ground means more power.
The above is simply not correct.

There are no ANALOG inputs by default.

If you are getting 'strange noises' in analog inputs then it will most likely be your code or possibly your driver stage to the analog mux not following
the electrical parameters. It will almost certainly NOT be the board.

Unconnected unused inputs have ZERO effect on system stability.

If you want absolute minimal power consumption you can avoid floating inputs on certain early designs only. This is about power - namely
ensuring absolute minimum power consumption, NOTHING at all to do with stability. The effect on power consumption is also negligible as it is
related to gate charge capacitance. Unless you are running on batteries then it is pointless.

Check the datasheet for any processor you are using and treat it as the bible.

The full size Rasb Pi - I believe - at reset - sets all inputs and a combination of pull ups and downs depending on the specific GPIO,

The Rasb Pi Pico sets pads all, input - pull downs enabled and Schmitt enabled at reset.

inputs are, by their physical nature - extremely high impedance - due to the MOSFET gates. That is why the OUTPUTS are sometimes (misleadingly) classed as tri-stated and effectively leave a third, so called, High Z state, which actually IS the input stage.

Stability problems tend to be caused due to users not understanding the electrical parameters of the board they are using. For example, people
believing that a MEGA can drive LEDs on all it's outputs, or that a MEGA can deliver 25mA on all it's output pins or that you can drive 20 LEDs from a mega at even 15mA per LED (absolutely not possible). A mega is one of the higher rated - current wise - devices and has a maximum sink / source overall of 200mA, That is it. You cannot run any more current through the device. When it comes to a nano or an arduino it is a tiny amount of current that they can source or sink.

Arduinos and the like are simply NOT good solutions for lots of digital outputs that sink or source current. They need BUFFER stages. You are far better using a micro board to drive a dedicated input or output (especially output!) driver board and NOT the micro directly.

ADC inputs have electrical rules to follow and minimum times between samples and switching source inputs.

ALL inputs on a development system that will be written to during code development should have a buffer resistor capable of dropping the full voltage of the chip supply voltage at the maximum current sink / source of the pin.


But, otherwise, as said, you have nothing to change or add to unused and hence unallocated pins. ;)
Joe. CISSP, MSc.

User avatar
nnyerges
Posts: 81
Joined: Sat Jun 18, 2022 6:28 pm

Re: Unused Pins on Arduino 's & Raspberry 's

#9 Post by nnyerges »

Nice talk white bear man. I will keep using 10K resistors held to GND on unused ANALOG inputs. Have a nice day.
Chief Technology Officer (CTO) at 360ATC Aviation Training Center
Electronic Engineer. Control & Software Specialist

User avatar
Keith Baxter
Posts: 4684
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Unused Pins on Arduino 's & Raspberry 's

#10 Post by Keith Baxter »

Hi,

I am just curious as to if you are going to use a 10K resistor on all your switch pins. Simply because switches (especially multi position rotary) will be open circuit at some time.
If you do, then the switch might not work. ;)

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

Post Reply