Auto Gate

Hi… I am wondering if anyone can help me… I am currently doing my first project with an arduino uno. The project is an auto gate open/close using ultrasonic sensor and a dc motor. The hardware I current have is an arduino uno, a syren 10 motor driver, a sim900 (to open and close the gate via text SMS), 2 proximity sensors, a photoelectric sensor, an RF receiver(priority) and 2 ultrasonic sensors (please keep in mind I want to use only one). I grab two codes from the net - one for the gate open and close and one to control via SMS. I somehow merge the two codes but I am not sure if I did it right. Can someone review this program and make the changes for me please? Thank you

gate.txt (13.5 KB)

If it works, you did it right. If not, you didn't.

Please be aware of the safety aspects of automatically operated powered gates.

See this document regarding the regulations for professionally installed gates in the UK.
Other territories are likely to have similar legislation.

Also see this from the HSE (Health and Safety Executive).

I think the fact that you propose to use SMS to control the gate, which means the gate can be out of sight of the operator makes your proposed system especially dangerous.

Wizard234:
Can someone review this program and make the changes for me please? Thank you

You might want to assist the forum by revealing whether the program works or not and if not what does not happen.

Also be aware that forum members are volunteers and there may not be anyone around with the time to spare to re-write your program for free.

JohnLincoln:
Please be aware of the safety aspects of automatically operated powered gates.

See this document regarding the regulations for professionally installed gates in the UK.
Other territories are likely to have similar legislation.

I think the fact that you propose to use SMS to control the gate, which means the gate can be out of sight of the operator makes your proposed system especially dangerous.

Indeed.

I am in the UK, I recall that a few years back a young girl was killed in one of these automatic gate closers and that was a 'professionally' installed system.

srnet:
Indeed.

I am in the UK, I recall that a few years back a young girl was killed in one of these automatic gate closers and that was a ‘professionally’ installed system.

That incident, and several other deaths are mentioned in the 2 documents I referred to. (I’ve edited my post to add a second link since you quoted me).

JohnLincoln:
That incident, and several other deaths are mentioned in the 2 documents I referred to. (I've edited my post to add a second link since you quoted me).

Thanks for that.

I remember at the time thinking how easy it was for a 'simple' bit of automation to become so deadly.

Can someone review this program and make the changes for me please?

To hire help, post in the "Gigs and Collaborations" forum section.

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Thanks.. Tom.. :slight_smile:

I appreciate the need for safety concerns. But as safety is paramount and all precautions have been taken. Now the question isn't about safety as with all questions in a forum people tend to steer away from answering the question. I was asking about whether in anyone expertise eyes if the code I am using is or was written properly not ranting on other stuff (this is done using a model, not to operate in public or where people are). I am also using a syren 10 using s1 and s2 (can't seem to find a dip switch that matches). So please can someone stick to the question?

Thanks Tom for the heads up

What happened when you tested your code?

No the code didn't work.. the serial monitor gave an indication that the ultrasonic sensors is picking up data such as "1st sensor 0cm 2nd sensor 168cm" and it keep repeating. The motor not running when an object is place before the sensors.

Maybe it is the syren 10 as the s1 and s2 when tested is getting pulses but the motor not turning

Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Can you post a picture of your project so we can see your component layout?

Thanks.. Tom.. :slight_smile:

Wizard234:
No the code didn’t work… the serial monitor gave an indication that the ultrasonic sensors is picking up data such as “1st sensor 0cm 2nd sensor 168cm” and it keep repeating. The motor not running when an object is place before the sensors.

Debug your program one problem at a time. You may have to write a program that ONLY uses the ultrasonic sensors until you get the logic figured out.

Paul

Thank you.. I will try that

Stopped following.
I hate Fritz diagrams, and it's too hard to download/read formatted code from some other sever. (on tablet)