This particular kit has a special place in my engineering heart. I worked at KEMET during the acquisition of NEC TOKIN. As a result, I spent a significant amount of time in Tokyo, Shiroishi, and Sendai visiting with the engineers of what became known as TOKIN. (I also spent time at the Toyama facility, but they mostly did capacitors.) When I saw this Design Challenge pop-up, I asked if I could get one of the kits to see how the product line came along. I am not competing with the other Vibration Sensor Challengers.
What I found super interesting about the TOKIN products is how they used similar base materials to make a wide range of passive components and sensors. For example, they made PZT-based actuators which are linear micro-movement servo motors. This technology is used for microscope bed positioning and stabilizing camera lenses--among other things.
PZT is a piezoelectric ceramic material made of lead zirconate titanate. It is similar in behavior, though not as "expansive", to barium titanate which is used in the vast majority of ceramic capacitors. So the "piezoelectric" effect that makes ceramic caps sing can be used for movement. Conversely, when these materials vibrate, they generate a voltage.
To be clear, I do not have any inside knowledge of what material is in the VS-Series vibration sensors. Their development happened after my time. The VS-VB203 datasheet says "proprietary Piezo Ceramic Material." But I suspect is some form of PZT since they do continue to carry one of the remaining RoHS exemptions for lead(Pb). (The lead-free alternatives to this material simply do not perform as well!)
Initial Impression
When I got the kit, I did not expect the STM32 Nucleo board and the BLE module. However, the three together gave an idea for a project that I would like to consider in the future. Positive 2020 surprise, for the win! Based on the element14 picture above, I was surprised at how small the vibration sensor is. It measures 12 by 9 mm. For reference, my cutting mat has 1-inch (2.54cm) squares.
Connecting to VS-VB203
The VS-series has two different connector styles available. These both appear to be industry-standard connectors, though not types popular in the hobby community. The included instructions show a clear pinout, with wire colors. That inclusion made swapping in my own 0.1-inch (or 2.54mm) header a piece of cake. Also, imagine receiving a sensor that comes with a paper-instruction sent in multiple colors. How often does that happen today?
The sensor's pins are straightforward: Vin, Vout, and GND. Even though there are four pins, the sensor only uses 3 wires. when working with sensors there fundamentally two different types: analog and digital. Analog sensors output a voltage relative to some physical quantity. Digital sensors provide an interface, like I2C or SPI, to read the sensor's value. KEMET TOKIN's VS-Series outputs an analog voltage, generated by an internal amplifier.
This integrated amplifier is awesome because you can connect it directly to a microcontroller's analog-to-digital converter (ADC). Well, provided the ADC can support the sensor's full-range output. This spec is not a subtle point. With the integrated amplifier, the output swings up to VCC and down to GND with an offset at 50% of VCC. In general, a microcontroller's VCC can safely handle up to its VCC, however, it may not be able to digitize across that range. Do not take this as a negative, just a warning when using it.
For the purpose of this hands-on, I used the STM32 Nucleo that the element14 Community provided. Even though the processor runs at 3.3v (I think), the ADC input is internally scaled such that it can handle the sensor's 5 volt output.
Measuring the TOKIN Vibration Sensor's Output
Measuring the sensor with a multimeter does not make much sense. At first, it seemed like the sensor did nothing when looking at the sensor's output with my Multicomp Pro MP73006 meter. The DMM samples data way too slow for a good measurement. You might even think the sensor isn't very good. (I mean, I certainly did NOT think that for a few seconds! Nope. Nu-huh.)
Since the sensor responds so quickly to vibration, I switched over to viewing signals on a scope. The result was a very distinctive and lively waveform. The sensor was so sensitive, I could use it to visualize sound. In the measurement shown here, the sensor is taped to a table. I placed my phone relatively close. The phone vibrates the table and the vibration sensor picks up that table vibration.
Visualizing Sensor's output with Arduino IDE's Serial Plotter.
I'm going to bypass any discussion around the STM32. I made the mistake of trying to install the STMicro tools and wasted significant amounts of time. If you'd like to see me struggle, check out this clip. [Link to STcube Clip]. Since I don't have a couple of weeks to invest in a completely new toolchain, I decided to use the Arduino IDE to stay productive.
With a little bit of Arduino code, I was able to see my tapping affect the Arduino IDE's Serial Plotter. After that, I tried the same trick we did with the oscilloscope. The serial plotter shows audio waveforms. Even after enabling more bits on the STM32's ADC, I noticed that there was some noise. So I tried a few averaging techniques to clean it up.
Using a modified moving average, I was able to get a real-time boxcar that resulted in a decent looking audio waveform. At THIS point, I would like to go back a step and try the same task with STMicro's tools. I think their dedicated toolchain and ADC-specific information could result in a more efficient averaging algorithm. (I think there is some dedicated DSP hardware that could do the averaging.)
unsigned long sensor_average; const byte average_count=64; void setup() { // put your setup code here, to run once: Serial.begin(57600); //delay(2500); while(!Serial); Serial.println("STM32 Analog Read Test"); analogReadResolution(16); sensor_average = mass_reading(average_count, A0); } unsigned long mass_reading(byte count, int pin) { unsigned long counting_average = 0; for (int x=0; x<count; x++) counting_average += analogRead(pin); return (counting_average / count); } void loop() { // put your main code here, to run repeatedly: // sensor_average = mass_reading(average_count, A0); Serial.print("35000,"); Serial.print(analogRead(A0)); Serial.println(",30000"); //Serial.println(sensor_average); //delay(10); }
Watch the entire sequence
The highlight below is from the Twitch stream. It shows the work I describe above in more detail.
Who is the sensor intended for?
Let's be clear. In small quantities, this high precision sensor costs over 100 USD. It isn't intended to be used in one-off projects. These sensors become inexpensive in high-volume. So if you do not plan to mass-produce a product using it, there are alternatives to consider.
Conclusion
These sensors are one of the few examples of a "vibration" sensor available on the market that isn't MEMS-based. That fact alone made checking out the sensor was a fun live stream activity. It gave me a chance to see what my old friends in Japan were up to. Their sensor, is of course, very impressive. I look forward to seeing what projects it gets incorporated into the element14 Community Design Challenges.
Top Comments