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.
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 ?
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.
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)
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.
@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.
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.
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:)