Custom PCB car

Table of Contents

Background

This is the project where i decided to try some new things in the embedded programming space. Many of my previous projects have been created using the arduin IDE and use many libraries that take up space in the microcontroller memory. I believe that it is a worthwile skill to be able to program onto the hardware directly so this project wii be done exclusively in C with no libraries. I will also attempt to design my own PCB after spending months designing circuits on breadboards and then moving them to perf boards. It would be a great experience for me to test out the process of designing an actual PCB even if there are many problems involved that are difficult for me to solve. Much of this process would be easier for me with specialized tools such as an ISP debugger, a logic analyzer, and an Oscilloscope, but I have to work with the tools that are available to me since those tools are very expensive.

Design

This is the second microcontroller based cart that I have designed after the ArduKart, but with this one I am working much closer to the hardware level. Instead of using and Arduino dev board, I am working directly with an ATMega328P DIP and I am programming it with an in-system programmer(ISP). The programmer I am using does not have debugging capabilities built in because those are very expensive, but am working with what I have. The car is very simple in design and functionality. It is made up of a 3d printed base, 2 3d printed axles and wheels, and 3d printed gears attached to a small dc brushed motor. The car is powered by a 4 AA battery pack. The logic is controlled by an ATMega328P and the motor is controlled by a cheap H-Bridge ic. The cart is only capable of going forwards and backwards, but I will use these limitations to display the capablilities and peripherals of the microcontroller by integrating interrups. timers, and low power/sleep mode.

Specifications

Kart

  • Body Length: 158.9mm
  • Body Width: 99.5mm
  • Wheel Diameter: 65mm
  • Gear Ratio: 4.077:1
  • Power: 6v, 4x AA
  • Mass: 216g

Component List

ATMega328P
16MHz Crystal Oscillator
330 ohm Resistor
2x 47pF, 4x 0.1µF Capacitor
USBtinyISP
L7805CV 5V voltage regulator
L9110H H-Bridge Motor Driver
DC Brushed Toy Motor
3d printed spur gears
Yellow LED
4x AA Batteries

Block Diagram

Schematic

GitHub Code

Photos & Videos

PCB gerber file
PCB without components
PCB with components
Programming car

Testing

While testing the PCB that I designed and ordered from a PCB manufacturing site, i found that I was not getting the same results as the exact same circuit that I had made on a breadboard. From my tests, I believe that the problem is that I made the PCB tracks too narrow that not enough current was able to pass to the neccessary areas. Because it would take too long to redesign and get another pcb shipped, I decided to put together my circuit on a perf board instead to save me some trouble. Even though I am not using the PCB, I still gained valuable experience from the process.

Ongoing Issues

  • PCB: Input logic from microcontroller fluctuates when motor is connected