Go Down

### Topic: ultrasonic transmitter circuit (Read 8426 times)previous topic - next topic

#### nordbo

##### Jan 11, 2014, 10:25 pmLast Edit: Feb 03, 2014, 07:38 pm by nordbo Reason: 1
Hi.

I have one of these fireplaces which came with a simple remote control that uses ultrasound transmission to adjust the flame hight.

I am trying to build a thermostat for the fireplace, and need to create a circuit which can send ultrasound at 40.5 kHz (adjust flame up) and 40.0 kHz (adjust flame down).

I have found this schematic (se picture below) to create a circuit for transmitting on 40kHz, but i have two challenges:

• Can i somehow modify it to use the 5v power from the Arduino, or do i need to use an external 9v battery?

• Can it be altered so that I can send both 40kHz and 40.5kHz waves? If so, how?

I have a programming background, but i'm totally new to electronics. I would really appreciate any kind of help and tips

Edit: I understand that i can change the frequency by using the variable resistor, but i would like to change it by chaning which pin on the arduino i sent power from. Example:

pin 3 HIGH = 40kHz
pin 4 HIGH = 40.5 kHz

#### MAS3

#1
##### Jan 11, 2014, 10:36 pm
You can change the frequency, that is what VR1 does.
It trims the frequency to get what you want.
I can't tell if it can do a 1.25 % increase of the frequency, but you can if you build this and test it with your fireplace.
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

#### nordbo

#2
##### Jan 11, 2014, 10:38 pm

You can change the frequency, that is what VR1 does.
It trims the frequency to get what you want.
I can't tell if it can do a 1.25 % increase of the frequency, but you can if you build this and test it with your fireplace.

Yes, i understand that, but i want to change it by sending the signal from an other pin on the arduino, not by a physical button.

pin 3 HIGH = 40kHz
pin 4 HIGH = 40.5 kHz

#### Grumpy_Mike

#3
##### Jan 11, 2014, 11:52 pm
Tricky because that circuit uses 9V and the arduino can only handle 5V directly.
You will have to use a PNP transistor to act as a top switch and a NPN transistor to derive the switching voltage ( 0 to 9V) to control the PNP. You need two of these circuits each switching in a pot, which you adjust to get the required frequency. This replaces your switch.

#### jremington

#4
##### Jan 12, 2014, 04:44 am
You could generate the 40 or 40.5 kHz signal with the Arduino, and just use the transistors to amplify it for the transducer. The amplifier circuit you posted is not the best, by the way.

#### polymorph

#5
##### Jan 12, 2014, 06:51 am
Get rid of all that. Use the Arduino to generate the 40kHz or 40.5kHz using something like the tone() library. Drive the ultrasonic transducer with a better driver, that circuit automatically loses about 3V out of 9V, anyway.

Here's one using BJTs to drive a couple of MOSFETs in a configuration that limits shoot-through.

https://www.circuitlab.com/circuit/79azke/mosfetdriver01/
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8

#### nordbo

#6
##### Jan 12, 2014, 11:02 am

Get rid of all that. Use the Arduino to generate the 40kHz or 40.5kHz using something like the tone() library. Drive the ultrasonic transducer with a better driver, that circuit automatically loses about 3V out of 9V, anyway.

Here's one using BJTs to drive a couple of MOSFETs in a configuration that limits shoot-through.

https://www.circuitlab.com/circuit/79azke/mosfetdriver01/

Thank you so much for this. I have found all the parts i need at farnell, can someone verify that they are correct according to polymorph's circuit?

Ultrasonic Transmitter: partnr 1007332
2N3906: partnr 1574372
2N3904: partnr 9846743
IRF9530: partnr 8648603
IRF530: partnr 8648263
1 uf capacitor: partnr 2112990

#### polymorph

#7
##### Jan 13, 2014, 07:01 am
Better make that at least 10uF, I had just poked that 1uF in the circuit for a different project. 1uF is almost 4 ohms reactance at 40kHz.

A filter cap made for a switching power supply is good, it will be designed for high frequency and with low ESR.

100uF 63V ESR less than 2mOhm:
http://uk.farnell.com/illinois-capacitor/107tta063m/cap-alum-elec-100uf-63v-20-axial/dp/2364794

