User avatar
davidcoton
Posts: 3210
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Relay Module KY-019 5V

Sat Jul 07, 2018 9:11 pm

What you might consider, particularly if your project is portable, is a mains plug incorporating an RCD.
An additional MCB is a bit over the top, you have plenty of fuses everywhere and they fail safe (never heard of problems caused by fuse failure when the proper fuse has been used).
"Thanks for saving my life." See https://www.raspberrypi.org/forums/viewtopic.php?p=1327656#p1327656
“Raspberry Pi is a trademark of the Raspberry Pi Foundation”

User avatar
tlfong01
Posts: 678
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Relay Module KY-019 5V

Sun Jul 08, 2018 2:50 pm

tlfong01 wrote:
Thu Jul 05, 2018 9:17 am
I then tested a 220V 5W lamp (I forgot if it is LED) and everything worked OK. Next step is to test a AC220V motor.
All these years I have been playing with DC motors, from 3V to 12V, and also 6V servo motors, trying to make a line tracing robot car, with ultrasonic senors, but never completed any project. I also once played with stepping motors and brushless DC motor (BLDC), and hoping to make a 3D printer, but neither completed any project. But I am happy I have learned many things about motors.

I don't have any experience with AC motors, because I always thought AC motors were for driving heavy machinery in factories or mining sites. But I recently read that there are small power AC motors for home water pumps. This is one of the reasons I started learning with relays, because I read it is easy and efficient to use relays to drive AC motors. I hope I can control AC motors for my home automation project.

My testing plan is summarized below.
  • 1. Test a small 220VAC 4W 5 rpm motor. I bought this very cheap second hand 220VAC motor (and many many other cheap electronic components, [but not the fuse cartridge holders which I bought from a reputable DIY shop]) in the local electronics flea market in Apliu Street (only 15 minutes walk from my home).
  • 2. I will also test other 12VDC motors for comparison.
First step is setting up a bench power supply unit (PSU) for general relay control and DC motor power. This PSU has 12VDC, and LM2596 3 amp short circuit protected switching regulator based 5VDC, and 3.3V power, three volt meters and one current meter.

Apliu Street electronics market in Hong Kong Global Geek Tour
https://www.youtube.com/watch?v=MTHYR_0-zi4
Attachments
kUGXJc2[1].jpg
kUGXJc2[1].jpg (77.23 KiB) Viewed 1064 times
I am an electronics, smart phone, and smart home hobbyist.

User avatar
tlfong01
Posts: 678
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Relay Module KY-019 5V

Mon Jul 09, 2018 1:30 am

davidcoton wrote:
Sat Jul 07, 2018 9:11 pm
What you might consider, particularly if your project is portable, is ...
An additional MCB is a bit over the top ...
you have plenty of fuses everywhere and they fail safe ...
Many thanks for your explanation and recommendation. I fully agree with you.
So I searched Farnell UK, Farnell HK, RS HK, and TaoBao CN. I found the following good:
I already placed an order at TaoBao. I hope my new toy arrives in 2 days.
I am an electronics, smart phone, and smart home hobbyist.

User avatar
tlfong01
Posts: 678
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Relay Module KY-019 5V

Mon Jul 09, 2018 4:26 am

tlfong01 wrote:
Sun Jul 08, 2018 2:50 pm
My testing plan is summarized below.
  • 1. Test a small 220VAC 4W 5 rpm motor. I bought this very cheap second hand 220VAC motor at the local electronics flea market in Apliu Street
Attachments
ACkekpc[1].jpg
AC220V 4W 50Hz 5rpm sync motor
ACkekpc[1].jpg (94.18 KiB) Viewed 1020 times
I am an electronics, smart phone, and smart home hobbyist.

User avatar
Mortimer
Posts: 905
Joined: Sun Jun 10, 2012 3:57 pm

Re: Relay Module KY-019 5V

Mon Jul 09, 2018 5:43 am

The only problem you might have with a Permanent Magnet Synchronous Motor is it might not start by itself. They usually need either a small push to get them going, I have a clock like that. Or they need a variable frequency drive (Complicated).

User avatar
tlfong01
Posts: 678
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Relay Module KY-019 5V

Tue Jul 10, 2018 7:53 am

