Stavi23 wrote: ↑
Thu Mar 28, 2019 2:22 pm
Not sure if I'm posting in the right area but here it goes.
The company I work for is looking to use the raspberry pi in one of our projects.
We essentially need to cut off power to a mechanical unit during predetermined times. We would need to have a calendar schedule of some sorts to program when this unit turns on and off.
Then I assume the raspberry pi will control a relay, and we can take it from there.
Is this something that can be done?
Ps i am new to programming so please ask me your clarify anything if I've missed it.
Yes, this is something that the Pi can do quite easily.
As pcmanbob had mentioned, setting up a CRON job to handle the tasks of executing the turn-off or turn-on code (I used simple shell scripts) at predetermined times is fairly easy to set up. I did this very thing on a recent project to turn a LCD backlight on during the day, and off at night.
Also, you need to make sure that the Pi has a reliable clock source. If the Pi is going to be connected to your network, it can easily pull it's time sync from there using NTP (network time protocol), and you don't have to worry about clock drift or daylight savings time changes.
Another benefit of having it on the network is that you can monitor it. You can log into it, and/or have the Pi generate a simple web page to display a status among other things......
There are many threads on how to actuate a relay from a GPIO pin on this forum, so a little research and you should be off and running on that front. As for sizing the relay, depending on how you're connecting it (actuate another relay or wire it direct), it seems like you can take it from there......