lostpi
Posts: 1
Joined: Tue Aug 02, 2016 8:16 pm

Wiring Bell Relay

Tue Aug 02, 2016 8:25 pm

On a manufacturing floor I have a group of alarms hooked up to a kronos bell relay. The time clock that provided the scheduling and charge to fire this relay has broken and as a cost savings we are trying to use a raspberry to handle this process.

What I have done is wrote a simple python script that turns GPIO 17 on for 5 seconds and then turns it off. Using cron I have scheduled this and have it firing whenever I need the bells to ring. To test my logic I hooked a small LED light up to the PI and let it run for a day, the light blinked for 5 seconds as expected whenever cron called my script.

Today I went out to the factory and wired the pi into the bell relay and nothing happened, my thoughts were the GPIO was not providing enough output to fire the bell relay. As a test to prove this out I just hooked the 5V pin for power and the bell relay fired immediately. So I can make the bells ring when I hook directly to the 5v pin but the problem is then the bells will obviously ring forever.

So I guess at this point I am trying to figure out how can I use a GPIO pin to schedule the firing of the bells and yet provide enough power to fire the bells. If anyone has any ideas I would sure be happy to hear them.

Thank you,

LostPi

mfa298
Posts: 1387
Joined: Tue Apr 22, 2014 11:18 am

Re: Wiring Bell Relay

Wed Aug 03, 2016 10:42 am

lostpi wrote: Today I went out to the factory and wired the pi into the bell relay and nothing happened, my thoughts were the GPIO was not providing enough output to fire the bell relay. As a test to prove this out I just hooked the 5V pin for power and the bell relay fired immediately. So I can make the bells ring when I hook directly to the 5v pin but the problem is then the bells will obviously ring forever.

So I guess at this point I am trying to figure out how can I use a GPIO pin to schedule the firing of the bells and yet provide enough power to fire the bells. If anyone has any ideas I would sure be happy to hear them.
The 5v pins on the gpio header are effectively just connected direct to the PSU input (there's a bit of protection circuitry in the middle but no control), this means there's 5V and reasonably amounts of current available, the GPIO pins however are connected into the Raspberry Pi CPU so run at 3.3V and have limited current available. This would explain why it works on the 5V pin and not on the normal GPIO pins.

What you'll probably need is a driver circuit to drive the relay with 5V and more current. You should be able to find various examples of this online. The components you're likely to need are a transistor, diode and couple of resistors.

You should probably also check the ratings of the relays coil so you know what it needs to be driven with (although sounds like 5V works)

ant_thomas
Posts: 115
Joined: Fri May 04, 2012 4:33 pm

Re: Wiring Bell Relay

Wed Aug 03, 2016 11:54 am

lostpi wrote:Today I went out to the factory and wired the pi into the bell relay and nothing happened, my thoughts were the GPIO was not providing enough output to fire the bell relay. As a test to prove this out I just hooked the 5V pin for power and the bell relay fired immediately. So I can make the bells ring when I hook directly to the 5v pin but the problem is then the bells will obviously ring forever.
You could use a secondary relay which can be triggered by the RPi's 3.3V GPIO, then route a 5V line through this onwards to the bell relay. This will mean you are turning on/off the 5V supply to the bell relay (which you know works).

A quick search on ebay for "arduino relay" will give you plenty of cheap options that should do the job.

Other options are a transistor or optoisolator.

Return to “Troubleshooting”