Created Sun, 22 Mar 2015 16:07:26 +0000 by ils4580
Sun, 22 Mar 2015 16:07:26 +0000
Hi. I am using chipkit max32 board with Labview. I have one of the digital outputs connected to a 3 volt relay which triggers a solenoid on and of with 12 volts. When I turn the digital output on the board stops communicating and I have to reload firmware. What could cause this? Thanks
Sun, 22 Mar 2015 16:17:33 +0000
Probably either the fact that you're directly driving a relay with an IO pin (are you? Schematic please!), or your supply is dropping out or being otherwise interfered with when the relay or solenoid turns on.
Sun, 22 Mar 2015 19:41:50 +0000
Here is a rough schematic. It works fine with an Arduino Uno maybe because of the higher voltage. Also, when the 12 volts is not on the Max32 works fine and you can hear the relay shift.
Sun, 22 Mar 2015 22:09:40 +0000
An Arduino is capable of providing up to 40mA through an IO pin. A chipKIT is only able to provide a fraction of that. You have to drive the relay through a transistor (millions of examples on google).
I suspect the relay is causing a massive spike of reverse EMF when it turns off which causes the chipKIT to have a complete fit.
Sun, 22 Mar 2015 22:31:06 +0000
I've seen problems with my own projects before when using solenoids. The voltage spikes they produce are great at messing up all sorts of communications. In some cases I've needed to have separate power supplies for the solenoids with large bulk caps to keep things smooth enough to prevent resetting the microcontroller.
Mon, 23 Mar 2015 02:05:48 +0000
Adding a transistor worked great. Thank you.
Mon, 23 Mar 2015 08:53:03 +0000
Did you also add a reverse biased diode across both the relay and the solenoid coils?
Tue, 24 Mar 2015 02:16:11 +0000
So I thought I fixed the problem. I added the transistor and diode but so that the base of the transistor is connected to the digital output but the problem is the 3 volts still has to come from the board still cuts off when I trigger it. I suppose I will have to take my 12v down to 5v and use that with a transistor. Any ideas? Thanks
Tue, 24 Mar 2015 16:51:17 +0000
This must work fine with your relay and 12V.