NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Basic Electronics » L293 H-Bridge

October 19, 2010
by devinsbusiness
devinsbusiness's Avatar

I currently have a project going in which I am trying to drive a latching solenoid with my MCU. Per Mike's suggestion (Thanks Mike) I am using an L293 to send voltage of reverse polarity depending on which position I want the solenoid. I wired it up per the schematic in figure 5 page 9 of the datasheet. I used pins 28 and 27 of the MCU to pins 2 and 7 of the L293 then pins 2 and 6 of the L293 to the leads of the solenoid. So far everything seems to work the way I want it to with respect to the circuits function. I will add a side note and warning here. When you "test" a latching solenoid with more voltage than it needs, it will no longer function with less voltage than what you tested it with. The first time I tested it with 3 volts and that did the job. Another time I tried 9 volts. It actuated the solenoid. But now 3 volts won't work. Fortunately it wasn't too expensive of a lesson, but now I am going to have to buy a new solenoid. Now to the problem I am having. I am powering the device with a 9 volt battery. When I plug in the 9 volt battery, it only lasts a few hours. I was hoping for more like a few months minimum. Can anyone give me any pointers on why my circuit is so inefficient? Also can anyone tell me what an SES5001 (shown in the L293 datasheet) is, or where to find them? I am assuming they are the throwback diodes.

October 19, 2010
by Ralphxyz
Ralphxyz's Avatar

Where is the solenoid datasheet?

I am guessing that it is powered latch so it is sucking juice to hold the latch, therefore short battery life.

Ralph

October 19, 2010
by devinsbusiness
devinsbusiness's Avatar

I wish I knew where I could find a datasheet.

It is a latching solenoid in the sense that a pulse of voltage of one polarity moves the plunger to one position, where it stays until a pulse of reverse polarity moves it to the opposite position. That is the intent of using a latching solenoid. So it doesn't require a constant application of voltage, therefore extending battery life.

When I test the output of my device with a multimeter it is doing what I want it to. When the condition is meet for it to trigger the solenoid, it sends out a pulse of voltage, then stops. That is why I don't understand why my battery is not lasting very long.

October 19, 2010
by Ralphxyz
Ralphxyz's Avatar

Well how much amperage in/from a pulse?

Maybe that would give ou idea of battery life/power consumption.

Is your volage regulator running hot?

Ralph

October 19, 2010
by mongo
mongo's Avatar

Most H bridges are conductive in one way or the other unless there is an inhibit input on them. On this chip, it would be pin 1 for one set and pin3 for the other set. If it is always high, the outputs will always be active. If it is low, the outputs would deactivate. What I would do is set the inputs for whatever mode you want to set the output for and then pulse the chip enable to get the pulse signal to the outputs.

October 19, 2010
by devinsbusiness
devinsbusiness's Avatar

Thanks Mongo. I was wondering if I should do that or not. I opted not to because the schematic showed the enable pins (1 & 3) as having a constant supply. The new question I have then is do I use the same pins of my MCU that I use to control the output, in my case 28 and 27, or do I use a completely independent pin and set it high at the same time as either of the control pins? I also have to ask what a reasonable expectation is for the life of a 9 volt battery in this sort of an application?

October 20, 2010
by mongo
mongo's Avatar

If the battery is pulsed at the output, it should last a couple of days I guess...

I would use one MCU pin to set the data or relay polarity while another sends the enable signal momentarily. I would have the system pulse any time the polarity is changed. I don't know just how long it may need to be pulsed, I would thing that a tenth of a second might do OK. It may even work on shorter pulses as well. The shorter the pulse, the longer the battery lasts.

November 11, 2010
by devinsbusiness
devinsbusiness's Avatar

Just an update on my project. I wired it per Mongo's advice. That seems to have helped and it still functions the way I want it to. But a 9 volt battery still won't last more than a day. I know it is not the solenoid that is draining the battery because it doesn't matter if the solenoid is connected or not. I know that similar store bought devices last months to a year on a battery. But these devices also use a different style of display. wonder if the display is what is draining my battery?

