The only good bug is a dead bug
Many Christmas Displays have animated figures.
I've put this test rig together to test out this project option. I've already demonstrated a PSoC 4 driving servo motors but servo motors are not always the desired option.
This time I've performed a quick test of getting an H bridge working with a PSoC 4.
I've used my PmodHB3. It contains an H-Bridge Driver for a single motor rated from 5-12V @ 2A.
I just used a plastic robot base and one of its toy motor connected to 3.3V which seemed to work
The schematic can't be simpler.
All it needs is two digital level output pins - Enable and Direction.
The Direction pin is used control them motor rotation direction which is either CW or CCW.
The Enable Pin is used to turn the motor on and off.
The Enable Pin can be pulse width modulated (PWM) to provide slower speeds (and subsequently lower torque output).
All an H-bridge really does is enable current to flow through a motor in either direction using four transistors under logic control.
Some circuits such as the PmodHB3 has some additional hardware logic gates to ensure that only valid combinations of the transistors are turned on.
The last thing one wants when using an H-bridge is to use the two wrong combinations as this creates an unwanted dead short circuit that bypasses the motor.
Unlike a servo motor there is no idea of the motor's current position.
If the motor's position is required then additional sensors are added.
The code to drive the motor couldn't be simpler either.
All that is required is to set the input pins to the desired state.


