Group assignment

Here is a link to the group assignment page.

Individual Assignments:

Last week, I embarked on my journey into electronics design by creating a simple PCB featuring two LEDs—one indicating power and the other programmable—alongside a button to control the LED. The heart of this PCB was the Seeduino Xiao SMD 21 microcontroller, which served as an introduction to the intricacies of electronic circuit design.

final project sketch

This week, I have taken a significant leap forward by starting the design for the final PCB of my project. The complexity has increased manifold as this PCB will serve as the cornerstone of my final project.

    List of main Components:

      The final PCB is designed to be the central control unit for the feeding mechanism and door. It incorporates a refid reader, a servo motor and two distinct stepper motors, each with a specific role in the operation:
    • NEMA 17 Stepper Motor: This smaller motor is tasked with driving an Archimedes screw. Its precise movements ensure the correct deposit and dosage of food, providing controlled feeding.
    • NEMA 23 Stepper Motor: The larger motor is responsible for the rotational movement of the entire structure. It positions the feeding mechanism at predetermined locations, enabling targeted feeding.
    • Servo Motor: The servo motor plays a crucial role in managing access. It operates the locking mechanism of a cat door, securing the feeding area when not in use.
    • RFID Reader: An RFID reader detects the tags on the cat’s collar. Upon recognition, it signals the servo motor to unlock the door, allowing access only to the designated pet.

Microcontroller Selection:

Choosing the microcontroller for my final PCB was a challenging and iterative process. Initially, I considered the ESP 32C3 and the ESP 32 S3 for their compact size and integrated Bluetooth and Wi-Fi functionalities. The ESP 32 S3, being superior to the C3 in performance, seemed like a promising candidate.

However, during the sketching phase of my circuit design, I encountered a significant limitation: the ESP 32 S3, much like the Seeduino Xiao, offered only 11 digital pins. This was insufficient for connecting all the necessary components for my project, which includes two stepper motors, a servo, and an RFID reader.

This realization prompted me to explore alternative options, leading me to larger microcontrollers that could accommodate the extensive pin requirements of my design. The search was guided by the need for a balance between functionality, size, and pin availability.

When selecting the microcontroller for my final PCB, I ultimately chose the Arduino Nano ESP 32 over alternatives like the ESP 8266 or the Raspberry Pi Pico.

This decision was based on the immediate availability of the Arduino Nano ESP 32 in our lab, which met all the project requirements including the need for more pins and wireless capabilities. Had the circumstances required purchasing a new microcontroller, I might have opted for a more cost-effective option that still fulfilled the project’s needs. However, utilizing the resources at hand was the most efficient choice.

pin requirements:

In the PCB design, the RFID module selected is the RC522, which is a reliable choice for wireless communication and identification. It connects to the microcontroller via SPI interface, requiring connections for MISO, MOSI, SCK, and SDA, along with ground and 3.3V. Additionally, the reset pin of the RC522 must be connected to a separate digital pin on the microcontroller to facilitate proper initialization and operation.

As for the servo motor, its selection remains open since the project does not demand a high-torque component. The servo will be used to move a part that blocks the door from opening, which requires minimal power. The servo connects to one digital pin on the microcontroller for control signals, with other connections being ground and power. It’s important to note that the servo will need an external power source to ensure stable operation without overloading the microcontroller’s power supply.

connections:

RFID microcontroller
SDA A4
SCK D13
MOSI D11
MISO D12
IRQ not connected
GND GND
Servo microcontroller
RST D5
VCC 3.3V

Physical Sketch

KiCad

Using KiCad for designing a PCB involves a structured process that begins with the schematic layout. In the schematic editor, I first add all the necessary components and establish their connections based on the circuit design.

This step is crucial as it defines the electrical connectivity between components and serves as a blueprint for the PCB layout. Once the schematic is complete, I transition to the PCB layout editor, where I place the physical footprints of the components onto a virtual board. Here, I arrange them optimally for space efficiency and signal integrity.

In this part of the design process, I discovered that creating a single-layered PCB would not be practical for my project because certain parts were obstructing the connections of others.

While I could have resolved this issue by using a 0-ohm resistor to jump signals or by creating a physical wire bridge over the connections, these solutions did not align with my goal of achieving a cleaner PCB design. Fortunately, the milling machine available at our lab, the LPKF, features image recognition technology that greatly simplifies the creation of double-sided or double-layered PCBs. This capability allowed me to design a two-layered PCB, which provided the necessary space and routing flexibility to accommodate all components and their connections without compromise.

This time around for producing my PCB design, I will be making a double-sided board, which means that I have to take a few different and additional steps on the machine software when setting up the job. First, instead of choosing a template for a one-sided board, I chose "DubbleSided_NoTHP". The following steps are the same as last time documented here. After the isolation process, there is an additional step to create fiducials. This is done by going to "machining" then "placement" and choosing the material and design location for milling. Then go to "machining" and "fiducials". On the pop-up screen, pick two to three areas on the copper material but outside your milling zone. In my case, I chose three points, and this meant that the machine drilled three holes to help with the alignment of the second side of the board.