November 11, 2010
by Ralphxyz
Ralphxyz's Avatar

Definitely the display (LCD) will drain the battery even without the backlight on. If you have the backlight on you are luck to get a day out of it.

So use a button to turn the display on when you need to view data.

Ralph

November 11, 2010
by devinsbusiness
devinsbusiness's Avatar

Great idea ralphxyz. Thanks.

November 12, 2010
by BobaMosfet
BobaMosfet's Avatar

What is your 9V battery's Ah rating? What is your display's quiescent and/or standby current usage? What is your circuit's current usage, apart from the display? What is the solenoid's current usage?

A typical 9V battery is about .5 Ah. Over an 8-hour period, it can output about 62mAh at maximum voltage.

Most solenoids are little more than an induction coil, so understanding the current ratings of the solenoid are critical. If the solenoid requires 1A, and you trigger it once, you've exceeded what the battery can put out, causing the battery to collapse. It will only do this so many times before it's drained.

BM

November 12, 2010
by BobaMosfet
BobaMosfet's Avatar

By the way, the SES5001 you mentioned is an axial rectifier (high speed, low forward voltage, fast recovery).

PIV: 50V MAX DC Output Current: 2A Non-Repetitive Surge Current: 35A Thermal Resistance: 38C/W

Max Forward Voltage: .975V @ 1A (Junction Temp = 25C) .895V @ 1A (Junction Temp = 100C)

Max Reverse Current: 2uA (Junction Temp = 25C) 50uA (Junction Temp = 100C)

Max Rev. Recovery Time: 100nS

BM

December 04, 2010
by devinsbusiness
devinsbusiness's Avatar

Hi everybody. Sorry for the delay in response. Thanks for all of the ideas and input! BobaMosfet, I am pretty sure it is not the solenoid that is causing the short battery life for a couple of reasons 1)I set it up to only receive a 100 ms pulse at the regulated 5 volts. Measuring the resistance of the solenoid, it is 5.7 Ohms.So theoretically it is receiving .88 amps. Honestly I don't know what the mAh rating of my batteries are. They are just off the shelf 9 volt batteries. 2)This is the most conclusive reason I am sure it is not the solenoid causing the short battery life is because it is about the same whether the solenoid is plugged into the circuit or not :-). Does anyone know where I can find the datasheet for the display that comes with the Nerdkit. I have done some searches and only come up with sites that lead you on a wild goose chase. I am pretty sure the datasheet in the downloads section only covers the display driver.

December 04, 2010
by BobaMosfet
BobaMosfet's Avatar

devinsbusiness-

You have a couple of major current draws- the LCD display, and the solenoid. The solenoid will draw more current than anything else (by far)- that's what it does. It's an inductor, that's all it does. Unless you put a resistor inline with the solenoid, it is essentially a dead short (in a DC circuit). 880mA exceed's the batteries capacity immediately and it will collapse. Compared with the basic NerdKit circuit which draws about 100mA total.

A typical 9V battery will deliver about 500mAh (that's half an amp for 1 hour - usually a little less, there are some factors I won't go into here).

I have the actual datasheet for the NerdKit displays (20x4).

Rating is:

Forward Voltage: ~4.6V Forward Current: ~1.5 to 3mA

Backlight Current: 240mA Backlight Forward Voltage: ~4.1V

You MIGHT want to try putting four 9V batteries in parallel. That will give you same voltage, but 4 times the capacity. Do not have your face close to your circuit when you connect it-- DO pay attention with your nose. If you start to smell ozone or a 'burning' smell, disconnect it immediately, as you have a short.

BM

December 05, 2010
by devinsbusiness
devinsbusiness's Avatar

Okay, I see what you mean. So the question is, how do they do it in the off the shelf controller that controls this solenoid. It runs on one 9v battery. Would a capacitor help? I am not sure exactly how to wire it up. In my experience, capacitors seem a little tricky to get what you want out of them. But doesn't a capacitor build up a charge, then release it when it is needed?

Post a Reply

Please log in to post a reply.

Did you know that you can aim and fire a servo-controlled water gun from your computer? Learn more...