Pcomp Blog

Lab 1: Setting Up A Breadboard

I started the first lab. I realized that the primary purpose of this lab is to familiarize us with the breadboard and understand the use and connection of voltage regulators, solid core hookup wires, and LEDs. But soon, I met the first challenge. I linked each unit according to the instructions, but my light bulb flickered. At first, I thought my current was too high, but I found no problem after measuring it with a multimeter. Later I focused on the resistance, I felt a poor connection caused it, but the problem still exists after the replacement. Finally, I found out that my poor power connection caused the problem.

The problem was resolved after I replaced the power cable. Before this, I also caused the voltage to be too high due to the wrong volt regulator and burned out the LEDs. Through this time, I realize that I must be careful with every lab.

Lab 1: Switches and Pushbuttons

Then I started the next lab; I will use the switch to control the light switch. I decided to use Arduino for the power supply because firstly, it is more stable, and secondly, I can familiarize myself with the use of each jack in advance. At first, my switch was unavailable, but I later found out that it was because of poor contact with my switch and the wrong connection of my wire. So I quickly corrected the problem, and my light turned on successfully.

Not only that, but I also tried to connect two bulbs in series. However, in the beginning, due to my wiring error: I connected the two bulbs in series and connected the second bulb with extra positive electricity, which caused the circuit to short circuit and my second light bulb was burned out. Soon I found the problem and solved it. But the lesson this time made me understand the circuit structure better.

Lab 2: Digital Input and Output

Since I was familiar with the use of Arduino in the previous lab, this time, I will be able to link to use Arduino soon. At the same time, since Arduino's editor is based on processing, I haven't been troubled by these for a long time. But due to the connection problem between my computer and Arduino, I could not upload my code. I later found out that I did not choose my motherboard as nano 33. After the problem was solved, my circuit started to work successfully.

Lab 2: Analog In with an Arduino

Since I was familiar with the compilation and use of Arduino and Arduino editor in the previous lab, the making of this lab did not bother me a lot. But I was troubled a lot by the physics knowledge inside. I understood some of the basic physics knowledge by asking for help from the professor and residence. At the same time, through this lab, I have a better understanding of different resistors.

Lab 3: Tone Output

When I started the lab3, I connected the speaker and each jack according to the lab instruction. However, both the pressure resistance and speaker cannot be detected. I initially thought that the input and output interfaces would provide positive power during detection. But soon I found out that I was stupid. My circuit was neither connected to the positive power nor ground. After I discovered the truth, I was amused by my stupidity.

This should be the correct way to connect the force-sensing resistor and speaker. Now the circuit is completed.

After successfully linking, my speaker made sounds, but the strange thing is that it can only happen in the range of 300-1000HZ. I was puzzled why it couldn’t be the same as in the lab instruction. But I quickly discovered that the resistance I soldered was too large, making it unable to make the expected sound in this circuit environment.

I started the following experiment to amplify the sound. The strange thing was that it couldn’t play the sound at first, but I quickly found the problem this time. When I connected the circuit according to the lab instruction, I wondered if the TIP120 transistor was the wrong face, making the positive and negative poles opposite. The speaker did not make a sound to confirm my suspicion. When I flipped the TIP120 transistor, sure enough, the speaker made a considerable noise. (I began to wonder if the author deliberately drew the wrong way to increase the difficulty and challenge for us)

I continued to try to use resistors of different ohms to see how loud this speaker is, just for fun.

Lab 3: Servo motor control

When I started the motor control lab, my motor control could only run in a small range and was unstable. I realized that it might also caused by the resistance this time, so I removed the resistance direct connection circuit, and stranger things happened. It became more unstable and vibrated slightly (twitching?), so I tried to use a larger ohm. After the resistance, it becomes stable and can rotate as much as expected.

Question: Why the smaller the ohm of resistance, the more unstable the motor control. I thought the higher voltage could give motor control more electric energy to convert into kinetic energy.

