Once you wrapped the antennae around the mains cable, I recognized where I've seen this design before. Aftermarket/ add on tachometers use this technique with the antennae wrapped around an engine's spark plug wire! Thank you for the great video, I'm also in need of detecting the presence of mains power for a home automation project. This should do nicely!
I am an electronics enthusiast and quite adept to programmable interfaces and this is so simple, accompanied by an excellent explanation even for a novice. Thanks Ralph.
A year on, and this popped up again in suggested videos and it prompted another memory and thought, especially for those who find it from here on. I remembered a GREAT single chip - the CA3046 - that gives you FIVE gen purpose NPN transistors in a single package, and given MY memory remembering that - off the top of my head was, in itself, a minor miracle! Simply adding the external additional parts reduces the component count and makes the total circuit more compact. In addition since the chip has a FIFTH transistor, it could be used as either a buffer or inverter so that both a high active AND low active output are available. Also one pair of transistors has their emitters connected together allowing the simple use of a long-tailed pair that increases options for design changes for both the front end and the back end.
Wow! You remembered that, Bob? No prompting? Ha Ha! Those transistors would do well in a low voltage Arduino environment too. They have a 100 gain even at very low collector currents. Admittedly, we are limited to 50mA collector current. Thanks for sharing, Bob!
One thing that is worth knowing that I think some of the people watching these videos don’t understand it if you’re messing about with mains in a project you were going to install the crack protect devices and an RCD such that it would disconnectwithin 4 ms so it is deemed to be safe. There’s also the likely heard that something like this would be put inside an enclosure because of common sense.
Which is why I always hesitate talking about mains projects; there are always some uninformed people out there just waiting to connect stuff directly to the mains - without understanding the danger involved.
Really well made and presented video - thank you. I’ve been mucking around with a mains voltage detector for the past couple of weeks/months as I need to detect mains current flow (or at least the presence of switched mains), but have no requirement to actually measure the current. This is to detect when a large 240VAC motor (4hp/3000W) has started. As I have around 6 separate machines to monitor it started to get a bit expensive when I considered the type of ferrite core based current detectors that would be required for these high currents. I built a 3 transistor setup using BC547’s which worked, but I didn’t get as far as interfacing it to the Pico. Your video, detailing the charge pump, has squared that circle for me and I will re-visit. You have my sub. Thanks again. PS. My next challenge is to get each motor based sensor and Pico to talk, via an RFM69HCW 433Mhz radio link, to a central Pico that will in turn energise a relay that will (using a servo and a rack and pinion), open a dust extraction blast gate which once open will start a dust collector. This is all located in a wood working workshop. I think I may be spreading myself too thin....
THANK YOU VERY MUCH sir, you gave new idea to my AC line Detection to my project, it is safe and accurate and easy to assemble tooo , happy to see this
Great idea, you don't care about how huch current isnbeing used, just if it is ON/OFF. Sharing ideas is Great. Hope it works out well for your new lifestyle. This happened to me abot 15 years ago and iI think it added MANY years to my life by reducing the stress in my life.
I've only been "partially retired" from my old day job for a week now, and I'm already sleeping better and feeling more energetic, William, so I can only assume that you are totally correct. Glad you liked the video and thanks for your supportive words, appreciated.
Excellent video on detection. Right now I use a relay to determine if our power station generator is running. (This is off grid) I run the coil to a breaker on the split-phase and when it's working, a set of contacts tells my uno that the generator is now running and to stop running the starter for the engine. Upon seeing this, I just might pull the relay and rework my trigger circuit. Thanks, Ralph!
I am always amazed at the quality of your videos and the wealth of information in them. Two thumbs up. I had a brownout on Strike (little sailboat) last summer so added shore power monitoring to the Arduino systems. I just used a doorbell transformer, single diode (1/2 wave) off the secondary, voltage divider to Eve’s analog input. Eve is one of Strike’s Arduino crew. There are 9 total (so far). Zener on the output of the divider to protect Eve’s input. The rest is all programming for no voltage, not enough, too much and in the window 100-130 USA. She’ll accept a 1 second brownout but on a single positive half of the sine wave over voltage she kicks us off shore power. Well she tells Adam and he takes us off for 4 minuets. Someday I really should do a video. I’m not good at them but even an overview of the crew may help someone. Cheers
An interesting Real World implementation you have there, Ricky, thanks for sharing. And if a picture paints a thousand words think what a video would do! Great to hear from you.
Indeed. It sure wouldn't be quality and may be difficult to follow with all the systems involved as well as the fact I have never done one before would be painfully obvious. May be a good idea since this heat precludes me from doing much else.
@@RalphBacon I know, I know, it's my background as an electrical fitter that makes me squirm because I know the dangers of mains all too well. You do a good job of drawing attention to the dangers I just feel it doesn't do any harm to reiterate the risks involved! I won't mention the "m" word again, I promise! ;-)
Hi...read your blog, you have a very pragmatic attitude which is great and I wish you loads of good fortune in all your endeavours...Now back to this video...…….It's blooming marvellous !...….I love the thinking and its great to see an "old school" analogue circuit just do what its meant to, more transistors please I say !...……...Very refreshing (like a cold Guinness)
Ha ha! A cold Guinness, hey? Actually, I had a Murphy's this evening, just as good. And thanks for the good wishes. And I'm glad you like the simple circuit, I was somewhat satisfied with the performance too. I must now build it on stripboard whilst it is fresh in my mind. Nice to hear from you, Andy.
Was that the "rude photos" post? I think TH-cam zapped it pretty quickly (before I could delete the post here anyway) and I've blocked the username. Thanks for reporting this Jago, that's the last thing we need here.
I'm likely going to use this idea to detect my doorbell rining. I believe (at least in the US) it is 24vac, less lethal than mains, but this is non-invasive and simple. I really like it.
Check that this will accurately detect 24v AC - in this demo we're detecting 240v AC, 10 times as much and therefore a bigger electromagnetic field. It would be interesting if you would report back whether it can detect it or not. What do you reckon?
I built the circuit (no charge pump or 4th transistor) powered it with 12 volts, ussed a buzzer instead of led. I get .4 volts and a faint buzz running the antenna along side an (18 guage, 120v us) power cord. Not quite there. Maybe a 4th gain transistor. Ill report back if I have any success. Otherwise assume I am sulking in a corner....
Hi Ralph. I just re-watched this video as I'm about to make an electric field detector (like Big Clive's ghost detectors) and I just wanted to elaborate on my earlier comment about completing the circuit. I can see the attraction of sensing the field around a cable (note: cable) as this means not having to separate the wires. But in an electronics laboratory there can be stray fields from time to time and just consider what happens when we get thunderstorms. So, referring to my earlier comment I guess what I was thinking was that if you do separate the wires and put a few turns round a small toroidal ferrite and take a wire from your sensor circuit and wrap that round a few turns too, then back to 0v, you would maybe have a more robust solution that could dispense with one or more stages of amplification. Maybe no need for the torrid - just make a coil of a few turns of the mains wire and wrap some turns of sensor wire round that to intersect the field. Just a thought. PS you're too good for an orange apron job!!
Certainly winding a few turns of the Line wire around a core, together with the sensor wire is how Earth Leakage Circuit Breakers work (aka RCDs) so this idea would doubtless work too, but the focus of this experiment is that it would be totally non-intrusive. Given that the range of the detection is in the area of a few mm I'm not sure stray fields would affect it, but I haven't done the experiments. Now here's an idea, Mike: it takes about 15 minutes to build so why not build one and experiment away? Then report back, of course, and share your findings. By 9am tomorrow morning would be good 🤣 😂😹 (that last one was Benny, by the way). Good to hear from you, as always.
wow! i've been working on a project very much like this for the past month or so... in my project i used a split transformer device that would pull the voltage down to around 5 volts which i would then filter and lower for my NodeMcu (esp82660). the split transformers cost around $10 (US), and your circuit would seem to be a lot cheaper. I'll give it a try! thanks, and keep up the great work! Russ from Coral Springs, Florida, USA
They do different things, Russ. The cost of split transformers (split core current transformers) is quite high as you point out but then again it does allow the measurement of the actual current flowing rather than just the _presence_ of voltage as per my video (but which is all I wanted or needed). The cost is much lower from Far Eastern suppliers: Bare split core: www.aliexpress.com/item/Free-shipping-1PCS-5A-Sensor-Range-of-Single-Phase-Module-Ac-Current-Sensor-Module-For-Arduino/32877238653.html Split core with relay switch (to indicate overload): www.aliexpress.com/item/1PCS-5A-Overcurrent-Protection-Sensor-Module-AC-Current-Detection-12V-Relay-Module/32858449954.html So if you're only detecting the presence of voltage my adapted design should be fine; if you need to measure the current then you'll need to stick to split transformers. I'm glad you liked the video, Russ, and thanks for posting your experiences on this topic, nice to hear from you.
I tested this circuit today, two variation .. with a coil wrapped around wire and just a coil spaced 3cm from the wire. When it is wrapped around the coil, it shows 500mV when switch is off and 700mV when switch is on. But, when the coil is outside and placed 3 cm from the wire, it detects 500mV when switch is off and 4.8V when switch is on. The LED lite up when it is at 500mV and off when at 4.8V. Capacitor is 10uF. Circuit was tested with 15W load and no load conditions.
@@RalphBacon Sorry, my mistake. I had the resistor 100ohms instead of 100Kohms by error. Fixed it. Now, the LED lite up near the switches which are ON and drop from 4V high (using a 18650 cell) to around 1.5V for ON and back to 4V for OFF. More wraps and wire strands also improved the detection. Will try it over weekend. By the way, thank you very much! Because in my region, there is power cut on daily basis and inverter is used for providing backup, I'm planning to detect when mains goes off and comes back, same on the inverter side so as to know the backup time, inverter fault, logging these time info. etc.
Brilliant Ralph.... simple and elegant, wonder what length of wire you could run for the sense wire before it started to give spurious noise responses.... just thinking about if you needed to monitor several things..... it would need several psu’s and nano’s for each sensor.... where as one Nano and some lengths of wire..... Lovely tribute to your Dad...
Thanks, Tony. Yes, I often about my Dad still and what he would have said about this. He would have been fascinated for sure. Regarding monitoring several things, you could use several of these cheap, transistor monitor circuits all running a signal to a single Nano (on different input pins). Then the Nano would know which circuits were live and which were not. Use an ESP8266 instead and we have the basis of a wifi-enabled, mains monitoring station with simple phone app... sounds like we might have just completed my design! Thanks for posting, good to hear from you.
Thats very useful. Concern would be sensitivity vs selectivity, but if that would be an issue, maybe a high or low cutoff filter might help (but complicate things). I have a few of the coils you showed the Current transformers, to measure current, but for a number of appliances I just want to know if they are on or off, so I will certainly make this
Hello Ralph! I have seen this circuit on talking Electronics the author of this circuit is Collin Mitchell, it's called "Mains hum detector", i hope it does not give you any false readings as it's picking up static electricity, I prefer the previous circuit you used which in my opinion is reliable. That's my opinion i hope it does work out for you without any problems! Vasilis K
I found the author you mentioned (and his circuit), Vasilis, thanks for the heads up. Unfortunately, I also found the exact same circuit many, many times on the Internet too, so it's quite difficult to say where it came from originally now. But it does seem to work quite reliably (for me) it will be interesting to see what the feedback is from others who build it too. Thanks for posting.
Another very informative video. Hopefully lots more to come now that you have a little more time on your hands. Many thanks for taking the time to create these masterpieces.
I do this with only two components: A tiny neon indicator bulb, and an LDR coupled together with heat shrink tubing. Provides complete isolation, easily read with microcontroller, costs only a couple of cents.
@@RalphBacon I only needed to detect the presence of the AC, and log when it went off and came back on. I didn't care about measuring the voltage. So I used a small neon indicator lamp such as: www.ebay.com/itm/20pcs-Neon-Bulb-Indicator-Lamp-Red-Neon-5X12mm-With-Resistor-Neon-Light-Lampada/252468642466?epid=850361273&hash=item3ac84dc2a2:g:BS0AAOSwLN5WlmQO:rk:1:pf:0 with resistor across the AC line. These are the same kind of tiny lamps found in orange light up switches. If AC (220v or 110v) is present, the neon will light. I use the Light Dependent Resistor LDR to detect if the neon is lit or not. The LDR is easily read with a Microcontroller pin using a pull-up or down resistor. Use heat shrink to couple the Neon with the LDR in a short piece of drinking straw. Essentially, this is a DIY Optocoupler, with an AC side, and a DC side. Providing complete isolation. Also, you can use a photo-transistor or photo-diode in place of the LDR. I've found this solution works nicely for only about 25 cents.
Hi, It will be interesting to see how this unit reacts in a thunder storm with all the electric charge around. It will also be interesting if you can feed the input through coax or twisted cable so you can mount all the detectors in a box and remotely monitor your appliances. Cheers Dave.
Yes, I'd had similar thoughts about using screened wire up to the point where you actually want to detect it, so spurious signals were not being detected along the way. But all bets are off during thunderstorms, who knows what happens then (we sometimes get power cuts then anyway, so I'd know that the lamps were off!) I'll try and do some experiments once I've built it onto stripboard. Thanks for posting.
Ralph S Bacon decadies ago I went my feet a bit in trying to detect thunder/lightning and that wasn't easy. I suspect this circuit may be insensitive to lightning strikes, unless it's really close. Nevertheless, the proof of the pudding is in the eating
Didn't you do a vid entitled "useless projects" or something like that !...……….any how that involved a Tesla Coil...….Well now ya have ya lightning...……test away!
Thanks for sharing this. Very informative and an easy solution to the problem. I will definitely be trying this out. Please keep up the great work, I enjoy your videos and have learned a lot.
One thought I have Ralph is that a standard Darlington requires a minimum of 2x diode drops to turn on, a triple requires 3x and the circuit as presented has a total of four diode drops to the capacitor. I wonder if a standard Sziklai pair (complementary Darlington) might provide sufficient gain instead given that it only has one diode drop before turning on plus the charge pump diode drop to get current to the capacitor? It would make for an even simpler and more elegant circuit. Who knows, you may even get away without the charge pump if you made a MOSFET Sziklai. The latter if it worked could potentially be made using a single MOSFET N + P complementary pair chip as long as the internal connections allow them to be used in the right way. I shall have to check this out myself as I can see some great uses for this concept. Being able to sense failed bulbs being a classic ... Switch on, power reaching the ceiling rose but no light hence bulb or neutral failure. If other lights on same neutral work, definitely the bulb. From a long term safety perspective this is potentially by far the safest, but given that people would still be in close contact with the mains whilst fitting the wire sense, especially when having to remove light switches etc. I don't think it's really that much safer whilst fitting than your first circuit with the opto isolators ... In both cases the power and or lighting circuits should be isolated before doing any work so from a safety perspective. In THAT sense, there is little difference, although this method produces a result with far less risk of voltage breakdown causing issues which opto isolators do NOT necessarily provide unless they are true HV isolation types i.e. > 600 volt.
Interesting slant on this design you have there, Bob. You seem almost on the point of trying this out so I'm going to hand over the baton to you to follow through and see whether your theory pans out in practice. I look forward to hearing the results in due course!
It's *great* you put it together, Ed, and must be quickest anyone has ever followed one of my circuits, but I'm not quite sure what you mean about not much difference whether on the live wire. On a standard mains cable (eg one running to a heater, lounge light or anything that has two or three core cable with a plug on the end) it will detect the mains "as is". The problem is with the dual-core wire (plus earth) running to light switches in or behind your walls - you have to ensure the sensor wire is only looped around the switched wire, as per the demo, otherwise it will _always_ detect the presence of electricity. Perhaps I didn't quite understand what you mean, care to just clarify for me?
I understand your point Ralph, but, I noticed that no matter what (single) wire I coiled it around, as soon as the (electric) circuit is broken, the sensor picks up on that. But it's the continent, things are different here I guess ;-) Anyway, it works. That is the most important thing :-)
Ah ha! The plot thickens. I'm guessing from what you've said that the wiring layout and switching arrangement may be different on the continent (from the UK) in some way. But as you say, it works so that's the most important thing. Thanks for clarifying this.
@@RalphBacon (dunno if you still care, 5 years later, but...) could this just be a case of it needing to be passing a certain amount of current before the detector will register? That's my interpretation of what Ed reported, though I've not (yet) tried it myself, and I'm far from an expert, so I could easily be wrong. That's just how I'm interpreting it. Would be interesting to know! Would also be interesting to know if one could (without a much more complicated circuit) make at least some crude level of detection of different current flows -- not necessarily precision, but just having an ability to distinguish between, say, 10W and 1kW or whatever.
It's certainly easy enough to build, Tony (on a breadboard first, perhaps) and you'll find a use. It might flash if you put it near your mobile cell phone - it should light up when you receive a call. You can let us all know whether that happens!
amazing project and thank you. i tried to build it. LED gives light when it's close to a live wire and the switch is off which is when no current is flowing. after the switch is on and when current is flowing i expect to detect EMF on the neutral wire (just after the switch) but LED is off. I used 1N4007.1uf electrolytic capacitor. what did i miss here
If the LED lights up when the switch is off, it means that that wire is still "hot" but the switch is preventing current flow. Typically in a house, the wires are live with a branch to the switch. The neutral wire will never give a reading as it is the equivalent of the Earth wire (N and E are connected together either just outside your house or by the electricity company on the way to your house).
If you build it and use it in a non-hobby environment then you are not covered by your work insurance as you are using a non-approved item. But if it is battery powered (this could be), in a plastic box, then the risk must surely be very low? But your employer will have different ideas, I'm sure.
Hi Ralph, good video. I believe here in Australia, if your friendly electrician (who must be licenced guy/gal to play with mains wiring) is to wire a simple light and wall switch, that the active and neutral supply have to go to the switch and then to the light. Even though the active is the only switched wire. Did you try looking at the sense wire input with the scope? It would be interesting as the impedance of the scope may be a problem.
I did try and look at the sense wire signal but it was just a jumble of noise; after the first stage transistor, though, I got a spiky 50Hz signal OK that my 'scope could resolve. Regarding Australian light switch wiring, they looked to me pretty much the same as UK ones: diy.stackexchange.com/questions/28013/why-is-my-australian-light-fixture-wired-this-way Logically, this is the way to do it. There is no more efficient way, and bringing the neutral to the light switch serves no purpose at all (unless the light switch is also a PIR, in which case it will need it). I've also seen some low voltage remote switches (eg for bathrooms but can be used anywhere) where there is a control unit in the ceiling where the ceiling rose is and a couple of low voltage wires run to the switch - now THIS is a nice way to do it as it reduces risk and hum and just feels right. It keeps the high voltage stuff where it needs to be and protects consumers from 230v (or whatever it is in your part of the world) when removing light switches when decorating, for example. Unfortunately, this circuit would not then work! Thanks for your post, Tom, nice to hear from you again.
I haven't tried it but I wonder if 4000 CMOS could pick up the AC from the coil and do the job without all those transistors. I'll try that this weekend! I've been looking for a non-contact solution to do zero crossing detection.
ok, finally got it working. Should follow your actual implementation, and not the drawings... the last part, the charge pump, in your actual implementation, the 4k7 is missing. It works when, the T4 base connects to the capacitor, and capacitor connects to Gnd. The Emitter connects to Gnd.
Oh. I've just checked my video and the "white board" drawings there do seem to include the 4k7 resistor - so please tell me where the error is so I can fix it (or at least make a note so others don't get mis-led). That said, the 4k7 resistor should just ensure the capacitor doesn't remain charged (and hence give a permanently "on" signal). But I'm glad you got it working at last!
strange, when i put in to resistor, it doesn't work. The values starts at 5V (I used analog pins to check the voltage), when main is off. When I turned on the main, the value goes to 0 and then back to high values (4.xx).....
How does this detect the power on/off state when the antenna is around the appliance power cord (as shown at 25:42)? Doesn't that cord always have power going to the [clothes dryer] appliance and the on/off switching effect occurs internal to the appliance? In other words, this detector detects the presence of electricity, but not the flow of electricity, correct? If I'm interested to know when the dryer turns on/off by only monitoring the appliance cord for the flow of electricity, I would need the current toroid sensor circuit? Love your videos, I'm always learning something when you make a post.
You are correct inasmuch that this detector only detects the _presence_ of mains, not the flow of current. As you suggest you need either a current sensor, either something non-invasive like this: www.ebay.co.uk/itm/1Pc-SCT-013-000-YHDC-30A-50A-100A-Retractable-Current-Transformer-SCT0130-YM6K/313337299840 or something where you have to make a box with a socket etc: www.aliexpress.com/item/32890540897.html The problem with the first method is that the tumble dryer/washing machine etc can sometimes just sit there having a think, and during that time very little current is consumed - making your sensor suggest that the power cycle has finished. Even the second method has that problem but is slightly more accurate (but not much) because your current sensing device must be rated appropriately (so for a tumble dryer or washer, more than 13A, probably 20A is the next value). How does such a device detect just 100mA current? Poorly is the answer. What I did is have a configurable delay, so that I would wait for 5 minutes after a "no current" measurement and then sound a "washing finished" alarm if it didn't start up again (and reset the 5 minute delay). Tumble dryer was easier to detect than the washing machine.
Hi Ralph, Thanks for the video, for the clear explanation. I've built the circuit with exactly the same comonents. It kinda works, but seems to be extremely sensitive, the LED is on most of the time, even when powered from a 5V charge pack. Which parameters/components could be changed to make it less sensitive? Many thanks! :)
Well, it's good it worked but it sounds very sensitive. Put the aerial/antenna via a very small capacitor (eg 100pF) and see if that helps. If you disconnect the aerial does it turn off (ie it definitely turns on because it has detected something via it)?
This is the circuit I was looking for to signal a Victron Global 520 to report over cellular when my Mains is on / off during power outages - I'm planning to use a 3V rechargeable battery, trickle charged with a USB wall wart. Then when Main is off, would run for days on battery alone. Do you have any measure of the current draw while the Mains is on and that circuit is live/drawing from the battery? I've calculated it should be less than 400microA. (approx 367 uA) while Mains is on (not counting whatever is connected to the Output pin to signal the Victron. I may be overthinking this because the circuit should be off while mains is off; so battery should last for a VERY long time as long as I keep the draw on the output pin very low. Thoughts? Thank you!
I have two devices in my workshop that have to act differently when the mains power supply is interrupted; both have battery backups, from a small Li-Ion battery of about 1000mAH. Anything from 500mAH to 2000mAH is small, slim and works great. The way I do it is to run the ESP32 board (which has an inbuilt battery/charger) from a USB-style wall wart; I also connect the incoming 5v (eg from the USB socket) via a suitable 3K/2K resistor divider to one of the GPIO pins. So far, so easy. When the power is interrupted, and the wall wart stops supplying power, the ESP32 keeps on running uninterrupted on its battery power. But it knows the power has gone off because the GPIO pin (monitoring the incoming 5v) reports zero volts. It then, for example, sends a WhatsApp message or email or whatever to alert me, or just does some other processing as required. It only requires the battery to run for a minute or so after power interruption, although I've discovered the ESP32 can run off my Li-Ion battery runs for 15 hours+ before it is depleted. If you put the ESP32 to Deep Sleep and wake up every 15 minutes to check the power state, it can run for a couple of days (at least, I've never depleted the battery!). My ESP32 board with built-in battery socket and charging circuit is a TTGO T8 v 1.7.1 but there are many others out there that have a similar setup, some quite a bit smaller than the one I mentioned. Just throwing this out there for you to consider too!
I'm confused. I wonder why you have a load on the mains. Is that required for the circuit to detect or what? I'd like a circuit that detects the AC voltage with or without a load present. I guess I'll have to make it and find out for myself. Thanks for almost giving me the answer I'm looking for.
The load is purely to ensure we have a main supply flowing which can be detected. This will detect the _presence_ of mains in a wire, but if that wire has been switched off (eg wall light switch) it obviously won't detect anything.
@@RalphBacon Thanks for your reply. I built the circuit using 2n2222a transistors and was able to confirm no load required. I hope you continue making these great videos. Have a wonderful day.
I wish someone just sell this as a board already made up. A lot of people are demanding of this kind of sensor for arduino & Pi but dont want to spend hours ordering each components and making pcbs, soldering .. If someone want to do it, ill need 10-20 units of this.
Hello Ralph. Your handy video was just what I was looking for to monitor the state of my central heating valves (which are as you may know are mains operated). I followed your excellent instructions and built one. One odd thing though, it works perfectly off a battery but the moment I switch to the ESP8266 3.3V supply it lights up. Not sure why. Uses the same wire from the circuit to the microcontroller or battery. Could there be some noise on the microcontroller supply that triggers the sensor? I notice in the video you have an extra (undocumented) cap on your prototype board between the signal aerial and the transistor. Would that help? Anyway, not sure if you still monitor this but thanks for the great video!
Running off mains means that noise, as you suspect, will probably make its way into the circuit. Either seriously decouple the supply to the detector (low value resistors, in series, with caps to ground at each junction. Say 10Ω resistors and 100nF-ish caps) or just run off battery when you need to detect the presence of voltage. If you have a scope check what the voltage line looks like.
@@RalphBacon Thanks Ralph. I suspected as much but was not sure how to clean up the supply to the sensor. I'll will try your suggestion although in the meantime I bought the mains optoisolator from your other video - (sensibly encased in a project box with a transparent lid before the h&s zealots start kicking off) and that is very reliable!
I've built and rebuilt a circuit based off this about 100 plus times and I can't get it to work properly / consistently. :( I feel like I'm missing some key information on the input channel, and the charge pump components. I delved into a fait bit but still seem at a loss (using the pi pico, Thonny, Micro python and ADC input since I can't seem to keep the voltage reliable)
Are you picking up extraneous signals from your hands or other wiring nearby (eg other wireless equipment)? You can use a shielded box for the components, make sure the power is ripple free (use a battery for testing that) and shielded cable for the sensor up to the point where you want to sense power. Different transistors may have different gain (Hfe) that could affect the result - talking of which what results are you getting, John?
Thanks for the video. I would to buy an 8-channel circuit to detect 24VAC from a PLC and get a 3.3v output. Do you think it's possible without changing the big resistor?
Sorry, Stefano, I wouldn't like to comment on the suitability of your project, although detecting 24VAC should be tested first, as this was designed for 240VAC (or thereabouts).
There are probably a hundred ways to do this, ct clamps, current sensors, etc. Your choice is a nice one, low cost, doesnt add extra features. The only thing I wonder is does it fail silently? I think if the first darlington "pair" fails the current could be on and you wouldnt know. If I am right, it should be fixable by inverting somewhere in the path.
Hmm, I'm not sure we cater generally for hardware failure conditions, do we? This is already a backup of my Sonoff/RasPi automation hub, so I get independent verification that things are doing what the computer is saying it is doing. So if this fails (seems a bit unlikely) I guess I will be "blind" for a bit until I realise it is not working. And, yes, there are many ways to do this and this is just one way, but as you say it's pretty basic and therefore simple. Thanks for posting K3n7, you raised an interesting point.
Ah no, it doesn't matter whether the light bulb has failed or not, as this detects the _presence_ of electricity, not the _flow_ of electricity. Yes, if I turn the light switch on and nothing happens the bulb may have blown but the phone app (or whatever I end up using) will say that the lights are on regardless. That's what I like about this circuit!
Thanks for that great video Ralph! I'm using your circuit to detect the mains of my lights with an ESP32, but it doesn't work as expected! When I turn the light off, serial shows off, but when I turn it on, serial shows on, off, on, off,... randomly. Checking the VoltsPin with multimeter it reads nearly 5V when the light is OFF, wich is close to VCC. But when I turn the light on it reads 2.5V!! When I performe a analog.read(VoltsPin) when light is OFF, it reads a valaue of 4095 constantly, but when I turn on the light, the reading drops to 0 but raises up to 4095 again, drops to 0 and raises up to 4095 again, and so on!!! What's wrong with my circuit, or do I miss something important!! What is that orange thing on your breadboard before the first transistor, where you connect the antenna through? it isn't shown in the schematic??? CAN YOU HELP ME, PLEASE, I'M STUCK!! THANKS!!!
OK! The "orange thing" is a capacitor, connecting the antenna to the base of the first transistor (T1). It is a filter to reduce interference. It's probably about 0.1μF but you may need to experiment with the value a bit (say, from 0.01μF [10nF] to 0.1μF [100nF]). See what works best. There's another capacitor between the base of T4 and GND to eliminate jitter (ripple) and is "fed" by the diode from T3. The voltage at the base of T4 should be steady (800mV+ or 100mV). In other words the final OUT is either HIGH or LOW, not jumping about. Does the LED in your circuit remain steady ON when the mains has been detected? This will indicate whether your circuit is working properly (if not, then no wonder the Arduino detection does not work either). If you have a scope then it will be easy to see the outputs at each of the transistors emitters but if not check the above in logical sequence. Good luck!
Does the mains voltage has to be connected to a load? i mean there should be a small bit of current flow for the electromagnetic field to be formed right? in my scenario i want to lay out a wire directory to my diy hub and act as a binary sensor showing the precense of voltage in the mains which might not be compatible with the new way explained in the video
No. but at least one of wires must be connected to mains voltage for it to be detected. Note, however, that if you have a light switch, the "line" (aka live) wire will be hot up to the switch. After the switch it will be off but usually the two wires to a light switch run in the same outer sheath so would be difficult to differentiate.
Another very good video. The one fiddly bit is the splitting of the 2 mains wires. Does it happen to work if you just the sending wire alongside of the main wire (straight, not coiled) or if you do coil it about both wires? Theory says that it is unlikely, but with the gain in that circuit it just might detect the difference between on and off anyway.
Yes, Cir, that is the fiddly bit, and might not matter to many people. But I certainly need it to detect my lights. You _might_ get away with running it in parallel with the switched wire of the pair but it might make it very unreliable; I'd prefer to gently (and safely) split the wire and loop it around the switched wire, exactly as the demo, by YMMV. Thanks for the great question, nice to hear from you.
I guess you could do that, John, but I'd like to see the advantage of an opamp over the circuit I proposed. KISS and all that! And it gives viewers a chance to actually use some discrete components here. Woo hoo!
@@RalphBacon I use op amps in these cases because they are an integrated solution to a high gain amp. Kinda like your power amp video I just watched. They are cheap and ubiquitous. I use them anywhere I don't need CURRENT amplification. Of course you can get high current op amps as well. I love your videos and am just throwing out alternatives. Back in the 80 I got an op amp circuit book and studied it well. You can use them for low / high / band pass filters, very linear amplifiers etc. Because of the high gain they bring to the table.
@@RalphBacon an op amp will be an 8 pin dip with 2 amplifiers. Input and feedback resistors, A diode and a capacitor. Much simpler circuit. KISS.😉. Love your stuff tho.
There is no circuit to complete here, Mike, as the sensor wire acts pretty much as an antenna or aerial, so feeds in its signal to the rest of the circuit. I hope that clarifies things for you, thanks for posting a good question.
An op amp connected as a comparator (or a CMOS Schmidt trigger) will work fine - antenna connected to inverting input. One 8-pin IC and two resistors to set the threshold. Run the op amp or CMOS Schmidt trigger at 3.3V and...
BTW, why might you use an IC instead of discrete transistors? These are either dual-op amp (or dual Schmidt triggers, such as the SN74LVC2G1) or quad op amp (or even 6 Schmidt triggers, such at the 4016). Lots of inputs may be detected with a very compact circuit. Use care connecting multiple antennas to avoid crosstalk.
An interesting alternative that you suggest there, Richard; I especially like the idea of multiple inputs. Care to draw out a quick (but complete) circuit diagram and I'll mention it in a future video? Thanks for posting this anyway!
Hi Ralph, I decided that I shouldn't rely upon a 70 year's old 40 year-old memory (the last time I thought about this topic), so I prototyped my concept. It works, but not as a direct substitute for the transistor version. The comparator output isn't a digital signal. Well, it is, but it is either high (power detected), or 50/60 Hz pulses - I'm in the US, so 60 Hz is the name of the game for me. Thus, my Arduino code detects either a pulse train, or its absence. Why? Well, the "antenna" is just that, an antenna, and it picks up any stray powerline signal(s) in the general area, not just the signal in question. I used a thin coax cable, with the shield grounded only at the comparator, and allow the center conductor "antenna" to extend just a few inches beyond the at the far end, then to be wrapped around the target switched mains feed. The pulses are generated because stray signals, even with a shielded cable, exceed the comparator threshold when there is no local electrical field. You can see this by touching the oscilloscope probe tip with nothing else connected -- you are the antenna. However, when the power switch is energized, the stay signals are reduced by the effect of detected electrical field AND that the actual amplitude of this new induced signal has lower peak-to-peak excursions than that of stray signals. It actually feels like there is a little black magic involved. Counting pulses also acts a type of digital filter. If there are fewer than 25 in a period of one second (30 here), then something went haywire; ignore, reset the count and try again next second interval. This should avoid false positives, or in this case "negatives". I'd also monitor the analog value using a separate AD input of the Arduino (need more hardware on a Pi!), if there were no counts during a period of one second. If the analog value is not "high" but is low, something else went southwest. It is interesting to see the input signal on an oscilloscope and to come to a sort of understanding of what is going on. It isn't really intuitive, at least to me. Anyway, I can email you a video showing my results and a schematic, if you want. Your transistor design might be best, mounting the detection circuitry right next to the source, so that the antenna is very short -- as short as possible, so that stray signals are minimized. The output signal could be connected to a central Arduino via something like Ethernet cable, so that the circuit power could be furnished over the cable. My "design" would facilitate connection to the source via the coax (distance limits probably apply, TBD), while the circuitry could be near the Arduino itself. BTW, the components I used are a single op-amp (I used a BiMOS CA3040 - the modern part is CA3140 -single OA and CA3240 -dual OA. Because I had a 3040 in my parts drawer) and 3 resistors. Two resistors set the comparator trigger level (about 5 mV, I think) and the third terminates the coax at the op-amp. One might add a fourth resistor as positive feedback for the op-amp, if there are noise problems in practice. Pretty simple, but only investigation would tell if there is anything to be gained here. Just to be clear, I could not get this circuit to work with unshielded wire. Dick (www.hardandsoftware.net)
A very informative experiment, indeed, Dick. I'm thinking that if the input signal is sufficient to trigger the comparator without the real signal being present, then maybe either a series resistor may help, or a potential divider or a 1M resistor across the sensor wire and ground (think: x10 oscilloscope probe), with or without a 20pF capacitor in parallel. Just throwing ideas around. Your idea of shielded cable has been discussed in other comments; I'm surprised it didn't offer better shielding. Perhaps your circuit is just too sensitive as it stands (or you have rubbish shielded cable, gasp). I might try this later this week (I'm actually working on Monday with a 7am start!) The idea of counting pulses, or detecting a certain analog value was the very thing I was trying to avoid, actually. High or low is what is going to be the most reliable in this case, but you never know. I'll put my circuit through some further experiments regarding the above so I can compare. Thanks for doing this, I hope you had fun even if you did end up waving a dried seaweed root over your oscilloscope at one stage! Black magic indeed. Stand by for more experiment details but don't hold your breath.
I imagine this would detect all mains-level voltages (eg 110 volts in the USA) but the lower the voltage the less the field around the wire (it must be AC). I don't know what the lowest voltage is that it will detect, I've never tried that.
This might have been answered, so I am sorry if it is. Your drawing in this video doesnt match your Git repo. I think you explain that in the video, but I cant find the info on the capacitor used in the charge pump. For some reason I can never identify what type of capacitor is used. Are you able to clarify or provide a jameco link to the cap used in the charge pump?
From what I can recall, Jim, and I've just looked at the schematic, a normal electrolytic capacitor of 1μF - 10μF with a voltage rating of about 10v (you can go higher but it will get bigger) will suffice.
Hey there, thanks for this beautiful video. I have been using the contact based voltage sensor as what you started with. My requirement is actually very specific which is fully satisfied by the contact voltage sensor so I am wondering if this will also do the job. In my use case there will me multiple wires with live in them in the vicinity of where I want to measure the presence of mains in one of the wires. So something which would catch the signal from a few mm away wont do. I need to monitor only a specific wire - would coiling around the wire in question do the job , I will make this and try this out. If you know, please let me know.
I could not get this to detect AC when it was powered from any type of 5v USB charger or other types of plugin wall psu's, I tried loads. The only thing that does work is when powering the unit from my PC 5v usb or batteries. I could only think that the wall chargers use a capacitive dropper and possible cancelling out from the coil, did you have this problem ?
I didn't have that issue AFAIK but I can only think that the 5v (switched) PSUs are introducing noise into the system that basically makes the circuit insensitive to anything. Try filtering the 5v via a very low resistor eg 100ohm followed by low value cap eg 100nF to 10uF.
Hi Ralph, I am new to electronics, so excuse what might be a daft question. I want to use this with a raspberry pi so built the first part up to the first 3 transistors and LED but the led is always on (but dim) even without the aerial but glows brighter when I add the aerial or put my finger close to the first transistor. This is even before bringing the aerial close to the AC cable. Any suggestions as to what I might be doing wrong. Many thanks
You're acting as a ginormous aerial, Peter, and you will have plenty of electromagnetic interference (ever touched the input to an audio amplifier and jumped out of your skin with the loud buzz that ensued?). You could use screened cable, of the type used for microphones or other audio inputs. The outer, coaxial screen goes to ground and the inner wire is your sensor that you can then extend (without the screened outer) for the actual detector wire (short-ish). Finally, try a high value resistor in the sensor wire, 100K to 10MΩ to reduce the sensitivity. And/or a high-ish value from the base of the first transistor to ground. Your transistor setup is probably a higher gain than mine was (just random luck) so is picking up more mains hum floating about in the ether. Good luck!
Hi, I having problems getting this circuit to work? How did you power the arduino? I’ve got mine connected to a standard mains powered usb charger and the voltage detector circuit is on all the time even when there is no power cable near the antenna! Looks like theres some noise coming through from the ac as the circuit works perfectly using a battery!
I've powered the Nano from a standard 5V USB hub, David, but I'm powering the transistor circuit from the 3v3 pin. Check the voltage at the OUT point - it should be the same as VCC (3V3) with no mains being detected. It will drop to near zero when the mains is detected. If you have a scope you can check your DC supply. Try putting a 100Ω - 500Ω resistor in the VCC line to the circuit with a 100nF cap either side. Also add in a 47µ-100µF after the resistor (ie transistor side). That should clear any ripple.
If we're talking about the circuit at 6:00 then we are only running from 3v3 in the first place so it's just the inherent resistance in the circuit and the fact that only a few milliamps will flow because we have a 1N4148 diode in series with T3 too (forward voltage drop of about 0.7 - 1v [max]) and then via T4 (another 0.7v drop). This brings the voltage for the LED down to below 2V3 which is safe enough to ensure the max current of 20mA is not going to be exceeded. If you notice how dimly the LED lights you will see that my hypothesis is correct! Even at 5V VCC it will still be fine!
@@RalphBacon Have just tried your circuit, never once has a circuit worked, and worked perfectly the first time of asking. was looking at all sorts of solutions an this is by far the simplest. I will be looking into a 2 darlington configuration 10k gain at@ 1mA - little more expensive but same TO-92 package and hopefully mitigate T1 and T2. will let you know. Thanks again for the vid Ralph
Nice video. Just what I'm looking for to detect whether my oil boiler is being fired up - I wanted to sense if the oil feed solenoid was being demanded so bought a single channel version of one of those dodgy boards but never had the courage to implement it. Will definitely try this. Just a couple of thoughts. Is it detecting voltage or current? The video suggests voltage. Will the number of winds increase sensitivity? Could the coil be alongside or around? (I will experiment and report back when done.)
@@RalphBacon I made up 2 on a bit of veroboard to sense my Boiler Termostat demand and the Oil Sonenoid demand. The Heating controller demand I've got sensing from the battery charging circuitry. BTW I've also got 3 x 18B20s sensing the cabinet, water out and water return temperatures. A bit of Arduino code for an 8266 and I've now got all of this being reported to my Home Assistant through an MQTT broker. So thanks for this video which enabled me to complete my ambitions safely. I did use some different resistor values - 47k for T2, 2k2 instead of the LED, and 100k with the 10mf smoothing bit. One of my circuits is using 2N3904 and the other is using 2N2222. The latter is slightly more sensitive. In fact both were over sensitive until I made sure the mains cables being detected were properly connected to Neutral. The cheap JYETech home built oscilloscope really came in useful. Thanks again.
Update - I made up a circuit and put it in my boiler with the antenna on the wire coming from the internal thermostat and it is just too sensitive giving false on readings. When the power goes off it momentarily goes off too then over a few seconds the led indicator comes back on and says on. I've even tried putting the circuit board right next to the mains wire inside the boiler and keeping the antenna really short. Any clues on what I can do to stop this?
Hi Ralph. Thanks for the wonderful safe solution! I have tried to build this with Ardunio Uno. I powered the circuity with 5V (and then also with 3V source from the Arduino) I connected the antenna to a life wire. The LED is steady. But the output from the 4th transistor is going ON and OFF using the digital input of the Arduino. I tried using Analog input, and saw that the values are fluctuating. I used 10 uF capactor. Any idea what could be wrong with my circuit? Thanks.
Hi Ralph, been a while since you posted this, but I've only just had my interest peaked :-) I built this, and got it to work quite reliably, but only when I used a 47uF capacitor in the final stage, wouldn't work at all with 1 - 10uF. However, it works great if I power the circuit from a battery or USB lead from a computer, but if I use any SMPS like power adapter, including the genuine RPi PSU, the circuit is permanently triggered. I guess it's some sort of interference from the switching, so I've tried various smoothing capacitors to no avail. Did you see this behaviour?
I didn't see that behaviour at all, Nick, I must admit. I've just checked the video and I see I was powering the circuit from the Arduino itself which could be quite noisy - but maybe not as noisy as a SMPS. As well as smoothing caps, try putting in a 100nF cap too (in parallel) as that defeats high frequency noise on the power lines (and why we put such caps right next to the power pins of ICs and MCUs). Nope, I don't understand why a 10μF cap would not work for you. The upside of all this is that you researched and modified the circuit to get it to work for you, so kudos indeed!
I had a similar experience detecting 110v ac using 3.3vdc as the circuit supply. The 10uF cap didn't have enough energy storage to keep T4 on for the entire 60Hz cycle.
Hi Ralph. Can this be used to check is there electricity without any bulb at the end? The other words, to check is there electricity in an outlet with nothing plugged in? Just to check AC is there in a cable or not. Bare wires, nothing at the end. No current flow, just power on in cable.
It will detect the hot (live) wire only as that is the only one carrying voltage. Whether a bulb is plugged in or not, I'm pretty sure, as that wire is generating an electromagnetic field around itself.
Great video! I just wondering what will happen if there are bunch of live wires as we have behind the panel and we have activate a device with a relay and then detect if it turned on/off or not. Wouldn't other live wire interfere with this circuit? Also, we have 230VAC to 5V modules with lowest possible current rating which are available in PCB mount version, which can be connected to parallel to our circuit after the relay. Wouldn't it be a better and reliable alternative to your circuit?
Yes it will interfere, Nitin. This cannot differentiate between different live wires, only detect the presence. So if one wire is already live, switching on another will probably have no effect (it _might_ make the LED a tad brighter). I don't know what you mean by the 230v to 5v modules being "better or more reliable" than my circuit! In what way? You can run my circuit off 3 AA batteries, about as safe as you can get too. You'll have to clarify that question, Nitin.
@@RalphBacon Lets take another scenario, you have 3 wires, you want to detect if one wire is live or not by winding up a wire of your circuit and 2 other wire are also nearby. Now, if any wire from those 2 other wires goes live, even if the wire we are interested to detect doesn't go live the interference from that wire from those 2 other wires may be picked up by and we can have a false positive. Now, about the 230V to 5V modules, those modules have mini transformer along with other components all encapsulated in a plastic case with only 4 wires coming out, 2 for main inputs and 2 for 5V DC output. You can get such module for PCB for a rating of 200mA. If we use those after our relay or switch, that we are interested to detect if it is on or not or mains is available or not, we can use those module which will turned on when our mains/switch/relay is on, we will get a output of 5VDC. It does not interfere with other wires, and it can power another circuit if so need be.
The 5v SMPS units you refer to (which can deliver more than 200mA BTW, see my video #105 (th-cam.com/video/xodLuR6C8N4/w-d-xo.html ) would require actual physical connection to do what you describe - the opposite to the thrust of this video! But yes, it would work. Another way to differentiate wires, if you have access to the wires, is to wrap the "antenna" part of this circuit around/along the wire you expect to go hot; that way others will not really affect it too much but should that wire suddenly carry 240V it will be very obvious.
@@RalphBacon Yes, I'm aware of the challenges. It is a interesting problem when it comes to reliable detection and being economical at the same time. 5V SMPS has it's own problems that it need to be protected by fuse, once it is fixed inside a panel, not easy to replace and then some constant power loss, though smaller but still some power loss of those module/units. I'm building a DIY 3-phase smart meter for my home, I can get currents reading reliably now if they are above 0.2A using a 70A Hall sensor (may replace it with lower current rating). So mains/live wire can also be detected by hall sensor and they also have minimum to no interference, they are cheap and constant loss of power is also less than smps modules. Of course, we have to clamp or pass through wire we are interested in. Perhaps, we can modify your circuit where it coils around wire. We can have more winding when wrapping it on the wire we want to detect, and we can insulate those winding from outside so it can minimize the magnetic flux from surrounding wire. Investigation of such kind of tape/material which can provide of insulation is needed.
Whole Lotta questions popping into my mind: would it work with a standard two-can darlington array, have you tried that? How close can the wire be to that antenna in the switch scenario so it doesn't trigger permanently? Is that w fourth transistor really necessary, why not do that in Software? Those are just the most prominent ones.
It might work with a single package Darlington, I haven't tried, it will depend on the gain of the Darlington pair. How close it can be depends on that gain - try and see. Transistors are cheap and fast and hardware is sometimes better than software but it's your choice, try it and see!
If you touch the base pin of the BC547 does it light up the LED? If not, perhaps it does not have the required high gain for this circuit? Build the circuit starting with just one transistor and work up in stages to see when it stops working.
@@RalphBacon Hi, thanks so much for your answer. My LED is on most of the time, seems to catch up noise, I have ordered the 2n2904 so I plan to wait. The gain math is one or three levels over my skills. I will use the circuit for my pond pump and and well pump and send cycles to my Home Assistant.
Unfortunately not, Robert, as this will really only detect mains (240v) level AC voltage. With a speaker output you could use an optical isolator, perhaps.
I Love it, how much power does this Consume... im Looking For something like this to Monitor My doorbell (Send via 433mhz or mqtt, but an ESP32 For example draws Slot of current from a Battery..)
Most of the power here is drawn by the LED but even that might not be much, depends on the LED. Some consume only 2mA. Too much for a battery though, if continuously driven. You could use an ESP8266 that sent out a quick MQTT message every X seconds/minutes and then goes back to sleep. Others might have more experience of this so we will wait to see what they say.
Ok, maybe i Try it without The LEd. Thought a ESP32 has a Deep sleep Funktion, it should only wake up if The Front door Bell rings and Send mqtt. Should work Fine because The esp does Not use much power in Deep sleep.
Yes, the trick is to use a µController that allows deep sleep and only wakes up every X minutes. A doorbell is, perhaps, a little more time-critical (you don't want to be notified 5 seconds after someone has pressed the bell) but for mains detection, it doesn't matter too much. I'm making a note even as I type this to look into sleep modes for the ESP8266 / ESP32.
I tried creating a voltage detection circuit using three BC547, power it with 5V via a phone charger. The main problem is there is always false positive when the phone charger is power on (the detection voltage have a power supply). Only when I remove the phone charger (still have power in the capacitor) then the circuit work as intended. Does any body have the same problem ?
It's probably mains-borne interference (mains hum) making its way up the wire. Try running it off a battery of suitable voltage (eg 3 x AA) it will be good then.
@@RalphBacon It's no good mate as I intended to use the detection circuit as a sensor in an Attiny project so I can't rely on battery due. But your answer does explain why my other experiment failed. I tried creating a linear power supply as I assume the fault is i the high frequency switching in the switch mode power supply. I created it but it still gave false positive. I'll probably try something else like creating a switching circuit for it, sth to temporarily power the detection circuit for a while to charge the capacitor before measuring. Then open the circuit and let it run on the left-over juice from the capacitor for accurate measure. Thanks for the reply, mate! It's heartwarming to still got help from a video so long ago
Hi Ralph, this is a great video, big thanks for the video! I have build the circuit as you said but my output voltage from 4th transistor is fluctuating and Arduino is receiving high and low randomly even when continuous AC current is flowing, only the thing I had to change was capacitor, I had to use 10 microfarad electrolyte one since I could find the one you used in the diagram. can you please help me to find the what is going wrong with my circuit? thanks a lot.
Hmm. Does the red LED also flicker wildly or is it steady? The 10µF should make the Arduino see a steady voltage not a rapidly moving one - you are using pin A0, I assume? If you put a multimeter on the base of the last transistor (T4) is it a steady voltage?
@@RalphBaconthanks for the quick reply....the red LED is study and and I see .5V of Steady voltage at T4 Base. first I used digital pins to see the HIGH/LOW but it was continuously changing between HIGH & LOW then I switched to A0 to see what's happening. it is going like below, and I have changed T4's many and also tried using 2N2222 but no luck.. what is happening here? is there any way I can fix this.. I though this is a great hack to use in my project but not working only for me... 933 1023 1023 131 1016 1023 2 592 1020 1023
I'd just use H11AA1 and acouple of resistors to detect zero-crossings. Minimum components, galvanic isolation and reliability. It's more appealong to make a proper isolation for the circuit then to deal with dinky antenna wires and separation of L&N conductors. You gonna need to cut in mains wires anyway if you are going tocontrol it and not just monitor.
Ah, I guess you must have missed my video #111 Mains Optoisolator which does pretty much what you describe here. The module I use there is available in single detectors or in a three-unit module like the one in the video. Regarding the cutting of wires to control them, that is absolutely true, but not the focus of this video! Thanks for posting.
Typo Alert: At 11m, the schematic says "2N2904 or similar NPN...". I suspect that you meant 2N3904, the famous NPN. The 2N2904 is the famous PNP of course. Cheers.
Yup, that was pointed out already (will you all STOP trying to earn your *EagleEyes* awards please?) but I'm hoping the context and transistor symbol points to NPN-type transistors. Thanks for posting JH, good to hear from you.
Just built the circuit using 4 transistors 2n3904 and a loop of wire as the antenna. The problem is, the LED lights up as expected up if I put the antenna around the live wire, but it never lights up when wrapped around the neutral. I'm in the US by the way. This circuit does not detect the AC voltage in the neutral wire after I turn on my desk lamp, only in the hot wire which isn't useful since that's always on. Any tips for troubleshooting this issue? I'm getting 4.75v at the output when the LED is off and 0.75v when the LED is lit up. I swapped the 10k resistor out for a 1M because with the 10k I was getting 3.3 volts at output when LED is lit and I don't see how that would work with Arduino logic levels. This is the only change I made from the reference circuit.
If you have a live wire going to a lamp but the lamp is switched off then the neutral is not carrying any current. Switch the lamp on and the neutral also becomes "hot" and this circuit should detect it. Have a go, let me know!
@@RalphBacon Thanks for replying. I wish it were that easy. I have switched the lamp on and still the same issue. I made a video to show you what's happening with it: th-cam.com/video/k1MrWLVsumo/w-d-xo.html
Your video described it perfectly. You are supplying the lamp with both Line and Neutral. Once the current hits the neutral wire it cannot be detected (otherwise it too would be "hot"). You won't get a shock by touching the neutral wire (but don't try it) only the line "hot" wire. Neutral is, in fact, connected to earth either at your premises or in the street somewhere. Make sense?
Hi Ralph, interesting and entertaining as are all your videos. I've learnt loads from them. Re your blog, have you considered Patreon? I'm sure enough people would cough up a dollar a month to cover the costs. I'd be sad if you didn't continue.
Well, Steve, the idea is not to give up on this channel, the idea is to make the channel pay its way. So whilst Patreon _might_ be a way forward (see my response to John Crawford here) I'd much prefer it if my subscriber base increased, viewing figures increased and TH-cam promoted my channel more than it does. But, that said, it's a competitive marketplace so I will have to work harder and smarter. Thanks for your support, lovely to hear from you.
I'm probably missing something obvious ... Is there a reason that you don't just put a USB supply in parallel to your load and connect the output to a 1k load and a digital input?
That means, Flemming, that you would be wiring up a USB supply which doesn't qualify as "non-contact". And, quite frankly, after my video #90, I don't fancy wiring up any more cheap, Far Eastern wall warts which have this tendency to burst into flames! Especially as this (in my case) is supposed to be "behind the scenes", that is, buried in the wall cavity, or similar, of my (wooden) workshop. Additionally, as several posters here have mentioned, it should be possible to have several of these mini-sensors connected to a single Arduino, possibly via screened cable. That's not to say your method would not work, (of course, it would) but it just doesn't seem elegant enough for my workshop automation project. So you didn't miss anything obvious, but it just doesn't fit into my plans at this time. But you raised a very good point so thanks for posting.
I don't buy 220V connected stuff outside Europe - nobody should. A USB PSU from an old phone, ignored for it's ability to only deliver 500mA, would do the trick safely. However, I do see your point. And yes, I'm probably more pragmatic than elegant ;-)
Hi i just tried to make this circuit but i'm having some problems, the led lights when i have the "antenna" near the cable but at the out point i get 2 volts. when the antenna is moved away i get the running voltage 3.3 i have tried to follow the components as close as possible. im using 2n4401 transistors is that the problem you think?
Hmm, that's quite a deviation from my circuit design. I use silicon NPN transistors, you're using germanium PNP transistors! I shall to say to you what I say to all my viewers who can't get a circuit or sketch working: follow my example *exactly* before customising it. You know my version works, so there's your answer. Good luck (not that you will need it, believe me!)
@@RalphBacon ah ok thx I'll work on it. As you can tell I'm not very good at the electronics part. I'm ok with cobbling together Arduino and sensors but lack the experience with discrete electronics. Thank you for answering so quick. I'll have to find those transistor you used.
My bad. The circuit does say 2N2903 (or any similar *NPN* transistor) so it should indeed say 2N3904. I was probably getting carried away with the 2N22222 which I use all the time. Cheap as chips too. Sorry about that I shall make a note in the video description.
@@RalphBacon I'm still working on getting it right. I tried with the bc547 but still couldn't get it going. The led lights, but having trouble at the out signal stage. Anyway is a good learning experience for me. I haven't really done much discrete electronics before. Will order all the components you used and try again until I get it right. Thanks for your videos. BTW hope your eyes get better. My friend had the same thing happen to him both eyes within a year of each other.
any suggestion for a suitable DIP chip with 4 npn transistors built in, for easier management? thanks p.s.: when i read "bipolar tranny" i thought to a mad transvestite from transylvania (Rocky Horror Picture Show) :D
I'm not sure a mad tranny from Down Under is going to help detect mains voltages but any Quad Transistor Array chip (such as a TPQ3904) should work, assuming the gain is sufficient (around 200 - 400 per transistor). Google might be your best friend here, dammit, Janet!
A point here. I was thinking that the "no contact" system is responding to current in the wire instead of voltage. What made me think that is that there a mains ammeters that are "no contact" (an example: www.amazon.com/Amprobe-4560537-AMP-210-Clamp-Meter/dp/B00U2F4S0Q/ref=sr_1_3?s=hi&ie=UTF8&qid=1529100520&sr=1-3&keywords=amprobe ). You just clamp it around a wire and from the magnetic field generated by the current in the wire it measures the current.
They use split current coils, of the type linked to by whitefields5595 (as per my demo) and they generate a voltage proportional to the current flow; I don't need this, just the presence of mains is enough for me, and this circuit works whether current is flowing or not. (I, too, have a current clamp meter and it works pretty well but just not what I need here.) But if you need to measure current flow that is certainly one way to do it.
I must say that I learned something here. First I apologise for thinking you might not know of current clamp meters. My problem was that I could only picture a "no contact" sensor as being inductively coupled. It didn't occur to me that capacitive coupling would work. Of course your setup couldn't have been inductively coupled because only one end of the antenna (aerial) was connected to the sensing circuit. I've been out of the business too long.
No apology of any kind required, captxrox, I didn't take any offence, we're all friends here. I'm just glad this circuit seems to provide a way forward for my "backup" verification for my workshop automation project!
My inner pedant is screaming, "11 components - 4 transistors, 4 resistors, 1 capacitor, 1 LED and 1 signal diode." ;) That aside, it's an elegant circuit.
Hang on, BaronVonBiffo, let me count, 1..2..3..4..5..er, hang one where did I get to, 4...5...5...8, no ...7... er... Oh WTH let's call it 10, we're all friends here. What? Oh alright, it's eleven then. 🤓 In my defence, I had to "count" whilst I was filming the video so it wasn't a bad estimate, hey? Heh heh, thanks for the correction. And yes, it's quite a nice circuit, cheap AND safe!
Hey, Is there anyway to reduce the sensitivity? I get a bright LED just from moving my hand near it! Iv tried this with my RPI to detect if heating is on (if there is power in the switch/thermostat wire) and its picking up when the boiler is on (just for hot water) as well. Also the pin on the RPI doesn't seam to ever get "LOW" so I just get lots of HIGH notifications. any ideas? maybe a way to increase the voltage difference as well as sensitivity? this is great tho thanks!
Heavens be praised, I've been set free! A huge burden has been lifted off my shoulders. Thanks for that whitefields5595, nice to hear from you, hope you didn't mind me quoting you!
Ralph, for homework I'd like you to compare and contrast the hardware (charge pump) and software methods for determining mains presence at your final stage. Some of the baying mob out there are going to get solder anxiety so it would be useful to see the pros and cons of "doing it in software" vs hardware. Also you are still going to find it a tight fit in places so the 4 transistor DIL chip would be good so you could make it long on thin for tight spaces ..... This would then be a good project taking first principles of non-contact, then HW vs SW rationalisation and finally miniturisation/ component reduction / packaging. Maybe use the ATTiny or similar?
Ralph, homework cannot be outsourced. Richard is proposing a different method of INPUT detection using an op amp. Your homework is to compare and contrast conditioning the OUTPUT signal using the binary nature of your charge pump vs (quasi-analog) pulse train counting in software. There is always a decision to be made between hardware vs software that would add a richness to your projects .....
Thank you for an interesting and useful project. When I did my training transistors were around, but we learnt valve technology, I am still trying to catch up! I agree with Steve Hallam, why not try Patreon? I too was forced into early retirement, best thing that ever happened. Good Luck. Are the transistors 2N2904? as the data sheets that I have looked at say it is a PNP and not a NPN.
Oh dear, did I say 2N2904, they were, in fact, a *2N3904* or any other general purpose *NPN* transistors, such as 2N2222A or BC327. The link I put in the video description is for a selection of NPN and PNP transistors, very cheap and useful. And I have now painstakingly resorted them all back into their correct locations, took about 15 minutes. Now I'm _very_ careful when opening the lid. Thanks for correcting this. I once did a course on valves (or tubes, as our American cousins might call them). They seemed even more dangerous than all the mains projects I've ever tackled! And hot! And big! Yet nowadays I yearn for a retro mini-tube amplifier, with exposed tubes, they just seem so cute! But far too expensive. Patreon? Hmm. I've read their new terms and conditions. They have increased their overall markup percentage for small amounts so that my original plan (if I was going to do it at all) of a $1 monthly donation would lose 5c to fees but also about 10c to payment processing fees. Plus a fee when money is transferred to my bank account. Not good at all for small, affordable donations. So to make it even vaguely viable I'd have to ask for $1.50 or even $2 which suddenly subscribers would notice more. I'm not sure about this at all until I have twice the subscriber base I have now. But never say never, as James Bond might say! Thanks for the encouragement, John, we shall see how things pan out over the next 6 months or so.
Just quoting your post, Martin: "Darlington input must be ... for the circuit to work. very very unlikely!" But surely the video proves it does work? I don't fully understand your objections or concerns, care to elucidate?
Once you wrapped the antennae around the mains cable, I recognized where I've seen this design before. Aftermarket/ add on tachometers use this technique with the antennae wrapped around an engine's spark plug wire! Thank you for the great video, I'm also in need of detecting the presence of mains power for a home automation project. This should do nicely!
Glad you found this interesting/useful!
I am an electronics enthusiast and quite adept to programmable interfaces and this is so simple, accompanied by an excellent explanation even for a novice. Thanks Ralph.
Glad you like it!
A year on, and this popped up again in suggested videos and it prompted another memory and thought, especially for those who find it from here on. I remembered a GREAT single chip - the CA3046 - that gives you FIVE gen purpose NPN transistors in a single package, and given MY memory remembering that - off the top of my head was, in itself, a minor miracle! Simply adding the external additional parts reduces the component count and makes the total circuit more compact. In addition since the chip has a FIFTH transistor, it could be used as either a buffer or inverter so that both a high active AND low active output are available. Also one pair of transistors has their emitters connected together allowing the simple use of a long-tailed pair that increases options for design changes for both the front end and the back end.
Wow! You remembered that, Bob? No prompting? Ha Ha! Those transistors would do well in a low voltage Arduino environment too. They have a 100 gain even at very low collector currents. Admittedly, we are limited to 50mA collector current. Thanks for sharing, Bob!
One thing that is worth knowing that I think some of the people watching these videos don’t understand it if you’re messing about with mains in a project you were going to install the crack protect devices and an RCD such that it would disconnectwithin 4 ms so it is deemed to be safe. There’s also the likely heard that something like this would be put inside an enclosure because of common sense.
Which is why I always hesitate talking about mains projects; there are always some uninformed people out there just waiting to connect stuff directly to the mains - without understanding the danger involved.
Really well made and presented video - thank you.
I’ve been mucking around with a mains voltage detector for the past couple of weeks/months as I need to detect mains current flow (or at least the presence of switched mains), but have no requirement to actually measure the current. This is to detect when a large 240VAC motor (4hp/3000W) has started. As I have around 6 separate machines to monitor it started to get a bit expensive when I considered the type of ferrite core based current detectors that would be required for these high currents.
I built a 3 transistor setup using BC547’s which worked, but I didn’t get as far as interfacing it to the Pico. Your video, detailing the charge pump, has squared that circle for me and I will re-visit. You have my sub. Thanks again.
PS. My next challenge is to get each motor based sensor and Pico to talk, via an RFM69HCW 433Mhz radio link, to a central Pico that will in turn energise a relay that will (using a servo and a rack and pinion), open a dust extraction blast gate which once open will start a dust collector. This is all located in a wood working workshop. I think I may be spreading myself too thin....
You certainly have your work cut out for you! Thanks for the sub and keep tuned! More Pico stuff this Friday.
THANK YOU VERY MUCH sir, you gave new idea to my AC line Detection to my project, it is safe and accurate and easy to assemble tooo , happy to see this
Glad it helped!
Great idea, you don't care about how huch current isnbeing used, just if it is ON/OFF. Sharing ideas is Great.
Hope it works out well for your new lifestyle. This happened to me abot 15 years ago and iI think it added MANY years to my life by reducing the stress in my life.
I've only been "partially retired" from my old day job for a week now, and I'm already sleeping better and feeling more energetic, William, so I can only assume that you are totally correct. Glad you liked the video and thanks for your supportive words, appreciated.
Excellent video on detection. Right now I use a relay to determine if our power station generator is running. (This is off grid) I run the coil to a breaker on the split-phase and when it's working, a set of contacts tells my uno that the generator is now running and to stop running the starter for the engine. Upon seeing this, I just might pull the relay and rework my trigger circuit. Thanks, Ralph!
Thanks for the info! Glad it's making you think!
I am always amazed at the quality of your videos and the wealth of information in them. Two thumbs up.
I had a brownout on Strike (little sailboat) last summer so added shore power monitoring to the Arduino systems. I just used a doorbell transformer, single diode (1/2 wave) off the secondary, voltage divider to Eve’s analog input. Eve is one of Strike’s Arduino crew. There are 9 total (so far). Zener on the output of the divider to protect Eve’s input.
The rest is all programming for no voltage, not enough, too much and in the window 100-130 USA. She’ll accept a 1 second brownout but on a single positive half of the sine wave over voltage she kicks us off shore power. Well she tells Adam and he takes us off for 4 minuets.
Someday I really should do a video. I’m not good at them but even an overview of the crew may help someone.
Cheers
An interesting Real World implementation you have there, Ricky, thanks for sharing. And if a picture paints a thousand words think what a video would do! Great to hear from you.
Indeed. It sure wouldn't be quality and may be difficult to follow with all the systems involved as well as the fact I have never done one before would be painfully obvious. May be a good idea since this heat precludes me from doing much else.
This is a great wee circuit and could be used in various projects. Especially useful for those who don't like getting hands on with mains!
Indeed, it should be absolutely safe! The stick I get about mains safety! Thanks for posting.
@@RalphBacon I know, I know, it's my background as an electrical fitter that makes me squirm because I know the dangers of mains all too well. You do a good job of drawing attention to the dangers I just feel it doesn't do any harm to reiterate the risks involved! I won't mention the "m" word again, I promise! ;-)
You explained in an easy way to understand..
My Home Automation will be much better..
Thank you, Ralph
You are most welcome Sukapura Tech, I'm glad you like the video. Nice to hear from you.
Hi...read your blog, you have a very pragmatic attitude which is great and I wish you loads of good fortune in all your endeavours...Now back to this video...…….It's blooming marvellous !...….I love the thinking and its great to see an "old school" analogue circuit just do what its meant to, more transistors please I say !...……...Very refreshing (like a cold Guinness)
Ha ha! A cold Guinness, hey? Actually, I had a Murphy's this evening, just as good. And thanks for the good wishes. And I'm glad you like the simple circuit, I was somewhat satisfied with the performance too. I must now build it on stripboard whilst it is fresh in my mind. Nice to hear from you, Andy.
Was that the "rude photos" post? I think TH-cam zapped it pretty quickly (before I could delete the post here anyway) and I've blocked the username. Thanks for reporting this Jago, that's the last thing we need here.
I'm likely going to use this idea to detect my doorbell rining. I believe (at least in the US) it is 24vac, less lethal than mains, but this is non-invasive and simple. I really like it.
Check that this will accurately detect 24v AC - in this demo we're detecting 240v AC, 10 times as much and therefore a bigger electromagnetic field. It would be interesting if you would report back whether it can detect it or not. What do you reckon?
I built the circuit (no charge pump or 4th transistor) powered it with 12 volts, ussed a buzzer instead of led. I get .4 volts and a faint buzz running the antenna along side an (18 guage, 120v us) power cord. Not quite there. Maybe a 4th gain transistor. Ill report back if I have any success. Otherwise assume I am sulking in a corner....
Oh, don't sulk, the best antidote is another transistor (and/or the charge pump). Let us know how you get on. Come on, now, out of that corner...
Hi Ralph. I just re-watched this video as I'm about to make an electric field detector (like Big Clive's ghost detectors) and I just wanted to elaborate on my earlier comment about completing the circuit. I can see the attraction of sensing the field around a cable (note: cable) as this means not having to separate the wires. But in an electronics laboratory there can be stray fields from time to time and just consider what happens when we get thunderstorms. So, referring to my earlier comment I guess what I was thinking was that if you do separate the wires and put a few turns round a small toroidal ferrite and take a wire from your sensor circuit and wrap that round a few turns too, then back to 0v, you would maybe have a more robust solution that could dispense with one or more stages of amplification. Maybe no need for the torrid - just make a coil of a few turns of the mains wire and wrap some turns of sensor wire round that to intersect the field. Just a thought. PS you're too good for an orange apron job!!
Certainly winding a few turns of the Line wire around a core, together with the sensor wire is how Earth Leakage Circuit Breakers work (aka RCDs) so this idea would doubtless work too, but the focus of this experiment is that it would be totally non-intrusive.
Given that the range of the detection is in the area of a few mm I'm not sure stray fields would affect it, but I haven't done the experiments. Now here's an idea, Mike: it takes about 15 minutes to build so why not build one and experiment away? Then report back, of course, and share your findings. By 9am tomorrow morning would be good 🤣 😂😹 (that last one was Benny, by the way). Good to hear from you, as always.
wow! i've been working on a project very much like this for the past month or so... in my project i used a split transformer device that would pull the voltage down to around 5 volts which i would then filter and lower for my NodeMcu (esp82660). the split transformers cost around $10 (US), and your circuit would seem to be a lot cheaper. I'll give it a try! thanks, and keep up the great work!
Russ from Coral Springs, Florida, USA
They do different things, Russ. The cost of split transformers (split core current transformers) is quite high as you point out but then again it does allow the measurement of the actual current flowing rather than just the _presence_ of voltage as per my video (but which is all I wanted or needed).
The cost is much lower from Far Eastern suppliers:
Bare split core: www.aliexpress.com/item/Free-shipping-1PCS-5A-Sensor-Range-of-Single-Phase-Module-Ac-Current-Sensor-Module-For-Arduino/32877238653.html
Split core with relay switch (to indicate overload): www.aliexpress.com/item/1PCS-5A-Overcurrent-Protection-Sensor-Module-AC-Current-Detection-12V-Relay-Module/32858449954.html
So if you're only detecting the presence of voltage my adapted design should be fine; if you need to measure the current then you'll need to stick to split transformers.
I'm glad you liked the video, Russ, and thanks for posting your experiences on this topic, nice to hear from you.
I tested this circuit today, two variation .. with a coil wrapped around wire and just a coil spaced 3cm from the wire. When it is wrapped around the coil, it shows 500mV when switch is off and 700mV when switch is on. But, when the coil is outside and placed 3 cm from the wire, it detects 500mV when switch is off and 4.8V when switch is on. The LED lite up when it is at 500mV and off when at 4.8V. Capacitor is 10uF. Circuit was tested with 15W load and no load conditions.
That sounds like something is not connected up correctly. The idea is that the LED should light when something is ON not OFF!
@@RalphBacon Sorry, my mistake. I had the resistor 100ohms instead of 100Kohms by error. Fixed it. Now, the LED lite up near the switches which are ON and drop from 4V high (using a 18650 cell) to around 1.5V for ON and back to 4V for OFF. More wraps and wire strands also improved the detection. Will try it over weekend. By the way, thank you very much! Because in my region, there is power cut on daily basis and inverter is used for providing backup, I'm planning to detect when mains goes off and comes back, same on the inverter side so as to know the backup time, inverter fault, logging these time info. etc.
Brilliant Ralph.... simple and elegant, wonder what length of wire you could run for the sense wire before it started to give spurious noise responses.... just thinking about if you needed to monitor several things..... it would need several psu’s and nano’s for each sensor.... where as one Nano and some lengths of wire.....
Lovely tribute to your Dad...
Thanks, Tony. Yes, I often about my Dad still and what he would have said about this. He would have been fascinated for sure. Regarding monitoring several things, you could use several of these cheap, transistor monitor circuits all running a signal to a single Nano (on different input pins). Then the Nano would know which circuits were live and which were not. Use an ESP8266 instead and we have the basis of a wifi-enabled, mains monitoring station with simple phone app... sounds like we might have just completed my design! Thanks for posting, good to hear from you.
Thats very useful. Concern would be sensitivity vs selectivity, but if that would be an issue, maybe a high or low cutoff filter might help (but complicate things).
I have a few of the coils you showed the Current transformers, to measure current, but for a number of appliances I just want to know if they are on or off, so I will certainly make this
I saw you already posted later on that you had made this so I replied to that. Cheers, Ed.
Great Video!
Really nice to see some original thinking. Much better than a video on some generic pre-made module.
Thanks for that, James Searle, glad you liked my (sort of) original thinking! Nice to hear from you.
Hello Ralph!
I have seen this circuit on talking Electronics the author of this circuit is Collin Mitchell, it's called "Mains hum detector", i hope it does not give you any false readings as it's picking up static electricity, I prefer the previous circuit you used which in my opinion is reliable. That's my opinion i hope it does work out for you without any problems!
Vasilis K
I found the author you mentioned (and his circuit), Vasilis, thanks for the heads up. Unfortunately, I also found the exact same circuit many, many times on the Internet too, so it's quite difficult to say where it came from originally now. But it does seem to work quite reliably (for me) it will be interesting to see what the feedback is from others who build it too. Thanks for posting.
Another very informative video. Hopefully lots more to come now that you have a little more time on your hands. Many thanks for taking the time to create these masterpieces.
You are most welcome Bruce Morgan, I'm glad you like the videos. Nice to hear from you.
Seems like a nice solution to the problem.
Thanks for that, Maxx B, nice to hear from you.
I do this with only two components: A tiny neon indicator bulb, and an LDR coupled together with heat shrink tubing. Provides complete isolation, easily read with microcontroller, costs only a couple of cents.
I don't get how this works, John. How do you connect it up and what is the relevance of the LDR? I'm intrigued, do tell!
@@RalphBacon I only needed to detect the presence of the AC, and log when it went off and came back on. I didn't care about measuring the voltage. So I used a small neon indicator lamp such as:
www.ebay.com/itm/20pcs-Neon-Bulb-Indicator-Lamp-Red-Neon-5X12mm-With-Resistor-Neon-Light-Lampada/252468642466?epid=850361273&hash=item3ac84dc2a2:g:BS0AAOSwLN5WlmQO:rk:1:pf:0
with resistor across the AC line. These are the same kind of tiny lamps found in orange light up switches. If AC (220v or 110v) is present, the neon will light. I use the Light Dependent Resistor LDR to detect if the neon is lit or not. The LDR is easily read with a Microcontroller pin using a pull-up or down resistor. Use heat shrink to couple the Neon with the LDR in a short piece of drinking straw. Essentially, this is a DIY Optocoupler, with an AC side, and a DC side. Providing complete isolation. Also, you can use a photo-transistor or photo-diode in place of the LDR. I've found this solution works nicely for only about 25 cents.
Ah ha! So basically it's what I demoed in video #111, just a bit more DIY. Cool, see we're all thinking along the same lines.
Hi, It will be interesting to see how this unit reacts in a thunder storm with all the electric charge around. It will also be interesting if you can feed the input through coax or twisted cable so you can mount all the detectors in a box and remotely monitor your appliances. Cheers Dave.
Yes, I'd had similar thoughts about using screened wire up to the point where you actually want to detect it, so spurious signals were not being detected along the way. But all bets are off during thunderstorms, who knows what happens then (we sometimes get power cuts then anyway, so I'd know that the lamps were off!) I'll try and do some experiments once I've built it onto stripboard. Thanks for posting.
You could check several times to see if the signal persists longer than a lightning bolt.
Yes, indeed, it would be sensible to sample the inputs (over one second maybe) and make sure you get three identical values before acting.
Ralph S Bacon decadies ago I went my feet a bit in trying to detect thunder/lightning and that wasn't easy. I suspect this circuit may be insensitive to lightning strikes, unless it's really close. Nevertheless, the proof of the pudding is in the eating
Didn't you do a vid entitled "useless projects" or something like that !...……….any how that involved a Tesla Coil...….Well now ya have ya lightning...……test away!
Thanks for sharing this. Very informative and an easy solution to the problem. I will definitely be trying this out. Please keep up the great work, I enjoy your videos and have learned a lot.
You are most welcome, ward procter, I'm glad you like the video. Nice to hear from you.
One thought I have Ralph is that a standard Darlington requires a minimum of 2x diode drops to turn on, a triple requires 3x and the circuit as presented has a total of four diode drops to the capacitor. I wonder if a standard Sziklai pair (complementary Darlington) might provide sufficient gain instead given that it only has one diode drop before turning on plus the charge pump diode drop to get current to the capacitor? It would make for an even simpler and more elegant circuit. Who knows, you may even get away without the charge pump if you made a MOSFET Sziklai.
The latter if it worked could potentially be made using a single MOSFET N + P complementary pair chip as long as the internal connections allow them to be used in the right way.
I shall have to check this out myself as I can see some great uses for this concept. Being able to sense failed bulbs being a classic ... Switch on, power reaching the ceiling rose but no light hence bulb or neutral failure. If other lights on same neutral work, definitely the bulb.
From a long term safety perspective this is potentially by far the safest, but given that people would still be in close contact with the mains whilst fitting the wire sense, especially when having to remove light switches etc. I don't think it's really that much safer whilst fitting than your first circuit with the opto isolators ... In both cases the power and or lighting circuits should be isolated before doing any work so from a safety perspective.
In THAT sense, there is little difference, although this method produces a result with far less risk of voltage breakdown causing issues which opto isolators do NOT necessarily provide unless they are true HV isolation types i.e. > 600 volt.
Interesting slant on this design you have there, Bob. You seem almost on the point of trying this out so I'm going to hand over the baton to you to follow through and see whether your theory pans out in practice. I look forward to hearing the results in due course!
OK, I put this together, works pretty good, but I get impression it doesn't make much difference if it is on the 'live' wire, still works pretty good
It's *great* you put it together, Ed, and must be quickest anyone has ever followed one of my circuits, but I'm not quite sure what you mean about not much difference whether on the live wire.
On a standard mains cable (eg one running to a heater, lounge light or anything that has two or three core cable with a plug on the end) it will detect the mains "as is". The problem is with the dual-core wire (plus earth) running to light switches in or behind your walls - you have to ensure the sensor wire is only looped around the switched wire, as per the demo, otherwise it will _always_ detect the presence of electricity. Perhaps I didn't quite understand what you mean, care to just clarify for me?
I understand your point Ralph, but, I noticed that no matter what (single) wire I coiled it around, as soon as the (electric) circuit is broken, the sensor picks up on that. But it's the continent, things are different here I guess ;-) Anyway, it works. That is the most important thing :-)
Ah ha! The plot thickens. I'm guessing from what you've said that the wiring layout and switching arrangement may be different on the continent (from the UK) in some way. But as you say, it works so that's the most important thing. Thanks for clarifying this.
@@RalphBacon (dunno if you still care, 5 years later, but...) could this just be a case of it needing to be passing a certain amount of current before the detector will register? That's my interpretation of what Ed reported, though I've not (yet) tried it myself, and I'm far from an expert, so I could easily be wrong. That's just how I'm interpreting it. Would be interesting to know! Would also be interesting to know if one could (without a much more complicated circuit) make at least some crude level of detection of different current flows -- not necessarily precision, but just having an ability to distinguish between, say, 10W and 1kW or whatever.
I'm going to build this. I'm not sure what to use it for yet though.
It's certainly easy enough to build, Tony (on a breadboard first, perhaps) and you'll find a use. It might flash if you put it near your mobile cell phone - it should light up when you receive a call. You can let us all know whether that happens!
amazing project and thank you. i tried to build it. LED gives light when it's close to a live wire and the switch is off which is when no current is flowing. after the switch is on and when current is flowing i expect to detect EMF on the neutral wire (just after the switch) but LED is off. I used 1N4007.1uf electrolytic capacitor. what did i miss here
If the LED lights up when the switch is off, it means that that wire is still "hot" but the switch is preventing current flow. Typically in a house, the wires are live with a branch to the switch.
The neutral wire will never give a reading as it is the equivalent of the Earth wire (N and E are connected together either just outside your house or by the electricity company on the way to your house).
Very nice mains detector. I wonder if i could use it on my work. Nowadays they want to use only CE labelled things.
If you build it and use it in a non-hobby environment then you are not covered by your work insurance as you are using a non-approved item. But if it is battery powered (this could be), in a plastic box, then the risk must surely be very low? But your employer will have different ideas, I'm sure.
Hi Ralph, good video.
I believe here in Australia, if your friendly electrician (who must be licenced guy/gal to play with mains wiring) is to wire a simple light and wall switch, that the active and neutral supply have to go to the switch and then to the light. Even though the active is the only switched wire.
Did you try looking at the sense wire input with the scope?
It would be interesting as the impedance of the scope may be a problem.
I did try and look at the sense wire signal but it was just a jumble of noise; after the first stage transistor, though, I got a spiky 50Hz signal OK that my 'scope could resolve.
Regarding Australian light switch wiring, they looked to me pretty much the same as UK ones: diy.stackexchange.com/questions/28013/why-is-my-australian-light-fixture-wired-this-way
Logically, this is the way to do it. There is no more efficient way, and bringing the neutral to the light switch serves no purpose at all (unless the light switch is also a PIR, in which case it will need it).
I've also seen some low voltage remote switches (eg for bathrooms but can be used anywhere) where there is a control unit in the ceiling where the ceiling rose is and a couple of low voltage wires run to the switch - now THIS is a nice way to do it as it reduces risk and hum and just feels right. It keeps the high voltage stuff where it needs to be and protects consumers from 230v (or whatever it is in your part of the world) when removing light switches when decorating, for example. Unfortunately, this circuit would not then work!
Thanks for your post, Tom, nice to hear from you again.
I haven't tried it but I wonder if 4000 CMOS could pick up the AC from the coil and do the job without all those transistors. I'll try that this weekend! I've been looking for a non-contact solution to do zero crossing detection.
Good luck and don't forget to add your findings to your comment so others can benefit! Sharing is caring (except when it comes to beer, of course).
ok, finally got it working. Should follow your actual implementation, and not the drawings... the last part, the charge pump, in your actual implementation, the 4k7 is missing. It works when, the T4 base connects to the capacitor, and capacitor connects to Gnd. The Emitter connects to Gnd.
Oh. I've just checked my video and the "white board" drawings there do seem to include the 4k7 resistor - so please tell me where the error is so I can fix it (or at least make a note so others don't get mis-led). That said, the 4k7 resistor should just ensure the capacitor doesn't remain charged (and hence give a permanently "on" signal).
But I'm glad you got it working at last!
@@RalphBacon On second look, yes, there is a resistor in parallel with the capacitor. Thanks for clarifying! Again, great video!
strange, when i put in to resistor, it doesn't work. The values starts at 5V (I used analog pins to check the voltage), when main is off. When I turned on the main, the value goes to 0 and then back to high values (4.xx).....
Great way to set up a power senor.
Thanks for your post, Simon Thomas, good to hear from you.
How does this detect the power on/off state when the antenna is around the appliance power cord (as shown at 25:42)? Doesn't that cord always have power going to the [clothes dryer] appliance and the on/off switching effect occurs internal to the appliance? In other words, this detector detects the presence of electricity, but not the flow of electricity, correct?
If I'm interested to know when the dryer turns on/off by only monitoring the appliance cord for the flow of electricity, I would need the current toroid sensor circuit?
Love your videos, I'm always learning something when you make a post.
You are correct inasmuch that this detector only detects the _presence_ of mains, not the flow of current. As you suggest you need either a current sensor, either something non-invasive like this:
www.ebay.co.uk/itm/1Pc-SCT-013-000-YHDC-30A-50A-100A-Retractable-Current-Transformer-SCT0130-YM6K/313337299840
or something where you have to make a box with a socket etc:
www.aliexpress.com/item/32890540897.html
The problem with the first method is that the tumble dryer/washing machine etc can sometimes just sit there having a think, and during that time very little current is consumed - making your sensor suggest that the power cycle has finished.
Even the second method has that problem but is slightly more accurate (but not much) because your current sensing device must be rated appropriately (so for a tumble dryer or washer, more than 13A, probably 20A is the next value).
How does such a device detect just 100mA current? Poorly is the answer. What I did is have a configurable delay, so that I would wait for 5 minutes after a "no current" measurement and then sound a "washing finished" alarm if it didn't start up again (and reset the 5 minute delay). Tumble dryer was easier to detect than the washing machine.
Hi Ralph,
Thanks for the video, for the clear explanation. I've built the circuit with exactly the same comonents. It kinda works, but seems to be extremely sensitive, the LED is on most of the time, even when powered from a 5V charge pack. Which parameters/components could be changed to make it less sensitive?
Many thanks! :)
Well, it's good it worked but it sounds very sensitive. Put the aerial/antenna via a very small capacitor (eg 100pF) and see if that helps. If you disconnect the aerial does it turn off (ie it definitely turns on because it has detected something via it)?
This is the circuit I was looking for to signal a Victron Global 520 to report over cellular when my Mains is on / off during power outages - I'm planning to use a 3V rechargeable battery, trickle charged with a USB wall wart. Then when Main is off, would run for days on battery alone. Do you have any measure of the current draw while the Mains is on and that circuit is live/drawing from the battery? I've calculated it should be less than 400microA. (approx 367 uA) while Mains is on (not counting whatever is connected to the Output pin to signal the Victron. I may be overthinking this because the circuit should be off while mains is off; so battery should last for a VERY long time as long as I keep the draw on the output pin very low. Thoughts? Thank you!
I have two devices in my workshop that have to act differently when the mains power supply is interrupted; both have battery backups, from a small Li-Ion battery of about 1000mAH. Anything from 500mAH to 2000mAH is small, slim and works great.
The way I do it is to run the ESP32 board (which has an inbuilt battery/charger) from a USB-style wall wart; I also connect the incoming 5v (eg from the USB socket) via a suitable 3K/2K resistor divider to one of the GPIO pins. So far, so easy.
When the power is interrupted, and the wall wart stops supplying power, the ESP32 keeps on running uninterrupted on its battery power. But it knows the power has gone off because the GPIO pin (monitoring the incoming 5v) reports zero volts.
It then, for example, sends a WhatsApp message or email or whatever to alert me, or just does some other processing as required. It only requires the battery to run for a minute or so after power interruption, although I've discovered the ESP32 can run off my Li-Ion battery runs for 15 hours+ before it is depleted. If you put the ESP32 to Deep Sleep and wake up every 15 minutes to check the power state, it can run for a couple of days (at least, I've never depleted the battery!).
My ESP32 board with built-in battery socket and charging circuit is a TTGO T8 v 1.7.1 but there are many others out there that have a similar setup, some quite a bit smaller than the one I mentioned.
Just throwing this out there for you to consider too!
I'm confused. I wonder why you have a load on the mains. Is that required for the circuit to detect or what? I'd like a circuit that detects the AC voltage with or without a load present. I guess I'll have to make it and find out for myself. Thanks for almost giving me the answer I'm looking for.
The load is purely to ensure we have a main supply flowing which can be detected. This will detect the _presence_ of mains in a wire, but if that wire has been switched off (eg wall light switch) it obviously won't detect anything.
@@RalphBacon Thanks for your reply. I built the circuit using 2n2222a transistors and was able to confirm no load required. I hope you continue making these great videos. Have a wonderful day.
I wish someone just sell this as a board already made up. A lot of people are demanding of this kind of sensor for arduino & Pi but dont want to spend hours ordering each components and making pcbs, soldering .. If someone want to do it, ill need 10-20 units of this.
Let's hope someone reading this takes you up on your offer, Antoine.
Hello Ralph. Your handy video was just what I was looking for to monitor the state of my central heating valves (which are as you may know are mains operated). I followed your excellent instructions and built one. One odd thing though, it works perfectly off a battery but the moment I switch to the ESP8266 3.3V supply it lights up. Not sure why. Uses the same wire from the circuit to the microcontroller or battery. Could there be some noise on the microcontroller supply that triggers the sensor?
I notice in the video you have an extra (undocumented) cap on your prototype board between the signal aerial and the transistor. Would that help? Anyway, not sure if you still monitor this but thanks for the great video!
Running off mains means that noise, as you suspect, will probably make its way into the circuit. Either seriously decouple the supply to the detector (low value resistors, in series, with caps to ground at each junction. Say 10Ω resistors and 100nF-ish caps) or just run off battery when you need to detect the presence of voltage. If you have a scope check what the voltage line looks like.
@@RalphBacon Thanks Ralph. I suspected as much but was not sure how to clean up the supply to the sensor. I'll will try your suggestion although in the meantime I bought the mains optoisolator from your other video - (sensibly encased in a project box with a transparent lid before the h&s zealots start kicking off) and that is very reliable!
I've built and rebuilt a circuit based off this about 100 plus times and I can't get it to work properly / consistently. :( I feel like I'm missing some key information on the input channel, and the charge pump components. I delved into a fait bit but still seem at a loss (using the pi pico, Thonny, Micro python and ADC input since I can't seem to keep the voltage reliable)
Are you picking up extraneous signals from your hands or other wiring nearby (eg other wireless equipment)? You can use a shielded box for the components, make sure the power is ripple free (use a battery for testing that) and shielded cable for the sensor up to the point where you want to sense power.
Different transistors may have different gain (Hfe) that could affect the result - talking of which what results are you getting, John?
Thanks for the video. I would to buy an 8-channel circuit to detect 24VAC from a PLC and get a 3.3v output.
Do you think it's possible without changing the big resistor?
Sorry, Stefano, I wouldn't like to comment on the suitability of your project, although detecting 24VAC should be tested first, as this was designed for 240VAC (or thereabouts).
Great video Ralph. Very informative. Thanks for your efforts.
Thanks for that, Bruce Peterson, nice to hear from you.
There are probably a hundred ways to do this, ct clamps, current sensors, etc. Your choice is a nice one, low cost, doesnt add extra features. The only thing I wonder is does it fail silently? I think if the first darlington "pair" fails the current could be on and you wouldnt know. If I am right, it should be fixable by inverting somewhere in the path.
Hmm, I'm not sure we cater generally for hardware failure conditions, do we? This is already a backup of my Sonoff/RasPi automation hub, so I get independent verification that things are doing what the computer is saying it is doing. So if this fails (seems a bit unlikely) I guess I will be "blind" for a bit until I realise it is not working.
And, yes, there are many ways to do this and this is just one way, but as you say it's pretty basic and therefore simple. Thanks for posting K3n7, you raised an interesting point.
Good point. If you turn on the lights and this doesnt register, then you'd know about the fault, or that your light bulb has failed.
Ah no, it doesn't matter whether the light bulb has failed or not, as this detects the _presence_ of electricity, not the _flow_ of electricity. Yes, if I turn the light switch on and nothing happens the bulb may have blown but the phone app (or whatever I end up using) will say that the lights are on regardless. That's what I like about this circuit!
Thanks for that great video Ralph!
I'm using your circuit to detect the mains of my lights with an ESP32, but it doesn't work as expected!
When I turn the light off, serial shows off, but when I turn it on, serial shows on, off, on, off,... randomly.
Checking the VoltsPin with multimeter it reads nearly 5V when the light is OFF, wich is close to VCC. But when I turn the light on it reads 2.5V!!
When I performe a analog.read(VoltsPin) when light is OFF, it reads a valaue of 4095 constantly, but when I turn on the light, the reading drops to 0 but raises up to 4095 again, drops to 0 and raises up to 4095 again, and so on!!!
What's wrong with my circuit, or do I miss something important!!
What is that orange thing on your breadboard before the first transistor, where you connect the antenna through? it isn't shown in the schematic???
CAN YOU HELP ME, PLEASE, I'M STUCK!!
THANKS!!!
OK! The "orange thing" is a capacitor, connecting the antenna to the base of the first transistor (T1). It is a filter to reduce interference. It's probably about 0.1μF but you may need to experiment with the value a bit (say, from 0.01μF [10nF] to 0.1μF [100nF]). See what works best.
There's another capacitor between the base of T4 and GND to eliminate jitter (ripple) and is "fed" by the diode from T3. The voltage at the base of T4 should be steady (800mV+ or 100mV). In other words the final OUT is either HIGH or LOW, not jumping about.
Does the LED in your circuit remain steady ON when the mains has been detected? This will indicate whether your circuit is working properly (if not, then no wonder the Arduino detection does not work either).
If you have a scope then it will be easy to see the outputs at each of the transistors emitters but if not check the above in logical sequence.
Good luck!
Does the mains voltage has to be connected to a load? i mean there should be a small bit of current flow for the electromagnetic field to be formed right? in my scenario i want to lay out a wire directory to my diy hub and act as a binary sensor showing the precense of voltage in the mains which might not be compatible with the new way explained in the video
No. but at least one of wires must be connected to mains voltage for it to be detected.
Note, however, that if you have a light switch, the "line" (aka live) wire will be hot up to the switch. After the switch it will be off but usually the two wires to a light switch run in the same outer sheath so would be difficult to differentiate.
Another very good video. The one fiddly bit is the splitting of the 2 mains wires. Does it happen to work if you just the sending wire alongside of the main wire (straight, not coiled) or if you do coil it about both wires? Theory says that it is unlikely, but with the gain in that circuit it just might detect the difference between on and off anyway.
Yes, Cir, that is the fiddly bit, and might not matter to many people. But I certainly need it to detect my lights. You _might_ get away with running it in parallel with the switched wire of the pair but it might make it very unreliable; I'd prefer to gently (and safely) split the wire and loop it around the switched wire, exactly as the demo, by YMMV. Thanks for the great question, nice to hear from you.
Use an op amp for amplification and a half wave rectifier on the output. Then you get a DC voltage which could be sensed as a logic level.
I guess you could do that, John, but I'd like to see the advantage of an opamp over the circuit I proposed. KISS and all that! And it gives viewers a chance to actually use some discrete components here. Woo hoo!
@@RalphBacon I use op amps in these cases because they are an integrated solution to a high gain amp. Kinda like your power amp video I just watched. They are cheap and ubiquitous. I use them anywhere I don't need CURRENT amplification. Of course you can get high current op amps as well.
I love your videos and am just throwing out alternatives. Back in the 80 I got an op amp circuit book and studied it well. You can use them for low / high / band pass filters, very linear amplifiers etc. Because of the high gain they bring to the table.
@@RalphBacon an op amp will be an 8 pin dip with 2 amplifiers. Input and feedback resistors, A diode and a capacitor. Much simpler circuit.
KISS.😉.
Love your stuff tho.
Very nifty circuit. Thanks.
Thanks for your post, Drex, good to hear from you.
Hi Ralph. Great video, thanks. Why don't you ground the other end of the sensor wire to complete the circuit? Mike
There is no circuit to complete here, Mike, as the sensor wire acts pretty much as an antenna or aerial, so feeds in its signal to the rest of the circuit. I hope that clarifies things for you, thanks for posting a good question.
An op amp connected as a comparator (or a CMOS Schmidt trigger) will work fine - antenna connected to inverting input. One 8-pin IC and two resistors to set the threshold. Run the op amp or CMOS Schmidt trigger at 3.3V and...
Whoops, forgot the rectifier/filter, which you still need.
BTW, why might you use an IC instead of discrete transistors? These are either dual-op amp (or dual Schmidt triggers, such as the SN74LVC2G1) or quad op amp (or even 6 Schmidt triggers, such at the 4016). Lots of inputs may be detected with a very compact circuit. Use care connecting multiple antennas to avoid crosstalk.
An interesting alternative that you suggest there, Richard; I especially like the idea of multiple inputs. Care to draw out a quick (but complete) circuit diagram and I'll mention it in a future video? Thanks for posting this anyway!
Hi Ralph,
I decided that I shouldn't rely upon a 70 year's old 40 year-old memory (the last time I thought about this topic), so I prototyped my concept. It works, but not as a direct substitute for the transistor version. The comparator output isn't a digital signal. Well, it is, but it is either high (power detected), or 50/60 Hz pulses - I'm in the US, so 60 Hz is the name of the game for me.
Thus, my Arduino code detects either a pulse train, or its absence. Why? Well, the "antenna" is just that, an antenna, and it picks up any stray powerline signal(s) in the general area, not just the signal in question. I used a thin coax cable, with the shield grounded only at the comparator, and allow the center conductor "antenna" to extend just a few inches beyond the at the far end, then to be wrapped around the target switched mains feed. The pulses are generated because stray signals, even with a shielded cable, exceed the comparator threshold when there is no local electrical field. You can see this by touching the oscilloscope probe tip with nothing else connected -- you are the antenna. However, when the power switch is energized, the stay signals are reduced by the effect of detected electrical field AND that the actual amplitude of this new induced signal has lower peak-to-peak excursions than that of stray signals. It actually feels like there is a little black magic involved.
Counting pulses also acts a type of digital filter. If there are fewer than 25 in a period of one second (30 here), then something went haywire; ignore, reset the count and try again next second interval. This should avoid false positives, or in this case "negatives". I'd also monitor the analog value using a separate AD input of the Arduino (need more hardware on a Pi!), if there were no counts during a period of one second. If the analog value is not "high" but is low, something else went southwest.
It is interesting to see the input signal on an oscilloscope and to come to a sort of understanding of what is going on. It isn't really intuitive, at least to me. Anyway, I can email you a video showing my results and a schematic, if you want.
Your transistor design might be best, mounting the detection circuitry right next to the source, so that the antenna is very short -- as short as possible, so that stray signals are minimized. The output signal could be connected to a central Arduino via something like Ethernet cable, so that the circuit power could be furnished over the cable.
My "design" would facilitate connection to the source via the coax (distance limits probably apply, TBD), while the circuitry could be near the Arduino itself.
BTW, the components I used are a single op-amp (I used a BiMOS CA3040 - the modern part is CA3140 -single OA and CA3240 -dual OA. Because I had a 3040 in my parts drawer) and 3 resistors. Two resistors set the comparator trigger level (about 5 mV, I think) and the third terminates the coax at the op-amp. One might add a fourth resistor as positive feedback for the op-amp, if there are noise problems in practice. Pretty simple, but only investigation would tell if there is anything to be gained here. Just to be clear, I could not get this circuit to work with unshielded wire.
Dick (www.hardandsoftware.net)
A very informative experiment, indeed, Dick.
I'm thinking that if the input signal is sufficient to trigger the comparator without the real signal being present, then maybe either a series resistor may help, or a potential divider or a 1M resistor across the sensor wire and ground (think: x10 oscilloscope probe), with or without a 20pF capacitor in parallel. Just throwing ideas around.
Your idea of shielded cable has been discussed in other comments; I'm surprised it didn't offer better shielding. Perhaps your circuit is just too sensitive as it stands (or you have rubbish shielded cable, gasp). I might try this later this week (I'm actually working on Monday with a 7am start!)
The idea of counting pulses, or detecting a certain analog value was the very thing I was trying to avoid, actually. High or low is what is going to be the most reliable in this case, but you never know.
I'll put my circuit through some further experiments regarding the above so I can compare. Thanks for doing this, I hope you had fun even if you did end up waving a dried seaweed root over your oscilloscope at one stage! Black magic indeed.
Stand by for more experiment details but don't hold your breath.
That is a great circuit!
Glad you liked it!
Really well made!
Q:
Is it possible to have range of detected voltage? For example detect from 80V to 220V or detect from 5V to 50V?
Thank you.
I imagine this would detect all mains-level voltages (eg 110 volts in the USA) but the lower the voltage the less the field around the wire (it must be AC). I don't know what the lowest voltage is that it will detect, I've never tried that.
This might have been answered, so I am sorry if it is. Your drawing in this video doesnt match your Git repo. I think you explain that in the video, but I cant find the info on the capacitor used in the charge pump. For some reason I can never identify what type of capacitor is used. Are you able to clarify or provide a jameco link to the cap used in the charge pump?
From what I can recall, Jim, and I've just looked at the schematic, a normal electrolytic capacitor of 1μF - 10μF with a voltage rating of about 10v (you can go higher but it will get bigger) will suffice.
@@RalphBacon thank you
Nice project 👍
Thanks for sharing 😀👍
You are most welcome Asger Vestbjerg, I'm glad you like the video. Nice to hear from you.
Hey there, thanks for this beautiful video. I have been using the contact based voltage sensor as what you started with. My requirement is actually very specific which is fully satisfied by the contact voltage sensor so I am wondering if this will also do the job. In my use case there will me multiple wires with live in them in the vicinity of where I want to measure the presence of mains in one of the wires. So something which would catch the signal from a few mm away wont do. I need to monitor only a specific wire - would coiling around the wire in question do the job , I will make this and try this out. If you know, please let me know.
Yes, coil the sensor wire around the cable carrying the current you are interested in, it should work...
Marvellous and good explanation thanks
Thanks for that, VINESH V, nice to hear from you.
I could not get this to detect AC when it was powered from any type of 5v USB charger or other types of plugin wall psu's, I tried loads. The only thing that does work is when powering the unit from my PC 5v usb or batteries. I could only think that the wall chargers use a capacitive dropper and possible cancelling out from the coil, did you have this problem ?
I didn't have that issue AFAIK but I can only think that the 5v (switched) PSUs are introducing noise into the system that basically makes the circuit insensitive to anything. Try filtering the 5v via a very low resistor eg 100ohm followed by low value cap eg 100nF to 10uF.
Hi Ralph, I am new to electronics, so excuse what might be a daft question. I want to use this with a raspberry pi so built the first part up to the first 3 transistors and LED but the led is always on (but dim) even without the aerial but glows brighter when I add the aerial or put my finger close to the first transistor. This is even before bringing the aerial close to the AC cable. Any suggestions as to what I might be doing wrong. Many thanks
You're acting as a ginormous aerial, Peter, and you will have plenty of electromagnetic interference (ever touched the input to an audio amplifier and jumped out of your skin with the loud buzz that ensued?).
You could use screened cable, of the type used for microphones or other audio inputs. The outer, coaxial screen goes to ground and the inner wire is your sensor that you can then extend (without the screened outer) for the actual detector wire (short-ish).
Finally, try a high value resistor in the sensor wire, 100K to 10MΩ to reduce the sensitivity. And/or a high-ish value from the base of the first transistor to ground. Your transistor setup is probably a higher gain than mine was (just random luck) so is picking up more mains hum floating about in the ether. Good luck!
Hi, I having problems getting this circuit to
work? How did you power the arduino? I’ve got mine connected to a standard mains powered usb charger and the voltage detector circuit is on all the time even when there is no power cable near the antenna! Looks like theres some noise coming through from the ac as the circuit works perfectly using a battery!
I've powered the Nano from a standard 5V USB hub, David, but I'm powering the transistor circuit from the 3v3 pin. Check the voltage at the OUT point - it should be the same as VCC (3V3) with no mains being detected. It will drop to near zero when the mains is detected. If you have a scope you can check your DC supply. Try putting a 100Ω - 500Ω resistor in the VCC line to the circuit with a 100nF cap either side. Also add in a 47µ-100µF after the resistor (ie transistor side). That should clear any ripple.
Great vid ralph, one question, what are we relying on to limit the current to the LED?
If we're talking about the circuit at 6:00 then we are only running from 3v3 in the first place so it's just the inherent resistance in the circuit and the fact that only a few milliamps will flow because we have a 1N4148 diode in series with T3 too (forward voltage drop of about 0.7 - 1v [max]) and then via T4 (another 0.7v drop). This brings the voltage for the LED down to below 2V3 which is safe enough to ensure the max current of 20mA is not going to be exceeded. If you notice how dimly the LED lights you will see that my hypothesis is correct! Even at 5V VCC it will still be fine!
@@RalphBacon Have just tried your circuit, never once has a circuit worked, and worked perfectly the first time of asking.
was looking at all sorts of solutions an this is by far the simplest. I will be looking into a 2 darlington configuration 10k gain at@ 1mA - little more expensive but same TO-92 package and hopefully mitigate T1 and T2. will let you know. Thanks again for the vid Ralph
Nice video. Just what I'm looking for to detect whether my oil boiler is being fired up - I wanted to sense if the oil feed solenoid was being demanded so bought a single channel version of one of those dodgy boards but never had the courage to implement it. Will definitely try this.
Just a couple of thoughts. Is it detecting voltage or current? The video suggests voltage. Will the number of winds increase sensitivity? Could the coil be alongside or around? (I will experiment and report back when done.)
It detects the presence of voltage in the wire, even if no current is flowing (eg it is switched off). Good luck!
@@RalphBacon I made up 2 on a bit of veroboard to sense my Boiler Termostat demand and the Oil Sonenoid demand. The Heating controller demand I've got sensing from the battery charging circuitry. BTW I've also got 3 x 18B20s sensing the cabinet, water out and water return temperatures. A bit of Arduino code for an 8266 and I've now got all of this being reported to my Home Assistant through an MQTT broker. So thanks for this video which enabled me to complete my ambitions safely.
I did use some different resistor values - 47k for T2, 2k2 instead of the LED, and 100k with the 10mf smoothing bit. One of my circuits is using 2N3904 and the other is using 2N2222. The latter is slightly more sensitive. In fact both were over sensitive until I made sure the mains cables being detected were properly connected to Neutral.
The cheap JYETech home built oscilloscope really came in useful.
Thanks again.
Update - I made up a circuit and put it in my boiler with the antenna on the wire coming from the internal thermostat and it is just too sensitive giving false on readings. When the power goes off it momentarily goes off too then over a few seconds the led indicator comes back on and says on. I've even tried putting the circuit board right next to the mains wire inside the boiler and keeping the antenna really short. Any clues on what I can do to stop this?
Nice video as usual
Thanks, Hans.
Hi Ralph. Thanks for the wonderful safe solution! I have tried to build this with Ardunio Uno. I powered the circuity with 5V (and then also with 3V source from the Arduino) I connected the antenna to a life wire. The LED is steady. But the output from the 4th transistor is going ON and OFF using the digital input of the Arduino. I tried using Analog input, and saw that the values are fluctuating. I used 10 uF capactor. Any idea what could be wrong with my circuit? Thanks.
Ralph, I noticed that you have a capacitor between the antenna and the transistor. What's the value of this capacitor?
It should work even without the cap, but if you use one use something like a 10nF. Even a 1nF might work OK.
Same issue. Did anyone find a fix for this?
Hi Ralph, been a while since you posted this, but I've only just had my interest peaked :-) I built this, and got it to work quite reliably, but only when I used a 47uF capacitor in the final stage, wouldn't work at all with 1 - 10uF. However, it works great if I power the circuit from a battery or USB lead from a computer, but if I use any SMPS like power adapter, including the genuine RPi PSU, the circuit is permanently triggered. I guess it's some sort of interference from the switching, so I've tried various smoothing capacitors to no avail. Did you see this behaviour?
I didn't see that behaviour at all, Nick, I must admit. I've just checked the video and I see I was powering the circuit from the Arduino itself which could be quite noisy - but maybe not as noisy as a SMPS. As well as smoothing caps, try putting in a 100nF cap too (in parallel) as that defeats high frequency noise on the power lines (and why we put such caps right next to the power pins of ICs and MCUs).
Nope, I don't understand why a 10μF cap would not work for you. The upside of all this is that you researched and modified the circuit to get it to work for you, so kudos indeed!
I had a similar experience detecting 110v ac using 3.3vdc as the circuit supply. The 10uF cap didn't have enough energy storage to keep T4 on for the entire 60Hz cycle.
Hi Ralph.
Can this be used to check is there electricity without any bulb at the end? The other words, to check is there electricity in an outlet with nothing plugged in? Just to check AC is there in a cable or not. Bare wires, nothing at the end. No current flow, just power on in cable.
It will detect the hot (live) wire only as that is the only one carrying voltage. Whether a bulb is plugged in or not, I'm pretty sure, as that wire is generating an electromagnetic field around itself.
@@RalphBacon with 9014 and 4.7uF electrolitic cap it doesn't work
Great video! I just wondering what will happen if there are bunch of live wires as we have behind the panel and we have activate a device with a relay and then detect if it turned on/off or not. Wouldn't other live wire interfere with this circuit? Also, we have 230VAC to 5V modules with lowest possible current rating which are available in PCB mount version, which can be connected to parallel to our circuit after the relay. Wouldn't it be a better and reliable alternative to your circuit?
Yes it will interfere, Nitin. This cannot differentiate between different live wires, only detect the presence. So if one wire is already live, switching on another will probably have no effect (it _might_ make the LED a tad brighter).
I don't know what you mean by the 230v to 5v modules being "better or more reliable" than my circuit! In what way? You can run my circuit off 3 AA batteries, about as safe as you can get too. You'll have to clarify that question, Nitin.
@@RalphBacon Lets take another scenario, you have 3 wires, you want to detect if one wire is live or not by winding up a wire of your circuit and 2 other wire are also nearby. Now, if any wire from those 2 other wires goes live, even if the wire we are interested to detect doesn't go live the interference from that wire from those 2 other wires may be picked up by and we can have a false positive. Now, about the 230V to 5V modules, those modules have mini transformer along with other components all encapsulated in a plastic case with only 4 wires coming out, 2 for main inputs and 2 for 5V DC output. You can get such module for PCB for a rating of 200mA. If we use those after our relay or switch, that we are interested to detect if it is on or not or mains is available or not, we can use those module which will turned on when our mains/switch/relay is on, we will get a output of 5VDC. It does not interfere with other wires, and it can power another circuit if so need be.
The 5v SMPS units you refer to (which can deliver more than 200mA BTW, see my video #105 (th-cam.com/video/xodLuR6C8N4/w-d-xo.html ) would require actual physical connection to do what you describe - the opposite to the thrust of this video! But yes, it would work. Another way to differentiate wires, if you have access to the wires, is to wrap the "antenna" part of this circuit around/along the wire you expect to go hot; that way others will not really affect it too much but should that wire suddenly carry 240V it will be very obvious.
@@RalphBacon Yes, I'm aware of the challenges. It is a interesting problem when it comes to reliable detection and being economical at the same time. 5V SMPS has it's own problems that it need to be protected by fuse, once it is fixed inside a panel, not easy to replace and then some constant power loss, though smaller but still some power loss of those module/units. I'm building a DIY 3-phase smart meter for my home, I can get currents reading reliably now if they are above 0.2A using a 70A Hall sensor (may replace it with lower current rating). So mains/live wire can also be detected by hall sensor and they also have minimum to no interference, they are cheap and constant loss of power is also less than smps modules. Of course, we have to clamp or pass through wire we are interested in. Perhaps, we can modify your circuit where it coils around wire. We can have more winding when wrapping it on the wire we want to detect, and we can insulate those winding from outside so it can minimize the magnetic flux from surrounding wire. Investigation of such kind of tape/material which can provide of insulation is needed.
Whole Lotta questions popping into my mind: would it work with a standard two-can darlington array, have you tried that? How close can the wire be to that antenna in the switch scenario so it doesn't trigger permanently? Is that w fourth transistor really necessary, why not do that in Software? Those are just the most prominent ones.
It might work with a single package Darlington, I haven't tried, it will depend on the gain of the Darlington pair. How close it can be depends on that gain - try and see. Transistors are cheap and fast and hardware is sometimes better than software but it's your choice, try it and see!
I got my circuit down to this:
electronics.stackexchange.com/questions/328897/using-240v-mains-on-off-as-input-to-microcontroller/429820#429820
Hi, can you tell me why my copy off your work won't work. I use BC547, rest is exactly as your circuit..... 😀
If you touch the base pin of the BC547 does it light up the LED? If not, perhaps it does not have the required high gain for this circuit?
Build the circuit starting with just one transistor and work up in stages to see when it stops working.
@@RalphBacon Hi, thanks so much for your answer. My LED is on most of the time, seems to catch up noise, I have ordered the 2n2904 so I plan to wait. The gain math is one or three levels over my skills. I will use the circuit for my pond pump and and well pump and send cycles to my Home Assistant.
Do you have any idea if this would be able to detect voltage on a speaker wire?
Unfortunately not, Robert, as this will really only detect mains (240v) level AC voltage. With a speaker output you could use an optical isolator, perhaps.
I Love it, how much power does this Consume... im Looking For something like this to Monitor My doorbell (Send via 433mhz or mqtt, but an ESP32 For example draws Slot of current from a Battery..)
Most of the power here is drawn by the LED but even that might not be much, depends on the LED. Some consume only 2mA. Too much for a battery though, if continuously driven. You could use an ESP8266 that sent out a quick MQTT message every X seconds/minutes and then goes back to sleep. Others might have more experience of this so we will wait to see what they say.
Ok, maybe i Try it without The LEd. Thought a ESP32 has a Deep sleep Funktion, it should only wake up if The Front door Bell rings and Send mqtt. Should work Fine because The esp does Not use much power in Deep sleep.
Yes, the trick is to use a µController that allows deep sleep and only wakes up every X minutes. A doorbell is, perhaps, a little more time-critical (you don't want to be notified 5 seconds after someone has pressed the bell) but for mains detection, it doesn't matter too much. I'm making a note even as I type this to look into sleep modes for the ESP8266 / ESP32.
I tried creating a voltage detection circuit using three BC547, power it with 5V via a phone charger. The main problem is there is always false positive when the phone charger is power on (the detection voltage have a power supply). Only when I remove the phone charger (still have power in the capacitor) then the circuit work as intended. Does any body have the same problem ?
It's probably mains-borne interference (mains hum) making its way up the wire. Try running it off a battery of suitable voltage (eg 3 x AA) it will be good then.
@@RalphBacon It's no good mate as I intended to use the detection circuit as a sensor in an Attiny project so I can't rely on battery due.
But your answer does explain why my other experiment failed. I tried creating a linear power supply as I assume the fault is i the high frequency switching in the switch mode power supply. I created it but it still gave false positive.
I'll probably try something else like creating a switching circuit for it, sth to temporarily power the detection circuit for a while to charge the capacitor before measuring. Then open the circuit and let it run on the left-over juice from the capacitor for accurate measure.
Thanks for the reply, mate! It's heartwarming to still got help from a video so long ago
Hi Ralph, this is a great video, big thanks for the video! I have build the circuit as you said but my output voltage from 4th transistor is fluctuating and Arduino is receiving high and low randomly even when continuous AC current is flowing, only the thing I had to change was capacitor, I had to use 10 microfarad electrolyte one since I could find the one you used in the diagram. can you please help me to find the what is going wrong with my circuit? thanks a lot.
Hmm. Does the red LED also flicker wildly or is it steady? The 10µF should make the Arduino see a steady voltage not a rapidly moving one - you are using pin A0, I assume? If you put a multimeter on the base of the last transistor (T4) is it a steady voltage?
@@RalphBaconthanks for the quick reply....the red LED is study and and I see .5V of Steady voltage at T4 Base. first I used digital pins to see the HIGH/LOW but it was continuously changing between HIGH & LOW then I switched to A0 to see what's happening. it is going like below, and I have changed T4's many and also tried using 2N2222 but no luck.. what is happening here? is there any way I can fix this.. I though this is a great hack to use in my project but not working only for me...
933
1023
1023
131
1016
1023
2
592
1020
1023
@@santh028 l have the same issue. Did you find a fix for this?
I'd just use H11AA1 and acouple of resistors to detect zero-crossings. Minimum components, galvanic isolation and reliability. It's more appealong to make a proper isolation for the circuit then to deal with dinky antenna wires and separation of L&N conductors. You gonna need to cut in mains wires anyway if you are going tocontrol it and not just monitor.
Ah, I guess you must have missed my video #111 Mains Optoisolator which does pretty much what you describe here. The module I use there is available in single detectors or in a three-unit module like the one in the video. Regarding the cutting of wires to control them, that is absolutely true, but not the focus of this video! Thanks for posting.
Typo Alert: At 11m, the schematic says "2N2904 or similar NPN...". I suspect that you meant 2N3904, the famous NPN. The 2N2904 is the famous PNP of course. Cheers.
Yup, that was pointed out already (will you all STOP trying to earn your *EagleEyes* awards please?) but I'm hoping the context and transistor symbol points to NPN-type transistors. Thanks for posting JH, good to hear from you.
Just built the circuit using 4 transistors 2n3904 and a loop of wire as the antenna. The problem is, the LED lights up as expected up if I put the antenna around the live wire, but it never lights up when wrapped around the neutral. I'm in the US by the way. This circuit does not detect the AC voltage in the neutral wire after I turn on my desk lamp, only in the hot wire which isn't useful since that's always on. Any tips for troubleshooting this issue? I'm getting 4.75v at the output when the LED is off and 0.75v when the LED is lit up. I swapped the 10k resistor out for a 1M because with the 10k I was getting 3.3 volts at output when LED is lit and I don't see how that would work with Arduino logic levels. This is the only change I made from the reference circuit.
If you have a live wire going to a lamp but the lamp is switched off then the neutral is not carrying any current. Switch the lamp on and the neutral also becomes "hot" and this circuit should detect it. Have a go, let me know!
@@RalphBacon Thanks for replying. I wish it were that easy. I have switched the lamp on and still the same issue. I made a video to show you what's happening with it: th-cam.com/video/k1MrWLVsumo/w-d-xo.html
Your video described it perfectly. You are supplying the lamp with both Line and Neutral. Once the current hits the neutral wire it cannot be detected (otherwise it too would be "hot"). You won't get a shock by touching the neutral wire (but don't try it) only the line "hot" wire. Neutral is, in fact, connected to earth either at your premises or in the street somewhere. Make sense?
Hi Ralph, interesting and entertaining as are all your videos. I've learnt loads from them. Re your blog, have you considered Patreon? I'm sure enough people would cough up a dollar a month to cover the costs. I'd be sad if you didn't continue.
Well, Steve, the idea is not to give up on this channel, the idea is to make the channel pay its way. So whilst Patreon _might_ be a way forward (see my response to John Crawford here) I'd much prefer it if my subscriber base increased, viewing figures increased and TH-cam promoted my channel more than it does. But, that said, it's a competitive marketplace so I will have to work harder and smarter. Thanks for your support, lovely to hear from you.
Very interesting. Thanks.
You are most welcome Pekka Grönfors, I'm glad you like the video. Nice to hear from you.
I'm probably missing something obvious ...
Is there a reason that you don't just put a USB supply in parallel to your load and connect the output to a 1k load and a digital input?
That means, Flemming, that you would be wiring up a USB supply which doesn't qualify as "non-contact". And, quite frankly, after my video #90, I don't fancy wiring up any more cheap, Far Eastern wall warts which have this tendency to burst into flames! Especially as this (in my case) is supposed to be "behind the scenes", that is, buried in the wall cavity, or similar, of my (wooden) workshop.
Additionally, as several posters here have mentioned, it should be possible to have several of these mini-sensors connected to a single Arduino, possibly via screened cable.
That's not to say your method would not work, (of course, it would) but it just doesn't seem elegant enough for my workshop automation project. So you didn't miss anything obvious, but it just doesn't fit into my plans at this time. But you raised a very good point so thanks for posting.
I don't buy 220V connected stuff outside Europe - nobody should. A USB PSU from an old phone, ignored for it's ability to only deliver 500mA, would do the trick safely.
However, I do see your point. And yes, I'm probably more pragmatic than elegant ;-)
Hi i just tried to make this circuit but i'm having some problems, the led lights when i have the "antenna" near the cable but at the out point i get 2 volts. when the antenna is moved away i get the running voltage 3.3 i have tried to follow the components as close as possible. im using 2n4401 transistors is that the problem you think?
Hmm, that's quite a deviation from my circuit design. I use silicon NPN transistors, you're using germanium PNP transistors! I shall to say to you what I say to all my viewers who can't get a circuit or sketch working: follow my example *exactly* before customising it. You know my version works, so there's your answer. Good luck (not that you will need it, believe me!)
@@RalphBacon ah ok thx I'll work on it. As you can tell I'm not very good at the electronics part. I'm ok with cobbling together Arduino and sensors but lack the experience with discrete electronics. Thank you for answering so quick. I'll have to find those transistor you used.
@@RalphBacon i'm looking at the datasheet for the 2n2904 and it says its a PNP transistor. ?? did you mean 2N3904 ?
My bad. The circuit does say 2N2903 (or any similar *NPN* transistor) so it should indeed say 2N3904. I was probably getting carried away with the 2N22222 which I use all the time. Cheap as chips too. Sorry about that I shall make a note in the video description.
@@RalphBacon I'm still working on getting it right. I tried with the bc547 but still couldn't get it going. The led lights, but having trouble at the out signal stage. Anyway is a good learning experience for me. I haven't really done much discrete electronics before. Will order all the components you used and try again until I get it right. Thanks for your videos.
BTW hope your eyes get better. My friend had the same thing happen to him both eyes within a year of each other.
any suggestion for a suitable DIP chip with 4 npn transistors built in, for easier management? thanks
p.s.: when i read "bipolar tranny" i thought to a mad transvestite from transylvania (Rocky Horror Picture Show) :D
I'm not sure a mad tranny from Down Under is going to help detect mains voltages but any Quad Transistor Array chip (such as a TPQ3904) should work, assuming the gain is sufficient (around 200 - 400 per transistor). Google might be your best friend here, dammit, Janet!
thanks, i don't even know how to search for these stuff :)
Thanks great video
Glad you liked it Steve, best of all it encourages safe behaviour around mains electricity!
A point here. I was thinking that the "no contact" system is responding to current in the wire instead of voltage. What made me think that is that there a mains ammeters that are "no contact" (an example: www.amazon.com/Amprobe-4560537-AMP-210-Clamp-Meter/dp/B00U2F4S0Q/ref=sr_1_3?s=hi&ie=UTF8&qid=1529100520&sr=1-3&keywords=amprobe ). You just clamp it around a wire and from the magnetic field generated by the current in the wire it measures the current.
They use split current coils, of the type linked to by whitefields5595 (as per my demo) and they generate a voltage proportional to the current flow; I don't need this, just the presence of mains is enough for me, and this circuit works whether current is flowing or not. (I, too, have a current clamp meter and it works pretty well but just not what I need here.) But if you need to measure current flow that is certainly one way to do it.
I must say that I learned something here. First I apologise for thinking you might not know of current clamp meters.
My problem was that I could only picture a "no contact" sensor as being inductively coupled. It didn't occur to me that capacitive coupling would work. Of course your setup couldn't have been inductively coupled because only one end of the antenna (aerial) was connected to the sensing circuit.
I've been out of the business too long.
No apology of any kind required, captxrox, I didn't take any offence, we're all friends here. I'm just glad this circuit seems to provide a way forward for my "backup" verification for my workshop automation project!
wonder if will detect DC?
It's the alternating current that makes this work, Jorge, so it won't work with DC, I'm afraid.
Where is the original video?
See the video description, all details that I have are in there!
@@RalphBacon oh! I misunderstood, I thought you built that "little device". Now I get it. thanks!!
My inner pedant is screaming, "11 components - 4 transistors, 4 resistors, 1 capacitor, 1 LED and 1 signal diode." ;)
That aside, it's an elegant circuit.
Hang on, BaronVonBiffo, let me count, 1..2..3..4..5..er, hang one where did I get to, 4...5...5...8, no ...7... er... Oh WTH let's call it 10, we're all friends here. What? Oh alright, it's eleven then. 🤓 In my defence, I had to "count" whilst I was filming the video so it wasn't a bad estimate, hey? Heh heh, thanks for the correction. And yes, it's quite a nice circuit, cheap AND safe!
Hey, Is there anyway to reduce the sensitivity? I get a bright LED just from moving my hand near it! Iv tried this with my RPI to detect if heating is on (if there is power in the switch/thermostat wire) and its picking up when the boiler is on (just for hot water) as well. Also the pin on the RPI doesn't seam to ever get "LOW" so I just get lots of HIGH notifications. any ideas? maybe a way to increase the voltage difference as well as sensitivity? this is great tho thanks!
You can try reducing the sensitivity by adding a resistor between the base of the collector and ground. Try 100K first.
Ralph, You can get off the naughty step now.
Heavens be praised, I've been set free! A huge burden has been lifted off my shoulders. Thanks for that whitefields5595, nice to hear from you, hope you didn't mind me quoting you!
Ralph, for homework I'd like you to compare and contrast the hardware (charge pump) and software methods for determining mains presence at your final stage. Some of the baying mob out there are going to get solder anxiety so it would be useful to see the pros and cons of "doing it in software" vs hardware. Also you are still going to find it a tight fit in places so the 4 transistor DIL chip would be good so you could make it long on thin for tight spaces ..... This would then be a good project taking first principles of non-contact, then HW vs SW rationalisation and finally miniturisation/ component reduction / packaging. Maybe use the ATTiny or similar?
See the responses from Richard Grier - I think that qualifies as getting my homework done by someone else!
Ralph, homework cannot be outsourced. Richard is proposing a different method of INPUT detection using an op amp. Your homework is to compare and contrast conditioning the OUTPUT signal using the binary nature of your charge pump vs (quasi-analog) pulse train counting in software. There is always a decision to be made between hardware vs software that would add a richness to your projects .....
Happy to make some free PCBs for you. I have sent you an email
I'll have a read, thanks Rupert.
Thank you for an interesting and useful project. When I did my training transistors were around, but we learnt valve technology, I am still trying to catch up! I agree with Steve Hallam, why not try Patreon? I too was forced into early retirement, best thing that ever happened. Good Luck. Are the transistors 2N2904? as the data sheets that I have looked at say it is a PNP and not a NPN.
Oh dear, did I say 2N2904, they were, in fact, a *2N3904* or any other general purpose *NPN* transistors, such as 2N2222A or BC327. The link I put in the video description is for a selection of NPN and PNP transistors, very cheap and useful. And I have now painstakingly resorted them all back into their correct locations, took about 15 minutes. Now I'm _very_ careful when opening the lid. Thanks for correcting this.
I once did a course on valves (or tubes, as our American cousins might call them). They seemed even more dangerous than all the mains projects I've ever tackled! And hot! And big! Yet nowadays I yearn for a retro mini-tube amplifier, with exposed tubes, they just seem so cute! But far too expensive.
Patreon? Hmm. I've read their new terms and conditions. They have increased their overall markup percentage for small amounts so that my original plan (if I was going to do it at all) of a $1 monthly donation would lose 5c to fees but also about 10c to payment processing fees. Plus a fee when money is transferred to my bank account. Not good at all for small, affordable donations. So to make it even vaguely viable I'd have to ask for $1.50 or even $2 which suddenly subscribers would notice more. I'm not sure about this at all until I have twice the subscriber base I have now. But never say never, as James Bond might say!
Thanks for the encouragement, John, we shall see how things pan out over the next 6 months or so.
That is good about the 2N3904 as I have some and 2N2222 in my selection box.
Let me know how you get on, John!
an electronic designer's nightmare !
the leakage current + currents produced by insulation resistance at the
Darlington input must be Ico + i ]leak
Just quoting your post, Martin: "Darlington input must be ... for the circuit to work. very very unlikely!" But surely the video proves it does work? I don't fully understand your objections or concerns, care to elucidate?
Kiran Daware is a lady I think.
Um, you may be right. Is it important? Did I say something indicating otherwise (oops)?
Ralph S Bacon No no you did’nt. Being Indian I surmised from the spelling of the name.