There are now 6 pins instead of the 4 on the old connector. This way I don't have to pay attention to component's values. It is by placing the original and new PCB side by side and desoldering theĬomponents from one with a hot air rework station and soldering them back in Soldering one of these new boards takes about 20 minutes. You want to use the cheap ITeadStudio PCB manufacture and get 20pcs for a
Schematic (I've appended an 'E' to the module name), I've used the AtTiny24 in a SOIC14 package with a 12MHz crystal. Then I've designed my own PCB keeping the same component locations The analog part is pretty decent so I will keep all the componentsįirst I've marked exactly where each component was placed on the original PCB In the end I've decided to change the processor and the board so I can improve The 27MHz crystal was unmarked and when I've measured it had almost 1/1000 The whole circuit is made to minimize the cost to extreme. The processor is OTP soĬannot be reprogrammed and there is no easy way to change it and hook another Variable range and cannot be filtered out in software. Returned when there is no obstacle in front. The circuit biggest problem is the false echo pulses which are Which will pass trough the analog 40KHz filter (which has a modest 6db/octaveĪttenuation). A noisy environment will probably produce false pulses There is no attempt to check is that first pulse is part ofĪ 40KHz train of pulses. This can be observed because sometimes only the second First the uP uses polling toĭetect a return pulse. There are several problems with this circuit. The echo pulse to calculate the obstacle distance. In the receiver the echo signal is deasserted and one can measure the width of This time the comparator threshold is also kept low to prevent any spurious After 248us, time to ramp up the +/-10V of the charge-pump, theĨ pulses 40KHz train is produced and then the power is switched off. Retrigger problem when no echo is receivedįalse readings even when triggers are 1s apart (all reflections have died off)Īfter the trigger input is raised the uP detects it and after some 10us powers Random echoes are returned when there is no obstacle in front The echo is longer because of the filter response and multiple reflectionsĮcho when the obstacle has soft surfaces - only some echoes are valid
ARDUINO SIMULATOR WITH HC SR04 FREE
If you want to see them in detail I have saved all traces in VCD format here and you can use the free gtkwave viewer to analyse them. To 2K2 and R11 to 18K) the filter response is shifted to the pulse frequencyĪnd this greatly improves the detection sensitivity.īellow are some waveforms captured from the circuit. Should be but instead it has a 18KHz peak. PSpice and it is not centered at 40KHz as it Together with Q1 as a hysteresis comparator. U2C is a multiple feedback (1st order) pass band filter which isįollowed by another times 8 amplifier (U2B). Receiver side uses LM324 which contains 4 OPAMPs.
The receive and emit circuits areĬontrolled by an EM78P153S chinese microcontroller running at 27MHz. To receive mode the MAX232 power is cut off. Power is onlyĪpplied to this circuit through Q2 some time before and during pulse emissionīecause the internal switching charge-pump is noisy. The transducer isĬonnected between two outputs so it is in fact powered at 20V. +/-10V (which are the normal USART voltages) from 5V. A MAX232 (U3) is cleverly used to produce I wanted to understand why this was happening so the first step was to reverse the HC-SR04 module schematic. Unfortunately when there are no obstacles in front of thisĭetector or when the obstacles don't have hard surfaces then erroneous results The results were pretty accurate for as far as 3-4m distance for Program for an AVR board which displays the distance in cm toĪn obstacle. Once they've arrived, to test them, I wrote a quick C test They are very cheap especially if you buy a dozen you can get them bellow 2$ I have bought several cheap echo location circuits from AliExpress and I'm planning to use them in one of my robotics projects.