Help with a Micro Controller
Apr 3, 2008 at 11:11 PM Thread Starter Post #1 of 8

Whitebread

1000+ Head-Fier
Joined
Sep 16, 2002
Posts
1,149
Likes
11
Before I say anything, let me state that I am a Mechanical Engineering student with no technical electrical engineering background, so please bare with me.

For a class project, I want to use a Micro Controller to control 4 solenoids based on input from an ADC chip. Maximum total output current from all 24 pins on the micro controller needs to be 50mA or less at 5v so I need an intermediary between the chip and the relay.

*please not that all analog components of this device will have to be NTE components because that is the only type available

I choose an NTE R42 12 volt relay (Data Sheet).
It can support 1.5 amps max carry current which is 50% more than the each individual solenoid will draw.
To control the switch (to switch the switch) side I need to get a transistor that can support the maximum .5 switching current at 12 volts, but I have no idea what to look for because I'm unfamiliar with the terminology and because I don't quite know what kind of transistor I need. The micro controller can out put digital and analog signals at aforementioned voltages and current. Also, 2 solenoids will need to be active at the same time
Can anyone suggest the correct type and polarity of transistor that would be suitable for this application?
 
Apr 3, 2008 at 11:20 PM Post #2 of 8
I think you might be misreading the datasheet. It states that the nominal coil dissipation at 12V is 77mW (@ 850 ohm), which works out to 15mA. I'm not sure what the max spec is there for, you'd have to run the coil at 600V to reach that dissipation as far as I can tell. 0.5A coil current doesn't make sense at all for a relay this size, so I would just ignore that spec. Be aware also that these relays are rated for a switching current of 0.5A. If your solenoids are drawing 1A, you're underspec'd by 100%. One more thing is that the back EMF spikes generated by large coils can be pretty large, and the dielectric strength is only 200V. You might eventually damage the relays.

I would not connect a microcontroller pin directly to the coil to protect the controller from back EMF, but pretty much any transistor is fine. Either polarity will work too, but NPN or N-channel is probably easier to use and get ahold of, and possibly cheaper. Look for 2N3904 or 2N7000. You should also connect a diode reverse biased across the relay coil; it will absorb most of the back EMF. If you use the 2N3904 (or any BJT), you should include a base resistor, but it's not really required, just best practice.

All that said, you could do away with the relays entirely and use TO-220 MOSFETs without much difficulty. The currents involved are not that large. The concern would be the back EMF I mentioned above.
 
Apr 4, 2008 at 12:50 AM Post #3 of 8
Yes, I was misreading the data sheet. I thought switching current was coil current.

As per your recommendation, using a TO-220 would do a way with a lot of extra components and would making wiring easier. I'd just need 4 of them and would need to figure out proper polarity.

I turned a pin high for a few seconds and measured the voltage with the positive probe to the pin and the negative to ground. I got a positive reading which means I'd need an N channel (because the base voltage needs to be positive to close the circuit, I think). Source pin voltage would need to be negative and drain pin voltage would need to be positive, right?
 
Apr 4, 2008 at 12:58 AM Post #4 of 8
I think something like this would work? With the source pin negative(battery) and the drain pin positive(load).
 
Apr 4, 2008 at 1:21 AM Post #5 of 8
Quote:

Originally Posted by Whitebread /img/forum/go_quote.gif
I turned a pin high for a few seconds and measured the voltage with the positive probe to the pin and the negative to ground. I got a positive reading which means I'd need an N channel (because the base voltage needs to be positive to close the circuit, I think). Source pin voltage would need to be negative and drain pin voltage would need to be positive, right?


You could use a P-type just by inverting the active polarity (low = on) and using it a bit differently. It's not really a big deal, but N devices generally perform better and are more available, so it's the default preference.

I think that FET is a poor choice. For one, you want to overspec it quite a bit, as good engineering practice. For two, if you pick one and run it close to its maximum rating, you will need a heat sink. For three, it's non-stock, with none on hand - so a lead time. From a quick and dirty DigiKey search (ie. this FET will meet all your needs, but a cheaper suitable part probably exists since I went for 'best' specs, not 'right' specs), try the Infineon IPP03N03LA. You want to look for low Rds-on (= high current capacity with low power dissipation) and low Vsd (so your solenoid gets as much of the input voltage as possible). Find something closer to the 10A range if you want to save a few bucks.

You'll also certainly want a good, fairly high-voltage EMF suppression diode. I would use UF4007 or MUR1100.
 
Apr 4, 2008 at 1:27 AM Post #6 of 8
That FET was an example that I just pulled from a search results list. I wont actually be ordering from digikey, I'll be buying from a local parts store. I figured 1.x amps was a little on the low side but an order of magnitude difference was way out of the range I was expecting. I'm used to safety factors of around 2 in my mechanical designs!

Also, I thought that setting the pin to low just brought the voltage down to 0 and didn't invert it.
 
Apr 4, 2008 at 1:45 AM Post #7 of 8
Quote:

Originally Posted by Whitebread /img/forum/go_quote.gif
That FET was an example that I just pulled from a search results list. I wont actually be ordering from digikey, I'll be buying from a local parts store. I figured 1.x amps was a little on the low side but an order of magnitude difference was way out of the range I was expecting. I'm used to safety factors of around 2 in my mechanical designs!

Also, I thought that setting the pin to low just brought the voltage down to 0 and didn't invert it.



The control voltage for a transistor is Vgs (or Vbe). In an N-type device, the gate is forward biased (on) when the gate (base) is a higher voltage than the source (emitter). In a P-type device, it's the opposite, and the gate is forward biased by a higher voltage on the source than the gate. It doesn't have to be negative absolute voltage, just relative (if the emitter is at 12V and the base is at 0V, Vbe is -12V).

You could use a P-type device connected with the polarity opposite (source to V+, drain to ground, gate is 'on' when low). In this situation it won't really work though, since the switched voltage is higher than the voltage the microcontroller will put out. If you put 5V on the gate and the emitter is at 12V, the transistor is still on. You could bias it with the 12V line and make it work - but why bother than N-channel devices are preferable in every way.

The reason for the extra margin is that the transistor is not specced to pass 1A without any additional cooling. It will overheat if asked to do so for any significant period of time. You can do the thermal dissipation math if you want, but I think a 10A transistor would probably handle it. That 80A one certainly would
wink.gif
. If you can get a catalogue of what's available at your local shop, I'd choose the lowest Rds-on one they have. Make sure Vsd isn't too high and it should be fine, as long as it's rated for at least 10A.
 
Apr 4, 2008 at 2:17 AM Post #8 of 8
Alright, I understand how the triggering works now. In the N-channel, the gate voltage must by higher by a certain amount which, in my case can be no more than 17 volts.

Now I need to figure out how to wire up this ADC chip to the micro controller and how to wire code to control it so that I can fire certain solenoids at the right time!

Thanks!!!!
 

Users who are viewing this thread

Back
Top