#Working with optical sensors

1 messages · Page 1 of 1 (latest)

karmic lichen
#

I'm now building my own switch for my panels (don't ask me why; I just like to do things the hard way, I guess) and instead of physical electrical contacts, I'm trying to do it with the TCST1103 optical sensor.

I've got it wired up and configured in MobiFlight as a button. My physical design is such that a small tab will block the sensor when my switch is in the pressed state. Due to how the sensor works, however, the actual electrical behaviour is the opposite -- that is, when there is nothing blocking the optics, it allows the incoming signal to pass through. And since the button device in the firmware uses INPUT_PULLUP, this is treated as the pressed state of the button in MobiFlight.

Is there any easy way to invert the logic?

steep mesa
#

Use on release instead of on Press

karmic lichen
#

Yeah, I'm already doing that on my earlier mini overhead panel because I got my pcb done wrong for the switches I bought 😁.

Problem is that it gets confusing after a while, and now I'm starting to build a full overhead which is a lot of switches.

I guess what I'm hearing is that I should go back to the drawing board and change the physical design...

steep mesa
#

I am not an electronics expert but I think there are ways to invert the logic by adding a transistor (if you must)