Current Sources that are intrinsically reliable to use with the MCU inputs

ATmega1284p Controller /w pluggable connectors for 9DIO, 2ICP, 6ADC
rpu_bus
Posts: 188
Joined: Sun Sep 18, 2016 6:07 pm

Current Sources that are intrinsically reliable to use with the MCU inputs

Postby rpu_bus » Tue Oct 10, 2017 3:50 pm

Punica has the latest iteration of current sources on the board which can not damage an MCU pin. I want the current source to take power from the VIN voltage (those wants are a PITA).

Years ago I noticed some circuits that level shifted I2C with a nearly useless BSS138 N-CH MOSFET. After playing with some SPICE simulations I started using the level shift for 12V to 5V and on the Punica, it will be used for 36V to 5V. Experiments and Spice show that running a 20mA current source from 36V and then through a string of LED's before going into the level shift and then into the MCU allows the MCU to control that string of LED's (which could be solid state relays or opto couplers).

I have yet to damage an MCU with these current limited sources, I think they are intrinsically reliable to use with these MCU inputs. I also think it helps that the MCU inputs are tolerant as possible of my mistakes (e.g. level shifted and limited to less than 40mA) without getting overly in the way of what I am trying to do.

Punica_CurrSourIntrinsicallySafeToMCU.png
Punica_CurrSourIntrinsicallySafeToMCU.png (16.9 KiB) Viewed 46 times


The 127 Ohm inline resistor drops 5V at 40mA when the MCU pin is low and the plug-able connector has 5V. The MCU will survive this for a while but is taking damage (over time, and may fail in a few days). With a green LED the current would be less than 20mA and the MCU takes no damage. With a red LED the current sink with a 5V supply will be about 25mA, which the MCU can handle for several years.

The current source is aimed to be about 22mA but with luck will fall in the range of 20 to 24mA. A digital input with that current source into it can be expected to work for years with the continued stress. An industrial application would want the MCU pin to last for twenty years or more which means it needs to have less than 20mA sinking (e.g. add a resistor).

To be clear this is all based on my present experience, and I am pushing everything too much for what an industral (e.g. Telecom) user world would consider to be safe but this also needs to be useful, which is code for getting out of the way and letting the thing I am trying to do be done (but also give me a chance to see a mistake before it becomes a smoking cinder).

Return to “Punica”

Who is online

Users browsing this forum: No registered users and 1 guest