0

I used an Arduino Uno on my project to produce a frequency greater than 35000Hz and the output of digital pin was connected to the ultrasonic transmitter circuitry:

enter image description here

However, it's not working on the transmitting side. Here's the Arduino code:

void setup()
{
    Serial.begin(9600);
}

void loop()
{
    pinMode(13,OUTPUT);
    pinMode(12,OUTPUT);
    int pirSenses = analogRead(A1);
    int pirOuts=11;
    pinMode(pirOuts,INPUT); /*PIR sensor 1*/
    int pirSense = analogRead(A0);
    int pirOut = 10;
    pinMode(pirOut,INPUT); /*PIR sensor 2*/
    Serial.println(pirSense);Serial.println(pirSenses);

    if (pirOut || pirOuts == HIGH)
    { /*tone produces ultrasonic frequency*/
        delay(8000);
        tone(13, 50132); delay(100); noTone(13); delay(10);
        tone(13,54621);  delay(50);  noTone(13); delay(50);
        tone(13,35689);  delay(60);  noTone(13);
    } 
    else if (pirOut||pirOuts==LOW)
    {
        tone(13, 50132); delay(100); noTone(13); delay(10);
        tone(13,54621);  delay(50);  noTone(13); delay(50);
        tone(13,35689);  delay(60);  noTone(13);
    } 
    else
    {}
}

And the transmitter (model "MCPCT-G5100-4139") specification:

enter image description here

Please help me with this problem. Thanks!

3
  • 1
    How do you know it's not working. First try it with an audible frequency.
    – Gerben
    Commented Dec 19, 2015 at 13:24
  • You have at most a tiny burst of attempt after more than 8 seconds of other operations and delay. First make it transmit continuously, and either use a scope or check at audio frequency as Gerben suggested. Commented Dec 19, 2015 at 15:02
  • The circuit diagram shows pin 3 but your code uses pin 13 - have you wired it correctly? The code in general makes little to no sense - check it's working with the following: void setup() { pinMode(13, OUTPUT); tone(13, 10000); } void loop() {}. Commented Dec 22, 2015 at 10:48

1 Answer 1

1

Your ultrasonic Transducer driver circuit isn't doing a very good job. At most you are getting only a few milliwatts output to the transducer. Your circuit is applying 12 volts through a 2.2K resistor to the transducer, and your Q1 transistor is merely shorting out the Transducer.

From viewing the data sheet on your transducer, it looks like a tiny loud speaker and not a Piezo device. But that is OK.

Try the following push pull driver circuit. I have tried to keep it simple, but you would need to come up with a PNP transistor (in addition to your existing NPN transistor).

The V2 square wave is your 5 volt output from Arduino.

Also, notice that I have shown the driver circuit using 5 volts, not 12 volts. Using this circuit, if you use 12 volts supply, the output doesn't get any more powerful, and just causes more heating in the transistors.

EDIT 1 : IMPORTANT : Don't leave your output pin in the HIGH state. This turns on transistor Q1 and causes sustained current in the Transducer. To alleviate this, insert a 47uf capacitor in series with the transducer.

EDIT 2 : Changed schematic to include output capacitor.

enter image description here

4
  • What kind of capacitor should I use for this? Electrolytic or polarize capacitor?
    – user13535
    Commented Dec 22, 2015 at 2:03
  • You can use electrolytic. Connect the positive to the transistors emitter.
    – Marla
    Commented Dec 22, 2015 at 2:09
  • what is the function of the 47uF capacitor? do this capacitor function as a high pass filter? thanks
    – user13535
    Commented Jan 16, 2016 at 16:10
  • To block DC from your transducer.
    – Marla
    Commented Jan 16, 2016 at 16:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.