I.Pressure Sensor

During the class, Rob and Nathan show us the sensors available in the lab. The first we make is the Pressure Sensor. It’s very easy to make a sensor as ours. You just need to attach two copper electrodes (tape on circuitboard material) with no extra resistors to Pin4 and A0 of the Arduino. And then you could put anything between these two conductor plates. If you put anything above them or use your hand to press them, you could see the change in reading from serial monitor or serial plotter.

Someone must be curious about the principle behind it, and actually the principle is very easy. These two conductor plates are just like the the two plates in a capacitor, and they combine to create a simple capacitor. And the reading in the serial is actually the measurement of the capacitance of the capacitor. Let me show you the formula of capacitor and you will figure out what’s going on! Board Traces

k = relative permittivity of the dielectric material between the plates

So there are different scenarios:

1. When you press it, d decreases. As a result, C becomes bigger and reading becomes higher.

2. When you change to bigger plates, A increases. Consequently, C becomes bigger and reading becomes higher.

3. When you change the material that you put between the plates, k changes and then C & reading change because of this. What happen with k is that different material have different k value. When the material is put between the plates, the electric field between the plates will decrease, and then the capacitance of the capacitor will also increase. So k is usually a positive number bigger than 1.

Board Traces

II.Light Sensor

After the class, professor asks us to think about which kind of sensor you want to make during the lab time. For me, I’m interesting in light sensor and distance sensor. One of the significant factor about these sensor is that they all need to use the electromagnetic wave. Initially I want to make a distance sensor which may be helpful for my car in the final project. The reason is that distance sensor is really significant in AUTO-DRIVING and the car in my final project is also AUTO-DRIVING. But unfortunately, there is no such sensor in the lab. So I decide to make a INFRA RED Sensor which I used before.

Although I used it before, I still meet some problems when I try to make a more complicated system. Let me show you the sketch of my circuit first.

Board Traces

Problem:

1. Components of the circuit

Because it’s infra red sensor and I cannot see the infra red light, I cannot know the circuit working well or not. As a result, I add a Blue LED in the series of the photo transistor so that I could know that whether it detect the infra red light. The problem is that when I use the AnalogRead to read the voltage of the photo transistor, it never change. It’s really confused for me and I try to get help from Rob. He is really experienced and he tells me that the voltage of the LED will almost always be the same. It means that there will not be significant change of the voltages of the two components, Blue LED and photo transistor, in the series. That’s the reason that I cannot read the change.

Also, because photo transistor will only allow really a little current flowing through, you need to have a resistor with really high resistance to help you detect the change of the voltage. That’s why I choose a 10k resistor later.

2. Programming

The thing I want to do is that I want the reading function always working. At the same time, I also want the LEDs switch on and off automatically according to the delay. So it means that I need to run two loops simultaneously on an Arduino. I try a lot of ways to do it but all of them fail. At last, the only choice I have is to google it. I find a person who want to do the similar thing as mine and we get the same problem. After viewing the comment of his question, I find that Arduino is actually not a multithreaded or multi-tasking device. So if I want to run two loops simultaneously, the only choice I have is to use two Arduino. That’s why you could see two Arduino from my sketch.

You can see the answer for multi-tasking from this WEBSITE. Click me!

3.Light collection

Because I don’t want the photo transistor be influenced by the natural infra red light and I want the change of voltage to be significant enough, I make a hat for them. With this hat, the infra red light will be reflected after emitting and the natural infra red could be blocked.

III. Project

You could see that when the Green LED is shining, the motor is rotating at the same time. That’s exactly what I want to do. Because everyone knows that you can only drive through the crossing when it’s Green light. And the reading and the loop for the LED is working at the same time in two Arduino. You could see the significant change in voltage from my photos. Board Traces

If you are interesting in my program,click to download it!

Summary

The course is going much faster than I think. We’ve already finished the midterm in this week and I received my grade. The grade makes me happy but not satisfied because I think I could do better. I’m still not perfect in documentation so it means that I ignored some points before. I cannot allow that thing happen again in the later documentation. Also, I’m not perfect in participation. I need to show more passion in this class and be more active. Hope I could do better in the next half term.

And I successfully solve a particular problem in my final project. Maybe using a pulley to pull the car is a better choice instead of AUTO-Driving. And I also make a big progress in programming and analysing. The problems I met in this week improve my ability to solving problem. I’m really looking forward the next week class and lab time.