Pages: [1]   Go Down
Author Topic: Making a Computer Control Panel  (Read 1216 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I like roller coasters and especially their electro-mechanical control systems. What I'd like to do is to make an operator's control panel for my computer (albeit a lot smaller/simpler). Certainly I'm not the only one who thinks it'd be neat to have a big panel of flashing buttons to do otherwise menial tasks...  I figured this would be rather easy for Arduino so I bought one a few days ago and have been tinkering since then.

The buttons would blink and light up like on a real control panel, but would do typical computer tasks like maybe restart or launch programs. Maybe even an e-stop button that would lock my computer after each use. I plan on integrating in a simple LCD screen too.

Anyone have any guidance on how to do this? Setting up buttons seems straight-forward, assuming I can use the big, high-quality buttons found on real panels (illuminated ones require 24 V for the lights so I'm assuming I'll have to tap an external power source for this). It's the communicating the signals back to the computer in form of a keyboard that I'm struggling with. Or perhaps there's an easier way to have software interpret the signals and convert into tasks/macros? I started off planning to do this by cracking open a USB keyboard but it occurred that if I wanted lights to flash and whatnot it'd be easier to get an Arduino.

Any guidance (or gotchas for using the nice buttons I want to use) will be much appreciated!
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 217
Posts: 13742
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Check Gobetwino, works quite well to start windows apps and run batch files - http://mikmo.dk/gobetwino/ -

Furthermore be sure to read the blink without delay example for all those buttons
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

robtillaart, thanks for the tip. This program looks like it could be very useful in accomplishing what I want to do.

KE7GKP, sorry for being vague. I meant that I want Arduino to control an "operator's panel" for my PC. The buttons would accomplish simplistic tasks on my computer, like I mentioned in my original post. The blinking lights wouldn't be for anything computer-related (yet at least), but instead just periodic blinking for visual effect like the control panel in this video:
You mention the ability to grab info from Windows and process it in Arduino. That's a nifty idea but one that's a little too advanced for me at this stage (my background is mechanical engineering for a reason; electronics have always baffled me smiley).
Logged

0
Offline Offline
Tesla Member
***
Karma: 145
Posts: 9637
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The buttons would accomplish simplistic tasks on my computer, like I mentioned in my original post.

The arduino usually communicates with a pc via a serial port. You will need to develop an application for the pc that listens to the serial port for information from the arduino, then process that information and act upon it. This may be the difficult part of your project that seems to be overlooked.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

0
Offline Offline
Tesla Member
***
Karma: 145
Posts: 9637
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
@zoomkat, that program that robtillaart recommended, gobetwino, appears to be an already worked-out solution to that problem. And isn't "processing" supposed to be able to do some of those things, also?

I haven't used either of those applications, so I can't speak to what they can/can't do. I was just making the point that "magic" just doesn't happen on the pc, some level of programming will be required.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

An update: thanks to the suggestion of using Gobetwino, I was able to do a proof-of-concept that locked the computer with the push of a button. It's a standard pushbutton circuit, and here's the coding:

Code:
#include <SoftwareSerial.h>

#define rxPin 2
#define txPin 3

// set up a new serial port
SoftwareSerial mySerial =  SoftwareSerial(rxPin, txPin);

const int buttonPin = 2;     // the number of the pushbutton pin
const int ledPin =  13;      // the number of the LED pin

// variables will change:
int buttonState = 0;         // variable for reading the pushbutton status


void setup() {
  // initialize the LED pin as an output:
  pinMode(ledPin, OUTPUT);      
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT);
  
  // define serial pins
  pinMode(rxPin, INPUT);
  pinMode(txPin, OUTPUT);
  Serial.begin(9600);
}

void loop(){
  // read the state of the pushbutton value:
  buttonState = digitalRead(buttonPin);

  // check if the pushbutton is pressed.
  // if it is, the buttonState is HIGH:
  
  if (buttonState == HIGH) {    
    // turn LED on:    
    digitalWrite(ledPin, HIGH);  
      
  }
  else {
    // turn LED off:
    digitalWrite(ledPin, LOW);
    
    // LOCKCOMP is the Gobetwino command with the SPRID command
    // for program/cmd line arg. C:\Windows\System32\rundll32.exe User32.dll,LockWorkStation
    Serial.println("#S|LOCKCOMP|[]#");
    
    // prevent more than one command being sent
    delay(3000);
  }
}

Originally I was going to use a sendkeys (sendk) command for the Windows Key+L since this locks the workstation, but apparently the Windows Key is somewhat tricky to send through sendkeys. Anyway, this method is more direct and more elegant than relying on keystrokes.

With that in place, creating additional commands, adding better buttons, and the bells/whistles like flashing indicator lights should be relatively easy. Suggestions are welcome!
« Last Edit: June 25, 2011, 03:37:14 pm by BrandonR » Logged

Pages: [1]   Go Up
Jump to: