Testing Sensors

First post in a while. I am finding I am a terrible note taker and keep forgetting what I learn so I thought it might be better to resume old habits and use my blog as a personal reminder site.

I am looking at a different sensor I bought from Hshop. A simple pressure sensor and using the Hummingbird Duo with Scratch I coded it as shown in the photo below.

Using the say command to know what voltage is being measured and using the voltage block to turn a RGB LED on and off but there is a problem.

I ran into this problem as I was helping a student during Project X. We were trying to to make a cardboard button (more on that in a bit). Our issue was that the sensor values were all over the place when the button was up although it worked fine when pressed.

The problem….

The issue had to do with a floating value. What was needed was a pull up or pull down resistor. Although I remember reading about this before (there are many many explanations) a search brought up a real nice explanation (a great Bald Engineer video https://www.youtube.com/watch?v=wxjerCHCEMg). So the next step is to connect a line from the sensor line with a 10k resistor and connect it to the negative pin to bring the voltage down to 0.

Alligator clips join the sensor line and a line with a 10K resistor connected to negative. The result is shown below as I connect and disconnect the white alligator clip.