Arduino PC Monitor

I'll show you, how to monitor some hardware variables.\r\n\r\n

Jan 31, 2017

99312 views

41 respects

Components and supplies

1

LCD 16x2

1

Jumper wires (generic)

1

Arduino Leonardo

Project description

Code

C# Application

csharp

Arduino Code

arduino

C# Application

csharp

Arduino Code

arduino

Downloadable files

Schematics

Schematics

Comments

Only logged in users can leave comments

Anonymous user

2 years ago

Hi, I followed your instructions and code to the letter. The C# program compiles fine; i can connect to my Arduino. However, all I am getting are 0 degrees for both the CPU and GPU. What am I doing wrong? Thanks!

zakrzu

2 years ago

Hi, Regarding to GPU, you have to set properly your graphics card in this statement if (hardwadre.HardwareType == HardwareType.X) X = GpuNvidia or GpuAti Program has to be run with administrator privileges. This should do the trick with processor. To start program automatically with this privileges you can add this statement: <requestedExecutionLevel level="highestAvailable" uiAccess="false" /> to app.manifest and compile it again.

Anonymous user

2 years ago

Hi Zak, I have an nVidia card. And, I am running the program as admin. Would it be too much to ask for you to post the entire project? Thanks!

apfel

2 years ago

Can anyone upload the Program? I do not have Visual Studio and i can't download it because my Internet is very bad. Please upload it for me. Nice project!

Anonymous user

2 years ago

Hi zakrzu, thank you for your work :) These are my very first steps with an arduino, Visual Studio and the language C# in general. Normally I love to work with AutoIt :P I own the arduino and Visual Studio 2019 for one day and yours, is my first project to play with. And the Level "easy" for the difficulty is an understatement :D It was a pain in the ass to get your project runing...^^ Even if I run Visual Studio as an admin (and so your app too) it shows only 0°C for CPU/GPU :( "(hardwadre.HardwareType == HardwareType.GpuNvidia)" is set. I am using v0.8.0-beta of OpenHardwareMonitor. Can you help me with that problem? And: There is a mistake i your arduino code: ``` if (recieved == '*') { inData.remove(inData.length() - 1, 1); lcd.setCursor(0,0); lcd.print("GPU Temp.: " + inData + char(223)+"C "); inData = ""; if(inData == "DIS") { lcd.clear(); lcd.setCursor(0,0); lcd.print("Disconnected!"); } } ``` If you use > inData = ""; at this position, you will clear "inData" and the next "if" will never read "DIS". You should use the code like this: ``` if (recieved == '*') { inData.remove(inData.length() - 1, 1); lcd.setCursor(0,0); lcd.print("GPU Temp.: " + inData + char(223)+"C "); if(inData == "DIS") { lcd.clear(); lcd.setCursor(0,0); lcd.print("Disconnected!"); } inData = ""; } ``` **EDIT:** Got the Solution for the 0°C problem :) I delete ``` private void Form1_Load(object sender, EventArgs e) { c.Open(); } ``` and add > c.Open(); to ``` public Form1() { InitializeComponent(); Init(); c.Open(); } ``` near the top of your code. Now it is working :) I want to use a Nexion Display and show way more stats... I will try to share my progress. But please be gentle. I'm not familar with this stuff. I will do a lot of mistakes an advanced coder would not do^^

Anonymous user

2 years ago

can you go into more depth how you set up the visual studio, im new to that

Anonymous user

2 years ago

Hi, did you do anything? Made it work? I have problems as well

Anonymous user

2 years ago

would it be possible to modify the program to also include the usage of the CPU and GPU, and the RAM usage(MB)?

Anonymous user

2 years ago

Hey Chris, I've tried to create the program, and it compiles, but it isn't working, as it doesn't show anything on the arduino, could you guide me to make it work, and possibly also add RAM usage/GPU temp?

Anonymous user

2 years ago

Hi PinaTryhard 😊 As soon as I am on my PC, I will upload my code. This should work, because I'm using it right now 😊

Anonymous user

2 years ago

