Does anyone have any code or advice to help me out with a project like this? It’s just an offline pi 3, RTC, relays, and a large bell. The idea is to have the bell signal at specific points during the day. Any help at all would be highly appreciated!
Hi Justin,
The easiest way I can see to use the time to control GPIO pins like this would be in Python, by setting the system time to use the RTC and then using the python time library to grab the time, then use one of the many GPIO libraries (I use RPi.GPIO) to control the GPIO pins. Just make sure you don’t pull too much current through the pins when switching the relays or you could burn out your Pi, there’s a maximum of 16mA per pin with the total current from all pins not exceeding 51mA.
Sounds like you’ve got an interesting project ahead, let me know how it goes!
All good information, thanks! About the current draw though, would I be fine just running the RPi.GPIO output directly to the 120v relay?
I plan on documenting the project here when I’m finished. Seems like it could be helpful as setups for industrial break bells are insanely expensive if you’re just buying a finished product.
If your relays have a switching rating of 3.3V and less than or equal to 16mA, then yes, otherwise you might need to pick a different relay or daisy-chain them (small relay controls larger relay, which then controls the bell). If your relays are 5V and active-low, it might work, but I wouldn’t count on it to be reliable.
This something like this would do the trick?
Looking at the datasheet, it appears that it would still draw too much current. If this is going to be 120V mains power, I’d just like to say that you need to be certified to work with it. It’d be much easier if you used a smart power point device that you could connect to your Pi without having to deal with the high voltage yourself.
Happen to have any examples?
Hi Justin,
To drive high-ish power devices, such as relays, you’d typically use a MOSFET or Transistor to drive the relay/high power device.
A certified technician (to work on mains) would also use an isolation device (such as a relay or optocoupler for added safety.
If you are curious about how to use relays, this guide has a similar approach despite being for a different board.
Thanks! I’m an electrician by trade, so would I be alright just using something like this?
If I wasn’t from America, I’d definitely purchase off this site.
Hi Justin,
Hard to tell, but if you are a technician by trade then you’ll know what to look for! Maybe get in touch with that vendor to talk shop.
I’m admittedly not as versed in microprocessors as I could be, but thanks everyone for the advice! I will document my project here and report any issues I run into