Garage door controller

Hello everyone,

My parents in law have a garage door opener of which the controller board has died, i'm pretty sure the main tranformator has bad windings since there is no voltage on the secundary winding.
Can't find a replacement since there are no markings on it.

I want to build my own controller using a arduino uno with 2 relays for the motor control.

there is a limit switch in the open and closed position
control is via a RF controlled relay and a normally open switch in the garage.

I simulated the would-be setup in tinkercad circuits, and made some code but it won't work properly.

what are now LEDS will be the coils of the relays to switch the mains to the motor.

this is what i have so far:



// Digital input end switches:
const int remote = 4;
const int button = 5;
const int DoorOpenPin = 2;
const int DoorClosedPin = 3;
const int OpenRelay = 7;
const int ClosingRelay = 8;

bool GateClosing = LOW;
bool GateOpening = LOW;


void setup() {
  // define pin modes:

  pinMode(remote, INPUT);
  pinMode(button, INPUT);
  pinMode(DoorOpenPin, INPUT);
  pinMode(DoorClosedPin, INPUT);

  //default relays to LOW
  pinMode(OpenRelay, OUTPUT); digitalWrite(OpenRelay, LOW);
  pinMode(ClosingRelay, OUTPUT); digitalWrite(ClosingRelay, LOW);


}

void loop() {

  int OpenStatus = digitalRead(DoorOpenPin);
  int ClosedStatus = digitalRead(DoorClosedPin);
  int ButtonStatus = digitalRead(button);
  int RemoteStatus = digitalRead(remote);

  //main program:



  //gate is opened with button or remote and stopped with endswitch or button or remote

  if ((ClosedStatus == HIGH
      && 
      ButtonStatus == HIGH)
      || RemoteStatus == HIGH)
  {
    digitalWrite(GateOpening, HIGH);
  }

  if ((ClosedStatus == LOW
      && OpenStatus == HIGH
      && GateOpening == HIGH)

      || RemoteStatus == HIGH
      || ButtonStatus == HIGH)
  {
    digitalWrite(GateOpening, LOW);
  }


  //gate is closed with button or remote and stopped with endswitch or button or remote

  if ((OpenStatus == HIGH
      && ButtonStatus == HIGH)
      || RemoteStatus == HIGH)
  {
    digitalWrite(GateClosing, HIGH);
  }

  if ((OpenStatus == LOW
      && GateClosing == HIGH
      && ClosedStatus == HIGH)
      || ButtonStatus == HIGH
      || RemoteStatus == HIGH)
  {
    digitalWrite(GateClosing,LOW);
  }

  //gate is opened when it is in stopped position between endswitches

  if ((GateOpening == LOW
      && GateClosing == LOW
      && OpenStatus == LOW
      && ClosedStatus == LOW
      && ButtonStatus == HIGH)
      || RemoteStatus == HIGH)
  {
    digitalWrite(GateOpening,HIGH);
  }



  //switch opening relay
  if (GateOpening == HIGH) {
    
    digitalWrite(ClosingRelay, LOW);
    delay(500);
    digitalWrite(OpenRelay, HIGH);
  
  }

  //switch closing relay

  if(GateClosing == HIGH){
    digitalWrite(OpenRelay, LOW);
    delay(500);
    digitalWrite(ClosingRelay,HIGH);
  }
 




  //End of main program loop
}

Welcome to the Arduino forum and your project looks like a good fit for an Arduino. Thank you for including a schematic and properly formatted code listing.
However when you do not tell us what the the code does or doesn't do that does not match you expectation, no one can help.
Did you develop your code in phases and test each step as you went along?

Hello Paul,

I'm trying to replicate the current working principle of the opener.

When it is closed and you press the button (or remote) it should activate the opening relay and open the gate untill the end stop " opened" is activated, thereby releasing the opening relay.
Same way for closing.

Also, when the gate is moving (GateOpening or GateClosing is high( and the relay is active)), and you press the button, the moving should stop.

When the gate is neither in the fully opened or closed position, when the button is pressed it should always go to the open position.

when i simulate it with my current code, after 500ms the OpenRelay becomes active, anything else doesn't do anything.

For safety reasons You should reverse the logic of the end switches. An open circuit, high from pullup, means Stop and a closed circuit, low level, means Good To Go.

Transformer.
Maybe there's a fuse on board.

Yeah, in my native language it's transformator :sweat_smile:
Checked the fuse, it's good. got 230v on the input side of the transformer but nothing on the output side.

There must be some electrolytic capacitors on the output. What are they rated? Is there just one secondary?

You do realize that replacement transformer is the quickest fix for the problem. It can be off the board and connected by wires if the input and output voltages and current capability are close to the original.

I do realize that, but i have no idea what the original transformer's specs are, since there are no labels or markings.

It's a Hormann B 55 DI ( german brand of gate/door openers)

The board being 30 years old isn't helping either, therefore i'm trying to update it with the more modular and modern approach of an arduino with a 2-relay board.

You don't need markings. You know the input AC voltage and you can assume the DC output to the electronics is most likely 5 volts. How many wires on the secondary of the transformer? The only unknown parameter is the current rating for the secondary winding.

Since it isn't working, some serial.prints would be handy to see what's going on.

The electrolytics' rating, the smoothing caps on the rectifier (an assumption on my part here), would be greater than V-peak.


This is the circuit I used for a curtain opener I built for my bedroom when I was 14. The motor was an old car windscreen wiper motor, the battery an old car battery kept charged with a float charger.

SW1 reverses the supply and acts as an open / close switch. SW2 and SW3 are the limit switches, note that they have diodes in series so each one only works for one polarity of the supply from SW1. The diodes and switches should be arranged so the door drives towards the switch with the conducting diode until it hits the switch and opens it. You could put 2 limit switches in series as a precaution against them failing short circuit. In the case of my curtain controller I think the limit switches were bent bits of Meccano for the the contacts. The motor must be DC and reversible, which implies either permanent magnets or using a rectifier to feed either the field coils or the armature.

A fuse near the battery would be a good idea....

If you are wondering about where the micro-contoller is in all this, they had not been invented in the early 1970s.

1 Like

You will note that a general theme of replies here is that it will be more practical to repair the original machine than to replicate all its various functions.

That said, the fact that it actually has limit switches makes it really old and really crude - so pretty easy to re-engineer!

No current machine uses limit switches that have to be mechanically set; my most recent one actually starts up slowly, accelerates in order to be as prompt as possible, then slows down again as it approaches the end of its travel.

How does yours sense an obstruction and respond?

I'd rather not repair the old board, since there are some components that look like they got rather hot during operation.

Refurbishing this board means more trouble than building something myself.
It has no obstruction detection afaik..

Also, maybe in the near future, the addition of smartphone control would be way easier with an arduino as the brain.

I always mention that the UNO is a bad choice for most projects, but if that is what you already have, then OK, run with it.

(The Nano is far more practical for complete designs.)

If you wish to add Bluetooth, then there are add-on modules available. If you want to use WiFi (control your garage door from overseas :grin:) then you should be starting with an ESP instead - such as a WeMOS D1 Mini.

I can always switch to an esp based board in the future, i have ordered some but they take a while to arrive.
In the meantime i just want to get the gate back up and running.
Any advise on the programming mentioned in the OP?

Thank you ! :slight_smile:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.