Pi Zero W, Grove Hat ans SW-420

Hello. First time here.
First steps to Grove. I have a Pi Zero W so I bought the HAT and the cheapest sensor to see how it works, SW-420. I installed GrovePi but the ‘‘vibration_sensor.py’’ is not present in the list. No luck, it’s the only one I have to test and it seems to be the only one missing in the list. It is digital, as far as I can see. So, I try something: I take tilt_switch.py and change the D3 (tilt_switch=3) by D5 (tilt_switch=5)—It’s a Zero Hat, no D3–. I start the program but I expected to see a message when I move the SW-420. On the contrary, the red LED on the module seems to react to movements.
Do you have a way to make this sensor work ?

1 Like

Short answer:  No.

Longer answer:
AFAIK, the tilt-sensor is an analog switch.

If the vibration sensor is digital, (assuming i2c), than the sensor types are incompatible.

Even if they are both digital, two different digital sensors will send different digital messages and they cannot be exchanged for each other.

The best way to do this is to use a supported sensor, or find the correct library for the sensor you have.

Not the best answer, I’m afraid, but I hope it helps.

Thank you for the information, jimrh. However, this sensor is well sold for the Grove but no script available. I understand your logic and I will not stop at this inconvenience to abandon the Grove concept which, unfortunately, has taken a bad start here. :sunglasses:

1 Like

Unfortunately I do not have that sensor to play with. It does look like it’s a digital sensor, so code for a button should work, maybe?
hard to know without having one to test.

1 Like

I wanted to make sure of the GrovePi board you have.

Is it the GrovePi+, the GrovePi0 or the GrovePi Base hat? They are 3 different boards completely.

1 Like

@CharlyD,

Cleoqc is the resident Goddess of the GoPiGo, (:wink:), and you would do well to find and read anything she has to say.

We all admire her greatly!
:+1:

1 Like

Who manufacturers the sensor?  Seeed?

If it IS a Seeed Studios product, that’s just about right.  They sell a lot of stuff and support virtually none of it.

There’s a whole thread on people trying to use a Seeed Studios pH sensor and having nothing but trouble.

I avoid Seeed products whenever possible.
(My opinion.  Your Mileage May Vary.)

These are the two modules and I have downloaded GrovePi. Tried it with a Zero and a Pi 3 B+.

https://www.robotshop.com/ca/en/grove-base-hat-raspberry-pi-zero.html

https://www.robotshop.com/ca/en/seeedstudio-sw-420-grove-vibration-sensor.html

1 Like

I looked at the sensor, (thanks for the link!), and though “digitally” controlled, the output is essentially that of a push-button where the output is high if nothing is happening, and it goes low when a change occurs.

Try treating it as a push-button and see what happens. :wink:

ah ah! You are using the base hat, manufactured by Seeed and incompatible with Grovepi drivers unfortunately.

1 Like

So, what hat(s), (links please), should people be buying?

Thanks!

I am curious about the possibility of adding additional Grove sensor inputs to Charlie. (Or any GoPiGo-3 robot for that matter.)

Thank you for your help. This little thing brings a lot of questions but it is a hobby for me. And it plays its role well!!!

1 Like

Best place to get started with the base hat is on the Seeed website
https://wiki.seeedstudio.com/Grove_Base_Hat_for_Raspberry_Pi_Zero/

1 Like

Thank you. I’m going to check this out

1 Like