Those are not the right MOSFETs, they require at least 10V. You need something called Logic Level MOSFETs that are rated at full ON at 4.5V.

It is the parameter entitled "Rds(on) Test Voltage Vgs".

P channel, 4.5V Rds(on):
http://uk.farnell.com/fairchild-semiconductor/ndp6020p/mosfet-p-to-220/dp/1017724

N channel, 4V:
http://uk.farnell.com/fairchild-semiconductor/fdp65n06/n-channel-mosfet-60v-65a-to-220/dp/2118346

The BJTs you've selected should be fine.
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8

#### nordbo

#8
##### Feb 03, 2014, 07:36 pmLast Edit: Feb 03, 2014, 07:38 pm by nordbo Reason: 1
Thank you so much for your help [user]polymorph[/user].

I tried to build the circuit with the parts you specified, and i am able to create the 40kHz signal using tone(myPin, 40000), but i cant get it to play 40500 hertz. I've tried all the frequencies between 39000 and 42000, but only 40000 is working. (i don't have a oscilloscope, so i can only test by seeing how my receiver responds).

Is the circuit correctly put together? Btw, i did not find a ultrasonic transmitter in Fritzing, so i used a pushbutton.

I used this https://www.circuitlab.com/circuit/79azke/mosfetdriver01/ as a reference.

Thanks for any help

#### polymorph

#9
##### Feb 04, 2014, 01:22 am
OK, great, so we know the circuit is working, because 40kHz will trigger the receiver.

Can you post your code? Don't forget to use the code tags.
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8

#### keeper63

#10
##### Feb 04, 2014, 05:35 am
Do you own the fireplace?

I mean - if you do - why are trying to figure out the ultrasonic portion at all? Instead, insert (not literally - you'll likely need to make some level conversion system) your Arduino between the output of the receiver and the valve.

That way, when you use your remote control, the Arduino can simply pass-thru the values to the valve - or you can use the valve directly via the Arduino. The valve could be anything; you would need to figure out where and how it is actuated, then take some measurements to determine what the receiver is sending (and/or receiving - in case it is some kind of servo-actuated valve - and by "servo" I don't necessarily mean an RC servo!).

Likely far easier to do this than to fake the ultrasonic transmitter (which, as you have found, is not easy without access to an oscilloscope).
I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

#### nordbo

#11
##### Feb 05, 2014, 10:08 am

OK, great, so we know the circuit is working, because 40kHz will trigger the receiver.

Can you post your code? Don't forget to use the code tags.

ive tried different stuff, something like

Code: [Select]
`long hertz;int pinId;void setup() {   Serial.begin(9600);   hertz = 39000;   pinId = 5;}void loop() {   tone(pinId, hertz);   Serial.println(hertz);   hertz += 10;   delay(1000);}`

By using this code, the fireplace reacts on hertz 39980 - 40020, where the fire is turned down. It does not react on any other frequences.

By using a hc-sr04 distance sensor, i was able to turn the flame both ut and down using the same code. But it was really unreliable.

#### polymorph

#12
##### Feb 05, 2014, 03:08 pm
This may sound strange, but try connecting a 100 ohm resistor in parallel with the ultrasonic transducer.
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8

#### Burntfaceman

#13
##### Feb 04, 2016, 10:08 pm
Nordbo, did polymorph's suggestion help in the end? My parents have recently got the same fireplace and I'd like to help them control it from their smartphones. Did you manage to get the 40.5khz signal working in the end?

#### urbanviuals

#14
##### Feb 24, 2016, 05:00 am
Hi Burntfaceman,

I'm just looking into this myself, as the remote for our fireplace has stopped working. I'm pretty sure the ultrasonic transmitter was broken when the remote was dropped. It will work if I hold it less than an inch from the receiver, but otherwise doesn't work.

I am considering replacing the ultrasonic reciever and motor driver circuit with an arduino or Spark Core (Particle Photon). One issue for me so far, is that the existing system is battery powered and there's no power immediately by the fireplace, so I want to make something that will have long battery life, and so a wifi option might not be the best bet.

There are only four wires from gas valve to the controller: Two drive the motor up and down, and two connect to a microswitch on the dial to relay the upper and lower limits of the motor to ensure the motor stops when it needs to.

Thanks,

Nathan

Go Up