Skip to content

Electronics Production

Individual assignment:

Make and test the development board that you designed to interact and communicate with an embedded microcontroller

Individual Assignment

  1. This assignment is to take the board that I designed in for Electronics Design and manufacture and test it with the knowledge we gained in the Embedded Programming week.

  2. The board I designed was allowed to two servos motors to be connected along with an input. My thought for this week is to use a potentiometer for the input and use that to move the servos at different rates with only one input.

    1. Servo Board

Programming the Board.

Before I manufacture the board I want to test out the design virtually in Wokwi.com. This site is one that Mr Dubick made us aware of during Embedded Programming, so I decided to put it to good use and test the RP2040 virtually and see if I could get it to run two servos off one potentiometer. In the end I was successful without too much sunk time.

  1. I used an example of a servo and potentiometer on an Arduino as my example and reconfigured it for use on a Pico first.

  2. After that I put an additional servo in the system to be controlled with the potentiometer. The servos are connected to the same output pin and move in sync. 1. RP2040 potentiometer two servos

  3. The next iteration is to have the servos controlled with different output pins and move independently. Instead of having a common signal pin for both servos, I used two different pins and scaled the outputs so one output was half the other one. It worked 1. RP2040 potentiometer two servos-different angles

  4. One item to note was that when I was wiring up the potentiometer, it did require an analog pin, so the map function could convert the signal to something the microcontroller could use. It appears that the pin 28 on the Pico has an analog to digital converter function.

Milling the Board

Now that I am comfortable with the coding for my development board, it’s time to mill it. That was fairly straightforward.

  1. I opened the gerber files from week 6 in the Bantam Tools Milling Machine Software.
  2. I set the traces to 0.2 mm depth and the trace clearance to 1.5 mm. The board used a 1/32” End Mill along with a 1/64” End Mill
  3. I decided to mill two boards to have a spare, so I opened the additional file and using the plan setup moved in above the first board in the Y-direction
  4. One issue that came up was in my board design I had added some text to name the ports and the board, but it was too small to be milled, even with a 0.005” engraving bit. I knew this because of the red lines in the software.
  5. Using the Probing feature in the Material Placement section of the software, I probed the material thickness in a few locations and used the low value (1.74mm) to mill the boards.
  6. I started the milling and let the machine do its works. After around 20 minutes, I had two boards that could be ‘stuffed’.

Soldering the Board

I used the techniques that I learned from our instructor Mr Dubick and Dr Gershenfeld to solder the components on the board according to the schematic I made in week 6.

  1. devBoard

I mainly used the solder paste technique to attach the components, especially the SEEED XIAO board, to the PCB. I took my time, tried not to rush and frequently checked my joints under the microscope. I also had Mr Dubick look over my work too. I took it slow and had an intermediary step you’ll see below, but after the kinks were worked out, here is my completed board.

  1. Finished Board

You may notice that I had a broken trace in the upper right quadrant of the board and made an adjustment to compensate. More on that later.

Hooking it All Up

Now that the board was all milled and partially stuffed, it was time to add the components and test it out. I learned a bunch of things along the way.

  1. I opened the Arduino IDE 2.0.1 and hooked up the board, but immediately ran into issues.
    1. The board wouldn’t accept example code. It had power, but uploading code just didn’t work. First issue turned out to be that my computer wasn’t connected to the Internet, so Arduino couldn’t find and load the correct libraries. I solved that by reconnecting my Wi-Fi and the Internet started working, so I was able to upload code. Yay!
    2. Now that I was able to upload code, I connected a servo to the pins on the upper right quadrant of my board and attempted to run the example ‘Sweep’ code from Arduino. It didn’t work. I double-checked the connections (power, ground and digital pin 10) and it all seemed fine. Mr Dubick helped me troubleshoot the issue and using a multimeter we verified the power, ground and signal pin. The odd thing was that the signal pin wasn’t putting out a signal like it was supposed to be doing. Long story short, I was using the wrong pin ID. I thought I was supposed to be using pin 10 (for digital pin 10) in my code instead of the pin 3 that it was mapped to based on GPIO Arduino pinout on Adrian’s infomration. Lesson learned.
    3. Even with that fix, it still had issues because the signal was getting to the servo. Turned out to be a broken trace, so we changed pin style and soldered on to the trace instead of the original pads. Now it worked. On to the second servo.
    4. Wiring up the second servo and loading the code went smoothly. Here are the two servos hooked up.
      1. Two Servose
    5. I soldered on remaining components (additional 3-pin connector, 1k resistor and an LED) and went to put on the servos back on and pulled off a 3 pin connector and a pad with it.
      1. Connector off
    6. I added some extra solder when I reconnected the 3 pin connector and all was good. Just had to be careful putting the jumper wires on the connectors. I had an LED on the board and I up0loaded code for it only to realize that was in backwards, so I fixed that along with the connector. Then it worked.
      1. LED
    7. The next I learned was that pin 0 was a digital pin and not an analog one. My code didn’t work. The servos would go to the initial position, but wouldn’t move with the potentiometer. After some thinking, I realized I had to rearrange a servo and the potentiometer, so it was connected to an analog pin(28). I rearranged the items and adjusted the code, and it all worked!!!
    8. I still need to figure out how to embed video, so that is my next task.

Link to my files for the week.

Group Assignment

Link to our group assignment.