Shop OBEX P1 Docs P2 Docs Learn Events
Is it possible?? — Parallax Forums

Is it possible??

TCTC Posts: 1,019
edited 2013-02-01 12:17 in BASIC Stamp
I would like to do some lighting for my custom computer case, and I would like to have the BS2 control the LED’s. But I would like for them to be based on CPU frequency. What I mean is when the CPU is at idle (1.6GHz) the led’s would do a fade on, off pattern. But when the CPU boosts (4.5GHz) the led’s would do a different pattern.

Now making the BS2 do the patterns is already done, my problem is knowing how to read the frequency of the CPU, and how could I do it without doing anything to the CPU or the motherboard.

Thanks for your time and input.

Comments

  • PliersPliers Posts: 280
    edited 2013-02-01 05:05
    You can get many of the computers vital signs via a Visual Basic program. Then VB can send that information to your BS2 via serial link.
    Here is an example for getting CPU speed. I found it on the WEB
    [COLOR=#333333]Private Function GetCPUSpeed() As Long
    [/COLOR]Dim hKey As Long   
    Dim CPUSpeed As Long   
    Call RegOpenKey(HKEY_LOCAL_MACHINE, sCPURegKey, hKey)                       
    Call RegQueryValueEx(hKey, "~MHz", 0, 0, CPUSpeed, 4)   
    Call RegCloseKey(hKey)       
    GetCPUSpeed = CPUSpeed     
    End Function
    
  • PliersPliers Posts: 280
    edited 2013-02-01 10:46
    Another option would be to monitor the CPU fan speed using an IR emitter and detector.
    I think the fan speeds up when the CPU is running faster.
    You would not need the BS2 to control the LEDs.


    Another Idea.....
    Monitor the power supply current. The higher the current the brighter the LEDs.
  • SRLMSRLM Posts: 5,045
    edited 2013-02-01 11:33
    You could use a thermocouple on the CPU to measure the temperature, and from there get the (implied) clock speed. My computer idles at about 42C, but when it's working it almost instantly jumps up to 50C+.
  • TCTC Posts: 1,019
    edited 2013-02-01 12:17
    Thank you Pliers for the VB info, I am going to have to check that out. I cant use the fan idea, my CPU is water cooled. I like the current idea :smile: I could use that to monitor the CPU and my video cards. You really got me thinking now MUAHAHAHA!!!!

    Thank you SRLM, I thought of doing that, but since my CPU is water cooled it would make it a little hard to get an accurate reading.
Sign In or Register to comment.