Very simple line follower robot with no microcontroller

Thread Starter

popcalent

Joined Mar 17, 2018
56
Hello, all.

First of all, I'm not sure if this the appropriate section to post this thread. If it's not, let me know where I should post it and I'll move it.

I made a very simple line follower robot using only a couple of TCRT5000 (optical sensor with transistor output), two D880 power transistors, two 6V 30RPM DC motors, and a few resistors. The following is the schematics diagram. Everything is duplicated except the 7805 voltage regulator, which there is only one:

Line.Follower0.png




The first problem I have is that if I power the circuit with a 9V battery and make it 5V through the 7805, the DC motors go too fast and the robot gets out of track instantaneously. The only way for the robot to work is that I remove the 7805 and power it with my power supply set to 5V. Surely, I'm missing something here, because this is the second time I make this robot, and I'm following my own schematics diagram that I made at the time...

The second problem, is that I added two LEDs per motor that indicate if the motor is on (green LED turns on) or if the motor is off (red LED turns on). The output of the TCRT5000 goes to a 7404 (hex NOT gate) in addition to going to the D880 transistor, and then, using the NOT gates in the 7404, I make each LED turn on when the other one is off and vice versa. The following is a schematics diagram of the circuit, and, again, everything is duplicated except the 7805. The problem with adding this part to the circuit, is that the motors won't stop when they are supposed to. They always go, no matter what the two TCRT5000 say. I added resistor R4, and the situation improved a little bit, they stop when they are supposed to, but it takes them a while, they won't stop immediately. This causes the robot to go out of track frequently. If I remove the 7404, the robot works just fine.

Line.Follower1.png




What am I doing wrong? Thanks for your help!
 

panic mode

Joined Oct 10, 2011
2,113
1. defective 7805 or middle pin (GND) is not really connected so output floats producing higher voltage.
2. there seem to be issue with sizing of the things. 74 series ICs source current at their inputs. this means adding 7404 you are adding more current into base of 2SD880-Y. this transistor has gain of 100-200. the TCRT5000 is also driven hard, input current (emitter) is some 30mA and CTR is 1 so receiver is blinded and therefore very low resistance. as a result voltage across R2 is more than enough to drive transistor. add to that a little bit more from the 7404 and the 2SD880 transistor is practically always on.
suggestion, try reducing current through TCRT5000. maybe add 1k potentiometer in series with R1. also you can increase Vbe of the Q1 by adding diode in series with R3 or a small transistor to make a Darlington.
3. in terms of sizing this is pretty crude. also there are n capacitors around regulator. personally i do not like to load 9V battery more than 20-30mA as it simply does not last but this may not be of interest here. in case you do care about battery life, keep in mind that biasing current of 7805 is several mA already (5-10mA depending on model). add 30mA for R1, then another 30mA or so for 7404 and LEDs and this is substantial (70mA?) before we even get to the motor. and since you are using linear regulator means that battery current is not smaller than output current you draw from regulator. using switching regulator would be much better here, you could cut the battery current practically in half.
 

Thread Starter

popcalent

Joined Mar 17, 2018
56
1. defective 7805 or middle pin (GND) is not really connected so output floats producing higher voltage.
2. there seem to be issue with sizing of the things. 74 series ICs source current at their inputs. this means adding 7404 you are adding more current into base of 2SD880-Y. this transistor has gain of 100-200. the TCRT5000 is also driven hard, input current (emitter) is some 30mA and CTR is 1 so receiver is blinded and therefore very low resistance. as a result voltage across R2 is more than enough to drive transistor. add to that a little bit more from the 7404 and the 2SD880 transistor is practically always on.
suggestion, try reducing current through TCRT5000. maybe add 1k potentiometer in series with R1. also you can increase Vbe of the Q1 by adding diode in series with R3 or a small transistor to make a Darlington.
3. in terms of sizing this is pretty crude. also there are n capacitors around regulator. personally i do not like to load 9V battery more than 20-30mA as it simply does not last but this may not be of interest here. in case you do care about battery life, keep in mind that biasing current of 7805 is several mA already (5-10mA depending on model). add 30mA for R1, then another 30mA or so for 7404 and LEDs and this is substantial (70mA?) before we even get to the motor. and since you are using linear regulator means that battery current is not smaller than output current you draw from regulator. using switching regulator would be much better here, you could cut the battery current practically in half.
Thanks for your response, panic mode.

I figured out the problem with the 7805, there was a short circuit due to the debris resulting from desoldering something with a cheap desoldering pump.

I made the following schematic diagram with your suggestions. I am using the two capacitors around the 7805 voltage regulator, I just forgot to add them to my previous diagram. However, once the robot works as intended, I'll follow your suggestion of using another means of powering the circuit.

Line.Follower2.png




I'll try to get to it asap, but probably I won't have time until next week because I have relatives coming and staying for the weekend to celebrate Christmas. Thanks again!
 

DickCappels

Joined Aug 21, 2008
8,686
Congratulations on getting your circuit to work. Just a quick comment: D1 probably doesn't hurt anything, but as far as I can tell it doesn't do anything either. You might save a penny by leaving it out.
 

Thread Starter

popcalent

Joined Mar 17, 2018
56
Thanks, LowQCab and DickCappels.

You're talking about the diode in parallel with motor (in my third diagram, I added a second diode that I mistakenly also named D1)? That diode is a flyback diode, I thought it would help if there are sudden voltage spikes from the inductor in the motor, I guess I'm wrong..
 

Thread Starter

popcalent

Joined Mar 17, 2018
56
I came up with this alternative circuit that completely forgoes the 7404 and uses two transistors to turn the LEDs on and off. It seems to work on a breadboard, I still have to see the results when mounting the robot.
Line.Follower3.png


As far as the power supply is concerned, would I be better off just using a voltage divider or a 5.1 zener diode?
 

sghioto

Joined Dec 31, 2017
3,061
The transistors are OK but you can increase the value of the base resistors R7 and R10 to 4.7K.
I wouldn't rely on a zener in this application.
How much current do these motors draw and what type of 9 volt battery are you using?
 

Thread Starter

popcalent

Joined Mar 17, 2018
56
The transistors are OK but you can increase the value of the base resistors R7 and R10 to 4.7K.
I wouldn't rely on a zener in this application.
How much current do these motors draw and what type of 9 volt battery are you using?
Hi, sghioto.

I had originally placed 1K resistors for R7 and R10, but the red LED never turned off completely, it just faded a little when it was supposed to be off. I replaced the resistors with 470 and now the red LED is completely off when it's supposed to. With 4K7 resistors, I have the same problem I had with 1K.

I don't know how much current the DC motors draw. How do I know? This is the motor: https://www.amazon.com/dp/B082GM11BS
As for the 9V battery, it's just a regular 9V battery. It's the first thing you see if you google "9v battery". I'm not sure if you're asking because you consider the possibility that I have a non-standard 9V battery, but it's not the case.
 
Last edited:

Thread Starter

popcalent

Joined Mar 17, 2018
56
The device will operate much longer if you use 3 of some 1.5 volt batteries, since almost half the power is wasted in that regulator IC. Even 3 AA cells will work better.
Thanks, for your response. Yes, I will get hold of a triple 1.5V battery holder next week. For the time being, I don't have any other means to power the robot. It's either a 9V battery, for which I have a battery holder, or my power supply, which limits the robot's range of movement due to the wire.
 
Top