Mortimer wrote:
Mon Jul 09, 2018 5:43 am
Permanent Magnet Synchronous Motor might not start by itself ...
need either a small push to get them going ...
or need a variable frequency drive ... (Complicated).
I have a clock like that. ...
So this motor is a bit complicated. I only heard about AC induction motor and did not know that there are many varieties. Just now I wiked to learn more. They are indeed complicated.
I was surprised to know the this kind of motors can be used for clocks and timers. Now I have changed my mind not to use it for small water pumps, but try to make use of it as timers. Not too long ago I bought some NE555 timer modules and found them tedious to program as precise timers. I hope this little motor makes a good timer.

Now I have assembled the motor in a small box, and going to do a open short check and started testing.

I forgot the meaning of electromagnetic induction which I learned in middle school physics but did not fully understand it. Just now I wikied the theory of induction, Faraday's Laws and Maxwell's equations and found them too complicated for hobbyists. So I gave up reading further

Synchronous motor - Wikipedia
https://en.wikipedia.org/wiki/Synchronous_motor

Small synchronous motors are used in timing applications such as in synchronous clocks, timers in appliances, tape recorders and precision servomechanisms in which the motor must operate at a precise speed;

Synchronous motors are available in sub-fractional self-excited sizes to high-horsepower industrial sizes. In the fractional horsepower range, most synchronous motors are used where precise constant speed is required. These machines are commonly used in analog electric clocks, timers and other devices where correct time is required.

AC Induction Motors vs. Permanent Magnet Synchronous Motors - Steve Bistak 2017jan23
http://empoweringpumps.com/ac-induction ... tors-fuji/

There are a few key differences between AC induction Motors and Permanent Magnet Synchronous Motors. Permanent magnet motors MUST operate with a drive. AC induction motors can be used without a VFD to drive a pump or fan, but are often installed with variable frequency drives (VFD) in pump systems or fan systems in an effort to improve system efficiency.

Faraday's law of induction - Wikipedia
https://en.wikipedia.org/wiki/Faraday%2 ... _induction
Attachments
sKWByAc[1].jpg
sKWByAc[1].jpg (70.08 KiB) Viewed 980 times
I am an electronics, smart phone, and smart home hobbyist.

User avatar
tlfong01
Posts: 678
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Relay Module KY-019 5V

Tue Jul 10, 2018 1:31 pm

Mortimer wrote:
Fri Jul 06, 2018 11:22 am
So you had BS1362 fuses in a 6x30mm holder? If so no wonder it was unreliable. ...
When you start using electric motors, you might want to consider changing any glass fuses in circuit to ceramic ones, like the BS1362. ...
Short fuse cartridge for long holder

Well, a 25mm fuse cartridge placed in a 30mm fuse holder is worse than just "unreliable". It might be very risky in some situations. It is indeed a laughable, but unforgivable mistake, even by hobbyist standard.

I googled and found that 20/25mm fuses are for 250V, and 30mm for 500V (longer tube to entertain longer arc, I guess). So my carelessly fitting a short fuse to a long holder is of course losing my face and damaging my reputation.

Anyway, this afternoon I went to the DIY shop and found them selling 20mm and 25mm fuses, but no 30mm ones. I needed to go to another smaller shop to get 30mm ones (package labelled 6 x 30 fuses, HK$10 for 10).

Appendices

The Circuit Protection Specialists
https://www.swe-check.com.au/pages/prod ... ide_list/1

LittleFuse Cartridge Fuses
http://www.littelfuse.com/products/fuse ... fuses.aspx
Attachments
G9gIt92[1].jpg
G9gIt92[1].jpg (80.81 KiB) Viewed 960 times
I am an electronics, smart phone, and smart home hobbyist.

User avatar
tlfong01
Posts: 678
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Relay Module KY-019 5V

Wed Jul 11, 2018 8:55 am

tlfong01 wrote:
Tue Jul 10, 2018 7:53 am
Mortimer wrote:
Mon Jul 09, 2018 5:43 am
Permanent Magnet Synchronous Motor might not start by itself ...
need either a small push to get them going ...
or need a variable frequency drive ...

Motor box earth wiring, assembly, and testing

