I'm working on a project that utilizes a sensor that sends 3.3v 50mA on trigger. The i/o pins on an Arduino can only handle 40mA max though. What is the best way to lower the current to 20-40mA? I attempted creating a current divider by using two resistors in parallel, this resulted in about 33mA and <1v but I can't get a pin to read it, maybe the voltage is too low now? I couldn't find any info on voltage to input pins, does it need to be around 3.3-5v?
Might be better to give details of the sensor: it's likely (or at least, possible) that someone's encountered the same issue before and has a tested solution.
KevinGulling:
I'm working on a project that utilizes a sensor that sends 3.3v 50mA on trigger. The i/o pins on an Arduino can only handle 40mA max though. What is the best way to lower the current to 20-40mA? I attempted creating a current divider by using two resistors in parallel, this resulted in about 33mA and <1v but I can't get a pin to read it, maybe the voltage is too low now? I couldn't find any info on voltage to input pins, does it need to be around 3.3-5v?
Any ideas? Thanks
What sensor are you talking about - put a link to a datasheet, or at least something that can be followed down. The statement "sends 3.3v 50mA on trigger" doesn't really make sense. If you have too much current, limit it with a resistor, but I don't think that's the problem.
Assuming a 5 volt Arduino such as a Uno, doing digitalRead() on an input pin, will return HIGH for voltages over about 3 volts, and LOW for voltages less than that.
"Might be better to give details of the sensor:"
Its RCWL0516 not much data on it that I can find
Turns out that I was just reading the wrong value, and it's *drawing about 6mA not 60mA, so I can plug it directly into the io pin.
Still wondering what the best (and/or simplest) way to lower the amperage without significantly lowering voltage would be though? (A resistor would be simple, but this would lower voltage as well and waste a lot of energy correct? Maybe what I'm thinking just isn't possible without a transistor and external power...).
"will return HIGH for voltages over about 3 volts, and LOW for voltages less than that"
I couldn't find this info for the life of me. I'm sure I overlooked it at some point. Is this true for the Arduino Uno R3 as well as the rest of the family?
It will try output 3.3 V but the voltage will be close to this value only if you do not drain much current. 6 mA in your case. You can drain less, if you drain more you may damage the output (i.e. short circuit to GND). Arduino pin configured as input should have very high input resistance (MegaOhms). But you may put resistor between Arduino input and the device's output - just in case you configure the pin as output by mistake. Anything around 10k should be OK.
KevinGulling:
Turns out that I was just reading the wrong value, and it's outputting about 6mA not 60mA, so I can plug it directly into the io pin.
Whether it is 6 or 60 mA this is almost meaningless without seeing the datasheet.
Usually things are specified as being ABLE to provide (say) 6 mA. But that does not mean that they DO. If the device they are connected to only draws 0.5 mA then that is all it will use. And if the device expects to draw 100mA it will either not work or will damage the 6mA device by effectively presenting a short circuit.
On the other hand there is a type of device that forces a certain current (by raising or lowering the voltage as needed) and it is the curent that indicates the signal level. 4-20mA devices are the sort of thing I am thinking of. If your device is one of those then it needs a special connection to an Arduino.
Robin2:
Whether it is 6 or 60 mA this is almost meaningless without seeing the datasheet
...
...
Arduino specifically states
" Each pin can provide or receive 20 mA as recommended operating condition"
Forgive my ignorance but would that mean that the sensor module is ABLE to provide 6mA since 6mA is the amp draw I'm measuring? and since the Arduino is expecting 20mA that the sensor could be getting damaged? So back to my original question then, but now increasing the amps it can provide by some means, assuming this is true and it's only able to provide 6mA. How would we safely hook this up to the Arduino?
In my experience the best way to find out if the device will be damaged is to test it!
I've ran a few short tests, now I'll leave it on for a few days and see what happens. I'll report back later in the week with my findings. I hope it all works well, because it's pretty neat for around a buck!
Arduino cannot measure current directly. It measures voltage.
Most signals are represented not by current but by voltage. When the device wants to signal something it tries to generate 3.3V on its output pin. It does so by sourcing current. If You connect the pin through resistor to 3.3V it has no work to do - no current sourced. But when you connect it through resistor to ground it mus source enough current to generate 3.3V over the resistor. If the resistor is 100k it will source only 33uA. If it is 1k current will be 3.3mA. But it is limited to 6mA - if you connect the output to GND via 100Ohm resistor it will try to source as much current as possible possibly damaging itself.
Arduino pins can be set as INPUT or OUTPUT. When set as INPUT they will sense voltage applied to them but wil let very little current to pass. So connecting your device to such pins is safe for it. BUT if you configure it as OUTPUT it will try to pull the voltage to 0 or 5V, depending how it is set - again, it will do so by sourcing/sinking current. If you let it sink/source too much you may damage the pin.
" Each pin can provide or receive 20 mA as recommended operating condition"
Don't be silly there is no such specification. Sure it can give out 20mA, but the statement about receiving 20mA is not only wrong it is stupid and shows that the person who wrote it has no idea what they are talking about.
You are not confusing this with sourcing and sinking current are you? This only happens on output pins not input pins.
Grumpy_Mike:
Don't be silly there is no such specification. Sure it can give out 20mA, but the statement about receiving 20mA is not only wrong it is stupid and shows that the person who wrote it has no idea what they are talking about.
You are not confusing this with sourcing and sinking current are you? This only happens on output pins not input pins.
^ This. As an input, the Arduino I/O pins take less than a microamp to drive (with pullups off) and somewhere about 200 microamps maximum with the pullup enabled.
OP is almost certainly confused about the sensors maximum output current, thinking somehow that it requires a certain output current.
KevinGulling:
R, obviously a datasheet would be nice. I can't find one online.
Kevin, can you at least conform that the sensor is an output, and so it drives an Arduino input. That is, that the sensor drives an Arduino input rather than the other way around (an Arduino output driving the "sensor").
BTW. If it really is "the other way around", that would normally be an actuator rather than a sensor.
The sensor you have looks like it's a microwave proximity sensor. It's advantage over a PIR or ultrasonic sensor is that it can sense through low density material like cardboard, wood or plastic. I did find a datasheet, but it had little information, and it was in Chinese.
The module is based on the RCWL-9196 chip. Here is some data I've found on this device:
It is apparent that you do not have much experience with electronic projects, and little understanding of electricity in general. That's fine - everybody has to start somewhere. This module is about in the middle of complexity as far as Arduino sensors go.
Get yourself a meter, a battery, wire, some resistors and a small light bulb or an LED. Experiment with the setup, lighting the bulb, changing it's brightness, and measuring the voltage and current (milliamps) at various places in the circuit. This is the first experiment all my students do, and at the end of it, they have a pretty good understanding of how a circuit works, and what the terms mean.
Once you 'get' that stuff, you'll be ready to use this module, and make contactless switches, motion detectors, and position detectors.