Hi,
Currently i'm creating a wearable device using ultrasonic sensor and mcu(atmega328P or attiny85). So
Is it possible to power a ultrasonic sensor HC SR-04 using 1 or 2 coin cell.
please answer. Thank u
dont. sr04+mcu+? need 20mA+ Lithium CR2032 cant deliver that current
I say it's probably possible, but you have to experiment and be very aware of the limitations - mostly the very limited amount of current (10-20 mA) and capacity (~220 mAh for a CR2032 at very low draw, less for higher currents) you have available.
Voltage: there are 3.3V versions of the HC-SR04. I don't know if they will work on 3V, never tried. An ATtiny will work fine at 3V provided it's running at 8 MHz (or less). 6V (two cells) is too much; you could use a diode to bring it down to 5.3V which is OK. Current draw at this voltage is likely to be higher than at 3V, so a setup with two batteries will last shorter than one with a single battery.
Current draw: I've seen 6-15 mA for the HC-SR04 when active, <2 mA (one source even mentions 100 uA) for idle. To save current you may consider connecting Vcc to an output pin, so you can switch it off (set the pin to INPUT; remember to set also both echo and trig to INPUT or at least LOW).
That, plus the ATtiny, will draw peaks of 20 mA. That's a bit much for a 3V coin cell, but you can of course use a capacitor to help out. 220uF or 470 uF and you can handle some serious peaks. That 15 mA of the HC-SR04 is no doubt only when producing the sound pulse, which are 8 very short pulses. Then it listens for the incoming signal, and goes to idle. If the developers are really good they would put the MCU on that thing in deep sleep mode until a new trig signal is received.
Put the Tiny to sleep as much as possible to save power - you can do it while measuring, use a sleep mode that keeps the timers running so you can still measure the input pulse length (have the echo signal trigger an interrupt to wake up).
Come to think of it, a way to limit the peaks the battery sees you may use a capacitor to actually run the contraption of (you will have the whole thing in deep sleep >99% of the time anyway) with a largish resistor in series with the coin cell to slowly add charge so it's ready for the next burst. Whether that works depends of course on what else the ATtiny has to do.
Have a look at more modern ATtinys as well - the '85 is a pretty old design. Good chance that a newer one like the '841 has lower power use.