DISTANCE METER HC-SR04 ULTRASOUND SENSOR
Using PIC12F629 and PIC16F628A each drives OLED display and TM1637 4 digits 7 segment LED display.
OLED SSD1306 0.96" screen is driven by software I2C.
With TM1637 LED brightness can be set in the code, value can be 0-7.
The sensor is triggered once every 500mSec. The recomended range is 0.1 to 3 metres.
When switching power on with the link fitted the reading changes to inches. With TM1637 the right digits displays c for cm or i for inch.
Accuracy changes up to 2% depending on air temperature that affect the speed of sound and the frequency of the PIC internal oscillator.
3.7V to 5V CONVERTER
Low power 5V or 9V from 3.7V lithium ion cell. The 5V can power the projects that use LCD, output current up to 10mA. The 9V version can power most digital multimeters that run on PP3, output current up to 5mA. The output voltage is regulated by the zener diode and the output current is limited by the value of L1.
See also Technical Tips
The hex inverter 4049 CMOS are used
as a free running oscillator. BC337 charges the coil when it's
on, and when it's off the coil dumps its charge via the diode 1N4148 into
the output capacitor.
When output voltage exceeds the zener voltage BC337 is switched on and stops the oscillator until output voltage drops below the zener voltage.
Table for selecting components.
||220 - 680 uH
||1 - 2.2 mH
Cmos 4049UB can also be 4049B.
Equivalent to BC337 can be used.
Coil can be the smallest physical size available.
Resistors are 5% tolerance.