Page 1
Page 1
Started By
Message

Transistor or relay?

Posted on 10/22/20 at 10:19 am
Posted by Lonnie Utah
Utah!
Member since Jul 2012
23982 posts
Posted on 10/22/20 at 10:19 am
Hoping someone where smarter than me can help answer this question.

I want to mod the remote control for our Halloween smoke machine. It triggers the smoke machine via IR when you push a button on the remote. One button press activates the smoke, a second turns the smoke off. The button is normally open and works by completing the circuit.

My initial thought was use an Arduino pro mini to trigger the remote either by time or when a motion sensor was tripped (buy approaching trick or treaters.) I was going to simply use a 3v relay to complete the circuit. My question is, can I do the same thing via transistor? The remote is powered by 2 AAA's so I don't think there is significant voltage across the push button.

The pros of the relay are,
1) I've wired them before so it should be simple to use.

Cons:
1) Bigger
2) More expensive.
3) larger battery consumption.

Pros for the transistor,
1) Smaller
2) Cheaper

Cons
1) I've never worked with them before.

Thanks
L
Posted by td1
Baton Rouge
Member since Oct 2015
2838 posts
Posted on 10/22/20 at 12:31 pm to
If you used an optocoupler you could completely separate the two electrically.

You could also download the IR libraries, write a sketch to read the IR signals from the remote, then program them into your sketch and use an IR emitting diode on your Arduino to turn the unit on an off, no relay needed and no need to interact with the original IR remote.
This post was edited on 10/22/20 at 12:36 pm
Posted by td1
Baton Rouge
Member since Oct 2015
2838 posts
Posted on 10/22/20 at 12:52 pm to
I have code that turns a TV on and off, but I can not post it here with the forum restrictions. I you want it, PM me and I will send it to you via email.

It uses this library IRLibSendBase.h
Posted by mchias1
Member since Dec 2009
805 posts
Posted on 10/22/20 at 12:55 pm to
if you want to replace the remote, get an IR emitter and hook it up to your arduino. I doubt the remote does anything besides sending a single light pulse to the smoke machine.

Wouldn't know for certain with out something that could see the remote's light output.

I would ditch the remote all together and replace the IR sensor with an opto-coupler attached to your arduino. Flash the arduino with tasmota and you can access it through a webpage.
Posted by Lonnie Utah
Utah!
Member since Jul 2012
23982 posts
Posted on 10/22/20 at 1:06 pm to
quote:

You could also download the IR libraries, write a sketch to read the IR signals from the remote, then program them into your sketch and use an IR emitting diode on your Arduino to turn the unit on an off, no relay needed and no need to interact with the original IR remote.



I'd actually thought of this, but I don't think I can code well enough to pull it off. lol.

I agree it might be the best solution.
Posted by td1
Baton Rouge
Member since Oct 2015
2838 posts
Posted on 10/22/20 at 1:31 pm to
I don't think it will be that hard. If you google the Arduino IR libraries, you will find the GitHub downloads and a ton of examples. It is not hard at all.

There is a very good chance they use NEC or Sony encoding, especially if it is china made. There would be no practical reason for them to do their own encoding.

They also have a sample sketch that will read the remote, no coding needed.

Also all you will need is a ir receive diode to sniff out the hex codes and a regular ir diode to send them.

Posted by td1
Baton Rouge
Member since Oct 2015
2838 posts
Posted on 10/22/20 at 1:44 pm to
I could see if working like this:

starup
set motion sense to not tripped.
start loop
read motion sensor trip status.
if motion sensor trip, execute on ir blast.
(one variation)
while motion sensor is tripped, or continues to be tripped within x amount of time, do nothing.
(another variation)
timer to countdown after on ir blast, then send off ir blast.
reset motion sensor trip variable.
loop

that would be a very simple way without using any type of feedback of whether the machine is on or not. It might get a little tougher if it uses the same ir hex value to turn on and off. That is why I had to put something into the one I did to give me feedback if the tv was on or not. We did this on a few TVs, it got a little tougher with one bc its usb ports were powered even when the tv was turned off, for that one we used a photocell placed inside the TV case to check the backlight as a way to verify if the tv was on or off. Cheap client who would not spring for the "commercial" versions of the TVs that would have allowed us to ask the tv if it was on or off, or use standard serial or network coms.
Posted by td1
Baton Rouge
Member since Oct 2015
2838 posts
Posted on 10/22/20 at 1:49 pm to
One more:

Go to Lowes / Home Depot. Buy a cheap outdoor motion sense light. Remove the motion sense unit from the light. Wire it to your power for the smoke machine. Set the sensitivity and on time as you would if you were setting up the motion sense light.

You could even go crazy and mount it in a workbox with an outlet you could use to plug other things you want motion sense to work with. Then you don't even have to cut the cord on the smoke machine.

Just make sure it is not one of the LED motion sense lights. And as always, don't exceed the wattage the original fixture or the motion sense unit is rated at.

Posted by Lonnie Utah
Utah!
Member since Jul 2012
23982 posts
Posted on 10/22/20 at 2:20 pm to
So I forgot to order the motion sensors when I made my amazon order. I think I'll just wire the new IR remote up on a time cycle for this year.
Posted by td1
Baton Rouge
Member since Oct 2015
2838 posts
Posted on 10/22/20 at 4:20 pm to
Amazon Motion Sensor

Here is one that is kind of already setup how you would need it for 20 bucks.
Posted by Lonnie Utah
Utah!
Member since Jul 2012
23982 posts
Posted on 10/24/20 at 8:39 pm to
Well I got it, basically, working.

Arduino Pro Mini, 100 om resistor, IR led and a battery holder for two button batteries was all it took.

I have to tweak the code to do more random length between the bursts and random length. But I diagnosed the IR code and was to write it into the code of the new sketch.
first pageprev pagePage 1 of 1Next pagelast page
refresh

Back to top
logoFollow TigerDroppings for LSU Football News
Follow us on Twitter, Facebook and Instagram to get the latest updates on LSU Football and Recruiting.

FacebookTwitterInstagram