Skip to content

Read arduino Serial Data and display it in a Java Swing GUI

License

Notifications You must be signed in to change notification settings

robaldwin9/DHt11JavaMonitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DHt11JavaMonitor

Application reads serial data from Arduino using jSerialComm Java library. This read data is then displayed back to the user in a graphical user interface(GUI).

Translations

  • None Available

Third party libraries

License

  • Do what you want commercial use, and private use are welcome

🏷️ Versions

  1. Version 1.0

✔️ Initial Release

:bug:Incorrectly selecting port

:bug: ​Only attempting connection to port 1x
  1. Version 1.1

    ✔️Fixed Incorrect selection of serial port

    ✔️Retry logic on Serial Port

  2. Version 1.2

    ✔️Add application configuration

    ✔️No longer requires compile to change port

  3. Version 1.3

    ✔️Add additional style configuration

    ✔️Added Logj4 logging for better debugging

    ✔️Added threading

    ✔️ Added configurable temp thresholds, and units​

  4. Version 1.4

    ✔️Added ability to reconnect when controller is removed, and then plugged in again. This will decrease the number of times you have to relaunch the java application

    ✔️Added Optional Air quality sensor MQ-135

    ✔️ Added logging of values on 1 minute intervals so the data can be collected over time

    ✔️ Improved parsing of serial data

    ✔️ Added progress bar that will show whenever the controller is disconnected​

  5. Version 1.5

    ✔️ Added Web socket server

    ✔️ Add example client webpage

  6. Version 1.6

    ✔️ Added Configurable UI, Text data view, Data as bars, data as arcs(like web client)

    ✔️ Much improved local UI graphics options

    ⚠️ BE SURE TO UPDATE CONFIG TO INCLUDE NEW CONFIGURATION OPTIONS

    🐛 Fixed some reconnect issues

    🐛 Made Control connected status more accurate

Feature Documents

Websocket server

UI Configuration Options

🖥️ Build/Load Arduino Sketch

  1. Open Arduino IDE

  2. Go to tools tab, and set your board, processor, and port

  3. Go to file tab, and select open

  4. Use the file explorer to select the tempReaderWriter.ino file

  5. Hit the build/upload button in the Arduino IDE

  6. Ensure your pins for you sensor match what is commented in the Arduino sketch

    1. GND
    2. PWR
    3. pin 2 is the data pin
  7. Open Arduino serial monitor, and temperature, and humidity are being published

  8. Ensure you close serial monitor, and any other applications that use serial communication with the Arduino before launching the GUI.

💻 Build Java Code

  1. Install maven if you have not already

  2. Ensure JAVA_HOME environment variable is set correctly.

    • windows: echo %JAVA_HOME%

    • Linux: echo $JAVA_HOME

  3. Ensure that the maven bin directory is in your system path

  4. 📂 Navigate to the unoTemp directory of the project in you terminal

  5. run mvn clean install

  6. If you get a build error complaining about the java version being 10 you can always adjust the target version in the pom.xml file.

    <plugin>
    	<groupId>org.apache.maven.plugins</groupId>
    	<artifactId>maven-compiler-plugin</artifactId>
    	<version>3.0</version>
    	<configuration>
    		<source>10</source>
    		<target>10</target>
    	</configuration>
    </plugin>

💻 ​Run/Setup Java Application

📂Navigate to target directory:

  • target/unoTemp.jar is your application
  • target/config.properties is your application config

💾 ​ Edit / save your configuration:

  • Ensure you have selected your Arduinos port correctly, or the application will fail to display data.

  • If you change the default colors make sure that they are provided as rgb values

    [0-255][0-255][0-255]

# Serial Port controller is on
serialPort=COM6

Run Application:

  • Launch by double clicking in your explorer

  • Alternatively you can launch from cmd/terminal

    java -jar unoTemp.jar

http://todo-programming.com/img/unoTemp1.PNG

About

Read arduino Serial Data and display it in a Java Swing GUI

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published