``` using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.IO.Ports; using OpenHardwareMonitor.Hardware; namespace Arduino_PC_Monitor { public partial class Form1 : Form { // static string data; Computer c = new Computer() { GPUEnabled = true, CPUEnabled = true, RAMEnabled = true }; float value1, value2, value3, value4, value5, value6; private BackgroundWorker backgroundWorker1; private ComboBox comboBox1; private Label label1; private Button button3; private Label label2; private Button button5; private Timer timer1; private IContainer components; private StatusStrip statusStrip1; private ToolStripStatusLabel toolStripStatusLabel1; private ComboBox comboBox2; private Label label3; private NotifyIcon notifyIcon1; private SerialPort port = new SerialPort(); public Form1() { InitializeComponent(); Init(); c.Open(); } private void Init() { try { notifyIcon1.Visible = true; port.Parity = Parity.None; port.StopBits = StopBits.One; port.DataBits = 8; port.Handshake = Handshake.None; port.RtsEnable = true; string[] ports = SerialPort.GetPortNames(); foreach (string port in ports) { comboBox1.Items.Add(port); } comboBox1.Text = "COM3"; port.BaudRate = 9600; comboBox2.Items.Add(1000); comboBox2.Text = "1000"; if (!port.IsOpen) { port.PortName = comboBox1.Text; port.Open(); timer1.Interval = Convert.ToInt32(comboBox2.Text); timer1.Enabled = true; toolStripStatusLabel1.Text = "Sending data..."; label3.Text = "Connected"; } } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void Label1_Click(object sender, EventArgs e) { } private void NotifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e) { this.notifyIcon1.Visible = true; this.WindowState = FormWindowState.Normal; } private void button3_Click(object sender, EventArgs e) { try { port.Write("DIS*"); port.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } label3.Text = "Disconnected"; timer1.Enabled = false; toolStripStatusLabel1.Text = "Connect to Arduino..."; // data = ""; } private void button5_Click(object sender, EventArgs e) { try { if (!port.IsOpen) { port.PortName = comboBox1.Text; port.Open(); timer1.Interval = Convert.ToInt32(comboBox2.Text); timer1.Enabled = true; toolStripStatusLabel1.Text = "Sending data..."; label3.Text = "Connected"; } } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void timer1_Tick(object sender, EventArgs e) { Status(); } // private void Form1_Load(object sender, EventArgs e) // { // c.Open(); // } private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker(); this.comboBox1 = new System.Windows.Forms.ComboBox(); this.label1 = new System.Windows.Forms.Label(); this.button3 = new System.Windows.Forms.Button(); this.label2 = new System.Windows.Forms.Label(); this.button5 = new System.Windows.Forms.Button(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); this.comboBox2 = new System.Windows.Forms.ComboBox(); this.label3 = new System.Windows.Forms.Label(); this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components); this.statusStrip1.SuspendLayout(); this.SuspendLayout(); // // comboBox1 // this.comboBox1.FormattingEnabled = true; this.comboBox1.Location = new System.Drawing.Point(13, 25); this.comboBox1.Name = "comboBox1"; this.comboBox1.Size = new System.Drawing.Size(121, 21); this.comboBox1.TabIndex = 0; // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(10, 9); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(66, 13); this.label1.TabIndex = 1; this.label1.Text = "Port wählen:"; this.label1.Click += new System.EventHandler(this.Label1_Click); // // button3 // this.button3.Location = new System.Drawing.Point(222, 24); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(75, 23); this.button3.TabIndex = 2; this.button3.Text = "Trennen"; this.button3.UseVisualStyleBackColor = true; this.button3.Click += new System.EventHandler(this.button3_Click); // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(10, 54); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(47, 13); this.label2.TabIndex = 3; this.label2.Text = "Intervall:"; // // button5 // this.button5.Location = new System.Drawing.Point(141, 24); this.button5.Name = "button5"; this.button5.Size = new System.Drawing.Size(75, 23); this.button5.TabIndex = 4; this.button5.Text = "Verbinden"; this.button5.UseVisualStyleBackColor = true; this.button5.Click += new System.EventHandler(this.button5_Click); // // timer1 // this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // // statusStrip1 // this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripStatusLabel1}); this.statusStrip1.Location = new System.Drawing.Point(0, 114); this.statusStrip1.Name = "statusStrip1"; this.statusStrip1.Size = new System.Drawing.Size(375, 22); this.statusStrip1.TabIndex = 5; this.statusStrip1.Text = "statusStrip1"; // // toolStripStatusLabel1 // this.toolStripStatusLabel1.Name = "toolStripStatusLabel1"; this.toolStripStatusLabel1.Size = new System.Drawing.Size(0, 17); // // comboBox2 // this.comboBox2.FormattingEnabled = true; this.comboBox2.Location = new System.Drawing.Point(13, 70); this.comboBox2.Name = "comboBox2"; this.comboBox2.Size = new System.Drawing.Size(121, 21); this.comboBox2.TabIndex = 6; this.comboBox2.TextUpdate += new System.EventHandler(this.timer1_Tick); // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(140, 75); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(45, 13); this.label3.TabIndex = 7; this.label3.Text = "Warte..."; // // notifyIcon1 // this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon"))); this.notifyIcon1.Text = "Arduino PC Monitor"; this.notifyIcon1.Visible = true; this.notifyIcon1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.NotifyIcon1_MouseDoubleClick); // // Form1 // this.ClientSize = new System.Drawing.Size(375, 136); this.Controls.Add(this.label3); this.Controls.Add(this.comboBox2); this.Controls.Add(this.statusStrip1); this.Controls.Add(this.button5); this.Controls.Add(this.label2); this.Controls.Add(this.button3); this.Controls.Add(this.label1); this.Controls.Add(this.comboBox1); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "Form1"; this.ShowInTaskbar = false; this.Text = "Arduino PC Monitor"; this.WindowState = System.Windows.Forms.FormWindowState.Minimized; this.statusStrip1.ResumeLayout(false); this.statusStrip1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); } private void Status() { foreach (var hardware in c.Hardware) { if (hardware.HardwareType == HardwareType.CPU) { hardware.Update(); foreach (var sensor in hardware.Sensors) if (sensor.SensorType == SensorType.Temperature && sensor.Name.Contains("CPU Package")) { value1 = sensor.Value.GetValueOrDefault(); // System.Diagnostics.Debug.WriteLine("value1: " + sensor.Value.GetValueOrDefault()); } foreach (var sensor in hardware.Sensors) if (sensor.SensorType == SensorType.Load && sensor.Name.Contains("CPU Total")) { value2 = sensor.Value.GetValueOrDefault(); // System.Diagnostics.Debug.WriteLine("value2: " + sensor.Value.GetValueOrDefault()); } foreach (var sensor in hardware.Sensors) if (sensor.SensorType == SensorType.Power && sensor.Name.Contains("CPU Package")) { value3 = sensor.Value.GetValueOrDefault(); // System.Diagnostics.Debug.WriteLine("value3: " + sensor.Value.GetValueOrDefault()); } } if (hardware.HardwareType == HardwareType.GpuNvidia) { hardware.Update(); foreach (var sensor in hardware.Sensors) if (sensor.SensorType == SensorType.Temperature && sensor.Name.Contains("GPU Core")) { value4 = sensor.Value.GetValueOrDefault(); // System.Diagnostics.Debug.WriteLine("value4: " + sensor.Value.GetValueOrDefault()); } foreach (var sensor in hardware.Sensors) if (sensor.SensorType == SensorType.Load && sensor.Name.Contains("GPU Core")) { value5 = sensor.Value.GetValueOrDefault(); // System.Diagnostics.Debug.WriteLine("value5: " + sensor.Value.GetValueOrDefault()); } } if (hardware.HardwareType == HardwareType.RAM) { hardware.Update(); foreach (var sensor in hardware.Sensors) if (sensor.SensorType == SensorType.Load && sensor.Name.Contains("Memory")) { value6 = sensor.Value.GetValueOrDefault(); // System.Diagnostics.Debug.WriteLine("value6: " + sensor.Value.GetValueOrDefault()); } } try { port.Write(value1 + "a" + value2 + "b" + value3 + "c" + value4 + "d" + value5 + "e" + value6 + "f"); } catch (Exception ex) { timer1.Stop(); MessageBox.Show(ex.Message); toolStripStatusLabel1.Text = "Arduino's not responding..."; } } } } } ```

