Recommendation for choosing sensor that detect vibration and a battery to connect to the particle photon


I tried to make the topic quite specific. But Ill write more detailed here.

I want to use my photon to control my philips hue lights. I want to use to sense vibration from the kitchen countertops, also i want to mount it under my countertops and then sense the vibration. So i need the a good sensor, I dont wanna put so much money into it so i dont wanna go all in, but for a decent price get a decent sensor.

I also need a battery, to make it stay alive since it will be no electricity source to connect it too. I can go with a solution that use 2xAA batteries or 4 for that sake, but i need advice for it.

1 Like

What kind of vibration would you want to detect?
Depending on the answer you could go with a vibration sensor, an accelerometer or a piezo sensor or even a sound sensor.

hmm, I wanna catch if someone put something on the countertop. Like if I. put a item on the countertop i wanna catch that event. If that make more sense :slight_smile: ?

Somewhat. But still, how hard would the impact of the action need to be?
Also how heavy would the object be?
Do you want to distinguish between a person leaning on the countertop and an object being placed on it?

If it happens with a noticeable “clonk” a piezo/knock sensor may work. As may a sound sensor.

I’m not convinced a mechanical vibration sensor or accelerometer would detect that.

However, if you also want to detect putting something down gently on the worktop detecting that would be harder. For that, assuming the weight of the object is considerable, you could go with a load cell.

So still, the exact intent will dictate the solution.

1 Like

Hm, i think i can simulate a situation with setting a big knife on the table. So I think I knock will do. I am considering a piezo sensor. But which one is to recommend? And what about a battery? I have ordered my self a SparkFun Photon Battery Shield. But what battery should I go with :)?

For the piezo sensor you can go with virtually any, but this should work

And they have a knock detector sample too

(be aware of the difference: Photon ADCs only take up to 3.3V signals and the reading range is 0…4095, where Arduinos take up to 5V with a range 0…1023)

With the Photon Battery Shield you may want to look at a single cell LiPo battery like the one that’s shipped with other Particle devices.
Similar to this on Lithium Ion Battery - 3.7v 2000mAh : ID 2011 : $12.50 : Adafruit Industries, Unique & fun DIY electronics and kits

Since the polarity of these JST connectors isn’t codified make sure to check.
If the polarity of the battery is flipped compared to the shield, you can simply swap the pins round in the connector on the battery.

1 Like


@ScruffR’s solution with the piezo is a solid one. When I started building vibration based tap detection for counting mountain bikes, I used these. They are cheap, simple and can be tightly affixed the the surface you are wanting to monitor. With a little extra circuitry (depending on the piezo and your signal) they can even wake a sleeping device in case power consumption is an issue. You would do well to start here.

I can also offer another choice which I use for my applications - the MMA8452Q

This is an inexpensive accelerometer with a rather impressive set of commands for defining “tap” detection. You can specify the characteristics of the tap (or double tap) you want and it is very sensitive. Depending on your countertop construction, you should have no trouble detecting someone putting a knife down.

There is an excellent library for this device from SparkFun in the Particle library

I ended up modifying the SparkFun library to better manage hardware driven applications (auto reset interrupt flag).

The biggest advantages in these devices is low power consumption and sensitivity. You may want to keep them in mind but the Piezo is likely the best place to start.

Hope this helps



That is awesome! I am considering this. Lower power consumption sure are +++ then I won’t be needing to charge the battery often either :)!

Thank you! How shall I charge this battery? Do I need some other parts for that too?

The Battery Shield will charge the battery via the USB connector of the Photon.

Thank you! Can I Ask you what kind of cable I can use and a power adapter to use along with the cable so that the Voltage I get from the socket would keep the photon and battery safe.

Sorry for the questions😅
Another question:
And if I need to catch sound? I had a project where I wanted to create a monitor, a baby call actually. I don’t need to record the sound, but just activate a alert if the baby cries. I think my microphone sensor broke down and I didn’t get to fix it. Thanks for any help in advance:)

The Photon sports a micro USB receptacle and a quality 5V USB charger - ideally 2A - should do.

Something like this should do the trick

Hello, did you manage to find a sensor that works for you?


That depends. I needed a few sensors for different purposes. What are u trying to achieve?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.