Trouble with digital input when connecting an external power supply only, what can I do?

I'm having trouble with my digital input when connecting an external power supply.

When I connect the USB first and then connect the external power supply afterwards everything works like it should. I can read my button press like normal. Unfortunately this doesn't work the other way around. When I only connect the external power supply, my button reads HIGH all the time. I tested the button and it is not shorted, it reads HIGH when there is nothing plugged in as well. This also happens when I plug in the external power supply first and then the USB afterwards.

To simplify a bit:

USB then Ext. PS -> Works

Ext. PS only -> Does not work

Ext. PS then USB -> Does not work

I'm at a complete loss, I've tried several other channels with no success. I've tried both with and without a pull-down resistor on the button, so it's not that it's unstable. I really need it to work when I plug in only the external power supply.

Markus Myklebust Myrstad
Markus Myklebust Myrstad
7
| 3 1 2
Asked on 4/17/18, 8:48 AM
0
vote
1896 Views

Hi Markus,

Assuming you are using the digital channels of the INDIO, can you try the following: when initialising the channel, first set it as OUTPUT and write LOW to it, then change to INPUT. E.g. for channel 1:

Indio.digitalMode(1, OUTPUT); // Clear CH1 to LOW

Indio.digitalWrite(1, LOW); // Clear CH1 to LOW

Indio.digitalMode(1, INPUT); // Set CH1 as an input

Please let us know if this solves it.

Tom
Tom
5675
| 1 1 3
Answered on 4/17/18, 12:35 PM
1
vote

Yes, your assumptions are correct, I use the INDIO D21G. Your solution works, thanks a lot!

Markus Myklebust Myrstad
on 4/18/18, 6:44 AM

Your answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

Ask a Question

Keep Informed

About This Forum

This community is for professionals and enthusiasts of our products and services.

Read Guidelines

Question tools

43 follower(s)

Stats

Asked: 4/17/18, 8:48 AM
Seen: 1896 times
Last updated: 4/17/18, 12:35 PM