Anonymous user

2 years ago

I've modified this program to show some more values. in my case: - CPU Package Temp - CPU Package Load - GPU Temp - GPU Load - CPU Package Power - RAM Load What question do you have in detail?

Anonymous user

2 years ago

Nice project, Finally I see someone using the LCD with the I2C interface. They are just as inexpensive if not cheaper https://goo.gl/cnSidd

Anonymous user

2 years ago

Can you upload your Visual Studio project to GitHub or a server so it can be downloaded and a lot of hassle is saved. I have never used Visual Studio and this is very confusing lol. Thanks for your project once again

Anonymous user

2 years ago

i cant get c# to compile i am using win 7 x64 vs 2013 tried vs 2017 but would not compile on win 7 can someone email me the compiled exe cchhuummllyy@yahoo.com

oiw

2 years ago

Can I use Arduino Uno?

Anonymous user

2 years ago

I don't know if anyone fallows this after that many years, but can someone explain C# part to me? I have never used from what I assume visual studio and if I tried to paste code in it I just get 16 errors. vainius.steponavicius@gmail.com

Anonymous user

2 years ago

How does it monitor the temp without being plugged into the pc?

Anonymous user

2 years ago

The software reads the values from the sensors that are already on the mainboard. The *.dll from Hardwaremonitor is able to read them and this tool show these values on the Display 😊

