I have been looking at making a carrier board for the Teensy 4.1 for the Mechatronics course that I teach that has some DC motor drivers, connectors for DC motors and encoder, stepper motors, etc. However, knowing that these are Mechanical Engineering students and often wire things up wrong (which I am OK with from an experiential learning standpoint), I desperately need the inputs to be 5V tolerant.
So, I have been looking at the best ways to do this. I found this great article (https://next-hack.com/index.php/2017/09/15/how-to-interface-a-5v-output-to-a-3-3v-input/) that talked about a whole bunch of ways of doing it. I have also seen discussions on here about the series resistance approach or the series resistance plus a schottky or zener diode. I also saw a different website that recommended using a bonafide level shifter like the LSF0108 (https://www.mouser.com/datasheet/2/916/LSF0108-1664472.pdf).
So, I guess my question is for people who know more about the Teensy 4.1 design than me (and electronics in general), with this LSF0108 work well for both input and output level shifting?
Also, what about protection for the analog inputs. I could easily use a voltage divider, but then when used for 3.3V instead of 5V (some sensors the students may hook up are 3.3V and some could go as high as 5V), then I would lose precision. So, could I use the series resistance and diode approach on these? Also, I would like to make the analog pins able to act as digital pins also when configured that way.
I guess in the long run, I am just asking which of the many approaches to making inputs 5V tolerant, thinking of both the digital and analog cases, would be best to implement on my carrier board?
So, I have been looking at the best ways to do this. I found this great article (https://next-hack.com/index.php/2017/09/15/how-to-interface-a-5v-output-to-a-3-3v-input/) that talked about a whole bunch of ways of doing it. I have also seen discussions on here about the series resistance approach or the series resistance plus a schottky or zener diode. I also saw a different website that recommended using a bonafide level shifter like the LSF0108 (https://www.mouser.com/datasheet/2/916/LSF0108-1664472.pdf).
So, I guess my question is for people who know more about the Teensy 4.1 design than me (and electronics in general), with this LSF0108 work well for both input and output level shifting?
Also, what about protection for the analog inputs. I could easily use a voltage divider, but then when used for 3.3V instead of 5V (some sensors the students may hook up are 3.3V and some could go as high as 5V), then I would lose precision. So, could I use the series resistance and diode approach on these? Also, I would like to make the analog pins able to act as digital pins also when configured that way.
I guess in the long run, I am just asking which of the many approaches to making inputs 5V tolerant, thinking of both the digital and analog cases, would be best to implement on my carrier board?