I have designed two controllers with the following features:
1. It uses an Arduino Nano as controller, which I plug in on the board on female headers.
2. It has an onboard 220VAC to 24VAC transformer as I drive external devices which needs 24VAC power.
3. I use a common LM2596HVS power supply to supply my board with 12V
4. This 12V is used to drive the on board Relays via a ULN2003A driver.
5. Both controllers have water level probes, the one has 4 channels and the other 6.
The boards are to a large extend very identical and most pins on the two boards has the same function.
The 4-channel boards performs perfect and reliable.
However, the 6-channel board was immediately extremely unreliable at power-up and freezes so much that it does not even start the sketch in the Setup void of the Arduino. I have checked that via serial monitoring as well as setting outputs to high in this block.
To make it run, it is a game of luck flipping the power switch off and on but once it runs, there are no problems at all.
So this morning after a night of no sleep about the problem, I decided to try one more thing:
What I did was to connect ONLY the Vin and ground pins of the Arduino to the header and it started every single time at power up.
Right, so I took a Nano and soldered only a header rail on the side with the Vin and all the AI's. Board started up perfectly every time.
Starting at the at other side, I then soldered only pins D0, D1 GND, Reset and D4 as those pins are not used. Unit started up perfectly every time.
So I started from the other end and solered pins D9, D10, D11 and D12. Unit started up perfectly every time.
I connected D2 and D3. Perfect.
And then came the luck. As soon as I connected D5, the board was 100% back to freezing at startup. I soldered the rest of the rails and took a brand new Nano and went through the same procedure. Once again, everything worked perfect until I soldered in D5.
So I took that Nano, cut out the D5 pin and it worked perfect.
What I find so strange, is that D% runs with a short track to a ULN2003A Input and the trouble is there just because the pin is connected. I removed the ULN2003A, same trouble. As soon as I plug in the Nano with the removed D5 pin, it works, plug in the full one and the trouble is there.
I even removed the 10K bussed resistor on the input of the ULN2003A as that is the only other path for the D5 pin to anything - in this case ground. It behaves exactly the same.
To put further pains into the mystery, I have rebuilt this PCB twice on a brand new blank and it behaves exactly the same. Yet the 4-channel boards runs super sweet.
![This is the troublesome board with the problematic track in red.][1]
The troublesome board with the D5 track in red.
[1]: /editor/20180128/5a6dca4503373.png
![And this is the one that works perfectly with the same D5 pin on that board connected to a ULN2003A pin][2]
And the working board with the same D5 track in red.
[2]: /editor/20180128/5a6dcad3c09cc.png