Pin Stays at 0V (LOW)

Hello,

Together with some friends im making a scale model using the arduino MEGA 2560.

On the board we used I broke an I/O pin (Only gives 1,8V output max.).

To fix this I bought a new MEGA 2560 and switched the new arduino for the old one. I put in the same software but now output 42 doesn't respond.

I use another pin to read in a switch, when the switch is pressed pin 42(output) needs to supply 5V to an LED. But when the switch is pressed no output voltage is supplied. And another input also changes value.

I´ve tried to look for a hardware connection between the pins but there is no hard contact between the pins.

When I switched the old board back (with the same software) evrything except the broken output seems to work fine.

My question comes down to: Why does the new Arduino MEGA board react differently to my inputs while using the same software?

Best regards,

Mark

We need to see how you connected everything. A clear photo or a drawing on a sheet of paper and photographed will be ok.

I assume you did have a resistor in series withe the LED?

Weedpharma

I’ve added the scheme as an attachement.

Pin 39 is used as an output for the LED.
Pin 42 is used as an Input with a pull down resistor.

But I want to adress that the software + Hardware worked fine when i used the other Arduino board.

I bought two new arduino mega boards.

I have now switched the mega board again with the other new board.

Now everything works fine.

There is no reason for one Arduino working differently so I suspect wiring error.

There are two things I would do differently in your circuit.

Normally the NPN transistor is used to switch to ground. Therefore put the LED and R between the 5v and collector and emitter to gnd.

It is better to use a pull-up R from 5v to the input pin and switch to gnd. There is a pull-up R built in to the Arduino and can be activated by software.

Search for pull-up in the search box at top of this page.

Weedpharma