I hope this is the right place to ask - it's not really an arduino question, more about reverse engineering. I have a rowing machine with pretty rubbish computery widget thing for counting strokes, timing the session etc (no, I'm not hacking a super cool concept2 urgo unfortunately - probably wouldn't need to). As far as I can make out, it counts the number of times the seat passes back and forth over a little something-or-other on the base. I'm guessing it's some kind of reed switch - I need to have a closer look. There's a cable the seems to connect the lcd computer with the somthing-or-other. I can't tell for sure as the only places you see it is where it pop out the bottom of the machine and is joined by what looks like a standard headphone jack socket/connector - the cable looks like little more than beefy speaker cable. There's no direct access the either actual endpoint of the cable, so I have no idea what the something-or-other is.
Basically I was hoping to hijack the jack, and connect an arduino in there to count the strokes instead, and pass those on via a serial connection to a laptop with a snazzier interface. I don't know a lot about reed switches, but I'm trying to work out what the cable will be doing and how I can read that from the board. I'm guess there must be a current going down the cable that forms a circuit every time the seat activates the switch?!? Should I just put a multimeter across the other side of the jack socket to see what voltage is currently going down the cable and try to replicate that - I can't even remember what batteries are in the current lcd computery thing. I would assume I'll need some resistors to get the voltage from the arduino down. Is looking at the current input the only way I'm likely to know what I should be chucking at the reed switch? As I said, all I can see of what I'm guessing is a reed switch is a little knobbly bit sticking out of the base. I guess i could see if the computer registers anything if I pass a magnet or piece of metal over it.
Sorry I know it's all a bit vague, but it's currently up in the loft, so I can't even get any pics to clarify. Thanks in advance for anyone's thoughts.
I have done exactly what you suggest, with a cheap row ergometer.
Hijached the signal from the reed switc, and read it with and Arduino, and for every two "clicks" of the switch i send a signal to a PC that keeps count of strokes, and time.
I made the PC program so it keeps track of serveral peoples training sessions and you can start by setting it up to for instance "i want to try to beat my own personal best for a 20 minute session on level 3"
Or i want to beat the overall best for a 30 minute session at level 4
(my machine has 5 levels that are manually adjusted on the machine)
The PC app. is programmed in MS Visual Studio (VB) 2005.
If you need any advise just yell
EDIT:
If it is a reed switch, you just hook it up to Arduino as any other switch, but you need to debounce the switch in the Arduino program. Reed switches often has some switch bounce.
wow, how cool is that! thanks for the advice. i'm writing my app in java - i used to do java web stuff, so am tinkering when it comes to desktop apps. had the same idea though. store sessions sessions in a database "race" against personal best, etc...
i'm going to have a closer look at the rower at the weekend. i might get back to you though.
wow, how cool is that! thanks for the advice. i'm writing my app in java - i used to do java web stuff, so am tinkering when it comes to desktop apps. had the same idea though. store sessions sessions in a database "race" against personal best, etc...
i'm going to have a closer look at the rower at the weekend. i might get back to you though.
// read reed switch from rowing machine.
// based on Lady Ada's "debounced blinking bicycle light" code
int switchPin = 2; // switch is connected to pin 2
int val; // variable for reading the pin status
int val2; // variable for reading the delayed/debounced status
int buttonState; // variable to hold the button state
int count=0;
void setup()
{
pinMode(switchPin, INPUT); // Set the switch pin as input
Serial.begin(9600); // Set up serial communication at 9600bps
buttonState = digitalRead(switchPin); // read the initial state
}
void loop()
{
val = digitalRead(switchPin); // read input value and store it in val
delay(5); // 5 milliseconds is a good amount of time
val2 = digitalRead(switchPin); // read the input again to check for bounces
if (val == val2) // make sure we got 2 consistant readings!
{
if (val != buttonState) // the button state has changed!
{
if (val == LOW) // check if the button is pressed
{
count++;
if (count==2)
{
Serial.print('s'); // send stroke signal to PC
count=0;
}
}
}
buttonState = val; // save the new state in our variable
}
}