# Using Processing for creating a GUI to display Vibration Measurements from an Arduino (using the Grove SW-420 Vibration Sensor)

**URL:** <https://discourse.processing.org/t/using-processing-for-creating-a-gui-to-display-vibration-measurements-from-an-arduino-using-the-grove-sw-420-vibration-sensor/25166>\
**Category:** Electronics (Arduino, etc.)\
**Created:** [November 4, 2020, 3:39am UTC](https://discourse.processing.org/t/using-processing-for-creating-a-gui-to-display-vibration-measurements-from-an-arduino-using-the-grove-sw-420-vibration-sensor/25166 "2020-11-04T03:39:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![AbroChief](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@AbroChief](https://discourse.processing.org/u/AbroChief)\
**Post date:** [November 4, 2020, 3:40am UTC](https://discourse.processing.org/t/using-processing-for-creating-a-gui-to-display-vibration-measurements-from-an-arduino-using-the-grove-sw-420-vibration-sensor/25166/1 "2020-11-04T03:40:00Z")

</div>

Hello everyone. I am creating a project, everything has gone perfect and the task is accomplished. I have fixed a Grove SW-420 vibration sensor and a Grove - LoRa Radio 433MHz Transmitter (acting as the client for sending) in one Arduino and the Grove - LoRa Radio 433MHz Receiver (acting as the server for reception) in the second arduino. When the vibration sensor records any vibration, the vibration measurement is immediately sent by the radio transmitter, to the radio receiver and the led on Pin13 of the 2nd Arduino lights up. I’m also able to get the vibration readings displayed on the serial monitor of the 2nd Arduino.  
Now, being a learner with Processing and Java Programming, all that I want is to create a Graphical user interface on the Processing Platform, which can communicate with the 2nd arduino connected to my PC (to which the receiver is connected) and graphically represent the vibration readings through a graph. I also want the GUI to light up a virtual led (not on the Arduino board) on the monitor screen, as soon as a vibration measurement is encountered by the receiver.

_Someone’s help and guide regarding this would be very beneficial for me. Please someone._  
_… Share your knowledge._

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [November 4, 2020, 6:15am UTC](https://discourse.processing.org/t/using-processing-for-creating-a-gui-to-display-vibration-measurements-from-an-arduino-using-the-grove-sw-420-vibration-sensor/25166/2 "2020-11-04T06:15:21Z")

</div>

Just to be clear: what you are trying to do is to create a Java app that runs on your pc and displays Arduino data that you are currently reading with Serial Monitor in the Arduino IDE. Is this correct? ie no Android device involved. Not as a final solution, but have you used Arduino IDE’s Tools/Serial Plotter to see what a graph of your data would look like?

---

<div class="post-metadata">

**Author:** ![AbroChief](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@AbroChief](https://discourse.processing.org/u/AbroChief)\
**Post date:** [November 4, 2020, 10:17am UTC](https://discourse.processing.org/t/using-processing-for-creating-a-gui-to-display-vibration-measurements-from-an-arduino-using-the-grove-sw-420-vibration-sensor/25166/3 "2020-11-04T10:17:04Z")

</div>

> [@svan](#):
>
> Just to be clear: what you are trying to do is to create a Java app that runs on your pc and displays Arduino data that you are currently reading with Serial Monitor in the Arduino IDE. Is this correct?

Yes, absolutely correct.  
I also want the GUI to light up a virtual led on screen immediately when the Vibration is received by the radio receiver.

> [@svan](#):
>
> but have you used Arduino IDE’s Tools/Serial Plotter to see what a graph of your data would look like?

Yes, I just now used the serial plotter of the second arduino, to see how the graph looks like. But this is very unexpected and the graph is bizzare. And, this is how it looks like:

 ![LoRa Receiver_Serial Plotter](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/a/a2ac3e5e203a48c35fdc2cf49f704402f78d49ca.png)  
Whereas, I want a suitable and understandable graph in the GUI of Processing.

If you want to see my transmitter and receiver sketches, I could give them… Kindly assist me… Its urgent.

---

<div class="post-metadata">

**Author:** ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Post date:** [November 4, 2020, 11:27am UTC](https://discourse.processing.org/t/using-processing-for-creating-a-gui-to-display-vibration-measurements-from-an-arduino-using-the-grove-sw-420-vibration-sensor/25166/4 "2020-11-04T11:27:07Z")

</div>

You’ll want to take a look at controlp5 or g4p which can be found in the processing app. If you click on` tools > add tool` then select libraries tab you’ll find them there. G4P comes with with a gui builder which can be accessed after install by going back into `tools > G4P Builder`.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/8/8e492a71c33efc652c9cb28cb7144f21bb4301c4.png)

---

<div class="post-metadata">

**Author:** ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Post date:** [November 4, 2020, 11:30am UTC](https://discourse.processing.org/t/using-processing-for-creating-a-gui-to-display-vibration-measurements-from-an-arduino-using-the-grove-sw-420-vibration-sensor/25166/5 "2020-11-04T11:30:27Z")

</div>

alternatively you can write your own gui classes, however this usually takes a fair bit of time. These are well established libraries they are both very well documented and G4P’s creator is active on this forum.

---

<div class="post-metadata">

**Author:** ![AbroChief](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@AbroChief](https://discourse.processing.org/u/AbroChief)\
**Post date:** [November 4, 2020, 11:31am UTC](https://discourse.processing.org/t/using-processing-for-creating-a-gui-to-display-vibration-measurements-from-an-arduino-using-the-grove-sw-420-vibration-sensor/25166/6 "2020-11-04T11:31:20Z")

</div>

Wow… Is it @paulgoux sir?  
Can I insert there whatever I want? Such as, if I want virtual LEDs and clear vibration sensor measurement graphs…

---

<div class="post-metadata">

**Author:** ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Post date:** [November 4, 2020, 11:36am UTC](https://discourse.processing.org/t/using-processing-for-creating-a-gui-to-display-vibration-measurements-from-an-arduino-using-the-grove-sw-420-vibration-sensor/25166/7 "2020-11-04T11:36:04Z")

</div>

Unsure… those are just aimed at gui creation so windows, buttons, sliders, menus, events and clicks etc. You could try those and add this one which is aimed at data visualisation, and combine it with one of the above to get the effect you are looking for.

> **[giCentre utilities — giCentre](https://www.gicentre.net/utils)**

also here is a link to other libraries in processing which may be useful

> **[Libraries \\ Processing.org](https://processing.org/reference/libraries/)**
