Stavi23
Posts: 1
Joined: Thu Mar 28, 2019 2:16 pm

Mechanical unit automation

Thu Mar 28, 2019 2:22 pm

Hello folks.
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?
Thanks
Ps i am new to programming so please ask me your clarify anything if I've missed it.

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

Re: Mechanical unit automation

Thu Mar 28, 2019 4:19 pm

Hi.

We would need to know a lot more about the power supply you want to switch before any specific help could be given on doing the actual switching. . . . For example AC/DC, at what voltage and what current.

As for scheduling, having 2 programs ( one to turn it on and one to turn it off ) you can simple run these programs using cron which is the scheduler in Linux.

You can set day of week , hour & minute for each action.

https://www.raspberrypi.org/documentati ... ge/cron.md

You may also find this site helpful in creating the correct cron lines

https://crontab-generator.org/
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

User avatar
Joel_Mckay
Posts: 289
Joined: Mon Nov 12, 2012 10:22 pm
Contact: Website

Re: Mechanical unit automation

Thu Mar 28, 2019 8:49 pm

In general, for industrial applications you will usually use an RTC calendar chip (lke the MCP79412 ) with an embedded mcu that has a real WDT.

I have hardened arm boards for long-term headless applications, and would recommend you look into a normal PLC given design certification costs.

Best regards,
J

Brandon92
Posts: 775
Joined: Wed Jul 25, 2018 9:29 pm
Location: Netherlands

Re: Mechanical unit automation

Thu Mar 28, 2019 9:26 pm

I would advice you to take a look to Siemens LOGO 8. You can program it daily what it need to do and it comes with all the required certifications.

PhatFil
Posts: 1437
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: Mechanical unit automation

Thu Mar 28, 2019 10:44 pm

If a single phase load < 16a Flash a sonoff TH16 or POW with tasmota and log onto its web interface to set the schedule with 16 timers..
https://github.com/arendst/Sonoff-Tasmota/wiki/ less than £20 and 20 minutes..

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

Re: Mechanical unit automation

Sun Apr 07, 2019 2:08 am

Stavi23 wrote:
Thu Mar 28, 2019 2:22 pm
Hello folks.
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?
Thanks
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......

User avatar
Gavinmc42
Posts: 4060
Joined: Wed Aug 28, 2013 3:31 am

Re: Mechanical unit automation

Sun Apr 07, 2019 6:21 am

I use PiCore Linux for my 24/7 Pi's and most of it is all done with shell scripts.
But I use cron for scheduled stuff.

These have been running for years.
They send me a daily morning email to say they are still alive and if any alarms are triggered I get an email too.
The emails contains a html link to the their webpage so I can see a plot of the daily data.
They log data every minute to a file in ram and that file gets written every day to SD card and I still have room for about 30 years of more data.

Lost track of how long these have been running, model B's? 4, 5 , 6 years?
None have RTC's, they all use network time.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
omegaman477
Posts: 148
Joined: Tue Feb 28, 2017 1:13 pm
Location: Sydney, Australia

Re: Mechanical unit automation

Tue Apr 09, 2019 3:20 pm

Stavi23 wrote:
Thu Mar 28, 2019 2:22 pm
Hello folks.
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?
Thanks
Ps i am new to programming so please ask me your clarify anything if I've missed it.
my 20 cents worth, If the RPI will be performing automatic, unattended starts of mechanical plant that could present a life hazzard if started suddenly, then you need to consider code reliability. As an academic exercise push on, but as its such a simple task I would consider an industrial hardened controller like a PLC.
..the only thing worse than a stupid question is a question not asked.

Return to “Automation, sensing and robotics”