Imp-pin freezes from time to time, workaround by switching pins

Hi,

we are using the electric imp for remote access management. For that, between 1-3 pins of the imp are connected to a relay module.

Recently, we experienced some pins of the imps to freeze after a while. Strangely, even a reboot didn’t help.
Our workaround was to send a command to another pin, which subsequently fixed the old pin and got it working again.

We had this issue with several imps, so it does not seem like an individual problem. Did anyone else experience a similar issue? Does anyone have an idea what the cause of this might be?

Thanks

That sounds rather strange, and nothing that we have had reported. Can you describe what the relay module is? Any code snippet?

We do not think that there is a problem with the relay. We are using 2-3 different kinds of relay modules and we experienced it with all of them. In one case, the pin of the imp controls a BC-337 transistor, that activates a relay. In another case the pin controls the diode of a diode-isolator, which is connected to a relay. So in those two cases there should be no issues of draining too much current or any other external hardware problem.

The breakout-board of the imp is powered by a 5V DC power adapter, so there shouldn’t be any problems with the power supply, either.

Could it be a hardware issue of the breakout board or the imp itself? Or is this maybe rather a software bug?

Thanks

If you’ve seen it on multiple imps then it’s unlikely to be the imp hardware, but overloading a single pin could cause issues. How much current is being drawn with the transistor switch (ie, what’s the base resistor on the BC337?). Any links to the relay modules you’re using?

It could be a software issue, but I’d have expected that with many many thousand out there, someone would have run into it previously.

What are you configuring the output pins as? Not using DIGITAL_OUT_OD are you?

We use 1kOhm as base resistor to stay below the maximum output of 4mA on 3.3V.
The relay would be this one: http://www.reichelt.de/Miniaturrelais/HJR-4102-L-5V/3/index.html?;ACTION=3;LA=446;ARTICLE=101950;GROUPID=3292;artnr=HJR-4102-L+5V

DIGITAL_OUT_OD means open drain right? I don’t believe so but I have to check. Would the transistors even work in OD-mode?

Yeah, some people have used DIGITAL_OUT_OD_PULLUP, which obviously means severely limited current when driving high, but it can work sporadically.

No problem with BC373, 1k resistor and that relay.