pcmanbob
Posts: 7295
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Wiring relay to Pi

Thu Apr 04, 2019 7:57 am

ptimlin wrote:
Wed Apr 03, 2019 9:38 pm
Your relay module states 15-20mA to activate the relay so you are only offering about 10% of the required current to the relay.
So the 15-20mA is the current required to switch the actual relay ie current drawn by the coil. this is being switch be the transistor on the relay board, so all we are doing it switching this transistor on using the opto isolator so it should only require a few mA to switch that transistor, but as we don't have a diagram with component details we are only guessing at the required voltage/current.

pi9
If you supply details of the relay you are now going to use then we have a better chance of helping you .

Edit.

So I just tested an opto isolator driving a transistor to switch a relay using this circuit

Image

and it works just fine, this is essentially how the relay board should work with an opto isolator , the small current from the opto isolator transistor driving the base of the of the next transistor which switches the relay coil. So there must be something different in the way the circuit is connected on the relay board pi9 is using.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

User avatar
ptimlin
Posts: 88
Joined: Tue Jan 08, 2019 7:44 pm

Re: Wiring relay to Pi

Fri Apr 05, 2019 3:43 pm

pcmanbob wrote:
Thu Apr 04, 2019 7:57 am
So the 15-20mA is the current required to switch the actual relay ie current drawn by the coil. this is being switch be the transistor on the relay board, so all we are doing it switching this transistor on using the opto isolator so it should only require a few mA to switch that transistor, but as we don't have a diagram with component details we are only guessing at the required voltage/current.
No. If you look at the data sheet for just the relay (Pi9 linked it in one of his original posts), the relay coil requires about 120mA nominal to turn on the relay. The relay module board is where they state 15-20mA, so that must be the "ON" current required to turn on the transistor or Opto or whatever they are using, in order to activate coil (where the current would be provided by the directly connected VCC line on the board).

So you need 15+mA in order to active the ~120mA coil of the relay on that board.

JohnsUPS
Posts: 129
Joined: Fri Jul 06, 2018 2:13 am
Location: USA

Re: Wiring relay to Pi

Mon Apr 08, 2019 1:30 am

Consider a different opto.
My go-to opto is the MCT62.

Return to “Automation, sensing and robotics”