element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi Projects
  • Products
  • Raspberry Pi
  • Raspberry Pi Projects
  • More
  • Cancel
Raspberry Pi Projects
Blog Wilcoxon PC420V vibration sensor with a Raspberry Pi 5
  • Blog
  • Documents
  • Events
  • Polls
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi Projects to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: mvalencia32
  • Date Created: 20 Jul 2024 11:52 AM Date Created
  • Views 5151 views
  • Likes 5 likes
  • Comments 8 comments
  • i2c interface
  • wilcoxon
  • raspberry pi
  • ads1115
  • data logging
  • vibration
Related
Recommended

Wilcoxon PC420V vibration sensor with a Raspberry Pi 5

mvalencia32
mvalencia32
20 Jul 2024
Wilcoxon PC420V vibration sensor with a Raspberry Pi 5

Vibration analysis is important for any industrial process, as it provides us with a lot of information about the mechanical state of the machines we use. It also allows us to use their signals as interlocks in PLC programming, etc. Therefore, one of my motivations for creating this small blog was to use a Wilcoxon sensor and adapt it to a Raspberry Pi with the idea of being able to view RMS measurements on the screen and log them in a .csv file.

Table of specifications:

Parameter Specification
Sensitivity 100 mV/g
Measurement Range 0 to 0.5 ips (inches per second)
Frequency Response 2.5 to 15,000 Hz (±3 dB)
Resonance Frequency >25 kHz
Transverse Sensitivity <5%
Power Requirement 18-30 VDC
Output Signal 4-20 mA
Operating Temperature -40 to 85 °C
Case Material Stainless Steel
Weight 145 grams (5.1 oz)
Mounting 1/4-28 UNF
Connector 2-pin MIL-C-5015

Pics:

Image 1; 

image

Project Comments:

  1. The Raspberry Pi 5 does not have an ADC, so I had to adapt an ADS1115 (I2C), which has a 16-bit ADC. (Image 2)
  2. The Wilcoxon sensor operates at 12 volts and has a current output of 4 to 20mA. Its datasheet provides a diagram of how to integrate it with a PLC, and using that idea, it is possible to integrate it with the Raspberry Pi 5. (Image 3)

Image 2

image

Image 3

image

Before processing the vibration signal, calibration tests were conducted between the ADS1115 and a reliable multimeter.

imageimage

Example Code to Anaconda Rsbaerry pi5:

import time
import math
import csv
import Adafruit_ADS1x15
import tkinter as tk
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg

adc = Adafruit_ADS1x15.ADS1115(address=0x48, busnum=1)
GAIN = 1
DATA_RATE = 860
V_REF = 4.096
MAX_ADC_VALUE = 32767
RESISTANCE = 120

root = tk.Tk()
root.title("Lectura del ADC ADS1115")
root.geometry("800x600")
root.attributes('-fullscreen', True)

speed_label = tk.Label(root, text="Velocidad (mm/s):", font=('Helvetica', 16))
speed_label.pack(pady=10)

fig = Figure(figsize=(8, 6), dpi=100)
ax = fig.add_subplot(111)
ax.set_title("Tendencia de la Velocidad")
ax.set_xlabel("Tiempo (s)")
ax.set_ylabel("Velocidad (mm/s)")
ax.set_ylim(0, 12)
line, = ax.plot([], [], 'b-')

canvas = FigureCanvasTkAgg(fig, master=root)
canvas.get_tk_widget().pack(fill=tk.BOTH, expand=True)

speed_values = []
time_values = []

start_time = time.time()

csv_file = open('vibration_data.csv', 'w', newline='')
csv_writer = csv.writer(csv_file, delimiter=';')
csv_writer.writerow(['Timestamp', 'Speed (mm/s)'])

def calculate_rms(voltage_values):
square_sum = sum(v ** 2 for v in voltage_values)
rms = math.sqrt(square_sum / len(voltage_values))
return rms

def current_to_speed(current_ma):
if current_ma < 4:
return 0
elif current_ma > 20:
return 12
else:
return ((current_ma - 4) / 16) * 12

def update_values():
voltage_samples = []

for _ in range(86):
adc_value = adc.read_adc(0, gain=GAIN, data_rate=DATA_RATE)
voltage = (adc_value / MAX_ADC_VALUE) * V_REF
voltage_samples.append(voltage)
time.sleep(1 / DATA_RATE)

rms_voltage = calculate_rms(voltage_samples)

current_ma = (rms_voltage / RESISTANCE) * 1000

speed_mm_sec = current_to_speed(current_ma)

speed_label.config(text=f"Velocidad (mm/s): {speed_mm_sec:.6f}")

current_time = time.time() - start_time
speed_values.append(speed_mm_sec)
time_values.append(current_time)

csv_writer.writerow([current_time, speed_mm_sec])

if len(speed_values) > 100:
speed_values.pop(0)
time_values.pop(0)

line.set_data(time_values, speed_values)
ax.set_xlim(min(time_values), max(time_values))
canvas.draw()

root.after(100, update_values)

update_values()
root.mainloop()
csv_file.close()

Results:

Image 2

image

Rasberry Pi Screen:

image

I hope you found this blog entertaining.

Regards

Martin

  • Sign in to reply

Top Comments

  • mvalencia32
    mvalencia32 over 1 year ago in reply to kmikemoo +1
    I have 4 speed sensors of the same model with me. I'm missing some materials to finish integrating them with the Raspberry Pi. The plan is to sample data from a single-phase or three-phase motor and store…
  • michaelkellett
    michaelkellett over 1 year ago in reply to mvalencia32

    Hello, sorry I didn't spot that it had a built in integrator and rectifier.

    The down side of looking only at RMS velocity over a fixed bandwidth is that most of the information from the accelerometer is discarded.

    I had a quick look at the Wilcoxon data sheet and some app notes but they are a bit unclear as to exactly what circuits and filters are inside the sensor.

    I'll be interested in where your project goes next.

    MK

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • kmikemoo
    kmikemoo over 1 year ago in reply to mvalencia32

    EXCELLENT application.  I wish you great success! Thumbsup

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mvalencia32
    mvalencia32 over 1 year ago in reply to kmikemoo

    I have 4 speed sensors of the same model with me. I'm missing some materials to finish integrating them with the Raspberry Pi. The plan is to sample data from a single-phase or three-phase motor and store it, train a model with TensorFlow, and attempt something similar to a digital twin just for fun.

    Ambitious plans, I hope my job allows me the time to execute them.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mvalencia32
    mvalencia32 over 1 year ago in reply to michaelkellett

    Hello, thanks for the advice. The factory vibration sensor already delivers an RMS signal proportional to the speed, so there's no need to apply high sampling frequencies or complex signal processing, since it was designed for field PLCs. Best regards.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • kmikemoo
    kmikemoo over 1 year ago

    Nice project.  What will be its application?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube