120/240V to logic level optoisolator (with schematic)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
a tiny and cheap little module from ebay well watch cheap it's gone up in price recently with all the politics and its purpose is to interface uh to your low voltage project like say for instance arduino raspberry pi even a plc and it lets you detect the presence of mains voltage at well this one is designed for 220 volts works at 240 volts you could uh possibly get off the 120 volts but you can just change one resistor and it will make it compatible with just any supply you want the listing for this describes it as one channel ac 224 opt coupler isolation module high voltage opto isolator 3 pound 79 but i didn't pay that for it the price has shot up with all the politics going on to save time i have uh already taken the picture so we can actually get a closer look at this so there's that the real module this is the top of the circuit board this is underside of the circuit board i've flipped the image so that the resistor correlates to these pads the rectifier to these the options to these etcetera everything is in the same place let's go over the circuit so this device up to isolates the mains from your circuitry there's i'll cover that afterwards applications that you could actually use that in but basically speaking if you had logic that you wanted to detect when a light had been switched on or some some motor had been switched on you could just hook this directly across the supply to that and it would provide a logic level signal to either your your small computer or a plc at 24 volts i'll again i'll demonstrate that afterwards and the way it works is it's got a resistor to limit the current it's got a bridge rectifier uh smoothing capacitor and then it's got an led and optiwise later and that's more or less it so i shall just pause the momentum i'll just let you take a picture of that if you want to have a we go reverse engineer yourself it's a bit odd that they've made it double-sided they didn't really need to make it double-sided but they always make everything double-sided these days so let's bring in the schematic ammo just take a look at it it's very simple there's nothing really complex about tom it is purely based on resistive current limiting that means that this resistor on particularly in our 220v supply gets hot it's a 150k and i measured it i left it on for a while on 240 it says 220 because that's its design voltage for the chinese market and uh it went to 55 degrees celsius above ambient that's fine actually it didn't get that hot as i'll show you later sometimes they push these things too hard hardened circuit boards the designers say it's a one watt resistor it should be fine at one want but in reality they're not because they get so hot they burn everything in the vicinity and it shortens their life and the soda gets damaged but it's going through the little bridge rectifier and then there's a smoothing capacitor and then a zener i don't know why the zener is there because ultimately it then goes through an led the green gallium phosphide led very dim green but reliable and then it goes through the gallium arsenide style infrared led in the opt coupler the optocoupler is this little black package here and it's basically got a little infrared emitter on one side and then a clear path the light and then a photo transistor in the other that is turned on by the light from that and you get what they call a transfer ratio or characteristic that ideally if you pass a milliamp through this you could get you can get various options that this it would be a 50 transfer that you'd get half a million would be switched to this or 100 transfer one milliamp and this would be one milliamp or you could get it super high gain one milliamp would be switching quite a lot of current in this case it seems to switch quite a lot of current it seems quite a sensitive opt-wise there as i say i don't know why this inner diode is there because the voltage across that will be capped and the only thing i can think of is that it's protection against this capacitor feeling it's not going to even go pop because that's very current limited it's so it's not really going to short out the supply so that zener diode is probably just never going to come into play ever because i would say that you're going to have two volts across the green led and approximately 1.5 volts across the infrared led it's strange that they've done that but you know it's just a it's a sensible enough design let me connect this up and i shall show you it's operating so i'm going to do i'm going to actually bypass there's a resistor i should have mentioned that there's a pull-up resistor on the transistor here that pulls up to the positive rail so supposing you're wanting it to be a logic level you could take that 5 volts this to zero volt and then this resistor would normally pull it up to 5 volts but then when it was enabled by the presence of mains voltage on this side covered across it would then the transistor would turn out and it would pull the output down to the zero volt rail so it'd go from a positive to negative so effectively uh when the the supplier is there it it puts out a logic zero and when the supply is not there it puts out a logic one i'm going to cheat here i should have left that in to show what i'm going to do i'm actually going to take a supply through an led straight to the transistor and then because the transistor is just floating in thin air it's not referenced at the i'll just put the resistor in the negative so i shall put the power supply on and i shall get a screwdriver get the cable here that i have prepared for this and i shall twist and fold stuff that terminal film this makes me think of that uh thing when you've got terminals close to each other like this with mains voltage between them there's this saying in the the elevator industry and the elevators industry is worth mentioning they use this circuit uh because they have a saying called a george michael if you have a cert type of phone caller george michael which is when you leave a whisker of copper sticking out one of these knit shirts out it's a careless whisker that's the george michael reference it's quite whimsical lots of whimsico now is dead but that's a minor technicality very very talented musician produced a lot of good music courted controversy while the media loved them let's put this resistor so this is the resistor i'm going to stick to the zero volt end so this is actually on the emitter of the transistor there's another thing the way i'm using this transistor is effectively what they call open collector it's commonly used with their plcs that where you've got a bias to the positive rail and you want it to be pulled down this can be used because the collector can just be used floating open it will pull it down to the negative rail when it detects the input it's a common enough approach let's get this polarity right so i'm going to be putting positive to the led then it's going to go through a transistor and then to the resistor so the resistor's just in the circuit somewhere trust me it's going to be fine so negative to here positive to here i turn the power on nothing happens because the op two isolator has not been activated now i get the cliff quick test which is down here somewhere people will inevitably ask what is that it's the cliff quick test it's a device designed for workshops engineering workshops where you lift the lid it's a safety device for connecting bare live electrical stuff up very very useful lets you just hook wires in ideal for test things like solenoids so this circuitry what we're expecting here is i don't know if this will be visible but when i close this down the green led should light and the blue led should light on the low voltage side as it has let me take the exposure off here pal and take the light down a bit there's a little very very dim green led off on so the blue led is being switched by the presence of mains voltage on that circuit board okay let's take a look at some examples of this watch your eyes the light is coming back now and i shall lock that off before the exposure you use up and down things worth of note the in main voltage side of this is reference the means you could get a shock off it just remember that it is fully isolated and they've gone they've got the proper gap here they've drawn a white box around this has been quite sensibly designed to have to say but they've drawn a white box and marked a high voltage just as reminded for that but they've done the usual thing that the little holes in the circuit board are kind of they're not great for mounting particularly this one fills the resistor and will actually short against it and could actually go through the insulation here this is a common thing they miniaturize the circuit boards but they don't think about the mounting of stuff so you'd have to use quite small screws to actually mount that onto something i shall get this out of the way i shall bring in some examples of where this might be used so first example these are actually all elevator circuit boards i think some they're a bit fuzzy because they've been taken the pictures have sometimes been taken in less than ideal conditions this one which brand is this global elevator equipment or something like that i think it is not sure they have the opto isolators here that optimize these one two three four five six seven and eight i'm not sure what's happening here this one is going off somewhere this one is a trailing off somewhere else i'm not sure where it goes uh it's not in the picture oh there is there's the 33 k now they've used a 33k resistor i'm not sure what voltage this is operating at now there's also well i'll draw the the schematic what they've done there that's the best bet here's a schematic they've used there's no smoothing uh that it's done in software that can detect that the the led will be pulsing uh at 50 or 60 times a second and the software just detects that you know it goes looks for the led it sees the led and then it says the power's there in this case i've got a 33k resistor a diode in series and then it's going through the opto isolator that means there's about seven milliamps which is quite a lot of current it's actually it's an awful lot current there is a diode in reverse parallel across the up twice later that's purely because you wouldn't think it would be needed because you've already got a diode here so blocking reverse current flow but in reality all diodes have reverse leakage and that can upset some leds although to be honest these the typical gallium arsenide to leds aren't really too bothered they will break down but they'll recover if you actually run them with a reverse voltage some of the cheapy chinese products just basically put a resistance here as an led there's also a resistor here the resistor here is kind of needed because leds are so sensitive that you can have a situation that uh if there's a safety circuit say quite often in elevators the safety switches down the shaft will all be a fairly high voltage they'll be 110 volts there'll be 240 volts the reason for that is because there's an awful lot of switches in series in each safety circuit and if you've got a huge say you've got a say you've got a flow uh let's see what could this be you might have a pit safety switch you might have a governor safety switch there's a whole load in the safety circuit plus every single landing will have usually on its own circuit it will have a string of safety switches down so if any landing door gets opened uh while it's open sections of the lift control system can't run and this is where it would be detected the reason they use the high voltage across those switches is because when you use low voltage if you were to use five volts out of a terrible idea or even 12 or 24 volts it switched contact resistance would become an issue and that's happened in the past so elevator companies the manufacturing companies went through a spell they did have low voltage safety circuits and they're fine in the lab they're fine when the list first installed but over time tarnishing in the contacts slight arcing in the contacts just with the code con opening closing with a low current will cause high resistance and you end up that you know you get safety the safety circuit's broken but you just have to thump the switch to make it go again so they use the high voltage across those because it's just more reliable it's not so great to to do troubleshooting on because it's spicy but anyway you have this big long safety circuit and it's coming back to tell the the processor that you know the safety circuit is intact or some other supply is intact but because it's a big long safety circuit you get passive coupling and it can cause ghosting you know that thing when an led light you turn the switch off but it's truly switching it just doesn't quite go off it just glows if that happens it can still send the signal to the processor saying that you know something's wrong that you know this thing hasn't this thing's being detected and it shouldn't be being detected so that's why they add a resistor across here just to clamp that it's the same reason they put them in led lamps the other fix for that if you have that problem is and this used to be quite a common thing you get a resistor and actually poke it into the leads better with a couple of wires attached to the resistor and have it dangling off the side the circuit board between say the live and neutral that acts as a we extra local load in some instances where you're getting cross coupling of current but in this case these ones are using 33k i don't know what voltage they're operating at that might hint at a lower voltage and it's worth mentioning that if you want to use this on 120 volts it may work as is but you can change this resistor to another one at least rated half watt preferably one watt if it's 120 volts you can use anywhere between about 33k up to 60k and it won't get too hot the the lower voltage actually is an advantage there but in this instance if they were running this at 240 volt um then they would be passing seven milliamps which would give 1.68 watts but it's got a diode in series so it's only active for half the time so that's still almost a 1.84 watts and that's fine you find systems where you can see what circuit is active all the time because it's looking a bit dark around it but in the case of this one under this cover here it has a similar section but this is the this is the phase detection it detects the three phases coming in to detect they're all present and also the processor can actually check that they're going the right direction in case something happens that the power goes down to a building and then it gets reinstated the phases in the wrong order which does happen and the elevator is running in reverse and all the switches are then just void because it the elevator thinks it's going up but it's actually going down and it causes problems that will hit the bottom limit switch if that happens and kill the elevator usually with people in it stuck so this bit under here it's a shame i couldn't find a picture with the cover off because it usually on the older systems these resistors are just toast underneath it they are just absolutely black they look cruddy it's all burnt around it and the soda is all dry and crusty and one of the most common failures of this particular board is the phase detection release it'll signal that it's got a phase failure or a phase fault and uh the the engineer goes out checks and all the phases are present the circuit board is not seeing it because of field resistors or dry soda joints and the answer is quite often to do things like this another fuzzy fuzzy picture sorry big chains of resistors to try and spread the dissipation what looks like a sorry this picture is really fuzzy it's i couldn't find any good pictures they're usually taken in awkward lighting situations there's opto isolator the double diode arrangement here looks as though they've actually used the two diodes in the one package not sure that goes for the higher voltage but um in this instance this is obviously the active bit that causes problems they've patched they've soldered a resistor onto the end of this diode and they've sorted it onto the opto isolator to bypass the burnt resistors and just quite often they'll lift those off the board to actually let the air flow through them one last picture and i really haven't a clue what happened here arona arca i just remember someone posting this picture in a forum and saying resistor failure any idea what happened here and it honestly looks like liquid has dripped onto the circuit board and damaged that these resistors are in good condition again i don't know what voltage this is or if it's just intermittent uh application of power because 22k is quite a low value even with a single diode they have quite a complex arrangement a couple of diodes here possibly the zener diode by the look of the blue one and then order diode again that that's kind of superfluous components these are not the phase detection i'm going to guess is 110 volts because in this circuit board there's another three big resistors uh for and opto isolators that look as though they're for the phase detection but this one i'm not sure i am there the engineer involved swapped that resistor and everything was fine but it just seems strange to me it looks like contamination the circuit board but interesting stuff but that's uh where they'd use these little modules well they'd actually build it onto the circuit board and if you ever get involved in designing something like that do grossly overrate this resistor because a one watt resistor i'd never use at one more i'd use it at the most half its rating i see so many faults that to one watt two watt three watt resistors being used right at the limit and they get so hot and just sit so hot for so long that they don't just carbonize the circuit board the whole circuit board goes black in the vicinity but the resistor itself in the case of the older carbon film resistors in particular um they sometimes darken and they go black and they carbonize in a way and then their actual resistance characteristics change and they can go down in resistance there was a case of a a certain timer for fan run-on timers in in toilets where when you switch the light on the fan would run even after you'd switched it off for a certain amount of time they used a resistive drop to try and power things like triax and it was a so much dissipation resistor that when they failed they were sometimes a bit smoky and flamey but there we go it's a useful little module ideal for where you want to actually interface with with uh either your logic boards or little plcs like this little clone mitsubishi knockoff plcs how sweet but that's that's an interesting little circuit well worth exploring and also it's worth mentioning that other circuitry the use of a resistor and an opto isolator with preferably the little led just as a visual indication just to show things working one other thing is worth mentioning sometimes the having the led there can be misleading because it can pass just enough current to make the led light and look like the circuit's working but not enough current to actually make it uh trigger the processor or maybe that a problem happens with the optics they're degrading over time so sometimes it's better to have the a little indicator from the microcontroller actually light instead or an led lit from the secondary side the isolated side just to show a real genuine state that it did detect a solid input and the output has detected that and changed state because uh just that light being lit doesn't always mean the processor is actually seeing it a very interesting little module pretty good value and actually quite well designed and functional
Info
Channel: bigclivedotcom
Views: 160,992
Rating: undefined out of 5
Keywords: 110v, 120v, 220v, 230v, 240v, optoisolator, optocoupler, opto, isolator, coupler, isolater, digital, logic, level, plc, open, collector, 5v, 3.3v, 24v, 12v, detector, elevator, phase, failure, direction
Id: 0C2o0rXOXYE
Channel Id: undefined
Length: 20min 20sec (1220 seconds)
Published: Fri Jan 29 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.