For those with kids who love their Elf on the Shelf during the Christmas season, looking for a quick / simple idea for what to do next with their Elf, here's a simple idea that my child loved seeing this morning :-)
So, I decided to breadboard out my setup for testing, by seeing if I could toggle the remote board via momentary button connected to the Arduino and breadboard, and have the state of that button change the I/O on the Arduino to High for the pin I connected the NPN base to, whose collector and emitter are connected to the remote board HIGH and LOW in the location where the remote's momentary button is connected (see below):
And, I'm proud to say, it works like a charm! Yes! Ignore my solder job, I'm still trying to perfect it.
Gonna try optos next, just for fun, but I'm ready to package this up and integrate it with the rest of my setup, and into my Android app now.
Thanks for those who helped assist / clarify my understanding.
What I don't under stand is why you changed from transistor to Logic Output Optoisolators
If you think it works better you can still hook it up backward and 2 I showed you clearly how this worked with a transistor.
Actually, I'll probably try it both ways just to learn. I like the simplicity of the opt-isolator though, as it appears I don't have to worry but any other ground connections, etc. It just seems simpler to me. Certainly appreciate your help as well. I already have 2 NPN transistors (1 for backup, lol), so they will probably get first shot.
Thanks. I'm getting there. Bear with me, I'm very "green" with the electronics side.
In this setup, then, I was clearly off on my thinking, as pin 6 is unused. I'm good, per your reply on 4 & 5.
The only thing that confused me in your statement is that pins 1 AND 2 are for the LED. Is that 1 for the I/O slot, the other for ground from the Arduino? And, the resistor is between the Arduino I/O slot and Pin 1, right?
Assuming I'm on the same page, it would seem to make sense to just go with the PC817, since it has just the 4 pins I need and nothing else.
Okay, I've essentially re-drawn on my own board what you provided previously, but I'm just covering my bases here.
Here's my proposed setup:
If I hold the board to the light, I can see the red lead headed to the bottom right pin in the photo above, so this should tell me (even w/o a multimeter, which I've tested as well), that this is my "high" and therefore, my solder point for the NPN collector.
One of the other pins that doesn't read out any volts is going to be my low (ground), and the NPN Emitter gets soldered to it.
NPN base is getting connected to one of the Arduino I/O's with a resistor between.
All good so far, right (hopefully)?
Under such a setup, I'm not using the Arduino itself to supply any power (I think where some of my initial confusion came from between us), and as such, the 9V battery remains in my setup to supply the needed power. Correct?
So, to confirm, in your diagram, your positive from the board is connected to the NPN collector.
Ground from the board goes to the NPN emitter.
1k resistor between base and digital i/o of arduino.
What about ground from board to arduino? I'm realizing in your original reply you mentioned "tie ground of remote to ground of arduino", but you also mentioned "solder emitter to ground side". I don't see this in the drawing.
Sorry for so many questions. Just want to make sure I actually understand what I'm doing before I do it :-)
EDIT: Attached, for your reference, is a photo of the remote board with the 4 pins for the momentary button circled.
When it comes to specifics of electronics I'm a bit of a noob, and as such, looking for a little help / guidance.
I've got an arduino uno with ethernet shield, reed sensor, and relay module all connected up and working great for opening / closing my garage door, detecting open/close status, etc.
What I would like to do next, is, given there is also a security gate just outside my complex, I would like to take an extra remote that I have, and connect the remote's board directly to my arduino uno to mimic the button press, so that I can issue a gate toggle programtically. This seems to be the most "eloquent" way for me to pull this off, i.e, I can't monkey with the gate operator to install another arduino with wireless connectivity to trip a relay to open the gate, and I think it is kludgy to try and rig up a mechanical device to actually press the button on the remote, so this is the direction I would like to head.
However, given my electronics noobiness, I'm not 100% clear how I would go about interfacing the arduino with the remote board. The board has the standard momentary switch on it you typically see in arduino starter kits, and I hooked up a multimeter to the varying 2 points on the board where the button is connected, and when selecting various alternate points on the board, w/o pushing the button, I get what appears to be about 4V DC (I didn't expect to see anything until I actually pushed the bottom, btw).
Any kickstarter tips, points in the right direction, etc, would be greatly appreciated.