Power supply safety relais triggers during startup of Electron

Hi there, I was hoping you could help me.

I am developing a product with the Particle Electron for about a year now. And I’ve run into a persistent problem.

The goal is to power a 12V linear actuator with the Electron using a motor controller IC (H-bridge from Infineon rated 45V and 5A). This works like a charm after some prototyping.
To provide the 12V at a max of 5A the setup uses a Mean Well MDR-60 power supply. This power supply has an LED that indicates that DC power is ok and is switched with a relay with a rating of 30V/1A resistive.

Here comes the tricky part, during startup of the electron the relay is triggered and the power supply goes into safety mode. This does not happen if the power supply is plugged in after the electron boots on the battery. This makes me think that something is happening in the boot sequence of the Electron, either by shorting something (highly unlikely I think because things should be permanently damaged, which is not the case) or by some effect the antenna is creating during connecting with the server. Is there a third option for the relay to trigger and is this something that has happened before (although I couldn’t find a similar post on the forum).

My problem is that the Electrons can’t reboot automatically after a power cut off or full reset because the power supply just stops working. I have to unplug the power supply, boot the Electron on the battery and reconnect the power supply.

Things that I have excluded:

  • PCB or anything on it
  • A Faulty Electron (used multiple can recreate the error every time)
  • Insufficient power supply
  • Faulty antenna
  • Faulty power supply (used multiple units)
  • Only happens with cold boot during green light (at around 5 sec)
  • Does not happen during data transmission (publish)

What pins are you using to control the relay?
You may need to stay away from the Dx pins that also double as JTAG pins during boot-up

There are some threads like this one

I am not controlling the relay, this is a safety relay in the power supply. The power supply is connected to Vin and GND with a DC/DC converter in between for 5V.

power supply --> DC/DC converter --> Particle Electron

What does the Electron the do in your setup then if it’s not doing that?
More info would help.

I simplified the code to test this particular failure. I do not do much in my setup. The relay switching in the power supply happens during cold booting of the electron (green light flashing).

Here is my code:

const int in1Pin = B3;                                     // H-bridge in1 (pin 3)
const int in2Pin = B2;                                     // H-bridge in2 (pin 5)
const int posPin = A0;
int pos =0;
//Log hander initialisation
SerialLogHandler logHandler(LOG_LEVEL_TRACE);

void setup() {
  pinMode(in1Pin, OUTPUT);
  pinMode(in2Pin, OUTPUT);
  Serial.begin(9600);
}

void loop() {
Log.info("retract");
retract();
Log.info("going to publish");
Particle.publish("Actuator retracted");
Log.info("waiting");
delay(5000);
Log.info("extend");
extend();
Log.info("waiting");
delay(5000);
}

void extend(){
    Log.info("extending");
    while(pos<3500){
          Log.info("Power on");
          digitalWrite(in1Pin, HIGH);
          digitalWrite(in2Pin, LOW);
          pos = analogRead(posPin);
          Serial.println(pos);
          delay(100);
          stop();
          Log.info("Power off");
        }    
}

void retract(){
    Log.info("retracting");
    while(pos>500){
          Log.info("Power on");
          digitalWrite(in1Pin, LOW);
          digitalWrite(in2Pin, HIGH);
          pos = analogRead(posPin);
          Serial.println(pos);
          delay(100);
          stop();
          Log.info("Power off");
        }   
}


void stop(){
 digitalWrite(in1Pin, LOW);
 digitalWrite(in2Pin, LOW);
}

Are you reading the EF pin (2) of the H-bridge?

does setup happen before connecting to the internet? I have always thought that no code would run before a connection was made.

The bootloader happens before connection, but if you use any of the non-AUTOMATIC system modes and/or SYSTEM_THREAD(ENABLED) your code will be run virtually immediately.

However, the EF pin can be monitored in circuit too (e.g. via a connected LED) - hence the question, since in code there is no sign of monitoring it.

1 Like