Liana II : Designing & Building the Circuit

by colilhasnel in Circuits > Arduino

62 Views, 0 Favorites, 0 Comments

Liana II : Designing & Building the Circuit

20240724_154536.jpg

Almost 1.5 years ago. I participated in my college TechFest in the line follower category. It was my first time building a line follower. I was familiar with the concept for years but never really tried building a line follower. I already had 8+ years of experience in IoT Projects at that time. So, I decided it was worth the shot.

And so I built Liana I. It was a simple line follower with 3 TCRT5000 sensors, Arduino Nano, L293D Motor Driver and BO Motors. All of it is put together with a simple PID algorithm. And the performance was not at all what I expected. It simply refused to follow the line on the day of competition.

I couldn't bear the idea of being unable to perform in such a simple competition. And so the making of Liana II began.

Liana II is inspired by all my mistakes and learning from Liana I. It has many more features than Liana I.

Liana II Features:

  • It has 7 TCRT5000 sensors, which use a weighted average algorithm to calculate the line position.
  • It has an OLED screen with three buttons for navigation through a menu. (This is a massive help in the calibration process)
  • It uses N20 Motors instead of BO Motors for higher speed. The motor driver is TB6612FNG.
  • I also added a header to attach MPU6050.
  • The code is much cleaner and more efficient.


This Instructable has all the steps of designing the circuits using fritzing software and soldering them on zero PCB. However, I will describe the code in another instructable. I felt the need to write instructable because many bots I saw at the competition were on a breadboard. Breadboards are a good idea for testing, but I would never take them to a competition.

Important Note - Whenever I instruct someone on "How to do.", it's more of a "How I did it." rather than a "ToDo List".

Supplies

20240724_154504.jpg
  1. Arduino Nano with Cable
  2. TB6612FNG Motor Driver Module
  3. TCRT5000 Sensors (as many as you want, but keep in mind the no. of analogue pins on Arduino Nano)
  4. 0.96-inch OLED Module (I used the I2C Version as it takes less pins)
  5. 7805 Voltage Regulator
  6. DIP Buttons (I used 3, again Pins limitations)
  7. Capacitors (0.1uF, 0.33uF times one)
  8. Resistors (4.7kohm, 100ohm times the number of sensors)
  9. Female Headers (Donot Solder ICs directly)
  10. Switch or Push Button for ON/OFF
  11. Battery (I used 9V 300 mah for the circuit and sensors & 3.7V Li-ion cells for motors. I could've just used a single high-power battery, but I was on a budget, so I used what I had)
  12. Zero PCB of size.

You will also need a solder kit.

Sourcing & Using Components

Screenshot 2024-07-24 154414.png

The first step you've got to do is to figure out what you will use. I did lay a detailed list right above, but that was according to my needs and budget. For example, for whatever motor you use, you must select the motor driver and power supply accordingly.

  1. Selecting the Microcontroller
  2. Make sure the microcontroller has a sufficient number of pins for sensors and motor drivers.
  3. Whatever additional modules you connect (like OLED display or MPU6050), ensure the processor has the required communication technology and the pins do not conflict with those selected above.
  4. Double-check the voltage levels, frequency of PWM, etc, of the selected microcontroller. (Always refer to the datasheet)
  5. Selecting the Motor Driver
  6. The most important thing to consider while selecting the motor driver is the current limitations per channel, peak current per channel, and the frequency of signal required.
  7. I am selecting batteries.
  8. This is an excellent resource for calculating your battery requirements.
  9. Supporting circuitry
  10. Whatever part you use will need additional components, like capacitors and resistors, to function smoothly. This part is not much talked about on the internet, so it is essential to pay attention. Refer to its datasheet for building the circuit for the component. You will find a circuit in the "Application Circuit" section or something similar. Master this part if you want to develop production-level circuits. You need to do this for every component that you use.
  11. Get the required circuitry components accordingly.

Note - Ready-made modules and microcontrollers don't need much circuitry as they already have everything onboard. This step is essential when you are not using a module and using a component directly. (Like voltage regulator in our case.)

Schematics

Screenshot 2024-07-24 154258.png

Fritzing is an open-source software. You can download it from the official website. There is better software, which will be my go-to for PCB that will go into production, like KiCad or EasyEDA. But if you are a beginner or want to design something for zero PCB, Fritzing is my choice. You will also get almost all the essential components in the frizzing library, and if you don't, you can do a Google search for that particular part and download it from the internet. That's the power of open source; the community is robust.

Import all the parts into frizting. You can start with the Breadboard View of Fritzing, but I don't. It is suitable for visual representation and maybe pitching, but I mostly use the schematic and PCB views.

Start building your circuit in the Schematic View. Connect things you have planned, such as "Application Circuits" of components and everything.

In my case, I referred to the datasheet of TCRT5000 sensors and the 7805 Voltage regulator. And I designed the circuit accordingly. Everything else is pretty standard. Spend as much time on this step as you need, and always be careful. Refer to many and more sources to see how other people build.

Designing the PCB

Screenshot 2024-07-24 154143.png

Enable the grid in fritzing. Start by placing the components. Here, I have three boards: one for the primary circuit, one for the sensor board and one for the buttons alone. I want to place the buttons apart from the primary circuit; you can design them. Generally, we don't use perpendicular turns, but while soldering on zero PCB, perpendicular turns help. Design the top layer, and use vias to get to the bottom. Use all the space available and complete the routing. Don't worry if you can't connect every route, you can use jumper and copper wires to jump from one point to another.

Once you are done with this step, you are 70% there.

Soldering

20240724_154520.jpg

This step is most exhausting physically, at least for me. You've got to start soldering the components on the PCB. I soldered the bottom copper side with solder only and used wires to route the top side. You can use any method you like. If you are new to soldering, you should refer to some material on YouTube about soldering on zero PCB. If you want to learn from me, contact me, and I will teach you how to solder correctly. I can also post a new instructable.

Extra care should be taken while soldering the sensors. As TCRT5000 is nothing but LEDs, excess heat will break the legs off the hemispherical encapsulation, and there is no way to fix that (I learned that the hard way.) Use female and male headers for ICs and modules; don't solder modules directly.

Tip - You can also use female and male headers for out-of-the-board connections (like connections from sensor boards and motor connections.) Direct wires on the circuit are a pain to handle, as components like motors keep on dangling with the main board. Instead, use a female header on the circuit and a male header on the wire, then connect and disconnect as many times as you like.

Next Steps

This instructable has gotten long enough. There 2 major parts remaining in this project, which I will post in another instructable. Next up is Assembling Everything, and the last part is Coding.

If you know your way around, this should be enough, and you can proceed with the assembly and coding. If you want my help with anything, contact me at my email (At the end).

Conclusion

This circuit is great for a level 2 Line Follower bot. If you get the coding right, you can beat many other bots in the competitions. When I took Liana II to competition, everything was set for a win. But on the track, Liana stalled. I forgot to charge the batteries. Make sure you take care of such things.

The Sensor Algorithm, PID algorithm, and Menu Design are essential to code. I haven't gotten around to using the MPU6050.

This PCB design is not for production purposes. I am currently designing Liana III; I designed the PCB on EasyEDA and will get it delivered from JLCPCB. Liana III has all the features of Liana II and much more; soon, another post about it will follow.

Thank You for reading.

Email - shahsahils100@gmail.com or colilhasnel1610@gmail.com

Checkout my website - www.colilhasnel.com