Where do those 85mA come from? I hope you haven't already fried it.
It works exactly like a switch that is normally open (NPN transistor with open collector). You connect the supply voltage to Vcc and GND. It will need about 10mA according to the datasheet. As I assume it will be connected to an arduino directly, Vcc is 5V. Then you take a 'pull-up' resistor (say 10k) and connect that to Vcc and the 'output'. Then connect 'output' to any digital pin on your arduino.
Easiest solution is to connect pin 1 to Arduino +5v, pin 2 to Arduino ground and pin 3 to an Arduino input pin. Enable the internal pullup for that Arduino pin by using digitalWrite to write HIGH to it. Then you don't need an external pullup resistor.
The device is an open-collector output - this means you need a pull-up resistor on the output - you can use the built-in pullups thus:
pinMode (pin, INPUT) ;
digitalWrite (pin, HIGH) ;
If the pin is written as HIGH while an input a 20k or so internal pull-up resistor is enabled on that pin. Alternatively a physical resistor of 5k to 100k will probably work fine (connect from +5V to the signal pin).
Easiest solution is to connect pin 1 to Arduino +5v, pin 2 to Arduino ground and pin 3 to an Arduino input pin. Enable the internal pullup for that Arduino pin by using digitalWrite to write HIGH to it. Then you don't need an external pullup resistor.
How can i read the value if i digitalWrite to HIGH?
And the build in pullup resistor, that is build in the arduino right?
Also what happens if you don't use a pullup resistor, i readed some things about them but it's hard for me to understand.
Why does it show a battery? Do you want to use lemons and zinc/copper nails? If it is plugged into the usb port, you don't need the battery of course. Then you'll get the 5V from the pc.
You have already mentioned in another post that the arduino survives an maximum of 40mA per pin. Now you force 75mA down its throat. Doesn't that ring a bell, maybe?
How to lower it? Use a resistor.
But honestly I'm not quite sure what it is you want to do exactly, and why it would require shorting out a pin by brute force. That's like sticking your hand in a food processor to find out if it is on...
The second is the most popular way of killing an arduino and you seem to be more than willing to conspire in its death.
Do not do things like trying to measure the current from an output with a meter and no load. It implies you have little idea of how electricity works.
Just to make sure, there is voltage coming from arduino pin 4 and the arduino 5V to the output pin of the sensor, and 5V is coming to the Vcc pin of the sensor. (and gnd connected to gnd).
(I want to use the internal pull-up resistor ).
And what is the NPN and all there rear signs around?
And the red triangle in the left bottom corner.
Also i saw on a video that the voltage was depanding on the magnet, so can i use analogRead?
Yes, those connections are correct. You supply 5v to the Hall sensor for its internal circuitry, and the output of the Hall sensor is draws current from +5v through a pullup resistor. You don't need R1 because you are planning to use the internal pullup resistor in the Arduino.
The "NPN" means that the hall sensor output is an open-collector NPN transistor.
Also i saw on a video that the voltage was depanding on the magnet, so can i use analogRead?
Not with this device you can't it is a latching switch sensor. That means when it see a magnetic field the output will go low and stay low until it sees a magnetic field of the opposite polarity. Then it will go high and stay high until it sees a field of the original polarity. Is that what you were expecting?
And the red triangle in the left bottom corner.
Signifies the emitter of the NPN transistor.
I hope your circuit is not actually like this because I don't think you can get a 5V battery.
Yes I am sure you don't need a pull up resistor.
You have a strange idea of what can damage your arduino. You do things that are clearly dangerous then you question what is perfectly safe.
But don't just take my word for it, if anyone says something wrong here ther are plenty of good people that will jump in and disagree.
You don't need R1 because you are planning to use the internal pullup resistor in the Arduino.
Are you sure that i don't fry my arduino or hallway sensor if i don't use a resistor at all (apart from the internal)?
You guys scare me
It is quite safe to leave that resistor out, i.e. just remove it from the schematic (DON'T replace it with a wire!). When you power the circuit up, there will be no pullup resistor present on that pin, but this is OK, the Hall sensor doesn't mind this. During setup() you configure the pin as an input (or leave it configured that way, because it is the default) but digitalWrite HIGH to it, which enables the internal 20k pullup. After that, reading from the pin will give you the high or low reading from the Hall sensor.
Well you can continue to be scared your whole like, and have to get permission and advice (and try and memorize the proper answer for the future) for every wire you hook-up, or you could get serious about learning fundamental DC electronics so that you can understand and answer your own questions in the future.
So your questions should not just ask how to do something, but also why so you can understand the reason the answer is correct.
Well you can continue to be scared your whole like, and have to get permission and advice (and try and memorize the proper answer for the future) for every wire you hook-up, or you could get serious about learning fundamental DC electronics so that you can understand and answer your own questions in the future.
So your questions should not just ask how to do something, but also why so you can understand the reason the answer is correct.