Alla dessa läsgafflar har öppen kollektor (Open Collector):fosfor skrev:ajje: Hur menar du med en pull-up? Observera att jag är nybörjade på dettaVarför behövs en sådan? Vad gör den?
Jag läste något om att Arduino har inbyggda pull-ups i sina ingångar, är detta något som alltid är aktiverat?

Notera att de olika gafflarna i familjen har antingen NPN- eller PNP-utgång, och du måste veta vilken sort det är.
För att få saker och ting att fungera måste du ha ett pullup-motstånd (eller om det är PNP-utgång) pulldown:

Hur vet du att Arduino Mega ska ha 2.4V?
Often it is useful to steer an input pin to a known state if no input is present. This can be done by adding a pullup resistor (to +5V), or a pulldown resistor (resistor to ground) on the input. A 10K resistor is a good value for a pullup or pulldown resistor.
There are 20K pullup resistors built into the Atmega chip that can be accessed from software. These built-in pullup resistors are accessed by setting the pinMode() as INPUT_PULLUP. This effectively inverts the behavior of the INPUT mode, where HIGH means the sensor is off, and LOW means the sensor is on.
The value of this pullup depends on the microcontroller used. On most AVR-based boards, the value is guaranteed to be between 20kΩ and 50kΩ. On the Arduino Due, it is between 50kΩ and 150kΩ. For the exact value, consult the datasheet of the microcontroller on your board.
NOTE: Digital pin 13 is harder to use as a digital input than the other digital pins because it has an LED and resistor attached to it that's soldered to the board on most boards. If you enable its internal 20k pull-up resistor, it will hang at around 1.7V instead of the expected 5V because the onboard LED and series resistor pull the voltage level down, meaning it always returns LOW. If you must use pin 13 as a digital input, set its pinMode() to INPUT and use an external pull down resistor.
VIN Supply voltage (7-12V)
GND Ground
5V Supply For External hardware device power supply
3.3V Supply For External low voltage hardware device power supply