Have I damaged the input pins?

I am stuck with what has happened.

Back story:
I am (again) working on a project.
It has 1 input, and quite a few outputs and an RTC.

It was working - kind of - and had a problem where the button wasn’t always “seen” when I pressed it and so sometimes the program hung if I was doing certain things.

After weeks, I asked for help and was shown a few of my mistakes - hardware wise.
The main circuit is 12 v. But now and then the Arduino regulator would get HOT for reasons - at that time - unknown.
To avert this, I put a 7805 before the Arduino and fed the 5 volts into the 2.1mm connector.

It worked. (Don’t ask how. I don’t know either.)

But the person who helped me showed me the Arduino was running on about 3.5 volts, not 5.
Though this was a good thing to learn, it is weird, as I had measured 4.x volts on some of the outputs while testing.
But anyway…

The 7805 was removed and I fed the 12v into the 2.1 mm jack and things were looking … good/better.

There were 4 pins used to output BCD to a display and it was not working “correctly” until then. The lower left segment was always on when displaying digits. So 2 and 3 were hard to distinguish.

Alas the 12v supply didn’t fix the problem.

Story:
There are 5 relays powered from 12v.
If any of them are active, a pump is activated too.
The pump pulls about 1.5A and a relay/load… < 1A.
It is a 5A supply.

All things plugged in, etc:
I click the button the sketch would run and do the “main function” ok.
Even clicking during the sketch the button was detected.

However, if I went into the added sub-menus, the button would not be seen/detected.

If I removed the pump, it would work ok. So it was thought to be noise.
I tried .09 and .47u caps across the motor to no avail - at the 3.5 volt stage.
By the time I got to the 5 volt stage, the sketch stopped working, so I never really got to test that.

If I unplugged the Arduino and sort of tested the inputs, they didn’t seem to have any problems, so I thought it may be something to do with the Arduino. But it was brand new.

I got the leads and pulled them all low, and then went through and put them high - one at a time - I say the correct digits on the display, so I am guessing that means “All good”. No Arduino in the circuit at this point, of course.

I re-assigned the pins and tried again.

I think that is when it all started to go wrong.

The sketch wouldn’t work any more.

I would click the button and nothing would happen.

I put the pins back to their original numbers, moved the plugs on the pins to their “old” positions and tried again.
On boot, the outputs were spiked high, then low for no reason.

Huh?

Adding a bit of code, I discovered the input pin was seeing a button press which wasn’t happening, AND wouldn’t respond to any more button presses.

I put the pins to the “new” assignments and re-plugged the pins to the new positions. Same.

To check I wasn’t going batty, I got a CLICK-BUTTON test sketch and tried it with NOTHING ELSE connected to the Arduino.

The LED wouldn’t change when I clicked the button.
(Yes, I had to edit the pins used for the LED and input.)

I tried this on the other pin to the same result.

But to add insult to injury, if I used ANOTHER input pin, it WOULD work.

It would SEEM that the two pins I used/assigned for the input and did the set up for Click button to PULL_UP, etc are now kaput.

But I can’t see how, or what I did to them.

As all the other pins are outputs, and they are going to drive transistor/drivers there would be no feedback to zap them.

As far as I can see, they work ok as outputs, but they are “stuck” LOW if acting as inputs.

Can anyone help me better understand the “problem”?

848 posts and you still haven't learned to post a detailed wiring diagram and code?

jremington:
848 posts and you still haven't learned to post a detailed wiring diagram and code?

848 compared to 10,134. I think I have a way to go before I reach your level of......... arrogance.

There is no need to post wiring diagrams or sketches.

The story explains what I did.

I explained that I ran a bare Arduino with a supplied "test" sketch and it didn't work with certain pins, and other pins did work.

All I want to know is how to determine if I damaged the input pins.