Anonymous user

2 years ago

Hi. I don't understand how I should make that C# app. What about Toolstrip, StatusStrip and NotifyIcon? How I should use them? My app is running without errors but everything I can see are COM1 and COM3. No interval, no buttons actions... Can you sen me whole solution please? curikjakub@gmail.com

AROTTER2

2 years ago

I have never used C before and when I copied your C# Code into VisualStudio i get 19 errors and 2 warnings and the Form1.cs is blank. I'm sure I did something wrong, but not sure what. I think it may be when unpacking OpenHardwareMonitorLib.dll. Any thoughts?

Anonymous user

2 years ago

Hi, I am new to arduino, will this work on an Uno rev 3? btw great work.

Anonymous user

2 years ago

I have edited my whole post. I managed to get it working, found the C# app on another site, and got the code onto my arduino mini, connected to pc and it shows text on display. But, Where it says GPU it starts like this: GPU.: I5 7500 *something* Then it scrolls to the left showing cpu temp (that is actually the temp of the gpu), but the second it start scrolling, digit number 2 gets turned into a permanent @, and then it keeps scrolling and shows GTX 1080 Temp 40c etc. Problem is that it shows both cpu and gpu at the GPU TEMP.: ************** At the CPU TEMP.: it says 139 mhzz ***c and that never changes Can all this be due to me using an other serial communication C# app? And not the exact same that you have here? Could you tell me in short (if possible) how i can turn the C# code into an application that will run? Regards Fredrik

Anonymous user

2 years ago

can anyone please send a link to a github repository for the visual studio code that is pre-compiled because i'm new to visual studio and can't seem to get it to show up as shown in the appearance tab of this project.

Anonymous user

2 years ago

Hey, did you find anything? I need help as well. Thnaks

Anonymous user

2 years ago

Well, How can I send any article wirelessly from C # instead of serial port? For example using esp32 or nodemcu

Anonymous user

2 years ago

id like to read the cpu temp ,and let arduino close a relay(extra waterpomp) no need for lcd screen. maybe someone give me some guide lines how to proceed. a'm new at this so forgive me if i dont get it right away. erik

Anonymous user

2 years ago

Is there a way for it to work without the LCD screen adaptor thing

Anonymous user

2 years ago

It's not necessary, but you will have to connect all LCD pins straight to arduino, or you can use SN74HC595N which comes with most kits