Now I have completed all the boring earth wiring and open short check. Next step is power the motor up and see if it moves happily by itself without any push.
Attachments
YTYCn2h[1].jpg
YTYCn2h[1].jpg (95.67 KiB) Viewed 934 times
I am an electronics, smart phone, and smart home hobbyist.

User avatar
tlfong01
Posts: 678
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Relay Module KY-019 5V

Wed Jul 11, 2018 9:29 am

tlfong01 wrote:
Wed Jul 11, 2018 8:55 am
tlfong01 wrote:
Tue Jul 10, 2018 7:53 am
Motor box earth wiring, assembly, and testing
Next step is power the motor up and see if it moves happily by itself without any push.

Motor testing
Motor moves by itself, without any push. So far so good.

But Wikipedia on Synchronous motor says push is necessary
https://en.wikipedia.org/wiki/Synchronous_motor
A permanent-magnet synchronous motor (PMSM) uses permanent magnets embedded in the steel rotor to create a constant magnetic field. The stator carries windings connected to an AC supply to produce a rotating magnetic field. At synchronous speed the rotor poles lock to the rotating magnetic field. Permanent magnet synchronous motors are similar to brushless DC motors.

Because of the constant magnetic field in the rotor these cannot use induction windings for starting. These motors require a variable-frequency power source to start.


I remember I read somewhere (forgot where) saying that for small motors, no push is required. I need to google more.

My new toy arrives
My new toy, the RCD plug arrives. So I will divert.
Attachments
vuHxQWY[1].jpg
vuHxQWY[1].jpg (66.67 KiB) Viewed 924 times
I am an electronics, smart phone, and smart home hobbyist.

User avatar
tlfong01
Posts: 678
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Relay Module KY-019 5V

Thu Jul 12, 2018 6:31 am

tlfong01 wrote:
Mon Jul 09, 2018 1:30 am
davidcoton wrote:
Sat Jul 07, 2018 9:11 pm
What you might consider, particularly if your project is portable, is ...
An additional MCB is a bit over the top ...
you have plenty of fuses everywhere and they fail safe ...
I already placed an order at TaoBao. I hope my new toy arrives in 2 days.
My new toy arrived in less than 2 days. I tested it and found it good. There is no need to do any wiring. Just plug and play.

But the user instruction is bad, though their website is good, but English as bad as me.
http://www.nandaoelec.com/
Attachments
xk0Q1TU[1].jpg
xk0Q1TU[1].jpg (61.98 KiB) Viewed 900 times
Last edited by tlfong01 on Thu Jul 12, 2018 7:18 am, edited 3 times in total.
I am an electronics, smart phone, and smart home hobbyist.

User avatar
tlfong01
Posts: 678
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Relay Module KY-019 5V

Thu Jul 12, 2018 7:08 am

Mortimer wrote:
Mon Jul 09, 2018 5:43 am
The only problem you might have with a Permanent Magnet Synchronous Motor is it might not start by itself. They usually need either a small push to get them going, I have a clock like that. Or they need a variable frequency drive (Complicated).
I did not have your problem. The motor starts itself, but in random direction. Google says that you cannot decide which direction to start, unless using a complicated thing called triac.

I gave up and will try another new toy, a mini water pump. This 220VAC pump can immerse in a fish tank. I wonder if the fish gets electrocuted.
Attachments
JD2cZNW[1].jpg
JD2cZNW[1].jpg (61.34 KiB) Viewed 894 times
Last edited by tlfong01 on Thu Jul 12, 2018 7:54 am, edited 1 time in total.
I am an electronics, smart phone, and smart home hobbyist.

User avatar
tlfong01
Posts: 678
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Relay Module KY-019 5V

Thu Jul 12, 2018 7:47 am

tlfong01 wrote:
Thu Jul 12, 2018 7:08 am
I gave up and will try another new toy, a mini water pump.
I already ordered my new toy. I hope it will arrive before the weekend.

I have also updated the KY019 relay box schematic, with the little water pump added.
Attachments
uGlgSct[1].jpg
uGlgSct[1].jpg (149.43 KiB) Viewed 883 times
I am an electronics, smart phone, and smart home hobbyist.

User avatar
tlfong01
Posts: 678
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Relay Module KY-019 5V

Fri Jul 13, 2018 3:17 am

