??? 10/19/11 02:06 Read: times |
#184268 - Design Responding to: ???'s previous message |
If I was doing this I would use a mechanical design that toggled open-to-locked or locked-to-open at a pulsed activation of the solenoid. This way the solenoid does not consume power all the while the system is turned on and in one of the locked / unlocked states. You would also be wise to add a switch closure of some type to the mechanical mechanism that detects if the mechansism is in the open or closed position. This detection would feed back to an input on your MCU. The feedback detection would be essential in the toggled mode of operation so the MCU knows the state of the locks in a reliable manner. The detection could be any one of a micro switch, a reed switch and small magnet, or an optical slot detector.
Most locking mechanisms will have a transition range where they are not fully open or fully locked. You could increase reliability by having two detectors, one for fully closed and one for fully opened. (I once worked on an aircraft landing gear detection system and there were separate detect switches for gear down and locked and for up and stowed). Some locking mechainsm designs may actually may be easier to implement with a pair of solenoids, one to open and the other to lock. You do need to look at your logic carefully with the ULN2003. Its input will be high to activate its output and thus energize the relay coil. Since the typical 8051 has its I/O pins go to their high state during reset and then staying that way until the firmware gets around to setting them low this will naturally cause the UL2003 and the relay to be on during this time. (This is what Erik was referring to in his earlier posing to this thread). This behavior is normally highly undeirable and you should really design so that the MCU output has to be low to activate the driver circuit and relay logic. Otherwise you will have a click of your relays every time the power comes on. In some systems this can even possibly be a safety issue. The dual transistor circuit in the FAQ I pointed you to does not have this problem. To use the ULN2003 and prevent the pulse at power up you need to add some type of signal inversion between the port pins and the ULN2003. That could be an 'HC14 chip, a single NPN transistor stage, or find a different driver that has activates when it's input is low. Two more things about the UL2003 usage. First it is essential that the COM terminal be tied to the most positive voltage in the output circuits. In your case tie this to +12V. The other thing is that you should be aware that these devices have bipolar transistors inside configured as a Darlington connection. When ON the output will not go to GND as you surmised. It will instead saturate somewhere between 0.8 and 1.2 volts depending upon the amount of current you are trying to get the output to sink to ground. For driving a relay coil this behavior is not a problem - particularly with a 12V supply feeding the relays. It can be a serious probem if you expect the output to drive some other digital logic and the saturated level never gets that other logic down to a valid low level. Michael Karas |
Topic | Author | Date |
Doors with solenoids + sensors | 01/01/70 00:00 | |
Not Signing Up | 01/01/70 00:00 | |
Original post + Link | 01/01/70 00:00 | |
Driving 12V Loads,,, | 01/01/70 00:00 | |
Work | 01/01/70 00:00 | |
More Work | 01/01/70 00:00 | |
then bth doors will be open during reset | 01/01/70 00:00 | |
Design | 01/01/70 00:00 | |
Design | 01/01/70 00:00 | |
There are such things ... | 01/01/70 00:00 |