I must admit I am a bit lost in your text too. I would guess in some part of your experiments the Arduino was powered from less supply than the pins were connected to (maybe when the regulator was in front of the Arduino). Or the caps may be discharged through pins when the Arduino was powered off? Hard to say. Or just an ESD not related to your experiments? Best way to decide is repeat previous steps with a new Arduino and see which step damages it :wink:
Also do you have correctly connected all the transistors and relays and most importadly the pump to protect Arduino from all the transients caused by switching?
The statement you measured over 4V on pins while Arduino was powered from less than 4V may lead to the cause. A higher voltage was probably leaking from somewhere. If current was higher than neligible it is very dangerous for the pins.

It looks like you have lots of confounding variables in your experimentation.

Start again by writing a sketch to test each piece of hardware separately, and check each
thing is working - then you'll know that you have working code and pins for each thing.

Then start combining into a larger sketch, one thing at a time, if anything breaks you'll
have to fix it before moving on to the next stage - only have one problem at a time to
understand and deal with, not several. Always have a previous working state to step
back to (save a copy everytime you get some new functionality working). Then you
can see what changes you made.

It sounds like you have electrical noise issues with the pump and relays. Layout and
grounding is important here, learn about star-grounding. Best to not even try to power
the Arduino from your 12V supply, its probably too noisy and has dropouts when the
pump starts (or at least get a 'scope on it to check). Good clean power is essential
for logic circuitry to work.

There is no need to post wiring diagrams or sketches.

Is that approach working well for you?

Well, to explain it "another way" I shall give a brief story.
(But when I have posted brief posts before, here and other places: I am told to include more detail.)

Brand new Arduino.

Loaded sketch.
Only TWO inputs. The button and an input which is not connected to anything yet.
The other pins are outputs driving either open collector transistors to drive relays or to drive BCD display.

The sketch works "on the bench" - with nothing connected.
Connecting ONLY the relays, it works.
Once the pump is connected, it doesn't always see button presses.

I changed the pins (and connectors) to try different pins on the Arduino.
SAME.

Adding a couple of extra lines of code, I see the sketch is seeing the button pressed on boot - when it isn't pressed.

Loading the CLICKBUTTON test sketch where you have ONE input and blink the internal LED, I loaded it and tried with the pins I used for the button.

I could not get the sketch to see the button press.

Changing to another pin (which was never used as an input) it works.

I wrote another quick sketch which scans and prints the state of pins 1 - 12. All set to use internal pull up resistors.
Pins 2, 6 and 7 show incorrect reading. As in they are not being pulled high.

Running a wire along them each pin goes low (except the ones in question) then back to high.

"Luckily" putting a 470 ohm resistor on pin 2 and pulled it high makes the sketch work again, while on the bench.

I was wanting to know how this problem happened.

As the 470 ohm resistor has negated (bad word?) THIS problem and I am waiting to get a rare chip, to attack the next issue with the project, I am chalking it to bad luck now.

The sketch I have it about 12k (on the arduino) and is "long winded" in itself.
Sure my programming has improved since "day 1" but I have also got an appreciation of reading other people's sketches as not easy.

Post your circuit and code if you want anything other than wild-guesswork.

Well, don’t say I didn’t warn you. Here is the sketch.

The BCDpins go to a 4504 (TTL - CMOS) level converter IC.

The BCD_TEST yields rubbish on the display. Testing the inputs prove it is ok.
The 4511 was dead and has been replaced.

The Solenoid pins drive an opencollector (common earth IC - (18 or 20 pin DIP package)) driver.

The Arduino is powered from 12v 5A supply, which is the same as the rest of the circuit.

There is a 4700u cap on the 12v rails.

There is a known noise problem, but with the solenoids and motor removed the BCD is still not “working” - as in the numbers are wrong.

The sketch can be started with a single click and stopped if needed.
Access to the other menus is now difficult as the display doesn’t show where I am.

But if used, and the pump starts, any attempt to stop/exit the “function”/menu is futile.

However, some parts (or all?) may be handy for others.

If so: No worries.

Oh, menu3 has a LOT of old code at the start. It is called WORK IN PROGRESS.

V10.zip (15.8 KB)