Hello,
Im trying to do a project which is a bit of a stretch for me. Im trying to interface with a gas fire. Dont worry, not directly!
There is a remote control which fires 40.5khz to turn up and 40khz to turn down. These remotes are not coded or anything and my understanding is anything transmitting an ultrasonic wave of that frequency will act on the controller.
Ive not used ultrasonic sensors and I've been reading about the HC-SR04 seems a commonly used board for lots of projects but I'm not finding much in the way of how you can control the frequency.
So my questions right now are, am on the right track using a HC-SR04? Is there any examples of how to do something similar (my googling doesn't find anything)? Or is there a better way to do this?
I want to read and learn and figure things out, but I'm really struggling even getting started on this one!
Depending on the distance and sensitivity of the receiver you may be happy with a (passive) piezo buzzer on a digital output. If not much else is to be done then delayMicroseconds() can be used to produce the sound.
That is very unusual. Could you post a link to where you found this information?
It is possible for an Arduino to generate those frequencies, but most ultrasonic transducers are tuned to a specific frequency (40 kHz is common). Signal transmission becomes significantly less effective, the further away from the tuned frequency.
The frequency used by the HC-SR04 is fixed, but you could extract and use the transducer (either one, they are supposedly equivalent).
Try using the toneAC library to generate the frequencies. Connect the transducer across the two output pins, with a 100 Ohm resistor in series to help protect the pins from overcurrent.