Anonymous user

2 years ago

Hi! Nice project, but I have some questions. Are you still active? Thanks

AROTTER2

3 years ago

I have never used C before and when I copied your C# Code into VisualStudio i get 19 errors and 2 warnings and the Form1.cs is blank. I'm sure I did something wrong, but not sure what. I think it may be when unpacking OpenHardwareMonitorLib.dll. Any thoughts?

oiw

3 years ago

Can I use Arduino Uno?

Anonymous user

4 years ago

I don't know if anyone fallows this after that many years, but can someone explain C# part to me? I have never used from what I assume visual studio and if I tried to paste code in it I just get 16 errors. vainius.steponavicius@gmail.com

Anonymous user

4 years ago

Hi! Nice project, but I have some questions. Are you still active? Thanks

Anonymous user

4 years ago

Hi, I am new to arduino, will this work on an Uno rev 3? btw great work.

Anonymous user

5 years ago

can you go into more depth how you set up the visual studio, im new to that

Anonymous user

2 years ago

Hi, did you do anything? Made it work? I have problems as well

20_10_butter

5 years ago

Is there a way for it to work without the LCD screen adaptor thing

Anonymous user

2 years ago

It's not necessary, but you will have to connect all LCD pins straight to arduino, or you can use SN74HC595N which comes with most kits

Anonymous user

5 years ago

can anyone please send a link to a github repository for the visual studio code that is pre-compiled because i'm new to visual studio and can't seem to get it to show up as shown in the appearance tab of this project.

Anonymous user

2 years ago

Hey, did you find anything? I need help as well. Thnaks

Anonymous user

5 years ago

Well, How can I send any article wirelessly from C # instead of serial port? For example using esp32 or nodemcu

tarbear123

5 years ago

How does it monitor the temp without being plugged into the pc?

Anonymous user

2 years ago

The software reads the values from the sensors that are already on the mainboard. The *.dll from Hardwaremonitor is able to read them and this tool show these values on the Display 😊

Anonymous user

6 years ago

Hi zakrzu, thank you for your work :) These are my very first steps with an arduino, Visual Studio and the language C# in general. Normally I love to work with AutoIt :P I own the arduino and Visual Studio 2019 for one day and yours, is my first project to play with. And the Level "easy" for the difficulty is an understatement :D It was a pain in the ass to get your project runing...^^ Even if I run Visual Studio as an admin (and so your app too) it shows only 0°C for CPU/GPU :( "(hardwadre.HardwareType == HardwareType.GpuNvidia)" is set. I am using v0.8.0-beta of OpenHardwareMonitor. Can you help me with that problem? And: There is a mistake i your arduino code: ``` if (recieved == '*') { inData.remove(inData.length() - 1, 1); lcd.setCursor(0,0); lcd.print("GPU Temp.: " + inData + char(223)+"C "); inData = ""; if(inData == "DIS") { lcd.clear(); lcd.setCursor(0,0); lcd.print("Disconnected!"); } } ``` If you use > inData = ""; at this position, you will clear "inData" and the next "if" will never read "DIS". You should use the code like this: ``` if (recieved == '*') { inData.remove(inData.length() - 1, 1); lcd.setCursor(0,0); lcd.print("GPU Temp.: " + inData + char(223)+"C "); if(inData == "DIS") { lcd.clear(); lcd.setCursor(0,0); lcd.print("Disconnected!"); } inData = ""; } ``` **EDIT:** Got the Solution for the 0°C problem :) I delete ``` private void Form1_Load(object sender, EventArgs e) { c.Open(); } ``` and add > c.Open(); to ``` public Form1() { InitializeComponent(); Init(); c.Open(); } ``` near the top of your code. Now it is working :) I want to use a Nexion Display and show way more stats... I will try to share my progress. But please be gentle. I'm not familar with this stuff. I will do a lot of mistakes an advanced coder would not do^^

Anonymous user

6 years ago

would it be possible to modify the program to also include the usage of the CPU and GPU, and the RAM usage(MB)?

Anonymous user

2 years ago

