Input Devices


This week we were tasked with an individual set of activities and group work. Working as a group, we needed to test a baords analog levels and digital signals using an oscillscope, multimeter, or similar lab tool. For our individual activities this week we were tasked with adding and reading a sensor to a board we designed.

My group got right to work setting up our custom boards with some sensors. We used the logic analyzer that we learned how to use in week 6 and a breadboard setup with an LED, a resistor, an ESP32-C6 and two copper plates connected with aligator clips. My group worked together to get working code, troubleshoot our board set up, and finally getting a readout for our copper plate pressure sensor.

I really liked this weeks group project, as it showed me an interesting and unexpected way that I make a sensor for my robot project. For a more in depth look at my groups week 9 assignment, see my groups Week 9 page.

Week 9

Check List

This week's project requirements:

    Group Assignment:

  • Probe an input device(s)'s analog levels and digital signals
    • As a minimum, you should demonstrate the use of a multimeter and an oscilloscope

  • Document the workflow for sending a PCB to a boardhouse
  • Document your work on the group work page
  • Reflect on what you learned on your individual page

    Individual Assignment:

  • Measure something: Add a sensor to a microcontroller board that you have designed and read it
    • Document the process

    Images/Files:

  • Include your original design files
    • Properly compress or use a zip folder if needed
    • Include hero shots of your results

Resources and Helpful Links

Learning Outcomes

  • Demonstrate workflows used in sensing something with input device(s) and MCU board

Introduction


I really enjoyed this week and I learned some really interesting and new things between my group work and my individual work. I am excited to explore the copper plate pressure sensors more as a possible additition to my final project, and I am excited to further explore the Serial Plotter feature in Arduino IDE.

Creating the Board

Adding FabLab Library


I created a breakout style board so that I could continue to use my board for multiple tests as I try different sensor options for my final project. The board I made in week 8 is only easily usable to light the soldered on LED, which is on backwards so thats not really even effective. I didn’t want to have to keep creating a new board for each thing I wanted to test, so I designed a new one with multiple uses in mind.

I started by designing the board to have 4 sets of header pins, but I was having trouble getting a ground connection to make sense.

Initial Board Design


I had turned to ChatGPT for some assistance and it gave me a few things to fix. It didn’t like that I had mixed sets of headers with J1 being a set of 3 and the rest being sets of 4. It didn’t like that I did not have ground or power going to J2 and J3, it also didn't love how I connected J4 to power. It also said to not use the 5V pin and to instead connect the 3V pin for everything. At this time, ChatGPT also told me to create Net Labels.

I made the suggested corrections and got the design below which I asked my ChatGPT to look over for me.

Design After Suggested Changes from ChatGPT


In this version it still had a few suggestions for me to fix. It was happier that I was being consistent with 4 Pinheaders in each group, but it did not like how I had everything wired together in my attempt to create ground and 3V connections.

I tried using the Net Labels like it suggested, but I was obviously not doing it correctly, because it once again told me to use Net Labels. When I created my GND and 3V3 labels I was just kind of placing them as nodes in my wires and connecting everything to the label.

I didn’t really understand what a net label did, and I was obviously using it wrong since it was correcting me, so I asked ChatGPT to explain it to me in more depth. This is when I learned that I was supposed to just place the label where I wanted that wire connection to be.

Design with Proper Net Labels


Not being able to see the wire connections felt strange to me and I was a bit skeptical about how it was going to work when I got to the PCB editor, but I was pleasantly surprised when it worked.

Board Wiring In KiCAD


So in my final design, each of my breakout sets had a connection to ground, the 3V3 pin, and 2 data pins on the board. I threw in an LED and a resistor on the open pins I didn't connect anything to, and I kept the 5v pin unused. I also made my trace size to be 0.5mm for all of my traces so that I wouldn't have the issue I had with the week 8 board.

Editing the Trace Sizes


Using MakeraCAM


After exporting my files from KiCAD, I opened them up in MakerCAM to get set up for milling. I once again followed the step by step instructions provided by Mr Dubick that we were given during week 8’s lesson.

2D Pocket Settings
2D Contour Settings
2D Contour Settings


Milling my Board


I successfully milled my board in one attempt on the CarveraCNC.

Week 9 Milled Board


Soldering my Board