CAM processing (Milling)

For this project, I produced a double-sided PCB design, which required additional steps in the machine software during setup. Firstly, instead of selecting a "SingleSided_top" template I used on the electronics production week, I chose the "DoubleSided_NoTHP" one.

Then, after importing my PCB files and creating the isolation, this process remains the same as the one for the single-sided PCB from the production week.

After the isolation process, there is an additional step to create fiducials, but before this, I have to define the placement of the board and material. This is done by going to "machining" then "placement" and choosing the material and design location for milling.

Then go to "machining" and "fiducials".

On the pop-up screen, pick two to three areas on the copper material but outside your milling zone. In my case, I chose three points, and this meant that the machine drilled three holes to help with the alignment of the second side of the board.

After finishing this, it's business as usual, and you can create the wizard and mill the board. The first part to be milled was the bottom layer, and as you can see, the three holes around the bottom layer are the fiducials.

After the bottom layer is milled, on the software there are instructions for flipping the board. During this, it's important to try to align it as best as possible for the image recognition to work properly and find the fiducials. After this, the top layer can be milled and you're done.

Soldering

With my board milled, all that was left was to solder all of the necessary components to it and test it. The soldering setup and process were explained here. Although this new PCB was much more challenging to solder than the first one, the components list is as follows:

Components List

Name Description and data sheet Quantity
Controller Arduino Nano ESP 32 1
LED (R_1206) Programable LEDs for testing 2
Resistor for the LEDs (R_1206) 499Ω 2
Capacitor WCAP-HSAH 25V 100uF Capacitor 1
1x02 TerminalBlock P5.00mm Horizontal 90° Wire Entry Angle 2
1x04 TerminalBlock P5.00mm Horizontal 90° Wire Entry Angle 1
Pin Headers 1x8 female 3
Pin Headers 1x15 female 2
Pin Headers 1x4 female 6
Pin Headers 1x3 female 1

Before starting to solder I first added all of the rivets, to do this, I used a tin twezer and inserted the rivet in one of the ends of the tweser, this allowed me to insert the rivets with more ease, as the holes are a tight fit, after inserting them half way i removed the tweezers, and pressed it down untill it was compleatly in, then i used a press to finish the job.

The small tip of the rivet press we have in the lab was broken. This tip is used to help align the rivets, making it a very helpful tool for achieving nice results with your riveting. However, the new part we ordered was going to take a little while to arrive. Despite this, I decided to proceed without it, as it is still very much possible to use the press without the alignment tool. Since it was also my first time using this tool, some rivets came out a bit funky, and I wasn’t sure if they would work. This led me to test all of them with a multimeter, specifically on the beeping setting, to check if the circuits were interrupted or not. The conclusion of this test, you may ask? They worked! Even the funky, questionable ones. In some cases, for circuits that will sustain a lot of movement and vibrations, you can also solder the rivets on both sides. However, I did not do so for this board, as it is not the final version. It’s just the first generation, and soldering all of the rivets is not necessary, especially if they all work.

After all the rivets were in, before starting to solder I placed the components where they should go and observed the difficulty and accessibility for soldering each one. I concluded that I should start from the middle and branch out. This meant starting with the most challenging and time-consuming part: the 1x011 female pin headers. This was challenging because of the amount and proximity of pins to solder properly and avoid bridges. To start, my instructor showed me how it was done on a few of the pins, and I carried on from there.

As I was soldering, I noticed some things I could change to improve the board. For example, the pads for the pin headers for the stepper controller were very small. Because of this, there were some problems, such as one of the pads breaking off from its connection. To fix this, I soldered them together, being careful not to create a bridge.

Testing

With the PCB finished, it was time to test it. The first part I tested was the connections for the RFID module. This was very straightforward. I plugged it into the female connectors on the board and connected the board to my laptop. From there, I used a code I wrote for the RFID module, which you can find in the inputs week.

The next part was to test the stepper driver and motors, pluged in the driver to the board, connected two wires to the bloc terminal to an external power source, and connected the stepper motor to the driver. I then used a code I wrote for the stepper motor, which you can find in the output devices week. However, there seemed to be a problem, and the motor was not moving. It wasn't even activated, and I could move it with my hand. This prompted me to test all of the connections with a multimeter. I would run the code and check if, when the motor should be running, there was a change in voltage in the pins that should be connected to the motor. There was. However, when I tested the step pin, it was constantly 5V, which shouldn't be happening. Turns out, the problem was during the design process. I had connected the sleep pin to dir, when sleep should have been connected to reset.

To correct this, I broke off the sleep pin on the driver and oversoldered it to the reset pin to connect them together. Then, I plugged the driver back into the board and tested it again. This time, it worked perfectly.