Transistor Help

Started by christhomas99, April 20, 2015, 11:16:40 AM

christhomas99

Hi,

I originally posted this on the Arduino forum, but haven't managed to get anywhere, so through I would try here.

Firstly I am pretty new to the whole electronics market and although I am enjoying it immensely, I am very quickly becoming aware of my overall lack of knowledge/understanding of some of the core fundamentals.

I have recently purchased a Moteino and would like to us this to trigger some electronic gates that are already in place. Unfortunately I am unable to alter the electronics of the gates directly (as the are co-owned) and so ideally I would like to trigger the switch on a spare remote that I have for the gates.

From my initial research, I believe this should all be possible and I am pretty sure that I will need some form of transistor to do the trigger the switch. The remote runs off a 12 volt battery and registers 12v (measured using a multimeter across the switch) when not pressed and 0V when pressed. It pulls 0.31mA when the button is pressed.

I have built an initial circuit with a S8050 transistor, that switches an LED on and off (powered from a different 3.3V source) from a output pin 3 of the Moteino with success, but I have been unable to use the transistor to switch the 12V circuit in the remote.

I am sure it is something to do with the switching power from the Moteino vs. the remote circuit, but I am a little lost with where to go next.

Any help would be greatly appreciated.

Thanks in advance,

Chris

EloyP

Hi Chris,

It might help if you share a diagram of your initial circuit, including resistor values.

Keep in mind that with a transistor there will be a voltage drop so the voltage will never be exactly 0 volts. I don't think this would be a problem but it's just something to keep in mind in case you cannot get it to work (in that case I think you might have to go with a relay).

Also, how long are you generating the pulse for?

Cheers,

Eloy Paris.-

TomWS

I'll agree with Eloy, a drawing, however rough, would help.  What would be useful as well would be a block diagram showing the entire 'system', showing your control point, your gate, and any information on the gate electronics (mfr, part number, etc).

It may be easier to add two Moteinos to your system.  One at your control point and one located at your gate.  There's more likely to be a switch input of some sort on your gate electronics than 'user input' on your remote control so retrofitting a pair of Moteinos might be easier and it would be a good learning vehicle...

Tom

christhomas99

Hi,

Thanks both for your help. I have done a circuit diagram using Fritzing, which should hopefully help a little, but I am unsure as to upload the PNG file to this post?

Kind regards,

Chris

christhomas99

Hi,

Hopefully you will be able to see the circuit diagram now:



Basically the switch allows me to toggle the state of pins 5 and 6. Pin 5 is to an LED to give me feedback and pin 6 goes to the transistor.

I hope this helps.

Kind regards,

Chris

TomWS

Quote from: christhomas99 on April 21, 2015, 02:23:50 PM
Hi,

Hopefully you will be able to see the circuit diagram now:



Basically the switch allows me to toggle the state of pins 5 and 6. Pin 5 is to an LED to give me feedback and pin 6 goes to the transistor.

I hope this helps.

Kind regards,

Chris
Hi Chris, welcome to the forum!

If your circuit is accurate, DO NOT press the push button switch!   As drawn, you will merely short your PWM output directly to 3.3V which is generally discouraged... :'(

I'm not sure what you want to do with this switch, but you need to rewire the switch so it does something different than it does now.

Ok, back to your transistor.  Your circuit isn't showing how the transistor connects to the remote control, but I can provide 'some' guidance.  R3, when digital pin 6 is high will deliver 3.3V to the base of your transistor, but to turn on the transistor you need to supply a return for the voltage to the transistor.  This return needs to come from the emitter of the transistor.  So, if the emitter is connected back to the Moteino GND pin, then you will complete the bias circuit and turn on the transistor.  However, this still may not accomplish what you want.

The transistor needs to 'do something' in your remote control.  If all you need is a switch closure AND the switch completes a connection to your remote's ground, then you're in luck.  In this case you also connect the remote's ground to the Moteino GND pin and the collector of the transistor to the switch pin on the remote.  The transistor, when digital output 6 is HIGH, will draw current from the switch pin and, presumably, open your gate.   If this is NOT how your remote works then, never fear, we have a solution  ;)

Ok, suppose you can't connect the remote control ground to the Moteino because your remote doesn't like it for some reason (it's switch matrix is multiplexed to take a random example).  Not a problem, except you'll need a different part than the transistor.  You will need an Opto-isolator in this case.  It will work in a similar way but before we get ahead of ourselves, why don't you try the change I mentioned above and then get back to us?

Tom

christhomas99

Hi Tom,

Thanks for the feedback. The circuit for the switch might not be done drawn right. It is installed and working essentially exactly the same as here http://www.arduino.cc/en/Tutorial/Debounce. I use the switch to manually flip the on/off state of the power to pin 5 and 6. Pin 5 showing me led feedback as to the state, but essentially all this is just used for testing purposes as all I really need if Pin6.

I have taken breakout cables from either side of the switch on the remote control for the gates. If I touch the two cables together (replicating the switch) the circuit is completed and the gates operate.

I have the "Base" of the transmitter connected to Pin6 on the Moteino, I have the +12V side breakout cable from the remote connected to the "Collector" and the other breakout cable connected to the "Emitter". However, applying 3.3V to Pin6 was not causing the transmitter to close the circuit on the remote control.

Having reread your response, I then added a cable between the remotes ground and the ground on the Moteino and I now have a working prototype!!! I still however don't completely understand why the ground is needed between the two devices, but that's just my curiosity!

Thanks very much for your help if is greatly appreciated!

Kind regards,

Chris

TomWS

Quote from: christhomas99 on April 23, 2015, 10:48:27 AM
<snip>I still however don't completely understand why the ground is needed between the two devices, but that's just my curiosity!
No, THAT is your learning opportunity!
Quote

Thanks very much for your help if is greatly appreciated!

You're welcome, I'm glad it's working!

Tom