Note: I’m writing this after a decade from actually building the project, mind my mistakes.
This Project was not my idea, it was my friend Motaz(AKA: Mag), we were the fresh engineering students, we just started taking digital logic and basic programming courses, and he came with this idea.
This was learning while you drive project, experimenting, and mistakes, burning ICs, burning IR LEDs, whatever comes to your mind of electronics parts we have burned it at some point.
The basic Idea is to build a robot car, that drives in a straight line until it detects an obstacle, if so, it will check right side, if it’s closed, It will check left if closed it will drive back.
The main Electronics Bill of material was:
- GAL IC, can’t remember the exact part number 🙁
- Dual H-Bridge using L298N Same one used in the board.
- IR transmitter- no specs.
- IR receiver- no specs.
- A different set of resistors, manly 10K.
- Two DC motors from old toys.
- comparator IC / op-Amp.
While the body was made out of lego parts from NXT kit and sheet metal assembly toy.
Getting the IR sensors to work, been newbie engineer, and not using MCU, IR was eliminating constantly, this in itself was an issue as IR transmitter where failing after a while, and if the resistor value is not good it will fail also. On the receiver side voltage level change based on how much of the IR rays are reflected back to the receiver. This where the comparator IC come to work.
At the beginning the comparator level was selected by a fixed resistor, which did not work everywhere, the solution was to use a potentiometer on the voltage divider that set comparator threshold, then we measure distance and change potential meter value until comparator change status. as a result, it neede calibration in every new room or test site. but was solved.
Now its time to connect sensors output from comparator IC to GAL IC, this one was straightforward, then connecting the output pins to driving signals of the H-bridge.
Getting the H-Bridge to work, again not have development boards accessible, and not have extra resources, we tried building the bridge from discrete components on the breadboard, and that was a frustrating process, three weeks until we managed to make a fully working and stable bridge. the lesson learned read datasheets carefully 😉 .
At this point, you think all is good, and once the two parts connected is going to work and
Nothing is working as expected, what wrong? another few weeks went by and we are trying to understand what is going on, and with lecture moving forward, we got to know more and understand some concepts, until we understood what is going on.
We found that the system is working fine as long there are no motors connected, once the motor is connected things go south, it turned out the motor spikes Vcc lines and make the system noise, so thresholds become changing constantly on the comparator and the system unstable.
We found the solution within using optocouplers, and that was the first time we got introduced to the device, at that point the system started working as expected, all the other changes were related to the structure and making the battery last longer, but nonmatres as its a Live
Know more about PAL and GAL, check this link.
Partners in This Project: Motaz Abu-Gharbia
Proof Reading By Nida Ammar