Project 1: Simon remember game

We plan to make a project similar to Simon’s remember game. We plan to use four lights, four buttons, one speaker, one servomotor to complete this job. The specific operation process is to start: LEDs light up in random order, the player needs to press corresponding buttons, and then when the led turns on, and the button is pressed, the speaker will give a different pitch. Finally, when the player wins the game, the servomotors will rotate a little flag. We think this will be a creative project that has exceptionally high playability and also meets the requirements (digital or analog input, PWM or tone output, Control of servomotors)

 

We plan to start buying materials after class ends on Wednesday and start making prototype 1.

In the beginning, Frank did the first prototype, we can see, the LEDs can work properly when people press the switch, and we get up some new ideas, for example, we can add tonnes for different pitches, and we can add servo motor, if the player wins/lose, the servo motor can swing the flag to add more player engagement. Also, we can add a display to show players which stage they are, and how far they can win the game.

 

The above picture is the first version after our thoughts, and it can work properly.

The first prototype is done, and we further thought about how to make it looks aesthetic and user-friendly. We planned to buy the LED button, which can light up before and after players press that. Also, we planned to use the transparent acrylic board, after the laser cut in parts and assemble, players can exactly how the wires go inside of the box, it just raised the aesthetic of the box.

But soon we faced the challenge. Our box is too small, if we put the full-size breadboard into the box, it won’t possible. But if we made a larger box, there may be too much unused space. Therefore, we tried to make a soldering board or half-size breadboard. Both have different pros and cons. The half breadboard is easy to wire, but if the cables are complex, it may cause cables too unstable and we may not have enough rows for all cables. The soldering board is good at cables, cause it’s a point to point, but we will spend lots of time soldering that. Anyway, we made both the board diagram and schematic diagram to make full preparation. We believed after visualizing the thoughts, we will find out which one is better. 

We finally decided to use the breadboard, since there are enough rows for us, and we may have some changes later, it’s really easy for us to make changes. And we soon moved everything from the full-size breadboard to the half-size breadboard. And we move to the next step to put everything in the box. And below the video is the final version of our project 1.

Lab 6: Intro to Asynchronous Serial Communications

This is how my monitor works after the Serial.println. When I change different analogs, it can show separate potentiometers’ situations. I notice that if I turn the potentiometer, the potential diagram goes like an arc graph, and when I press the button, some straight line suddenly shows up.

But when I moved to the next step, sending the data in many formats, although the data covert to the text successfully, the content somehow differed from the content shown in the lab tutorial.

Also when I sent data in different formats, some of the details were different from the data shows below.  Question: why some of datas(like the 2nd cloumn and 3rd cloumn) are same, but the first cloumn and the 4th cloumn are different?

And when I made the Flow Control: Call and Response, I found even all of my code is copied from the tutorial, and my monitor still can’t print out the hello. After reading the code, I found out the issue was the int value.

Lab 6: Serial Input to P5.js

When I was working on this lab, it took me a long time to reach this step. Even though all my coding is correct, the value I get is always undefined. Eventually, I discovered that this was due to my port error. Because I am a Windows computer, my port name is different from the MAC, which wastes me a long time. But thanks to this problem, I read the entire library and became familiar with all the code on the way to find the error. After getting the value, I made some additional attempts.

Lab 6: Serial Output From P5.js

After the above errors, I have a particular understanding of serial input and output. The following experiment didn’t bother me much.

Lab 7: Two-way (Duplex) Serial Communication using an Arduino and P5.js

Question: After I linked the Arduino, I found that the value of the potentiometer read by my Serial Monitor was correct, but my switch was not. It stands to reason that can be read as 1 after I press it, but when I don’t press it, it reads 1 and 0 randomly, and it will keep outputting 0 after I press it.

Question:Why does my ball keep shaking? I know this may be caused by the link or voltage instability, but I don’t know how to solve this problem.

Project 2: The bizarre adventure of basketball