I have the signal channels of four 5v magnetic encoders connected directly to the digital pins of the arduino due. I am aware that this is not allowed according to the specification which says that digital pins should only sink 3.3v but I have not encountered many problems with this setup until now and the encoders only sink 20mA.

This is the setup of one of the encoders, I only encounter the following problem only if I connect more than 2 encoders in this formation


The Due resets fine when I press the reset button, but when I reconnect USB, the Due crashes and is not able to run any code (tested a blink sketch).

I cannot change any of the circuitry because it is already in multiple PCBs. Does anybody have an idea why the 5v on the 3.3v tolerant pins is causing the reset over usb to fail and how I could fix this in software? It must be fixable in software as the arduino IDE manages to upload sketches while the encoders are connected. I tried to reset over USB by connecting with 1200 baud and setting DTR but that didnt work.

Thanks so much in advance, I hope my question was clear.

edit: I am aware I am doing things wrong here and that that is whats causing the issue. The problem is we soldered 20+ of those PCBs and I cannot simply make modifications, even simple ones. I am looking for ideas on how to hotfix something in software that I messed up in hardware.

edit edit: Honestly kinda disappointed with the hostility on here, am I being downvoted simply because I made mistake with the specification and am trying to find a workaround? I dont see how that makes it a bad question.

  • 3
    Your wondering why something isn't working right, when you know you are connecting 5v to a board that should only ever use 3.3v logic..........? – Chad G Apr 25 '18 at 17:09

You're over-stressing the MCU and causing all sorts of horrible things to happen with the power rails. Of course nasty things are going to happen.

The only way to fix it is to change the circuitry. Something as simple as adding a 1kΩ resistor in series with each of the input connections could be enough to sort it out.

  • Adding a resistor in series can be done by scraping away some of the soldermask, cutting the trace, and bridging the cut with a SMD resistor. – Gerben Apr 25 '18 at 21:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.