Michael,
What type and model will you be using, also is the Arduino type a Uno?

Yes if you are going to use the rolloff-ino.standard sketch done for a Uno. It maps open, close and abort to relay 1 which is set to use pin 4. It is for a one button controller that has its own limit sensors to stop when end of travel is reached. Depending on the relay you are using it might need a HIGH or a LOW on pin 4 to put to close the NO normally open contact. The default is that a HIGH closes the relay. If yours is the opposite flip the HIGH/LOW codes in the setRelay routine.

Separate open and closed switches are needed to indicate to the driver when the roof is fully opened or closed. With an Arduino open switch values tend to float. Meaning when read one time they might return a high and another time return low. So best to pull the open switch to ground or to the positive power voltage with a high value resistor. 10K ohm is common. Some models of Arduino's like the Mega have internal resistors that can be used. The default code is expecting that a low value will indicate that the switch is closed, so a pullup resistor should be used for the open switch setting. See OPEN_CONTACT_HIGH definition and its usage if you want to change that. The defaults for the opened/closed switches: Opened/switch1/pin A0, Closed/switch2/pin A1.

Off-line testing is not a bad idea to check you have these things reliably working before connecting up to the roof.
Regards
Tom

Read More...