Hey Chris, I've tried to create the program, and it compiles, but it isn't working, as it doesn't show anything on the arduino, could you guide me to make it work, and possibly also add RAM usage/GPU temp?

Anonymous user

2 years ago

I've modified this program to show some more values. in my case: - CPU Package Temp - CPU Package Load - GPU Temp - GPU Load - CPU Package Power - RAM Load What question do you have in detail?

Anonymous user

2 years ago

``` using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.IO.Ports; using OpenHardwareMonitor.Hardware; namespace Arduino_PC_Monitor { public partial class Form1 : Form { // static string data; Computer c = new Computer() { GPUEnabled = true, CPUEnabled = true, RAMEnabled = true }; float value1, value2, value3, value4, value5, value6; private BackgroundWorker backgroundWorker1; private ComboBox comboBox1; private Label label1; private Button button3; private Label label2; private Button button5; private Timer timer1; private IContainer components; private StatusStrip statusStrip1; private ToolStripStatusLabel toolStripStatusLabel1; private ComboBox comboBox2; private Label label3; private NotifyIcon notifyIcon1; private SerialPort port = new SerialPort(); public Form1() { InitializeComponent(); Init(); c.Open(); } private void Init() { try { notifyIcon1.Visible = true; port.Parity = Parity.None; port.StopBits = StopBits.One; port.DataBits = 8; port.Handshake = Handshake.None; port.RtsEnable = true; string[] ports = SerialPort.GetPortNames(); foreach (string port in ports) { comboBox1.Items.Add(port); } comboBox1.Text = "COM3"; port.BaudRate = 9600; comboBox2.Items.Add(1000); comboBox2.Text = "1000"; if (!port.IsOpen) { port.PortName = comboBox1.Text; port.Open(); timer1.Interval = Convert.ToInt32(comboBox2.Text); timer1.Enabled = true; toolStripStatusLabel1.Text = "Sending data..."; label3.Text = "Connected"; } } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void Label1_Click(object sender, EventArgs e) { } private void NotifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e) { this.notifyIcon1.Visible = true; this.WindowState = FormWindowState.Normal; } private void button3_Click(object sender, EventArgs e) { try { port.Write("DIS*"); port.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } label3.Text = "Disconnected"; timer1.Enabled = false; toolStripStatusLabel1.Text = "Connect to Arduino..."; // data = ""; } private void button5_Click(object sender, EventArgs e) { try { if (!port.IsOpen) { port.PortName = comboBox1.Text; port.Open(); timer1.Interval = Convert.ToInt32(comboBox2.Text); timer1.Enabled = true; toolStripStatusLabel1.Text = "Sending data..."; label3.Text = "Connected"; } } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void timer1_Tick(object sender, EventArgs e) { Status(); } // private void Form1_Load(object sender, EventArgs e) // { // c.Open(); // } private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker(); this.comboBox1 = new System.Windows.Forms.ComboBox(); this.label1 = new System.Windows.Forms.Label(); this.button3 = new System.Windows.Forms.Button(); this.label2 = new System.Windows.Forms.Label(); this.button5 = new System.Windows.Forms.Button(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); this.comboBox2 = new System.Windows.Forms.ComboBox(); this.label3 = new System.Windows.Forms.Label(); this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components); this.statusStrip1.SuspendLayout(); this.SuspendLayout(); // // comboBox1 // this.comboBox1.FormattingEnabled = true; this.comboBox1.Location = new System.Drawing.Point(13, 25); this.comboBox1.Name = "comboBox1"; this.comboBox1.Size = new System.Drawing.Size(121, 21); this.comboBox1.TabIndex = 0; // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(10, 9); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(66, 13); this.label1.TabIndex = 1; this.label1.Text = "Port wählen:"; this.label1.Click += new System.EventHandler(this.Label1_Click); // // button3 // this.button3.Location = new System.Drawing.Point(222, 24); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(75, 23); this.button3.TabIndex = 2; this.button3.Text = "Trennen"; this.button3.UseVisualStyleBackColor = true; this.button3.Click += new System.EventHandler(this.button3_Click); // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(10, 54); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(47, 13); this.label2.TabIndex = 3; this.label2.Text = "Intervall:"; // // button5 // this.button5.Location = new System.Drawing.Point(141, 24); this.button5.Name = "button5"; this.button5.Size = new System.Drawing.Size(75, 23); this.button5.TabIndex = 4; this.button5.Text = "Verbinden"; this.button5.UseVisualStyleBackColor = true; this.button5.Click += new System.EventHandler(this.button5_Click); // // timer1 // this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // // statusStrip1 // this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripStatusLabel1}); this.statusStrip1.Location = new System.Drawing.Point(0, 114); this.statusStrip1.Name = "statusStrip1"; this.statusStrip1.Size = new System.Drawing.Size(375, 22); this.statusStrip1.TabIndex = 5; this.statusStrip1.Text = "statusStrip1"; // // toolStripStatusLabel1 // this.toolStripStatusLabel1.Name = "toolStripStatusLabel1"; this.toolStripStatusLabel1.Size = new System.Drawing.Size(0, 17); // // comboBox2 // this.comboBox2.FormattingEnabled = true; this.comboBox2.Location = new System.Drawing.Point(13, 70); this.comboBox2.Name = "comboBox2"; this.comboBox2.Size = new System.Drawing.Size(121, 21); this.comboBox2.TabIndex = 6; this.comboBox2.TextUpdate += new System.EventHandler(this.timer1_Tick); // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(140, 75); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(45, 13); this.label3.TabIndex = 7; this.label3.Text = "Warte..."; // // notifyIcon1 // this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon"))); this.notifyIcon1.Text = "Arduino PC Monitor"; this.notifyIcon1.Visible = true; this.notifyIcon1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.NotifyIcon1_MouseDoubleClick); // // Form1 // this.ClientSize = new System.Drawing.Size(375, 136); this.Controls.Add(this.label3); this.Controls.Add(this.comboBox2); this.Controls.Add(this.statusStrip1); this.Controls.Add(this.button5); this.Controls.Add(this.label2); this.Controls.Add(this.button3); this.Controls.Add(this.label1); this.Controls.Add(this.comboBox1); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "Form1"; this.ShowInTaskbar = false; this.Text = "Arduino PC Monitor"; this.WindowState = System.Windows.Forms.FormWindowState.Minimized; this.statusStrip1.ResumeLayout(false); this.statusStrip1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); } private void Status() { foreach (var hardware in c.Hardware) { if (hardware.HardwareType == HardwareType.CPU) { hardware.Update(); foreach (var sensor in hardware.Sensors) if (sensor.SensorType == SensorType.Temperature && sensor.Name.Contains("CPU Package")) { value1 = sensor.Value.GetValueOrDefault(); // System.Diagnostics.Debug.WriteLine("value1: " + sensor.Value.GetValueOrDefault()); } foreach (var sensor in hardware.Sensors) if (sensor.SensorType == SensorType.Load && sensor.Name.Contains("CPU Total")) { value2 = sensor.Value.GetValueOrDefault(); // System.Diagnostics.Debug.WriteLine("value2: " + sensor.Value.GetValueOrDefault()); } foreach (var sensor in hardware.Sensors) if (sensor.SensorType == SensorType.Power && sensor.Name.Contains("CPU Package")) { value3 = sensor.Value.GetValueOrDefault(); // System.Diagnostics.Debug.WriteLine("value3: " + sensor.Value.GetValueOrDefault()); } } if (hardware.HardwareType == HardwareType.GpuNvidia) { hardware.Update(); foreach (var sensor in hardware.Sensors) if (sensor.SensorType == SensorType.Temperature && sensor.Name.Contains("GPU Core")) { value4 = sensor.Value.GetValueOrDefault(); // System.Diagnostics.Debug.WriteLine("value4: " + sensor.Value.GetValueOrDefault()); } foreach (var sensor in hardware.Sensors) if (sensor.SensorType == SensorType.Load && sensor.Name.Contains("GPU Core")) { value5 = sensor.Value.GetValueOrDefault(); // System.Diagnostics.Debug.WriteLine("value5: " + sensor.Value.GetValueOrDefault()); } } if (hardware.HardwareType == HardwareType.RAM) { hardware.Update(); foreach (var sensor in hardware.Sensors) if (sensor.SensorType == SensorType.Load && sensor.Name.Contains("Memory")) { value6 = sensor.Value.GetValueOrDefault(); // System.Diagnostics.Debug.WriteLine("value6: " + sensor.Value.GetValueOrDefault()); } } try { port.Write(value1 + "a" + value2 + "b" + value3 + "c" + value4 + "d" + value5 + "e" + value6 + "f"); } catch (Exception ex) { timer1.Stop(); MessageBox.Show(ex.Message); toolStripStatusLabel1.Text = "Arduino's not responding..."; } } } } } ```

