Page 1 of 1

Question on the formula for finding the frequency when doing the ultrasonic transmitter project.

Posted: Mon Oct 06, 2025 4:56 pm
by misobower123
Hi I am back again with another question, i am trying to use the provided formula to find the frequency.

periodMS = 4*numPulses*(Delaytime+digitalwritetime)

Frequency(Hz) = 1/periodS

i am using the formula but it is giving me an unrealistic frequency, when i use the variables given in the video the resulting frequency is 208hz. Can you please tell me what i am doing wrong. I created a python script to do it automaticallly maybe i messed that up.

Code:
delayTime = 10
numPulses = 5
digitalWriteTime = 2
offTime = 2*(digitalWriteTime+delayTime)*numPulses

periodMS = 4*numPulses*(delayTime+digitalWriteTime)
periodS = periodMS/1000000
frequency = 1/periodS
print(frequency)

Re: Question on the formula for finding the frequency when doing the ultrasonic transmitter project.

Posted: Mon Oct 06, 2025 5:31 pm
by DauntlessDog12
Hi there,

You may have an error with your units. Are you sure that you want to convert your periodS from periodMS/1000000? If you are referring to milliseconds, you will only want to use periodMS/1000. It also depends on what you want your periodS to be. If, in this case, periodMS = periodS, then 1/(4*5*(2+10)) = 15 hz, which is reasonable. Could you also post the site where you got this formula? The problem may just be from unclear variables. Hope this helps.
-Benjamin

Re: Question on the formula for finding the frequency when doing the ultrasonic transmitter project.

Posted: Mon Oct 06, 2025 6:13 pm
by misobower123
hello thank you very much for your help.

site:https://www.sciencebuddies.org/science- ... c-feedback

I shouldve made it more clear but periodMS is in Microsecond

Re: Question on the formula for finding the frequency when doing the ultrasonic transmitter project.

Posted: Tue Oct 07, 2025 9:09 am
by amyCC
I notice you've posted another thread with this question. I am adding the link here so that experts see that there is another thread. It's always best to keep all questions in one thread.

viewtopic.php?p=77446