Wall Tracker I Freshman Year Project I GAL & PAL

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:

  1. GAL IC, can’t remember the exact part number  😦
  2. Dual H-Bridge using L298N Same one used in the board.
  3. IR transmitter- no specs.
  4. IR receiver- no specs.
  5. potentiometer.
  6. A different set of resistors, manly 10K.
  7. Two DC motors from old toys.
  8. comparator IC  / op-Amp.
  9. Batteries.

While the body was made out of lego parts from NXT kit and sheet metal assembly toy.

Challenge One

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.

Challange Two

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.

Challenge Three

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



Challange Four

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


[Best_Wordpress_Gallery id=”2″ gal_title=”robot_car”]



Know more about PAL and GAL, check this link.

Partners in This Project: Motaz Abu-Gharbia

Proof Reading By Nida Ammar

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.