Posted on behalf of student
Student is using Science Buddies kit
Project: https://www.sciencebuddies.org/science- ... c-feedback
---------------------------------
I am doing the Ultrasonic Haptic Project.
I followed all the instructions and bought all the listed parts. But no vibration is coming out of the transducer. What are common problems and their solutions.
To try and give more detail, I followed the tutorial provided by Science Buddies to build the circuit and I also downloaded the code straight from their website only changing the numPulses variable (which my science fair is focused on). See images provided below.
Ultrasonic Haptics project help
Moderators: kgudger, bfinio, MadelineB, Moderators
-
amyCC
- Site Admin
- Posts: 405
- Joined: Wed Apr 01, 2020 4:02 pm
- Occupation: Moderator
- Project Question: *
- Project Due Date: *
- Project Status: Not applicable
-
bfinio
- Expert
- Posts: 964
- Joined: Mon Aug 12, 2013 2:41 pm
- Occupation: Lead Staff Scientist, Science Buddies
- Project Question: Expert
- Project Due Date: n/a
- Project Status: Not applicable
Re: Ultrasonic Haptics project help
Hello,
Your H-bridge does not have power. Carefully look at FIgure 4 in the project procedure:
https://www.sciencebuddies.org/science- ... c-feedback
and notice how the wire going to the lower left corner of the H-bridge (H-bridge pin
is going to the power (red) bus.
In your picture, the orange jumper wire on the left side (breadboard row 17) is going to the ground bus, and it should be going to the power bus.
I believe everything else looks correct - let us know if that fixes the problem.
Your H-bridge does not have power. Carefully look at FIgure 4 in the project procedure:
https://www.sciencebuddies.org/science- ... c-feedback
and notice how the wire going to the lower left corner of the H-bridge (H-bridge pin
In your picture, the orange jumper wire on the left side (breadboard row 17) is going to the ground bus, and it should be going to the power bus.
I believe everything else looks correct - let us know if that fixes the problem.
-
misobower123
- Posts: 14
- Joined: Mon Oct 06, 2025 2:40 pm
- Occupation: Student
Re: Ultrasonic Haptics project help
Hello,
Please see images of my circuit and code. (the motor driver now has power)
The "on" LED on my arduino is on, i verified and uploaded the code. How do I make sure the Arduino is "producing" the frequencies?
I know the arduino shown is an R4 but i have since switched to an R3. How would i change the code to use the tone fonction if that would be easier than the current code.
[Administrator note / linked images have been attached directly.]
Please see images of my circuit and code. (the motor driver now has power)
The "on" LED on my arduino is on, i verified and uploaded the code. How do I make sure the Arduino is "producing" the frequencies?
I know the arduino shown is an R4 but i have since switched to an R3. How would i change the code to use the tone fonction if that would be easier than the current code.
[Administrator note / linked images have been attached directly.]
-
misobower123
- Posts: 14
- Joined: Mon Oct 06, 2025 2:40 pm
- Occupation: Student
Re: Ultrasonic Haptics project help
My code for the Arduino Uno R3
const int trigPin = 3;
const int delayTime = 10;
const int numPulses = 100;
const int digitalWriteTime = 2;
const int offTime = 2*(digitalWriteTime+delayTime)*numPulses;
const float frequencymod = 208.33;
void setup() {
pinMode(trigPin,OUTPUT);
}
void loop() {
for(int i=0; i<numPulses; i++){
tone(trigPin, 40000);
delayMicroseconds(delayTime);
tone(trigPin,frequencymod);
delayMicroseconds(delayTime);
}
delayMicroseconds(offTime);
}
My code keeps giving me errors that. Every time I solve one another one pops up.
I tried to DIY it because the original was not working. I don't know if I made it worse or better.

Thank you
const int trigPin = 3;
const int delayTime = 10;
const int numPulses = 100;
const int digitalWriteTime = 2;
const int offTime = 2*(digitalWriteTime+delayTime)*numPulses;
const float frequencymod = 208.33;
void setup() {
pinMode(trigPin,OUTPUT);
}
void loop() {
for(int i=0; i<numPulses; i++){
tone(trigPin, 40000);
delayMicroseconds(delayTime);
tone(trigPin,frequencymod);
delayMicroseconds(delayTime);
}
delayMicroseconds(offTime);
}
My code keeps giving me errors that. Every time I solve one another one pops up.
I tried to DIY it because the original was not working. I don't know if I made it worse or better.
Thank you
-
bfinio
- Expert
- Posts: 964
- Joined: Mon Aug 12, 2013 2:41 pm
- Occupation: Lead Staff Scientist, Science Buddies
- Project Question: Expert
- Project Due Date: n/a
- Project Status: Not applicable
Re: Ultrasonic Haptics project help
Hello - a few things:
1. Unfortunately, unless you have access to an oscilloscope (which lets you view a graph of voltage on an Arduino pin), there's no easy way to tell whether the pin is actually producing the signal. One possible option would be to connect an LED with a current-limiting resistor (see our Arduino tutorial series) directly to the pin, instead of connecting it to an H-bridge, and you should see the LED light up when the signal is on.
2. One of your pictures did not attach properly in your last message, so I'm not sure what you had there.
3. See procedure step 2a for using an R3, but here is a hint for the loop section of your code. You do not need the for loop at all - that was for manually turning the pin on and off to generate the ultrasonic signal on the R4.
loop{
tone(trigPin, 40000); // this turns the ultrasonic signal on at 40kHz
delay(onTime); // this leaves the ultrasonic signal
// on for onTime milliseconds
noTone(trigPin); // this turns the ultrasonic signal off
delay(offTime); // this leaves the signal off for offTime ms
}
You can adjust the onTime and offTime variables to adjust the modulation frequency and duty cycle.
1. Unfortunately, unless you have access to an oscilloscope (which lets you view a graph of voltage on an Arduino pin), there's no easy way to tell whether the pin is actually producing the signal. One possible option would be to connect an LED with a current-limiting resistor (see our Arduino tutorial series) directly to the pin, instead of connecting it to an H-bridge, and you should see the LED light up when the signal is on.
2. One of your pictures did not attach properly in your last message, so I'm not sure what you had there.
3. See procedure step 2a for using an R3, but here is a hint for the loop section of your code. You do not need the for loop at all - that was for manually turning the pin on and off to generate the ultrasonic signal on the R4.
loop{
tone(trigPin, 40000); // this turns the ultrasonic signal on at 40kHz
delay(onTime); // this leaves the ultrasonic signal
// on for onTime milliseconds
noTone(trigPin); // this turns the ultrasonic signal off
delay(offTime); // this leaves the signal off for offTime ms
}
You can adjust the onTime and offTime variables to adjust the modulation frequency and duty cycle.

