tilt sensor/How it works/04. Which end is lower
How it works · 04 of 10

Which end is lower

The can lies across the board with its leads at the left edge. So the switch closes when the left edge is lower than the right, and opens when the right edge is lower. Tipping the header edge or the top edge down does nothing at all: it only rolls the can about its own length. Flat on a desk, the block reads whatever it read last.

One axis

A ball switch feels tilt along its own length and nowhere else. On this board that length runs across the board, from the leads at the left edge to the closed end near the right. So of the four ways to tip the block, two matter and two do nothing.

Which end is lower
Tip it
How far30°
Leads at
the left edge
Decided
yes
Switch
closed
The left edge is 30° down, and so is the can's lead end. The balls sit on the contacts: SIGNAL HIGH, LED lit. This is the one way to tip the block that closes the switch.

Pick an edge and tip it. Left edge down lowers the lead end: past about 10 degrees the balls roll onto the contacts, SIGNAL reads HIGH and the LED lights. Right edge down lowers the other end: the balls roll away and it reads LOW. Header edge down or top edge down turns the can about its own axis like a rolling pin: it stays level however far you go, and the switch keeps whatever it had.

What that means on a desk

Flat on a desk, the can is level. So is it when the block stands on its header edge, the way a TinkerBlock often stands in a model. In both, the reading is whatever the last tilt left, and a knock can change it. The owner's video of this block starts that way: flat on a baseplate, LED dark. Lift the baseplate so the lead end drops and the LED lights.

Two positions give a definite answer with the block upright: standing on its left edge, can pointing down, closed; and standing on its right edge, can pointing up, open, which Shouhan's sheet also names as the position a shake is least likely to disturb.

Choosing how to mount it

Put the direction you care about along the board's width. For "which way does this plank lean", lay the block along the plank. For "has this been turned over", stand it on its right edge, open and drawing nothing at rest, and it closes once turned far enough that the lead end drops below level.

For four sides at once, or for an upright that is itself a reading, the four-direction tilt sensor is the block for the job. For an angle rather than a side, you need an accelerometer.

When it does not work

I tip it forwards and nothing happens.

Forwards and backwards, header edge or top edge down, turn the can about its own axis and leave it level. Only a tilt that lowers the left or the right edge moves the balls. Turn the block a quarter so that the edges you want to compare are its left and right.

It says HIGH lying flat on the desk.

Flat, the can is level and the balls stay where they last rolled: the left edge was the low one when you put it down. Lying flat is not a reading. If your project needs one, mount the block so that its resting position has one edge clearly down.

Standing on its header, it reads differently every time.

Header edge down, the can lies across, level, just as it does flat on a desk. Stood on its left edge the can points straight down, closed; stood on its right edge, straight up, open. Those two are the only upright positions with a definite answer.

Where this goes next

What the rest of the board does with the switch.

The pull-down and the light →

Edit this page — content/books/tilt-sensor/which-end-is-lower.mdx

Community

Questions about this product

See what other owners have asked, and read their solutions.

Ask a question ↗

Tilt Sensor

Loading discussions…

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Modules and blocks on the forum →