Advanced AVR 3.0 time management - HC-SR04 Ultrasonic distance measurer test

Channel:
Subscribers:
539
Published on ● Video Link: https://www.youtube.com/watch?v=0humZc4XlTM



Duration: 2:19
2 views
0


Able to measure from 20mm - 4000mm in 3mm-increments means a lot of things;

First the minimal amount of time in resolution to measure it at 3mm is about:
0.003/331=0.000,009,063s === 9us * 2 =18us

Second the maximum amount of time for the maximize 4m distance timing is about:
4/331=0.01208s === 12ms * 2 = 24ms

so the MCU needs to be able to measure time from 18us-24000us; 2x here because sound travels both way.

A MCU clocked in 16MHz has 288 1-clock-cycle CPU instructions in time to do one increment at 9us;
0.000018/(1/16000000)=288;

In the path to develop Advanced AVR 3.0 time management, the HC-SR04 is tested and played with. Control at the lowest level is the key to integrate high time sensitive thing such as the HC-SR04 accurately, effectively and responsively. For starter, the ECHO pin should be connected to the ICP of the AVR timer 1 module. Once configured correctly, timing is done so automatically and this means an AVR MCU running at 16MHz can measure time in increment as low as (1/16000000)=0.0000000625s or 62.5ns.

PS. Most HC-SR04 are controlled by a STC11 MCU, and the firmware can be easily modified to improve its true capability, but it's good enough as-is.




Other Videos By Flyandance


2023-11-12What Juno Advanced AVR Core can do? Demonstrated with Light Tower 3.0
2023-11-11Light Tower 3.0 - Display mode 1 Demo + Advanced AVR 3.0 time management Nixie tube clock
2023-11-07Light Tower 3.0 Driver creation and Hardware Test - Nixie tube clock AVR High Voltage MCU control
2023-11-06Light Tower 3.0 Assembled - (Hardware preview) Nixie tube clock - Dual High Voltage converter DC-DC
2023-11-03Infinity Ring of Love and Light 1.0 ---- Advanced CD 4017 + NE555 LED chaser
2023-11-02New Kit: Light Tower 2.0X - 10+1 Neon Lamp Chaser 70mA No LED mini transformer CD4017 + NE555
2023-11-01Open box - 4 New PCB - Components - Goodies - 4.5kg - 7 days shipping vis UPS Trade Direct® Air
2023-11-01Advanced AVR 3.0 time management Finalized - Elegant delay code + new HC-SR04 library
2023-10-29Advanced AVR 3 0 time management
2023-10-26Advanced AVR 3.0 time management - Juno Edu 1.0 + HC-SR04
2023-10-25Advanced AVR 3.0 time management - HC-SR04 Ultrasonic distance measurer test
2023-10-17Mini Power supply controller - Universal PWM MCU 5v 12v 5-20v
2023-10-15Light Tower 3.0 - Final Product (PCB preview)
2023-10-14Light Tower 3.0 - Create Silkscreen with Photoshop bitmap
2023-10-13Light Tower 3.0 - The essence of flyandance
2023-10-12Secret of youtube enhanced bitrate Exposed
2023-10-09The art of creating an extremely high quality PCB
2023-10-06OS/HD/SSD -- clone/backup - PNY CS900 240GB SSD Real Test
2023-10-05Perfect Mini Gas Stove - Campingmoon Z23-CB - Water boiling (Short Film)
2023-10-04$15 PNY 240GB SSD Test - CS900
2023-10-03Ultrasonic missquitie sweetie stunner Mark 2 - Capture mosquito alive