Hi,
(Warning, "dangerous" hobbyist amateur at play in this post, all discussions below are for fun only, and no professional guidelines have been being considered )
Below is a quick and dirty picture of the circuit, I made from combining a "Herby" or Photovore circuit, with a L293DNE and a simple transistor based "NOT gate".
The Herby or Photovore circuit (see BEAM robotics), found at: http://members.tripod.com/robomaniac_2001/id75.htm works like this.
If the photodiode on the left gets more light then the one on the right, the right motor will turn, and the "robot" it controls, turns left, following the light.
This actually work quite well, allthough a bit eratic. (I build a few of these so called photovore's before)
It uses the LM386 audio amplifier to get this "hack" done.
My reasoning was, that, light can also be used to detect the angle of a robot, if the photodiode is pointing downward, with a led eluminating the area just below it. The close the photodiode is to the ground, the closer the led is to the ground, the more luminance.
And using the same principle, but reverse. The herby circuite would make the robot "rotate to" the side with least light, since that side is furthest from the ground.
Now for the next step, to do that we need one motor to change direction based on the angle of the robot, instead of having two motors (both spinning in the same direction) being alternated.
So to make that change. I modified the output from the LM386 (marked as A in the circuit), and passed it to a inverter, creating a NOT A signal as well.
The NOT A and A signal drive the D293DNE to change direction of the motor. (A=5v+NOT_A_=0v) is left AND (A=0v+NOT_A=5v) is right.
Here is the pin layout of the D293Dxx
https://www.rakeshmondal.info/L293D-Motor-Driver
Below is the circuit.
It works. Sort of.
The problem is however that when photodiode 1 and 2 get pretty much the same, but not 100% the same amount of light.
Then the LM386, is not generating a clean 5v or 0v signal, but something in between.
I need some way to get the results like this: More then 2.5v is 5v and less then 2.5v is 0v. Nothing in between.
Maybe I could add an opamp or something, but that would clutter the circuit, and maybe I need to replace the LM386.
Any ideas how to get around this problem?
Any help appreciated!!
(Warning, "dangerous" hobbyist amateur at play in this post, all discussions below are for fun only, and no professional guidelines have been being considered )
Below is a quick and dirty picture of the circuit, I made from combining a "Herby" or Photovore circuit, with a L293DNE and a simple transistor based "NOT gate".
The Herby or Photovore circuit (see BEAM robotics), found at: http://members.tripod.com/robomaniac_2001/id75.htm works like this.
If the photodiode on the left gets more light then the one on the right, the right motor will turn, and the "robot" it controls, turns left, following the light.
This actually work quite well, allthough a bit eratic. (I build a few of these so called photovore's before)
It uses the LM386 audio amplifier to get this "hack" done.
My reasoning was, that, light can also be used to detect the angle of a robot, if the photodiode is pointing downward, with a led eluminating the area just below it. The close the photodiode is to the ground, the closer the led is to the ground, the more luminance.
And using the same principle, but reverse. The herby circuite would make the robot "rotate to" the side with least light, since that side is furthest from the ground.
Now for the next step, to do that we need one motor to change direction based on the angle of the robot, instead of having two motors (both spinning in the same direction) being alternated.
So to make that change. I modified the output from the LM386 (marked as A in the circuit), and passed it to a inverter, creating a NOT A signal as well.
The NOT A and A signal drive the D293DNE to change direction of the motor. (A=5v+NOT_A_=0v) is left AND (A=0v+NOT_A=5v) is right.
Here is the pin layout of the D293Dxx
https://www.rakeshmondal.info/L293D-Motor-Driver
Below is the circuit.
It works. Sort of.
The problem is however that when photodiode 1 and 2 get pretty much the same, but not 100% the same amount of light.
Then the LM386, is not generating a clean 5v or 0v signal, but something in between.
I need some way to get the results like this: More then 2.5v is 5v and less then 2.5v is 0v. Nothing in between.
Maybe I could add an opamp or something, but that would clutter the circuit, and maybe I need to replace the LM386.
Any ideas how to get around this problem?
Any help appreciated!!
Last edited: