![]() It becomes a bit more tricky if one wants to dim a mains AC lamp with an arduino: just limiting the current through e.g. (I say Arduino, but if you use an 8051 or PIC16F877A microcontroller, there is stuff for you too here.) Switching an AC load with an Arduino is rather simpel: either a mechanical relay or a solid state relay with an optically isolated Triac. This will only work with a random fire optocoupler: NOT igniting at zerocrossing is the principle of this dimmer. WARNING: Some people try to build this with an optocoupler with zerocrossing coz 'that is better' right? Some are even told in electronics shops it is better to use such an optocoupler. Remember that these observations are to the pictures you posted, and might be different to what you have at this moment as you have done some changes since.ĭo the same measurements, measure at 0 volts (black measuring pin) and relay - (red measuring pin).Īgain, you should see relay off = 5 volts, on = 0.6 volts.WAIT!! before you decide to build this, it is good to know that a similar dimmer is available at Aliexpress at cost that is hard to beat (currently 2.70 euro) Leave the other end of the diode (orange wire) disconnected. The green wire in the picture should be connected to +5 volts. The red wire in the picture should be connected to - of your solid state relay. So the yellow wire should be connected to 0 volts. The 2N2222 is E B C so not what i said yesterday, sorry for that. Ok, i Googled again and downloaded a Fairchild datasheet (instead of just a quick look at some pictures like i did yesterday). I measured close to zero.Īt the moment the relay should be on, you should measure 0.6 volts. I haven't changed anything.Īlso measured the diode, the side that does not have the line and the other measuring pin at 0 volt.Īt the moment the relay should be off, you should measure close to 5 volts there. Recheck everything i told you here as it is 3:34 AM over here, and i might have missed something or assumed too much. You might think this is a bit of a childish approach, but it makes it very clear and easy to keep everything in track. ![]() Mark each connection once you connected it. You need 4 colors, not counting the connection to your Arduino. So now each connection should be in its own color. Use colored crayons or so to mark each different line, corresponding to the colors you have available in your jumper wires. Short: Your transistor is probably upside down, and so are your relay and diode. The - side is to be connected to the Collector of your transistor.Īnd the Emittor is to be directly connected to 0 volts. You can also see that the + side of the relay is supposed to be directly connected to + 5 volts. The diode is not neccesary when using a solid state relay, but if you still want to use it, connect it directly to that relay's screw terminal.Ĭonnect the Cathode (the side with the line) to + and the Anode to - (this would suggest it is "upside down", but is exactly what it is supposed to do in this case).Ĭheck the drawing in the link you posted for this. There is also a yellow wire going somewhere unknown, and connected to the collector. The green wire is at the 0 volts of the relay, at the Cathode of the diode and at an orange wire going nowhere (i'll assume it would go to either 5 volts or 0 volts). ![]() You have the red wire connected to + at the solid state relay, and at the Emittor. Looking towards the flat side of that transistor, holding the pins downwards, they are at C B E. Looked up (Googling) where Collector, Base and Emittor are. So after writing all of this, i decided i'd check again assuming the transistor you used is indeed a 2N2222. ![]() Most of the times you can see that on the top of it. You should measure something between 2 Ohms or so.Īlso check whether it is to be polarised, so if it has a + and - side at the coil. You can check the blue relay to see if you connected it correctly. It has a LED on it, so you can see that lighting up when the relay is supposed to switch. It does not click and you cannot feel it switching when you touch it during switching. Tell us what you measure in both states please. Make a measurement on your diode, the side that does not have the line and the other measuring pin at 0 volt.Īt the moment the relay should be off, you should measure close to 5 volts there.Īt the moment the relay should be on, you should measure 0.6 volts. I can't see what relay you used in the first pic (the blue one), so can't tell you anything about that and will ignore it for the rest of this reply. Is the transistor a 2n2222 as mentioned in the link you supplied ?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |