Three-wheel lazy robot

Thread Starter

NiORD

Joined Dec 23, 2016
7
Hello everybody,

I am trying to build a small robot that would

1. Detect human movement via IR sensor (one facing forward, one facing backward)
2. Move robot forward / backward depending which sensor was triggered
3. Avoid obstacles via ultrasound distance sensor and via IR proximity sensor

I only want it to operate while there is human movement - *lazy* bot.

The bot moves via two geared DC motors driven by H bridge circuits. And this is where I seek your guidance - I attached the circuit diagram for the H bridge. Can anyone please explain the criteria that should be considered when choosing the value of the four resistors? How do I control how much voltage goes out of the H Bridge and to motor?

The microcontroller I am planning to use is a Teensy 2.0 (behaves much like an Arduino).

Thanks for your advice

IMG_1079.JPG IMG_1086.JPG
 

AlbertHall

Joined Jun 4, 2014
12,346
You should select the resistors so that the base current is about 1/10 of the collector current so that the transistor can be fully saturated.
In you circuit there is a problem with Q2 and Q3. With a 6V supply for the motor, the bases of these two transistors need to be driven to around 6.5V to fully saturate them but the maximum drive voltage available is 5V from the teensy.
You could replace Q2 and Q3 with PNP transistors and drive them with NPN transistors to do the voltage translation.
Something like this:
 

Sensacell

Joined Jun 19, 2012
3,448
The design of an H-bridge depends on the current and voltage levels required.
What are the specs of the motor and power source?


Consider that once your robot starts to 'move', the PIR sensors will consider any stationary heat source a 'moving' heat source and continue to trigger. You will need to logically lock-out the PIR's when the robot moves.
 

Thread Starter

NiORD

Joined Dec 23, 2016
7
These are given on the schematic in the original post.
Update: the values given were for the small motor I had used to test the circuit. The actual motors will be supplied with 9V, and draw up about 80 mA when operating without any load, and 1,6A stall current (significantly higher).

I have noticed that I only have about 1.1 V when motor is operating. This seems rather low and rotation speed is slow as well. Do I understand correctly that the microcontroller is not supplying enough voltage to fully open the transistor switches?

Thank you for the circuit. I shall try to replicate it.
 

Thread Starter

NiORD

Joined Dec 23, 2016
7
You should select the resistors so that the base current is about 1/10 of the collector current so that the transistor can be fully saturated.
In you circuit there is a problem with Q2 and Q3. With a 6V supply for the motor, the bases of these two transistors need to be driven to around 6.5V to fully saturate them but the maximum drive voltage available is 5V from the teensy.
You could replace Q2 and Q3 with PNP transistors and drive them with NPN transistors to do the voltage translation.
Something like this:
You seem to have swiched around the order of the transistors - when you say Q1 / Q3 are you referring to your diagram above, or to the one I drew?
 

Thread Starter

NiORD

Joined Dec 23, 2016
7
I have tried your suggestion. May I please ask where exactly should I connect the wires for the microcontroller?
 

AlbertHall

Joined Jun 4, 2014
12,346
Connect R1 and R6 to one pin on the uC and R3 and R5 to a second pin. You must ensure that only one of those pins is high at any time. Which pin is high will determine which way the motor turns.
 

Thread Starter

NiORD

Joined Dec 23, 2016
7
I tried - will only turn in one direction. Have checked the connections on breadboard and the diagonal that will not function is identical to the other one. Tried switching the pins on Arduino - they both function.

Any idea what could be wrong?
 

AlbertHall

Joined Jun 4, 2014
12,346
I tried - will only turn in one direction. Have checked the connections on breadboard and the diagonal that will not function is identical to the other one. Tried switching the pins on Arduino - they both function.

Any idea what could be wrong?
When you switched pins was the motor still turning the same direction?
If so, then the problem is with the circuitry on the breadboard.
If the motor only turns the opposite way with the pins swapped then the problem is with the Arduino.
 

Thread Starter

NiORD

Joined Dec 23, 2016
7
It will only turn one way regardless of the pins used on Arduino. I will take the circuit away and re-build it.

Thanks for the heads up.
 

Thread Starter

NiORD

Joined Dec 23, 2016
7
I have found the problem: One of the connections to GND were not soldered properly - as in it was not soldered at all. I soldered the missing connection and the double H-bridge functions perfectly now.

Thank you for all your help.

I am modifying the chassis now - not happy with the free spin wheel - and then shall move on to sensors.

I shall return for your guidance if you'll be kind enough to help.
 
Top