Anonymous user

2 years ago

Hi PinaTryhard 😊 As soon as I am on my PC, I will upload my code. This should work, because I'm using it right now 😊

Anonymous user

6 years ago

I have edited my whole post. I managed to get it working, found the C# app on another site, and got the code onto my arduino mini, connected to pc and it shows text on display. But, Where it says GPU it starts like this: GPU.: I5 7500 *something* Then it scrolls to the left showing cpu temp (that is actually the temp of the gpu), but the second it start scrolling, digit number 2 gets turned into a permanent @, and then it keeps scrolling and shows GTX 1080 Temp 40c etc. Problem is that it shows both cpu and gpu at the GPU TEMP.: ************** At the CPU TEMP.: it says 139 mhzz ***c and that never changes Can all this be due to me using an other serial communication C# app? And not the exact same that you have here? Could you tell me in short (if possible) how i can turn the C# code into an application that will run? Regards Fredrik

Anonymous user

6 years ago

id like to read the cpu temp ,and let arduino close a relay(extra waterpomp) no need for lcd screen. maybe someone give me some guide lines how to proceed. a'm new at this so forgive me if i dont get it right away. erik

Anonymous user

7 years ago

Hi. I don't understand how I should make that C# app. What about Toolstrip, StatusStrip and NotifyIcon? How I should use them? My app is running without errors but everything I can see are COM1 and COM3. No interval, no buttons actions... Can you sen me whole solution please? curikjakub@gmail.com

