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)
Question on the formula for finding the frequency when doing the ultrasonic transmitter project.
Moderators: AmyCowen, kgudger, bfinio, MadelineB, Moderators
-
misobower123
- Posts: 14
- Joined: Mon Oct 06, 2025 2:40 pm
- Occupation: Student
-
DauntlessDog12
- Student Expert
- Posts: 34
- Joined: Wed Jul 03, 2024 12:32 am
- Occupation: Student
Re: Question on the formula for finding the frequency when doing the ultrasonic transmitter project.
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
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
-
misobower123
- Posts: 14
- Joined: Mon Oct 06, 2025 2:40 pm
- Occupation: Student
Re: Question on the formula for finding the frequency when doing the ultrasonic transmitter project.
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
site:https://www.sciencebuddies.org/science- ... c-feedback
I shouldve made it more clear but periodMS is in Microsecond
-
amyCC
- Site Admin
- Posts: 398
- Joined: Wed Apr 01, 2020 4:02 pm
- Occupation: Moderator
- Project Question: *
- Project Due Date: *
- Project Status: Not applicable
Re: Question on the formula for finding the frequency when doing the ultrasonic transmitter project.
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
viewtopic.php?p=77446

