Hey folks,I've been lurking on the listserv for a while, heard about this group at Code PalPOUsa last March. I'm a software engineer by trade, but kind of a newb at hardware stuff. I've got a project I'm working on right now where I want to turn this rotary switch (datasheet here) at something like 60 to 120 rpms while I'm pressing a button. I only need to run this for short bursts, not for hours on end. I'm somewhat limited in space and weight (and cost), and that will need to include the power supply -- which means I'm probably restricted to DC motors only. The real kicker is that this switch requires about 25 in-lbs of torque to overcome the resistance of its detents.Anyone have any suggestions? I need to wrap this project up by Labor Day weekend, so I can't afford much lead time on ordering parts. Bonus points if your suggestion is easily attached to this switch's flatted shaft (dimensions given in the datasheet).Thanks,-- Joe Ibershoff
Not sure if this applies but if you are working with a cordless drill motor, and have removed the chuck, the shaft you are left with has an unusual property… the inner thread on the shaft (Used to attach the chuck)is reverse threaded… just an fyi from my battlebot days… (I used a ton of DeWalt Hammerdrill motors… still boxes of the motor/planetary gear components in the basement
The information transmitted is intended only for the person or entity to which it is addressed and may contain CONFIDENTIAL material. If you receive this material/information in error, please contact the sender and delete or destroy the material/information.

// constants won’t change. They’re used here to
// set pin numbers:
const int buttonPin = 2; // the number of the pushbutton pin
const int RelayPin = 3; // the number of the Relay pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
int relayState = 0; // relay is off at start
void setup() {
// initialize the Relay pin as an output:
pinMode(RelayPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}
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) {
// change relay state
// see if relay is on or off:
if (relayState == HIGH) {
digitalWrite(RelayPin, HIGH);
relayState = 0;
// if relay is on, turn it off
// counterintuitive, but HIGH turns relay off
}
else {
digitalWrite(RelayPin, LOW);
relayState = 1;
// if relay is off, turn it on
// counterintuitive, but LOW turns relay on
}
delay(250);
// debounce
}
}



#include <Bounce.h> // http://www.arduino.cc/playground/Code/Bounce #include "SeeeduinoRelay.h" // Pin definitions for four buttons connected to the Arduino for testing. #define Button1pin 8 #define Button2pin 9 #define Button3pin 10 #define Button4pin 11 // Define "bounce" objects for input buttons. // Bounce is really nice, you should use it. // http://www.arduino.cc/playground/Code/Bounce Bounce Button1 = Bounce(Button1pin, 5); Bounce Button2 = Bounce(Button2pin, 5); Bounce Button3 = Bounce(Button3pin, 5); Bounce Button4 = Bounce(Button4pin, 5); SeeeduinoRelay RELAY1 = SeeeduinoRelay(1,LOW); SeeeduinoRelay RELAY2 = SeeeduinoRelay(2,LOW); SeeeduinoRelay RELAY3 = SeeeduinoRelay(3,LOW); SeeeduinoRelay RELAY4 = SeeeduinoRelay(4,LOW); void setup() { // Setup input pins pinMode(Button1pin, INPUT); digitalWrite(Button1pin, HIGH); // Activate internal pullup pinMode(Button2pin, INPUT); digitalWrite(Button2pin, HIGH); // Activate internal pullup pinMode(Button3pin, INPUT); digitalWrite(Button3pin, HIGH); // Activate internal pullup pinMode(Button4pin, INPUT); digitalWrite(Button4pin, HIGH); // Activate internal pullup Serial.begin(9600); Serial.println("Ready"); } // This is the demo loop. Check state of each button, toggle relay // and print out status of relays. void loop() { if (Button1.update() ) { if (Button1.read() == LOW) { Serial.print("Button #1 pressed: "); Serial.print("Relay #1 state was "); Serial.print(RELAY1.state()); RELAY1.toggle(); Serial.print(", now relay is "); Serial.println(RELAY1.state()); if (RELAY1.isRelayOn()) Serial.println("Relay #1 is on"); if (RELAY1.isRelayOff()) Serial.println("Relay #1 is off"); } } if (Button2.update() ) { if (Button2.read() == LOW) { Serial.print("Button #2 pressed: "); Serial.print("Relay #2 state was "); Serial.print(RELAY2.state()); RELAY2.toggle(); Serial.print(", now relay is "); Serial.println(RELAY2.state()); if (RELAY2.isRelayOn()) Serial.println("Relay #2 is on"); if (RELAY2.isRelayOff()) Serial.println("Relay #2 is off"); } } if (Button3.update() ) { if (Button3.read() == LOW) { Serial.print("Button #3 pressed: "); Serial.print("Relay #3 state was "); Serial.print(RELAY3.state()); RELAY3.toggle(); Serial.print(", now relay is "); Serial.println(RELAY3.state()); if (RELAY3.isRelayOn()) Serial.println("Relay #3 is on"); if (RELAY3.isRelayOff()) Serial.println("Relay #3 is off"); } } if (Button4.update() ) { if (Button4.read() == LOW) { Serial.print("Button #4 pressed: "); Serial.print("Relay #4 state was "); Serial.print(RELAY4.state()); RELAY4.toggle(); Serial.print(", now relay is "); Serial.println(RELAY4.state()); if (RELAY4.isRelayOn()) Serial.println("Relay #4 is on"); if (RELAY4.isRelayOff()) Serial.println("Relay #4 is off"); } } }