A very simple question, I hope, but one that is perhaps a matter of opinion so I’ve not found a definitive answer by myself!
I have some LED lighting that is controlled by an RF remote. I want to incorporate it into my ‘smart home’ setup but RF remotes appear to be tricky in that sense. Hence, disassembling the remote seemed to be the easiest route. It ran off a 3V LR2302 and I thought the photon would be a good way of both powering the board and ‘pushing’ the buttons.
I’ve identified the appropriate vias in the pcb and provided power. Basically everything works fine and I can control my lights just by completing the circuit between the two vias.
The question is what is the best way to do this with the photon? With a BJT? Or is it better to use an optocoupler and keep things separate? Or perhaps there’s an even simpler way!?
Do the contacts close to GND or to 3V?
Have you tried power the device off 3.3V already and it doesn’t mind?
If the answer to the second is yes, you could go the least effort way (which isn’t best practice tho’) and directly drive the contacts HIGH or LOW (with a 100Ω series resistor - if even needed) and then change pinMode() back to INPUT to go hi-Z again.
The advice from @ScruffR is great and if your remote switches the inputs to +V or GND, you have an easy path.
If, however, the remote uses a scanned keyboard where columns of switches are enabled and then common rows are the inputs, you can still make it work. It will be easy to tell if your switches are scanned if you have a scope.
The “trick” to replacing a switch in this case is a little part called a CMOS transmission gate or bilateral switch. It is a device like a switch in that current can flow from input to output when the control is enabled, and the nice thing is that it doesn’t really care what is on the input/output as long it is within the voltage specs. Here is the data sheet for a quad device:
All excellent advice and very helpful! Sorry for the painfully late reply, work took me away and separated me from my project for a couple of months.
I took the suggested (quad) bilateral switch route and have it all up and running - it replicates the button push for the four most useful buttons on the original RF remote. Everything works perfectly.
To extend the functionality I roped in google assistant and declared a couple of particle functions. One is a simple on/off and it functions as expected. The second takes an argument (IFTTT call function with text ingredient) and chooses one of the three remaining buttons (for light level). The function works as expected with all the defined options when I call it from the console. However, it doesn’t work via IFTTT. IFTTT lists the function when I setup the applet but google assistant doesn’t recognise the trigger. I’ve tried changing the trigger to very random things in case there’s some conflict but it still doesn’t work. Which makes me unsure of where the problem lies. I feel unsure about particle.function using int and not string so maybe I’ve got horribly confused somewhere. Though I would have thought would cause it to fail in the console too. Does anyone have any experience of troubleshooting these things? Any advice or pointers would be gratefully received.