So I am trying to control 28 servos to make a 7 segment display clock with moving segments. Using a single signal line and 4 p channel MOSFETs and 7 n channel MOSFETs and a binary to 7 segment decoder(cd4511).
Link to video
Below is a sample schematic and after that the real schematic, I know both MOSFETs show up as N-channel but the end product has the proper P channels with correct pinout, you can also view the actual board, the module in the middle is for an RTC, next to barrel jack is Vreg for the micro controller and Vreg for the servos
Look at the images provided for reference in the real schematic because in my schematics I use labels and not real lines so I am not sure if that will help you understand the circuit, so that's why I drew a sample one with lines. I also have a video link of one of the digits working as expected but the issue arises once I connect the rest of the digits.
First, there s a CD4511 Binary to 7 Segment decoder, this will take 4 inputs ABCD, A being least significant bit, I drive those pins high and low to make a binary number between 0 and 9. The IC then drives the corresponding output lines (ABCDEFG)high to make that number appear on a segment display. However I am not using it to drive an LED Display, instead, I am driving MOSFETs which are acting as LOW side switches for the Servos, All 28 Servos! However not all 28 are actually on because for every 7 servos (hence one digit) I have a P-channel MOSFET as a High side switch, that I control with the microcontroller, So when the time changes I only change one digit (7 servos) at a time and never all 28 servos.
So for example , If I want the first digit (the ones digit for the Minute) to display a 3 , i would set A and B high on the CD4511 chip, this would then through the N-channel MOSFETs provide the low side for the servos, then I would also activate the P_channel MOSFET via the microcontroller to only provide the high side of the first 7 servos which correspond to the ones digit of the minutes. So now those 7 servos are "on" and I give them the PWM signal to move their arms to the desired position that will reveal the segment like in the video. In theory the rest of the servos are not ON because the CD4511 decoder is not turning their MOSFETs on and I also have not turned the high side MOSFET ON for them either... the problem is that they DO move and the ones that I want to move don't move properly!!! and not to the position set by the PWM signal but just erratically, Now If I unplug all the servos and only leave 7 servos plugged in, doesn't matter what 7 servos it is but so long as I only work with one digit everything works fine like in the video, the problems are when everything is plugged in....I just can't figure out why? PWM signal looks clean in the scope.