Like week 8, I still didn't enjoy surface mount soldering, but at least this time I was more careful about putting in the LED. I followed the same steps I outlined in week 8 when I was soldering my week 8 test board.

Soldering my Board Part 1
Soldering my Board Part 2
Soldering my Board Part 3
Finished Board with all Headers Soldered on


Testing my Board


For this week's test, I connected a button and an LED to my headers. I used a breadboard to hold my button, but I connected my breadboard into my header pins. I used the basic button code example in Arduino as a starting point. I changed the pin for the LED and button to match how I had it wired up on pins D9 and D7.

ESP32-C6 Board Pins


I was having trouble getting the button to work so I looked online to ensure I had it wired correctly and found this AI voice over video which showed me that I could see the button press as a wave form in the Serial Plotter. I never noticed the button for the Serial Plotter, so I was excited to add in code to use that feature in the Arduino IDE. I added in the necessary lines to access and read to the Serial Plotter and I tested my code again.

I was still having trouble with my board not working. I tested the LED with my multimeter to ensure it wasn't dead, checked my connections, and checked my pins and didn't see anything strange. I decided to add in the onboard LED to the button control to see if maybe the way I have my headers connected is the problem.

With this test, I noticed that the onboard LED was bright red when I plugged it in and after a few minutes it would go almost off. To bring the light back to full brightness I needed to plug the port in again. I disconnected the board and plugged it in directly, and the same thing happened. My guess is that the port on my usb dock that I am using on my computer is not putting out enough power.

Trying Again

Push Button


I changed the USB port I was plugging into and tried my circuit again. This time, I had a really fun interaction. Every time I pressed the button, my computer made the sound of a device disconnecting.
Looks like I was shorting out my circuit through the button. Thankfully this was an easy fix, which was just removing the 3V pin and double checking I had my button legs oriented correctly.

Removing the 3V pin stopped the board from shorting when the button was pressed, however the LED was still not responding. I decided to test the button directly to make sure I had it oriented correctly. Since I had it across the breadboard I was almost positive I was fine, but it never hurts to check.

Code to Test my button


To test the button I simply asked the monitor to read out if the button was pressed. If the button was pressed the monitor would show a 0 and if not it would show a 1. All I was getting was 1's. This told me that there was some sort of wiring issue. I started by moving each wire and testing the button with no change. ChatGPT suggested I check the pins directly to ensure their was no issue with my pins.

Test your pin directly


To do this test, I removed my esp from my board and plugged in a male-male wire from GND to pin 9. This showed no change. This worried me at first thinking my board was damaged. I did short it by pressing the button so it was possible. Thankfully, that was not the case. With a little help from Chatgpt I realized I was missing the D in front of my pin numbers. This wasn't causing me issues before, but it did fix the problem. I then tested the connection in my breakoutboard just to be sure and that too was working. Finally I connected my button back in and saw the change to 0 when it was pressed. Success!

Now back to the LED and Button code. The button works independently, the LED works independently, but together they don't work. ChatGPT had me test out a separate code suggesting that there may have been either a serial delay interference or a loop flooding problem. The new code is similar to what I was using but removes the serial monitor.

Final code used to blink an LED with a button


With the serial monitor print out removed, everything worked.

Adding a Sensor and removing the Breadboard


After realizing the usb docker was the cause of my problem and solving the issues with the button shorting out, I knew I needed a break. I put this week on hold for about a week or two and finally came back to it to finish it correctly.

I switched out the bad usb dock for a brand new one that I ordered as a replacement, and I was ready to give it another try. At this point, I had alread taken apart the button breadboard I was using to work on other projects so I needed to build somthing else to complete this week.

I decided to use the flexsensor I had been playing with to possibly use in my final project. To use the flex sensor though, I needed an Analogue pin. All of my analogue pins were on a header that broke off sometime between weeks 8 and 9. Since I had put this week on a pause, you may notice in my week 10 page, that I had fixed the broken header pin during week 10.

For a more detailed look at the flex sensor and the wiring process take a look at my detailed explanation in Week 10. After wiring the flex sensor up, I added in a basic LED to pin 8 and I was ready to put this week behind me finally.



Week 9 Files


In my repo is a zip folder containing files for my week 9.

What files are inside my Folder:
  • My KiCAD files for my week 9 board
  • My Arduino Code for my Flex-LED Control

    Download My Week 9 Project Files Zip Folder