apfel

7 years ago

Can anyone upload the Program? I do not have Visual Studio and i can't download it because my Internet is very bad. Please upload it for me. Nice project!

Anonymous user

7 years ago

i cant get c# to compile i am using win 7 x64 vs 2013 tried vs 2017 but would not compile on win 7 can someone email me the compiled exe cchhuummllyy@yahoo.com

cowdude

7 years ago

I double checked the code and I still get this error when compiling. #include <LiquidCrystal_I2C.h> I'm using a 1602 LCD and the Mega 2560

zakrzu

2 years ago

Check if you have appropriate library for LCD.

Anonymous user

8 years ago

Can you upload your Visual Studio project to GitHub or a server so it can be downloaded and a lot of hassle is saved. I have never used Visual Studio and this is very confusing lol. Thanks for your project once again

Anonymous user

8 years ago

Hi, I followed your instructions and code to the letter. The C# program compiles fine; i can connect to my Arduino. However, all I am getting are 0 degrees for both the CPU and GPU. What am I doing wrong? Thanks!

Anonymous user

2 years ago

Hi Zak, I have an nVidia card. And, I am running the program as admin. Would it be too much to ask for you to post the entire project? Thanks!

zakrzu

2 years ago

Hi, Regarding to GPU, you have to set properly your graphics card in this statement if (hardwadre.HardwareType == HardwareType.X) X = GpuNvidia or GpuAti Program has to be run with administrator privileges. This should do the trick with processor. To start program automatically with this privileges you can add this statement: <requestedExecutionLevel level="highestAvailable" uiAccess="false" /> to app.manifest and compile it again.

Anonymous user

8 years ago

Nice project, Finally I see someone using the LCD with the I2C interface. They are just as inexpensive if not cheaper https://goo.gl/cnSidd