This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-01-03 13:11:48

andrewcevery
Scratcher
Registered: 2008-03-23
Posts: 28

Tilt sensor?

Hey guys i'm wondering if there would be a way to connect a tilt sensor to scratch. I want this because think of all the possiblilities! realistic steering, labyrnith games, and other stuff! So if anyone could help me I'd really appreciate it
PS I heard that on scratch sensor boards there is resistance sensors. Do you think theres a electronic component like a "tilt resistor"?

Offline

 

#2 2010-01-03 13:36:38

Greatdane
Scratcher
Registered: 2007-06-05
Posts: 1000+

Re: Tilt sensor?

In the WeDo, there is.


The future belongs to those who believe in the beauty of their dreams.
        ~ Eleanor Roosevelt

Offline

 

#3 2010-01-03 14:10:06

JSO
Community Moderator
Registered: 2007-06-23
Posts: 1000+

Re: Tilt sensor?

Or the Sensor board, but then you'll have to be creative and create a sensor on your own.

Or any other sensor, controlled by Scratch Remote Connections. But that's quite difficult  hmm


http://oi48.tinypic.com/2v1q0e9.jpg

Offline

 

#4 2010-01-26 03:29:53

abee
Scratcher
Registered: 2007-05-25
Posts: 100+

Re: Tilt sensor?

Making tilt sensor is very interesting. Simply you can buy an acceleration sensor and connect it to PicoBoard or Arduino but it's easy enough and a little expensive.
For example, imagine a small sound box that loudness is changing by angle. You can handle it by a mic and "loudness" block.
I know an university student who made a tilt sensor with two paper cups and confetti.

Cheers,
Kazuhiro Abe

Offline

 

#5 2010-01-26 22:12:10

billyedward
Scratcher
Registered: 2008-01-03
Posts: 500+

Re: Tilt sensor?

You could fill one container with salt water. Then insert a lead rod (or other cumulative resistor) into it, so as when the apparatus is tilted, the water moves away, and less of the rod is in the water.
Now, connect the dry end of the rod to one end of a resistance sensor, and the other to an electrode in the water. This way, the more it tilts, the more resistance.


"I'd love to change the world, but they haven't released the source code yet."
Check out the latest version of Streak --> http://billy.scienceontheweb.net/Streak

Offline

 

#6 2010-01-28 08:30:06

ajbarrosbr
Scratcher
Registered: 2008-01-24
Posts: 13

Re: Tilt sensor?

Hi andrewcevery,

Well, there are some "poor man's" accelerometers you can buy for only a few bucks.
This one <http://www.ladyada.net/learn/sensors/tilt.html> you can buy for U$ 2.00 at Adafruit store <www.adafruit.com>. I think you can use it as a "tilt switch".
I do not have one to test. but I've attached a Force Sensitive Resistor (FSR) <http://www.ladyada.net/learn/sensors/fsr.html> to the PicoBoard's resistance sensor and it worked like a charm  smile
I hope this can help.

Offline

 

#7 2011-02-02 16:30:02

EpicGuy22
Scratcher
Registered: 2010-10-03
Posts: 15

Re: Tilt sensor?

I don't understand how you can't have three sprites; a box, and two little squares being sensors. For sensor 1: forever: if touching color __, set {variable name1} to 1, else, set {variable name1} to 0. For sensor 2: forever: if touching color __, set {variable name 2} to 1, else, set {variable name 2} to 0. For box sprite: Forever: if {variable name 1} = 1 and {variable name2} = 0, rotate [right/left] 1, if {variable name1} = 0 and {variable name2} = 1, rotate [right/left] 1. Oh, and the sensors go at the bottom portion of the box sprite. The box can move left and right, and the sensors are still at the same spot. Now WHY WONT IT WORK!?!?!? Replies will be appreciated.  smile


"The only man who never makes a mistake is the man who never does anything" -I don't know who, I will update as soon as school starts again

Offline

 

#8 2011-05-04 20:44:42

jslomba
Scratcher
Registered: 2009-09-25
Posts: 1000+

Re: Tilt sensor?

EpicGuy22 wrote:

I don't understand how you can't have three sprites; a box, and two little squares being sensors. For sensor 1: forever: if touching color __, set {variable name1} to 1, else, set {variable name1} to 0. For sensor 2: forever: if touching color __, set {variable name 2} to 1, else, set {variable name 2} to 0. For box sprite: Forever: if {variable name 1} = 1 and {variable name2} = 0, rotate [right/left] 1, if {variable name1} = 0 and {variable name2} = 1, rotate [right/left] 1. Oh, and the sensors go at the bottom portion of the box sprite. The box can move left and right, and the sensors are still at the same spot. Now WHY WONT IT WORK!?!?!? Replies will be appreciated.  smile

ummm.... you realize we're not talking about THAT kind of sensor, right? we're talking about the thingamagigs you plug into your computer.


the the the the the

Offline

 

Board footer