A logic gate chip with 1 ea XOR and 2 ea AND gates?
I am using a PIC16F690 in an application which will control a valve solenoid. The solenoid requires reversing the polarity of the signal to latch open or latch closed the valve. I am using two output pins in the MCU to turn on or off two DPDT relays so that I can switch the polaritiy from a 9 v battery output to the solenoid: 1) MCU Pin1 turning on one relay that is Normally Open (NO) connects the +9 v to the redwire and GND to black wire of the solenoid...turning on the other relay that is NO connects the GND to the redwire and +9 v to the black wire.
The problem I need to solve is how to make sure as a fail safe that both relays are never activated at once by the MCU when it may be going thru powerup or register settings, which means I need a logic circuit connected to the two PIC output pins with the following logic outputs to the relays so that only one of the relays can ever be turned on:
Pin 1 Pin2 RL Output1 RL Output 2
0 0 0 0
1 0 1 0
0 1 0 1
1 1 0 0 'This state is the fail safe!
I have determined the logic circuit to do this is a 2-input XOR gate with its output wired to one of the inputs on each of 2 AND gates, and the individual inputs to the XOR gate also connected to the other input of each of the AND gates. My question is, where can I find a single DIP IC chip that contains at least one, 2-input XOR gate and two, 2-input AND gates, which I can then wire up per above on my MCU circuit board?? I tried to find a CMOS chip that combined these different types of logic gates with no success. Anyone know where I can find one and the part number?
1 Attachment(s)
This is a scheamatic for PIC/RELAY/SOLENOID connection
Quote:
it is not clear how you have connected the two relays to the solenoid
Attached is a schematic as to how I am connecting the PIC outputs to the RELAYS to control the SOLENOID via its RED and BLACK wires. This shoulld permit switching of the polarity to the RED BLACK wires depending on which control pin is active??
I guess if I follow the steps from Melanie's email I can do this without inserting the 2XOR and Dual 2AND gates in between the two PIC control pins and the two relay coils??????
Have you ever tested or used your circuit with a latching
aratti,
Thanks for the schematic. Yours is a better approach than mine because it only requires two SPDT relays instead of two DPDT relays...cheaper! However I am a little concerned about whether "nothing happens" in your circuit for the state where both Relay 1 and 2 coils are turned on and both the Red and Black wires are connected to +9vdc. I am not certain what the latching solenoid does that I am looking at when both wires are high.
Have your ever tested or used your circuit with an actual latching solenoid? If so what was your experience and can you refer me to the Part No. for the one you used??
1 Attachment(s)
Will this schematic work like yours?
Quote:
Originally Posted by
aratti
This picture should be more clear.
Al.
Edit: picture is too small to see details, I attach a zipped one
Anrati, I have designed the Relay Circuit for use with my 16F690 MCU as shown in the attached partial schematic. As you can see, pin RC2 controls one of the two SPDT relays and pin RC3 controls the other. I have purposely wired the ground from the battery rather than the positive terminal to the normally closed contacts on the two relays so that in case there is any leakage in the Solenoid_RED or Solenoid_BLACK wire circuits it won't drain the battery when the relays aren't actuated.
Do you think this circuit will work? One of my concerns is finding a SPDT relay that can be operated within the 25 mA limit of the MCU output pin. Any suggestions where I can get one?Attachment 3558
Right drive current...wrong drive voltage..any others?
Quote:
Originally Posted by
aratti
My 16F690 MCU is operating at 3.3 vdc. Therefore I need a relay (SPST or SPDT) whose coil voltage is 3.3 vdc with a coil resistance of 132 ohms or more, and a contact rating for 1 Amp when switching and 0.5 Amps when closed:
3.3 vdc/.025 ma = 132 ohms
Do you know of any sources? I have looked high and low with no success...most have coil resistances that require drive of 50 mA or more which is above 1-pin drive capabilty of the 16F690 and I didn't want to have to use more than one pin to trigger the relay.
I have read that many of the 5V reed relays will still operate at 3.3vdc. What do you know about this?
I appreciate your help. I am going to investigate the suggestion to use an "H-Bridge", but I know nothing about them. Can you point me to any good tutorials on H-Bridges for controlling solenoids that require more current than a PIC will provide?
Answer: Model of solenoid valve in our design
Quote:
Originally Posted by
bogdan
what is the model # of your solenoid valve ?
bogdan,
Our PIC microcontroller must control a latching valve solenoid, Model L 1/180 1/4"x1/4" as described at http://www.giplindia.com/pdf/water-valve-catalogue.pdf . Here is a description from this document and why we think it is the right choice for use with a microcontroller and battery operation. BTW, why do you ask?
"Brief Design Guide:
Life of battery (1.5 V DC X 4 Nos. alkaline) is about 250 000 cycles (only valve
operations).
Latching valve operates upto 5 V DC, 60 mS pulse. Hence cicuit should have cut off
voltage or battery low / replace battery indication sutabley.
It is prefered to mount latching valve in coil up right position.
As supply voltage goes higher pulse width decreases.
40 mS pulse is optimum pulse width for valve operation from CLOSE to OPEN
position. For OPEN to CLOSE pisition, pulse width of 20 mS may be kept. This will
maximize battery life.
Circuit employed in operation of valve should be of high quality and should have
minimum current consumption in stand by mode to maximise battery life.
Test figures mentioned in this document is based on 6 V DC obtained using 1.5 V X 4
Nos. alkaline batteries."
1 Attachment(s)
My current approach using H-Bridge solenoid control??
Quote:
Originally Posted by
Joe S.
Joe: I studied the H-Bridge circuit and I can see now why it is probably the preferred choice for microcontroller use with motor control, and I presume it can be applied in same manner for controller of latching solenoids. Therefore, I have redone our design as shown in the attached schematic, in which we propose to use a ROHM H-Bridge IC model BD6211 or BD6221, depending on what battery voltage we select for solenoid control (see http://www.rohm.com/products/databoo...x_series-e.pdf for data sheet). This IC can be purchased for $1.50 USD at Mouser and greatly reduces the cost and simplifies the circuit layout as compared to using relays. What is your opinion of this schematic?....will it work to control the latching solenoid without fear of "shoot through" during startup of the MCU while it is being initialized and the MCU pin logics are not yet stabilized? At this point that is my only concern about using the H-bridge for latching solenoid control.
Thanks so much for this tip!
Comparison of L293D and DB6221
Quote:
Originally Posted by
bogdan
..the clamp diodes are missing...
I think is easy with L293D (internal clamp diodes)...if you combine the channels you have Peak Output Current=1.2A (check the specs of the solenoid)
]
Granted I forgot the external clamp diodes, but I can't see why you think using the L293D is an advantage over the Rohm BD62x1. Here are compairsons that appear to favor the BD62x1:
Operating range: BD62x1 will run with Vss 3 to 36 v; L293D is 4.5 to 36. This is important to me since my board supply is 3.95 vdc (3 ea AA NiMH batteries);
Quantity 1 price at Mouser: BD62x1 = $1.50; L293D = $5.12....even adding the 4 ea clamp diiodes (1N4001??) BD62x1 approach is a lot cheaper;
Low Stanby current: BD62x1 has standby mode = 10 microAmps; L293D has quiescent current total (Vss + Vx) of at least 18 milliAmps dey pending on logic setting.....this is too high for battery operation.
Based on above comparison I wouldl really appreciate your opinon as to why the L293D is preferable. ???
1 Attachment(s)
Looks like BD622x chip also has internal clamp diodes
Quote:
Originally Posted by
jellis00
Granted I forgot the external clamp diodes, but I can't see why you think using the L293D is an advantage over the Rohm BD62x1. Here are compairsons that appear to favor the BD62x1:
???
Taking a closer look at the Rohm data sheets for their BD622x chips, it appears they also have internal clamp diodes, making it a further advantage for the BD622x1 over the L293D. The chip diagram from data sheet is in the attached image. Am I mis-interpreting this image??