Arg. I hate to even ask this, but I'm making about 35 individual projects to use in the field. I need to sense when a bird is at its nest, and I've determined that a distance sensor is the easiest way to do this. Ultrasonic is out merely because of price (price times 35 is a lot of money), so I've directed my attention to Infra-red. I found one that looks good, but I don't quite get the datasheet. It says that the typical draw is 30 mA and the max is 50 mA. However, it also says it could draw as much as 330 mA. Here's a link to the datasheet:
which is right? power consumption is a big issue because I have to run these off batteries. 330 mA is a very high number, and I'm skeptical that it would use that much.
My interpretation of the datasheet is that while peaks of current draw of 330mA are possible, the AVERAGE current draw is typically 30mA (50mA maximum). Think of it like an electronic camera flash. Even though the flash may draw 10A, it doesn't draw 10A all the time and if you average out the current over time between flashes, the average current draw from a power source is much lower.
It sounds like you should design for 30-50mA per sensor with a sizeable capacitor that can provide a 330mA burst of current on demand. A 10uF capacitor (more is better) is recommended by the datasheet.
I've always wondered how people come up with size recommendations for caps. To me, 10uF doesn't sound "sizeable", but then I'm the one asking how to figure it out. Would it matter what kind (electrolytic, ceramic, etc)?
Also, would it just have one leg in the power line of the sensor and one leg to ground? Correct me if I'm wrong, but when first charging it, wouldn't that just short out and possibly damage the pin?
The type of the 10uF capacitor doesn't matter too much. From best to worst: ceramic-->tantalum-->electrolytic. Make sure it's rated for 6.3V or higher.
The recommendation for size comes from the charge storage capacity of capacitors, Q=CV where Q is charge, C is capacitance, and V is voltage across the capacitor. If 330mA of current (0.33 Coulombs of charge per second) flows for 1 microsecond then it requires 330e-9 Coulombs of charge to flow. A 10uF capacitor charged to 5V stores 50e-6 Coulombs of charge, thus it can supply the 330e-9 Coulombs of charge and only decay to 49.67e-6 Coulombs of charge stored, thus its voltage will only decay down to 4.967V. A smaller capacitor would allow the voltage to fall farther away from 5V.
Indeed you would connect one end (the positive end for electrolytic/tantalum, doesn't matter which for ceramic) to the 5V power line of the sensor, the other end to ground. Keep the capacitor as close to the sensor as possible.
When first charging it will appear as a short circuit but that won't damage the sensor. The sensor will just see a voltage that rises slowly from 0V to 5V instead of a voltage that rises quickly.
The type of the 10uF capacitor doesn't matter too much. From best to worst: ceramic-->tantalum-->electrolytic. Make sure it's rated for 6.3V or higher.
Got a link to a 10uF ceramic cap, I'd like to see one before I die.
scrounging saves the day! I happened to have a 10uF electrolytic laying around from an old phone, I think. Thanks for the explanation, I've seen people saying "a so and so uF cap would be good for this but a so and so pF would be good if you did that" and I never got how they figured it out. I kinda thought it was guesstimation. Thanks!
It won't damage the arduino pin powering it to be connected to ground through the cap momentarily? I guess I'd be using the 5V line on the arduino.
Also, just out of curiosity, on the datasheet it says the supply can be from -.3 to 7 volts... how is it going to use negative voltage? seems like an LED wouldn't do anything with it.
The 5V pin from the Arduino can safely power the 10uF momentarily while it charges. It'll be fine.
The -0.3V to 7V range is an absolute maximum range that represents relative safety, but not normal operation. Outside this range you are quite likely to damage the sensor. The sensor does not use negative voltage and for normal operation does expect a supply voltage of about 5V.
Well knock me down, I've always thought that ceramic caps came in only those smaller flat orange/red disc types. I know that there are mylar and various other kind of non-polarized high value caps ( I always thought those old surplus oil filled caps were cool).
I guess I need to find a new search for the bucket list.