Noob Project

First, I want to apologize for my ignorance. I don't know much about electronics or Arduino - yet!

My plan is this: When my modem is working properly, there's a light on the front that blinks rapidly. When Verizon is throttling my connection (in my opinion) that light goes solid ON. To get it working again, I have to switch off the modem, wait ten second and switch it back on. Problem solved.

I want to program the arduino to watch for that solid light through a wire I'll solder to that led lead. If it's solid for ten minutes, an attached servo with arm attachment will switch it off, wait ten seconds then switch it back on. Repeat.

I know I need to attack this in pieces. So far, I have a simple battery, led, switch circuit through a breadboard. I'm trying to get the arduino to Serial.println when the light is on.

int analogPin = 3;     
connected to analog pin 3
                     
int val = 0;         

void setup()
{
  Serial.begin(9600);          //  setup serial
}

void loop()
{
  val = analogRead(analogPin);    // read the input pin
  Serial.println(val);            
}

I have the wire going from Analog 3 to the positive end of the led. It just returns random numbers. When the light is solid on, the numbers seem to be higher, but I might be imagining that.

I tried a digital pin, too and that also seems to return random results.

Am I even approaching this properly?

Help? Input?

Physically speaking a voltage is a difference between two potentials. So you always need two lines to measure it. One is usually a common ground line connected to GND of both circuits, the other one goes to the analog pin of the arduino.

The common ground sets the reference point to which the arduino will measure the voltage. A small current must flow for it to work.

So you need to identify the GND of your modem (LOW VOLTAGE DC PART!) and connect that to the arduino’s GND. The positive part of the LED can be used for measurement.

You must make sure the voltage is not above 5V. If you have a multimeter (volts, amps, ohms) I’d check that first. If you don’t have one, GET ONE.

modem ---------+
| |
| |
| R1 |<----R2----- arduino
| |
| |
GND --------+

I’d get a 10k potentiometer (R1) to adjust the voltage and a 10k resistor (R2) to protect the arduino’s pin.

In case you need more info ( http://en.wikipedia.org/wiki/Potentiometer ). If you already know about it, no offense intended.

Thanks! I almost understand all of that.

At this point I'm still trying to get it to recognize the LED (or, I guess, the current to the LED) on the breadboard! Baby steps, you know.

I've got the little LED circuit working through the breadboard. I've got a wire from Digital13 to LED pos and a wire from Arduino's Gnd to LED ground. I think that's how it should be. Now I'm working on the code - which I've started again from scratch.

I'm thinking it will be easier if I go digitalRead so I can later count how many HIGHs appear in ten minutes.