So I have tried to use the 4 NiMh batteries as the main power source,
and unfortunately the system didn't work at all.
I measured the input and output voltage but I didn't write down the values.
I did however fully charged the batteries.
The most logical explanation I could think of was that an electrical component is probably loading the power source resulting in incorrect input voltage.
And so I have separated my main power source to two parts:
- 9V rechargeable battery connected with a 2-leg-ed switch to a LM7805, providing 5V
- 4*1.2 NiMh batteries connected with a 2-leg-ed switch to an U3V12F9, providing 9V
The LM7805 is connected with 2 100mF Caps as described in:
The U3V12F9 is connected with a 33uF Cap between the Vin and Ground.
I am using a standard L293D to drive the motors:
-The 9V is used to power the motors
-The 5V is used to power the IC
I have a LED connected to my micro-controller, indicating whether the latter is functioning well.I have tried to test the new power system, but the result was the same.
The bot worked fine for about 30 seconds, but then it went crazy, the motors started running really fast uncontrollably and the LED went off.
The motors are driven according to your guide on PWM:
https://www.pololu.com/docs/0J21/5.c switching between 'break' and 'forward'
I have to tried eliminate options for the malfunction by switching the power supplies
separately. The U3V12F9 seems to be working well, with 5V input and 9.08V output.
The LM7805 works fine as well, with 8.6V input and 4.96V output.
When I switch them both ON nothing seems to work, one of them loads the other, resulting in incorrect input voltage readings. It is very strange, the power supplies are connected only through the L293D.
Please advice, I do not know what to do anymore.