Hi guys i'm after some guidance with my first project.
After a repeat failure of the control board in my gate opener ,i decided i could do better myself.
any way the hardware is completed i believe my sketch is 90% complete.
and i have checked individual parts of the code as well
but if anyone would like to have a look over my sketch and point out any troubles i might have it would be greatly appreciated
hardware is as follows
-arduino mega r3
-bts7960b motor controller x2
each requires +5 volts
ground
2x enable pins pulled high
2 x pwmon forward and reverse
2 wires for current sensing forward and reverse
-4 reed switches
2 gates each with open and close switches = 4
2 inputs debounced through ic pulled low when active
1st for pedestrian access
2nd for vehicle access
MC14490 DIP16 Hex Debouncer IC
-
7ah 12 volt batterys in series
-
5 volt regulator
-12 volt regulator
on the software side i plan to use 2 interrupts for the two access requests while the arduino carries out its other tasks i have in plan for it later on like controlling lighting when its dark sensing if a vehicle is parked in the drive way triggering a doorbell when the gate button is pressed etc
gate_logic.ino (923 Bytes)
gate_open.ino (1.08 KB)
gate_switches.ino (607 Bytes)
gateIs.ino (647 Bytes)
light_fade.ino (860 Bytes)
lm902gateopener.ino (2.32 KB)
lock_open.ino (296 Bytes)
motor_enable.ino (744 Bytes)
motor_openClose.ino (1.04 KB)
pin_numbers.ino (972 Bytes)
sensor_light.ino (521 Bytes)