tlfong01 wrote:
Thu Jul 12, 2018 7:08 am
I gave up and will try another new toy, a mini water pump.
My water pump is on its way. I have nothing interesting to do before it arrives, so I googled around to see what other hobbyists are playing with their AC220V relay toys.

I found the following yesterday question interesting.

Relay connected to rpi zero w - causes to freeze - by guyd 2018-ju7l11
viewtopic.php?t=217887#p1339456

The original poster is using Rpi and relay to control an AC220V windows shade motor but his Rpi freezes after a number of successful relay switching. I have seen similar reported problems while googling last month, usually Rpi freezes, or becomes crazy, or one water pump unexpectedly and randomly triggers another water pump etc. Similar to the Rpi KY019 relay newbies, all such questions have no confirmed acceptable answers, therefore all those disappointed newbies disappeared after a while, and I guess are still weeping in the dark, ...

My wild guess is that EMI (Electromagnetic Interference) causes all trouble. But I have zero experience in EMI, so perhaps I can do some experiments on that, to find what is going on, ...

I remember I have a Rpi Zero W lying in my no-time-to-play-toys box, collecting dust for a year or so. Perhaps I should dedicate this lonely RpiZeroW to control my coming water pump to verify my guess that EMI is the problem.

Errata 2018jul18hkt0941
> Rpi Zero W collecting dust for a year or so, ...
Actually I bought my RpiZero W from Argon40 in 2018dec, for HK$117.75 (= USD15). In other words, my RpiZW is only 7 months ago. I remember I bought it because I hope to play with the Google Visual Bounty. But later I found the Google AIY with the Visual Processing Unit (Intel Movidius MA2450 ) is not that powerful, and that the Rpi onboard GPU is not supported (On the other hand my Windows 10 PC's much more powerful Nvidia GPU is supported by the Google AI software) . The Google vision software for Visual Bonnet at that time seemed buggy. So I was disappointed and threw my Zero W into the junk components box collecting dust.

And BTW, an Rpi's authorized distributor in China
https://703805.world.taobao.com/index. ... 689295IRpl

is now selling Rpi ZW for also around USD15 (RMB105).
https://item.taobao.com/item.htm?id=55 ... acQAvD_BwE

That shop is even selling the Movidius Stick, and Intel TX2 development board, with 6 core CPU, 8GB 128bit, 32GB eMMC, Nvidia Pascal 256 Cuda cores, .... The low tech, hopelessly lagging behind Hongkong hobbyists are indeed losing face!

Anyway, next time perhaps I could get my second RpiZW from them, together with other Rpi goodies, with a much cheaper express deliver fee, ...
Attachments
EBnG9WD[1].jpg
EBnG9WD[1].jpg (65.04 KiB) Viewed 846 times
Last edited by tlfong01 on Wed Jul 18, 2018 3:15 am, edited 4 times in total.
I am an electronics, smart phone, and smart home hobbyist.

User avatar
tlfong01
Posts: 678
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Relay Module KY-019 5V

Fri Jul 13, 2018 7:22 am

tlfong01 wrote:
Fri Jul 13, 2018 3:17 am
Perhaps I should dedicate this lonely RpiZeroW to control my coming water pump

Relay recommended by Forbe and Amazon
While I was searching for my Rpi Zero, Google alerted me a new Forbe article on home automation.

Everything You Need To Set Up Raspberry Pi Home Automation
https://www.forbes.com/sites/forbes-fin ... 1d673e4cdb

Forbe is recommending a relay by JBtek. I thought this should be a new relay for Rpi. So I googled to check out.

JBtek 4 Channel DC 5V Relay Module for Arduino Raspberry Pi ...
https://www.amazon.com/JBtek-Channel-Mo ... 200921ccc4

The article says the following:
The relays will come with insight into where you should plug them in, so follow those directions to ensure you have the proper connection.

But the relay spec does not even say it is High level or Low level triggered :!: I read the critical reviews and found as disappointing.

JBtek Relay Module for Arduino and Raspberry - Critical reviews
https://www.amazon.com/JBtek-Channel-Mo ... geNumber=1

I gave up and went back to setup my Rpi Zero W, ... :cry:
Last edited by tlfong01 on Fri Jul 13, 2018 2:01 pm, edited 1 time in total.
I am an electronics, smart phone, and smart home hobbyist.

User avatar
tlfong01
Posts: 678
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Relay Module KY-019 5V

Fri Jul 13, 2018 11:53 am

tlfong01 wrote:
Fri Jul 13, 2018 3:17 am
The original poster is using Rpi and relay to control an AC220V windows shade motor but his Rpi freezes after a number of successful relay switching.

I have seen similar reported problems while googling last month, usually Rpi freezes, or becomes crazy, or one water pump unexpectedly and randomly triggers another water pump etc.

My wild guess is that EMI (Electromagnetic Interference) causes all trouble. But I have zero experience in EMI, so perhaps I can do some experiments on that, to find what is going on, ...

I have googled further and collected more references on how to solve the EMI related relay switching problem. I have a bad feeling that if I carrying on with the KY019 relay loading the AC220V water pump, sooner or later I will get the Rpi lock up/hang up/freeze problem. Then I might need to use varistors placed across the relay contacts (COM and NO). But that is a bit risky. So I am thinking of getting a assembled bare bone relay board, with varistor already installed, like the attached below.

Appendices

Simple relay circuit getting noise spike form AC line [mpu locked]
https://www.electro-tech-online.com/thr ... ine.38060/
The problem I have is when I switch the relay the AC load causes some sort of noise or interference which travels all the way back to the Pic and locks it up. This noise can happen both when I turn the motor on and when I turn the motor off. The motors are small 20 watt motors.
So what can I do to filter or suppress or eliminate this noise? What exactly is this noise?
One more thing, when I switch the relay with no AC load it works fine, it also works fine with resistive loads such as lights.


Relay noise problem although flyback diode is used [mpu locked]
https://electronics.stackexchange.com/q ... de-is-used

Mcp23017 resets and relays stop working! [mpu locked]
https://www.element14.com/community/mes ... ing#132424
The fan may be a much more difficult load than the lights - but if switching the relay makes it go wrong only if it's the fan that is switched then it is probably something to do with the characteristics of the fan/regulator combination.
You could try putting a transient suppressor across the relay contacts for the fan ...


Relay Arc Suppression
https://www.phidgets.com/docs/Mechanica ... uppression
For AC powered applications, you can put a Metal Oxide Varistor (MOV) across the load terminals of the relay in order to protect it from voltage spikes. An MOV will not remove the entire arc, but it will be helpful in circuits up to several hundred volts.
For low-voltage AC applications, a bi-directional transient voltage suppression diode (“transil diode”) that is rated for higher than the AC voltage of the circuit can be placed across the relay terminals in order to protect it from voltage spikes.
Attachments
CoORTzq[1].jpg
CoORTzq[1].jpg (75.53 KiB) Viewed 777 times
Last edited by tlfong01 on Sat Jul 14, 2018 1:17 am, edited 3 times in total.
I am an electronics, smart phone, and smart home hobbyist.

User avatar
Mortimer
Posts: 905
Joined: Sun Jun 10, 2012 3:57 pm

Re: Relay Module KY-019 5V

Fri Jul 13, 2018 12:31 pm

I would imagine that switching inductive mains loads (like motors) may causing momentary arcing between the relay contacts when the circuit is broken. This could possibly be inductively coupled back into the low voltage side and affect the controller or computer.

Some sort of snubber network across the relay contacts to prevent arcing might be considered.

Topics to research "snubber" and "inductive load arc suppression".

Careful with the snubber topic, because it can also cover the coil side of a relay too, but I believe this is already incorporated in your relay board.

User avatar
tlfong01
Posts: 678
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Relay Module KY-019 5V

Fri Jul 13, 2018 12:55 pm

Mortimer wrote:
Fri Jul 13, 2018 12:31 pm
I would imagine that switching inductive mains loads (like motors) may causing momentary arcing between the relay contacts when the circuit is broken. This could possibly be inductively coupled back into the low voltage side and affect the controller or computer.

Some sort of snubber network across the relay contacts to prevent arcing might be considered.

Topics to research "snubber" and "inductive load arc suppression".

Careful with the snubber topic, because it can also cover the coil side of a relay too, but I believe this is already incorporated in your relay board.
Thanks for your recommendation. I heard about the term "snubber" when browsing the EE stack exchange. I remember I googled further and guessed that it might be a EE guys' slang word for things like varistor and MOV. Perhaps I need to study more.
I am an electronics, smart phone, and smart home hobbyist.

User avatar
Mortimer
Posts: 905
Joined: Sun Jun 10, 2012 3:57 pm

Re: Relay Module KY-019 5V

Fri Jul 13, 2018 1:09 pm

You might find your motor is small enough that any arcing is minimal and unlikely to give you problems.

User avatar
tlfong01
Posts: 678
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Relay Module KY-019 5V

Fri Jul 13, 2018 2:19 pm

tlfong01 wrote:
Fri Jul 13, 2018 7:22 am
I gave up and went back to setup my Rpi Zero W, ... :cry:
I soldered the 40 pin header, and saved a copy of the nice SparkFun pinout for reference.
Attachments
sNctMvl[1].jpg
sNctMvl[1].jpg (117.71 KiB) Viewed 754 times
I am an electronics, smart phone, and smart home hobbyist.

User avatar
tlfong01
Posts: 678
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Relay Module KY-019 5V

Sat Jul 14, 2018 6:47 am

tlfong01 wrote:
Fri Jul 13, 2018 7:22 am

Everything You Need To Set Up Raspberry Pi Home Automation
https://www.forbes.com/sites/forbes-fin ... 1d673e4cdb

JBtek 4 Channel DC 5V Relay Module for Arduino Raspberry Pi ...
https://www.amazon.com/JBtek-Channel-Mo ... 200921ccc4

JBtek Relay Module for Arduino and Raspberry - Critical reviews
https://www.amazon.com/JBtek-Channel-Mo ... geNumber=1
I also read the positive reviews, which I don't find that positive, but help me understand the design of the relay. For example, about why EL817C optocoupler's suboptimal operating current 5mA as an engineering tradeoff.

Lots of Misinformation exists in reviews - Amazon Customer 2016feb14
https://www.amazon.com/gp/customer-revi ... B00KTEN3TM

I also read another critical review saying that a bad board blew up his Rpi. So I think it is a good idea to use a buffer [also a logical level converter] to protect the Rpi.

Nice to have 4 relays on 1 board [This bad board blew up my PI] - B-Dogon 2015jul11
https://www.amazon.com/gp/customer-revi ... 00KTEN3TM
Hooked it all up correctly, plugged it in, and POP my raspberry shut off. Looking at all the components relieved the 5v on the PI shorted out and it was because one of the 4 diodes on the relay board was bad. The one right under the relay. I tested it with a meter and voltage leaked both ways through it. The other 3 were fine. So this bad board blew up my PI and im not too happy about it.
Attachments
OflWQxx[1].jpg
OflWQxx[1].jpg (56.06 KiB) Viewed 723 times
I am an electronics, smart phone, and smart home hobbyist.

User avatar
tlfong01
Posts: 678
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Relay Module KY-019 5V

Sat Jul 14, 2018 9:21 am

tlfong01 wrote:
Sat Jul 14, 2018 6:47 am
tlfong01 wrote:
Fri Jul 13, 2018 7:22 am

Everything You Need To Set Up Raspberry Pi Home Automation
https://www.forbes.com/sites/forbes-fin ... 1d673e4cdb

JBtek 4 Channel DC 5V Relay Module for Arduino Raspberry Pi ...
https://www.amazon.com/JBtek-Channel-Mo ... 200921ccc4

JBtek Relay Module for Arduino and Raspberry - Critical reviews
https://www.amazon.com/JBtek-Channel-Mo ... geNumber=1
Lots of Misinformation exists in reviews - Amazon Customer 2016feb14
https://www.amazon.com/gp/customer-revi ... B00KTEN3TM

Nice to have 4 relays on 1 board [This bad board blew up my PI] - B-Dogon 2015jul11
https://www.amazon.com/gp/customer-revi ... 00KTEN3TM
Hooked it all up correctly, plugged it in, and POP my raspberry shut off. Looking at all the components relieved the 5v on the PI shorted out and it was because one of the 4 diodes on the relay board was bad. The one right under the relay. I tested it with a meter and voltage leaked both ways through it. The other 3 were fine. So this bad board blew up my PI and im not too happy about it.
I am looking closely at this relay recommended by Forbes.
Attachments
fwLmu59[1].jpg
fwLmu59[1].jpg (195.76 KiB) Viewed 709 times
I am an electronics, smart phone, and smart home hobbyist.

User avatar
tlfong01
Posts: 678
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Relay Module KY-019 5V

Sat Jul 14, 2018 9:37 am

tlfong01 wrote:
Sat Jul 14, 2018 9:21 am
I am looking closely at this relay recommended by Forbes.
I guess the schematic is similar to below.
Attachments
TR7hShL[1].jpg
TR7hShL[1].jpg (97.62 KiB) Viewed 562 times
Last edited by tlfong01 on Tue Jul 17, 2018 7:19 am, edited 1 time in total.
I am an electronics, smart phone, and smart home hobbyist.

User avatar
tlfong01
Posts: 678
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Relay Module KY-019 5V

Sat Jul 14, 2018 1:38 pm

Mortimer wrote:
Thu Jul 05, 2018 9:31 am
In either case precautions when turning on for the first time, e.g:
  • Switch on remotely if possible for the first time. I.e. turn any switches to on position on the project, then stand back and plug into a switched socket and turn on.
  • Once turned on, if you intend measuring for Voltages use one hand only, the other kept well away and behind your back.
> Switch on remotely if possible for the first time
So I am using long wires of about 2 meters long. My long term plan is to use I2C, SPI, and RS232 cables of over 10 meters long, then I can stand 10 meters away and press the button..

I have tested all 4 KY019 relays, with manual 0V, 5V input to IN1, IN2, IN3, and IN4. The permanent magnet induction moves slowly as expected, 12VAC. 24VAC, and 12VDC outputs are OK.

Next step is using DS3231 Real Time Clock generated signals to control the relays. Final step is using Rpi signals.
Attachments
Jg94gkf[1].jpg
Jg94gkf[1].jpg (89.5 KiB) Viewed 682 times
I am an electronics, smart phone, and smart home hobbyist.

User avatar
tlfong01
Posts: 678
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Relay Module KY-019 5V

Sun Jul 15, 2018 8:19 am

tlfong01 wrote:
Mon Jun 25, 2018 3:42 am
The DS3231 + CD4040 + HC14 is now a standalone, Rpi programmable, relay signal generator (3.3V/5V 8/4/2/1/ ..Hz and more) and 6 channel logical level converter.

Now I am coming back to the DS3231 RTC (Real Time Clock) based KY019 type relay control signal generator. A week ago I used Rpi to program the RTC to output 8/4/2/1 Hz signals. Because RTC has a backup battery to remember things, I don't need to use Rpi again to do any programming this time. In other words, RTC will be used standalone to do the testing, and there is no risk of any back EMF or EMI troubling my Rpi.
Attachments
sKi7sd2[1].jpg
sKi7sd2[1].jpg (73.4 KiB) Viewed 633 times
I am an electronics, smart phone, and smart home hobbyist.

User avatar
tlfong01
Posts: 678
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Relay Module KY-019 5V

Sun Jul 15, 2018 1:17 pm

tlfong01 wrote:
Sun Jul 15, 2018 8:19 am
Now I am coming back to the DS3231 RTC (Real Time Clock) based KY019 type relay control signal generator. A week ago I used Rpi to program the RTC to output 8/4/2/1 Hz signals. Because RTC has a backup battery to remember things, I don't need to use Rpi again to do any programming this time. In other words, RTC will be used standalone to do the testing, and there is no risk of any back EMF or EMI troubling my Rpi.

I have also tidied up the messy wiring and assembled a little signal routing board for easy input to the relays.

Notes.
  • 1. I am redirecting only 6 outputs because HC14 has only 6 channels.
  • 2. The six output signals are 1, 2, (No 4!), 8, 16, 32, 64 Hz. 4Hz is missing because CD4040 does not output binary counter stage 10.
Attachments
8zVCVY1[1].jpg
8zVCVY1[1].jpg (167.96 KiB) Viewed 615 times
I am an electronics, smart phone, and smart home hobbyist.

Return to “Automation, sensing and robotics”