- Discrete LEDs
- Dot/Bar LEDs
- Matrix LEDs
- 7-Seg LEDs
- Serial -- Software
- Serial -- Hardware
- RS-232 via the MAX3232
- I2C -- EEPROM
- I2C -- DS1307 Real Time Clock
- 1-Wire -- DS18B20, Powered, Single-Drop
- 1-Wire -- DS18B20, Powered, Multi-Drop
- 1-Wire -- DS18B20, Parasitic, Multi-Drop
- TI Link Protocol -- Calculator Demo
- Infrared Communication
- MIDI -- Output Demo
- MIDI -- Input Demo
- MIDI to Analog Synth
Motor Direction Control #2
Here's a better, if more complicated, way to add reverse to a DC motor. Moreover, an OFF mode comes along for free. If this was an automobile then, we'd have reverse, neutral and forward at our disposal.
What makes this less taxing on the motor is that whenever you switch gears, it's allowed to ramp down first (for one second) before engaging in the opposite direction. Here's the schematic:
Be sure to note that the switch is a three-position toggle with center-off.
The actual controller is made up of four power MOSFET transistors, a pair of N type and a pair of P type. The numbers are FQP30N06L and FQP27P06, respectively. I bought mine from SparkFun Electronics.
What makes these MOSFETs perfect for PIC control applications is that they're digital in nature; that is, they turn on fully with a +5V gate signal.
The arrangement you see in the schematic is referred to as an H-bridge. It's essentially a solid state equivalent of the DPDT relay topology we saw in the previous exercise.
When you run the demo, every time you flip the switch, the motor is paused for a second before the H-bridge changes polarity. And flipping the switch to the center, halts the motor altogether.
Click to get the source code.
Click to get the schematic PDF.
Next Project: Motor Direction Control #3