0
\$\begingroup\$

I am working on a project at the moment which requires a microcontroller to pull a signal low for two seconds. This signal is from a break away board which will be connected to the microcontroller by a screw connector. I am using a PIC microcontroller (18f25k22) running at 5 volts. The break away runs on 12 volts and has a pull up resistor on the signal input. I have built a circuit using two transistors to control the 12 volt signal, but I don't know if setting the pin low on the microcontroller will pull the signal low on the break away board.

The driver circuit: circuit diagram

This circuit is on the pcb containing the MCU. Point E goes to a connector which is used to connect to the break away board. Point RC4 is connected to the MCU pin. My idea was to hold the circuit high until I needed to pull it low, in which case I would set the pin low to turn off the transistors and cut power. The MCU circuit and the break away share a common ground and the whole thing is powered by 12VDC. I have a voltage regulator to power the MCU.

So I ask; will this work and pull the output low? Or is there a better way to do it?

\$\endgroup\$
  • \$\begingroup\$ Can you draw the input section of the breakaway board? You don't even specify the resistor value! Is it as simple as +12V and a resistor tied to the node that your 5V PIC accesses? Are you suggesting that your point E on your schematic is to be tied to a node that includes that resistor? Or are you showing part of the 12V circuit, as well? It's hard to know from your example and wording. (I suppose I should even ask you if the grounds are shared between these boards?) Or are you trying to control the +12V to some circuit as a load? \$\endgroup\$ – jonk Sep 29 '16 at 6:38
  • \$\begingroup\$ I haven't been given a schematic for the input section, nor do I know the resistance of the pull-up resistor. The point E goes to a connector, which will have a wire that goes out to the break away board, sorry I should have explained the circuit a bit. RC4 comes from the MCU. Yes they share ground. The input is normally high and needs to be held low to activate the circuit \$\endgroup\$ – Liam Mills Sep 29 '16 at 7:05
  • \$\begingroup\$ Sounds as though Wesley has given you reasonable advice, then. It is a signal line, not power, and all you need to do is pull it down to a shared ground level. You can do that with a single transistor, as he illustrates. Your output will have to be HIGH (1) to do actively do that. But that's just software. You've included a pull down to the base, which is fine to add to Wesley's arrangement, though I'd make the value smaller than 110k. Your 11k for R14 might be okay, or not, depending on that pull-up you don't know about. Do they specify the current? \$\endgroup\$ – jonk Sep 29 '16 at 7:09
  • \$\begingroup\$ Not a specific current, just that it will be a small amount \$\endgroup\$ – Liam Mills Sep 29 '16 at 7:25
2
\$\begingroup\$

That will not work.

You say you have a pull up that you need to pull low.

In the way your schematic is drawn, whatever you do to turn Q8 on, will make it pull your signal high, as in, connecting it to 12V.

What you need is actually a simpler open collector (or open drain if using a fet) output:

schematic

simulate this circuit – Schematic created using CircuitLab

When MCU pin is high, it turns Q1 on, making it conduct and connecting the signal to ground. When you turn it off (MCU low), Q1 stops conducting, and the pull up pulls the signal back to 12V.

\$\endgroup\$
  • \$\begingroup\$ So the collector of the transistor connects to the signal to be pulled down? Does it matter that the microcontroller is at 5 volts and the signal is 12 volts? \$\endgroup\$ – Liam Mills Sep 29 '16 at 6:18
  • \$\begingroup\$ Correct. Doesnt matter as long as Vce of the transistor you are using can tolerate that. This is actually very commonly used. You can look up "transistor as a switch", "open collector", "low side switch", etc. if you want more info on for example, non inverting the signal (basically inverting it back by adding another transistor). \$\endgroup\$ – Wesley Lee Sep 29 '16 at 6:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.