Friday, August 25, 2017

Arduino / Relay Interference


You have a relay connected to your Arduino, and after a while your Arduino stops running. That's not supposed to happen, these things loop forever, right?

It's a common issue when running inductive loads from a Arduino controlled relay. Many folks think it's a voltage problem and try throwing capacitors on the relay supply, or using a opto isolated relay (separate power and ground). These solutions may work, but more often than not, they don't.


So what is causing the problem? It's EMI!
The back EMF from an inductive load causes the relay contacts to act like a spark gap transmitter, scrambling the processor. The Atmel chips are very susceptible to RF.

Not to worry, it's not permanent, it clears when you cycle power.

How did we discover this and how do you keep it from happening?

We have a project where a Nano and a common relay board are installed in a small case. When all the parts are assembled on the bench, it works fine. When crammed together in the box, it works for a while, then freezes. But only with a inductive load attached to the relay. With no load, or a resistive load, it runs forever (well, 3 days or more, forever was too long a test period). We have tested this six ways to sunday with a variety of Arduino and Arduino clones.


Installing snubbing diodes on relay coils and motors (the common solution) can be difficult (they don't work on ac devices) or void a warranty on many household appliances.

I series connected a resistor and a capacitor together, and connected those across the Arduino relay contacts (as close to the relay contacts as you can get). This quenches the back EMF, and prevents the Arduino from locking up. There you go, a $0.30 solution to a nagging problem.

Make sure your capacitor is rated for the voltage you expect to see. I used a .1 uF 50v Tantalum, and a 100 Ohm 1/4w resistor on a 26v circuit. My load was another relay. In another application, the load was a 120v motor, so the cap was 150v.

Tuesday, August 22, 2017

2 Channel IR Interface

Recently we produced a 6 Channel IR interface for IR transceivers like the TCRT5000 pairs. Lots of Model Railroading and other object detection applications. Now we have the less expensive 2 channel version available. Same code, same components, just less of them! - $30 + S&H

Harbor Freight Caliper Interface

Did you know the inexpensive Pittsburgh / Chicago Tool / Harbor Freight Calipers (4 pin dataport under battery cover) have a digital interface? We can read that interface with an Arduino, just like we do with the Mitutoyo / Igaging calipers and micrometers. The electrical interface is different, as is the data stream. Now, thanks to the hard work and experimentation of the folks at Arduinotronics, you can integrate measurement into your projects.

You can display the results on a LCD screen, save to a SDcard, or log the data to a Raspberry Pi based database.

 I'll be posting video, code and schematic shortly, but get your board order in now so you can get started! $20 + S&H

Related Posts Plugin for WordPress, Blogger...