Hello there. I’m working with a Photon and a Shield Shield. I would like to use a couple inputs to monitor dry contacts. In my code I set the inputs, D2 and D3, as INPUT_PULLDOWN. If I have the the Photon mounted in a breadboard, the inputs seem to react as expected - LOW when not connected to anything and HI when connected to 3.3v. When I mount the Photon in the Shield Shield and have it running the same program, the inputs act differently. They act as if they have no pull up or down at all. If I connect 3.3 to the input, it shows HI. When I disconnect 3.3, it stays HI until I connect the input to GND. I have tried setting the input to PULLUP and it acts the same. Is this behavior possibly caused by the voltage translators?
I know the inputs are mapped to 11 and 12 on the Shield Shield.
Thanks in advance!
Yup, the level shifters on the Shield Shield seem to be a bit finicky and others had similar problems which should be addressed with external pull-ups on the 5V side.
Thanks for the info. Would it be best to use an external pull-up or will it work properly with an external pull-down just the same?
What value would you suggest as a pull up/down?
@Tubes110, 4.7K - 10K ohms should be fine.
up or down doesn’t matter, just don’t use internals at the same time - esp. not opposite
Thanks guys. I was planning on using 10k.
OK, well after coming back from a long break, I finally had a chance to test your suggestions. My conclusion is there is something wrong with my shield shield. I can not get digital or analog inputs to behave as expected. I bread-board my simple circuit and connect it directly to the Photon and it works fine. I can use pull-up or pull-down resistors. If I move the Photon to the shield shield and reconnect the input jumper to the shield shield it does not work. I have tried different inputs with same results. The input remains in whatever state it is in until it is positively grounded (turns off) or connected directly to 3.3v (turns on).
Analogs are funny too. I have not tested them thoroughly yet. What I did was use a 4.7k - 4.7k voltage divided to pull the input “high” (~2048). I then use a button to pull the center of the divider to ground. If the center of the divider is connected directly to the A2 pin on the Photon, the input reads perfectly. ~2048 with button OPEN, 0 with button CLOSED. If I run the input through the Shield Shield “Pin 2”, the reading is unreliable.
Am I crazy or is something wrong with my shield shield?
After reading another post about the same problem, I tried using a different value for the external pulldown resistor. If using 3.3v as your signal, a 2.7k seems to work well. If using 5v, 3.9k does the trick.
I still want to test the analog inputs some more…