I have a Madison Optical Level switch that I'm trying to wire up but can't seem to get it to work.
The sticking on it says:
Supply Voltage: 5 to 12VDC
Supply Current: 15ma
The following diagram was also included (ignore RLED, as it's an option I don't have):
I wired the Red to +5 with a 330 ohms resistor, the Green to a digital input pin, and the Blue to ground. This however is not working.
I'm wondering if its because I put a resistor in? I was thinking it uses a LED.... and didn't want to fry it but I may be way off.
I must be a bit confused, I read it as:
If the level switch is on the Green wire connects with the Red wire (5V) making it HIGH.
If the level switch is off the Green wire connects with the Blue wire (GND) making it LOW.
I'm not sure how I would wire a pull-up resistor into this scenario?
YOur logic makes complete sense, if the 5Volt is connected to the Arduino 5V,.
I'm not sure how I would wire a pull-up resistor into this scenario?
I mentioned the pull up as I do not know if your sensor is feeded by the 5V of the Arduino itself or if it has a separate power supply. The pullup should be between the Arduino 5V and the green line.
You should be able to test this sensor with an -- LED -- 220ohm -- between GReen and blue.
Hurray it's not broken, I got the led to light up by putting it between Green and Blue. Saidly though i'm even more confused on how to wire this to arduino now...
So im thinking a 10K pulldown resistor between Green and Blue?
No point in doing this, it will not change anything.
Simply green to arduino input, red to arduino +5V, blue to arduino ground.
If that doesn't work then you have either wired it up wrong or there is some error in the sketch you have in the arduino reading the input pin. Try posting what you have (use the # icon to surround your code with the right HTML to put it in a box)