1

I have been trying to make a (hopefully very simple) circuit for this that just uses a couple resistors, diodes, and transistors that can fit on a small breadboard and be powered by a 9V battery. Something like this would be perfect, except for the fact that it looks to need +12V and -12V, instead of just positive and ground.

I have done a bunch of experimenting with Tinkercad Circuits, trying to use photoresistors and photodiodes in any way I can to get the desired effect, but I keep running into problems with them. The transistor will either go between active and cutoff modes and I don't have the voltage swing to get it to go all the way to saturation, or it can't be tuned at all with a potentiometer, or it uses too much energy when not switched on.

I've never really done anything with transistors before, but I thought I would start at least trying to use them as switches. I understand Ohm's law, I can read circuit diagrams and I built circuits in labs for school, but it was all simple stuff that didn't require a deep understanding of the physics. I think I need to be pointed in the right direction here. Any help would be appreciated.

  • do you want the power supply to be 9 V or 24 V? – jsotola Oct 26 '20 at 02:45
  • What is this supposed to accomplish? Relays are typically quite problematic where the power source is a battery, other parts of the system may also be a challenge, but often a more conquerable one... – Chris Stratton Oct 26 '20 at 03:20
  • Russel, you will want to understand the concept of hysteresis. You may want to know about latching vs non-latching relays (if you need to power something requiring significant power.) You may also need to know about potentiometers, so you can adjust the threshold light levels to your taste. These are just a few details you may need to apprehend before you can fully specify your goals here. Just "doing something for show" isn't hard. There are no real specs for something like that. But doing something useful, usually involves some careful thought. What power levels will you control? – jonk Oct 26 '20 at 03:35
  • If you're trying to achieve a clear switch on and off from analog sensors, you probably want a comparator in there somewhere. – Simon B Oct 26 '20 at 11:32
  • @jsotola Definitely 9V. – Russell Emery Oct 26 '20 at 22:18
  • @ChrisStratton The relay would be a DPDT that latches itself and keeps a small buzzer on. This part of the circuit I don't have a problem with. I think I need a relay for the buzzer's power draw and latching, but not sure. – Russell Emery Oct 26 '20 at 22:19
  • @jonk I have only heard of hysteresis in the context of measurement directionality, where it's a lag. I am trying to use a potentiometer to tune the voltage at the base pin of a transistor, using a voltage divider. It's not working as I'd expect since significant current is flowing into the base, but I understand the working principle of a potentiometer.

    I do just want to do something quick and dirty, with the exception that it can't consume too much power when off. The power that the relay switches is something like 50mA.

    – Russell Emery Oct 26 '20 at 22:24
  • @SimonB Yes, I am trying to achieve a binary on/off. Does a comparator work instead of a transistor or will I need to use both? I have them both here, I'm just a noob. – Russell Emery Oct 26 '20 at 22:26
  • @RussellEmery I get it now about the power supply voltage ... I watched the video ... that project is not using -12 V and +12 V, that would make it a 24 V power supply ... it just uses a 12 V power supply ... the two outpus are connected to +12 V and GND .... by the way, that is some horrible way to solder wires .... the board would be much neater if the end of the wires were passed through the holes – jsotola Oct 26 '20 at 22:47
  • @RussellEmery Do you want a simple circuit to build? Or do you want to understand how to design one? (For example, here.) – jonk Oct 26 '20 at 23:03
  • Most likely, a comparator driving a transistor to turn the relay on and off. – Simon B Oct 26 '20 at 23:52
  • @jonk I want to build a circuit first, then I can learn how to improve it. – Russell Emery Oct 27 '20 at 00:04
  • I wish I could post images in replies, but I guess all I can say is that my circuit is very similar to many other examples where it's just a voltage divider connected to the base pin of a transistor.

    @jsotola That's good news that it's not a funky power supply, I'll look more closely and see if I can get this to work for me.

    – Russell Emery Oct 27 '20 at 00:28

1 Answers1

1

You could try something like this:

schematic

simulate this circuit – Schematic created using CircuitLab

I've not used this before. (Obviously, since I just made it up.) But the general idea was to use a simple diff-pair of BJTs running at very low collector currents (to keep the load relatively light when the relay isn't in use.) \$M_1\$ isn't critical. But it does need to have a threshold voltage of below \$4\:\text{V}\$. (It's usually given as a negative voltage on the PFET datasheet, so I'm talking about the magnitude.) \$Q_1\$ and \$Q_2\$ can be 2N2222A, PN2222A, 2N3904, or many other common small-signal NPN devices.

More could be done to reduce the current when it's not active. But at least this is something to try out and see how it goes for you. \$P_1\$ is there so that you can adjust the threshold. And this circuit includes hysteresis, as well, so it should "feel okay" when you bring it in and out of various lighting situations.

It will work with a \$9\:\text{V}\$ battery until the battery voltage is below \$7.5\:\text{V}\$. So that means well after the battery dies and wouldn't operate the relay, anyway. \$50\:\text{mA}\$ is a hefty load for a \$9\:\text{V}\$ battery. So just be aware that the battery isn't going to last more than a few hours' time, if you leave it activated.

jonk
  • 77,876
  • 6
  • 77
  • 188
  • Thanks for the detailed answer. I'll try to build it, although this looks pretty advanced for me. Do you have any tips for making sure you're following diagrams correctly? – Russell Emery Oct 27 '20 at 01:41
  • @RussellEmery Measure twice and build once? Take care and think about everything six different ways before actually soldering stuff up (or wire-wrapping them.) I could recommend methods *if* you understood enough design. Then you could break this up into subsections and test those individually. But as things are, I'd have to write a chapter or two of text to explain what every measurement meant and what to do next for each possible measurement. That's a bit much. I could redraw it into a wiring diagram, but that's too tedious. So all I can really say is just "follow the diagram closely." – jonk Oct 27 '20 at 03:07