My design has the following inputs and outputs:
2 pushbuttons, left and right
2 LEDs - left and right
1 servo output - push the left button, it moves to the left, push right button, it moves to the right
1 relay - arbitrarily configured but when the servo is left, the coil is not energized, when the servo is right, the coil is energized, since the left position is the more common.
I pin with a jumper that causes the servo to move to the center position if closed (jumper on)
2 input control lines coming from another circuit - one that locks out the pushbuttons so they do nothing, one that is a remote signal to move the servo
(2 complete sets of these I/Os)
While the servo is moving, both LEDs are off, the left or right LED only lights when the servo completes travel.
I want to add a second relay, contacts in series with the first relay's center contact, such that while the servo is moving, the coil is energized, cutting power to the contacts of the first relay. Once the servo reaches the end of travel, the first relay will be energized or de-energized, depending on position, and then this second relay would be de-energized, allowing power to flow through the NC contacts.
Problem is, not enough output pins. I suppose I could add a shift register or port extender, but I also had the idea of possibly connecting the LED outputs also to a NOR gate and using that (with a transistor driver - unless there is a NOR gate with sufficient drive capacity to not need it) which would give me the correct logic - both LEDs off while the servo is moving would equal a high output on the NOR gate, turning the relay on. LEDs are active high.
Does this make sense? Or is this just really bad design? This project is not for commercial use - although even if it's one of those "well, ok, but not something you'd do for production" I wouldn't want to do it. Switching to a different micro is kind of silly here - I am simply 2 lines short of being able to give the second relays their own dedicated outputs. I'm thinking so long as the total load on the LED output pin is well under the micro's limits, this should work fine at least from a technical point of view. My real question is, is this a reasonable design practice or should I investigate alternatives, like the port extender?