Not all Arduino inputs are equal


It transpires that some Arduino inputs are better at tolerating slowly-changing inputs than others.

For example, ATmega328P (Figure 13-2, Arduino Uno and Nano) and ATmega32U4 (Figure 10-2, Arduino Leonardo, Micro or Pro Micro) Arduinos have hysteresis built into the input side of digital IO pins (as does the ATtiny85 and ATtiny861A), and so can happily be used with slowly varying inputs so long as they are not too noisy – I cannot find the data sheet value.

ATmega4808 Arduinos (Nano Every) also gets hysteresis (Figure 16-1).

Arm-based 32bit SAMD21 Arduinos (Zero, M0, MKR Zero, Feather M0), also get hysteresis on their digital inputs (Figure 23-2).

So, so far, if it came from Atmel (now Microchip), it looks like you get hysteresis.

Arduino Nano RP2040 Connect uses Raspberry Pi’s RP2040 chip, and that has optional hysteresis that can be turned on and off (Figure 37 the RasPi folk score an extra point there, particularly as, for the first time in this investigation, they talk about it explicitly and have put number on the hysteresis – see table 5.2.3.4 🙂

So it looks like many Arduinos have digital input hysteresis, but does the Adafruit Feather Huzzah32, most likely to run the weather station.

No, is the answer. Expressif’s ESP8266 and ESP32 chips (found in several Adafruit Wi-Fi Feathers and lots of other Arduino IDE-compatibles) don’t have any hysteresis and might get confused by slowly varying inputs.

They do have a way to hold input pins high or low during sleep (that seems to use ~5μA) but I can’t discover if that can be turned on during normal operation, nor if it could be used to add hysteresis – does anyone know this, nor where the full (not brief) data sheet can be found.

BTW, Expressif have quite fast processors (two in the case of the ESP32). These chips take the road less travelled, and use 32bit Tensilica (Cadence) Xtensa processor cores.

Do note: some of the above boards accept 5V inputs, and others 3 or 3.3V. Not all of the 3.xV Arduinos and Arduino-compatibles have 5V-tolerant inputs, and will not respond well to having 5V stuffed into them.





Source link

We will be happy to hear your thoughts

Leave a reply

EvoCalmed
Logo
Enable registration in settings - general
Shopping cart