12vdc motor fwd/rev with photo transistor  - Page 1
Forum section: electronics / beginners

author: YankeePirate
author_rank: Newbie
timestamp: January 03, 2025, 07:20:42 pm
content: Two phototransistors (?5vdc) drive a 12vdc 3 amp motor fwd/rev using the circuit so when light is detected by one motor goes fwd, and other makes it go rev. I have begun buying parts shown. Are resistors and mosfet correct?

author: xvr
author_rank: Frequent Contributor
timestamp: January 03, 2025, 08:03:13 pm
content: This is will not work out. To drive motor you need to apply '+' and '-' for BOTH pins of motor. Your circuit can apply only '+', but this is not enough.

author: Infraviolet
author_rank: Super Contributor
timestamp: January 03, 2025, 08:17:25 pm
content: Probably better to built your system around a H-bridge chip (assuming the current needed in the motor isn't too high) like a TB6612FNG or the rather inefficient old L293D. Then use an opamp to monitor the phototransistor so as to detect light levels, put this through another op-amp acting as a comparator with hysteresis (op-amps usually come in multi op-amp packages, so you might as well slightly misuse one op-amp to be a comparator rather than get a dedicated comparator chip), then feed this signal to the h-bridge chip. You sound like a beginner, so you'll definitely find it easier to work with IC chips (like op-amps, varous logic gates, and h-bridges) than with discrete transistors or MOSFETs.

author: YankeePirate
author_rank: Newbie
timestamp: January 03, 2025, 09:16:41 pm
content: In this version I added 2 MOSFETs to handle Ground. Will that work?

author: YankeePirate
author_rank: Newbie
timestamp: January 03, 2025, 09:20:42 pm
content: Should I add a resistor to the ground leg or before the 2nd Gates leading to ground?

author: xvr
author_rank: Frequent Contributor
timestamp: January 03, 2025, 09:27:45 pm
content: QuoteNo. You have to provide control voltage to Gates of upper MOSFETS relative to these Sources, which now connected to motor, not to Ground.You need control circuits for so called HiSide MOSFET connection.

author: techninja80
author_rank: Regular Contributor
timestamp: January 04, 2025, 03:11:31 am
content: If you need to keep it discreet components, then this seems to be a good schematic. It seems to be what you are trying to do.https://www.precisionmicrodrives.com/discrete-h-bridge-circuit-enhanced-vibration-motor-control

author: YankeePirate
author_rank: Newbie
timestamp: January 04, 2025, 04:15:48 am
content: Thank you. The H Bridge article suggests the entire circuit also exists in a single package. What is confusing is A A' B B' ?where is input/output. Will try tracing performance.

author: techninja80
author_rank: Regular Contributor
timestamp: January 04, 2025, 04:44:52 am
content: You need to address all four pins as inputs. From what I remember there was a truth table to it. But to simpify it. I think it wasA=on A' = off (motor spins clockwise)B=off B' = ON (motor spins clockwise)A=off A' = on (motor spins anticlockwise)B=on B'=off (motor spins antniclockwise)B=on B'=on (motor breaks applied)A=on A'=on (motor breaks applied)The M in the middle is the motor (output), it will have two leads. You will connect the two of them as the schematic shows. It does not matter what way it goes the hbridge will control direction. The capacitor at the bottom is for noise cancellation, that just connects from on side of the motor to the other.Don't take my word for it. I am just going from memory. But yeah all four need addressing most use some type of IC like Arduino. Or you can just get the H-bridge IC like a L9110H and just use that. You most likely will need heat sync's on all four Transistors if you build it yourself for any real amps. So best to get the IC, and do one heat sink.

author: YankeePirate
author_rank: Newbie
timestamp: January 04, 2025, 07:54:49 am
content: Found these for $13 for 50A and $6 for 3.6AThis just leaves the trigger signal coming from phototransistors/light detector

author: Infraviolet
author_rank: Super Contributor
timestamp: January 09, 2025, 07:27:14 pm
content: Yankee pirate, some of those devboards might not be top quality (some are known for not working well at high frequency PWM rates and risking shorting themselves if you screw on a heatsink too tightly), but they'll work well for a basic prototype of your system.