Arduino Uno output 113KHz

Hi all,
I'm trying to output a 113KHz sign wave on a pin of the Uno board. This output would connect to a MOSFET which will power multiple piezoelectric transducers to produce humidity. Currently trying to do this with a Grove MOSFET but can change to another if needed. I can use the MOSFET to control the power for a humidifer circuit but would MUCH rather control the frequency with the Uno if possible.

My experience with Arduino is about 4 weeks. I've read many forums and still not found what I was looking for (although I probably missed it due to my lack of understanding).

So, I would likely need to use a PWM pin to get the wave I need for the Piezoelectric transducers. I understand that there are 3 timers - 0, 1, and 2. Everything I read from @Nick_Gammon provides brilliant detail but I'm having difficulty making sense of it. I've spent 2 days reading through forums...

Three questions:

  • Is it possible to output a 113KHz sign wave from an Arduino Uno?
  • Is it possible to output a 1.7MHz and 2.4MHz sign wave as well? (in a perfect world...)
  • Is there a sketch and library somewhere that could point me in the right direction?

Understanding the timers and how to use them is a little more complex than my basic knowledge.

Thanks everyone. Really appreciate any advice.

Without a proper DAC (digital-to-analog converter), generating a "sine" wave from the Arduino UNOs PWM is not going to be easy. Are you sure you need a "sine" wave or would a regular square wave would suffice?

See Wikipedia for the difference between a sine wave and a square wave

For an Ultra sonic mister, pick up an inexpensive mister module. The mister module will drive the mister and produce the proper voltages.

I use the MCU to control the power to the mister module.

The big trick is getting the mister piezo floating on top of the water at just the right height.

I can try it with a square wave. I'm definitely open to it. Is there a way to generate that square wave frequency (113KHz) from one of the pins? I can also get a DAC as well. That's a good idea.
Just need to figure out how to get 113KHz out of a pin and then can experiment from there.

As for the cheap ultrasonic mister modules, yep, I'm very familiar with those. I've burned out a few of them already.
I'm trying to make something a little more permanent and those things aren't reliable. I also want to power 12 transducers, which means 6 little modules (16mm transducers use between 40mA and 50mA at 24V). This is why I want to use the Uno pin to a MOSFET, and control the frequency that way, while providing enough current to many transducers.

As for the trick of floating - I've figured that one out. Hold the chips at 45 degrees. As long as they're touching the water, it's producing mist. I have a 3D printer and have created a housing that holds 12 transducers at 45 degrees. Also tried vertical but water leaked through them. 45 degrees and everything is good.
Now if I can just get them to work from the Arduino... :slight_smile:

Yes, at 113Khz write to the pin highs and lows.

pin high
wait 8.695652173913E-6
pin low
wait 8.695652173913E-6
pin high
wait 8.695652173913E-6
pin low
wait 8.695652173913E-6
pin high

How will you be upping the voltage of the signal being produced by the Arduino Uno to drive the transducers?

I have my misters in a 5 gallon water tank that float on top of the water. As the water lowers the misters are held at the correct height by the floats. I run the mister from 5 gallons to 1/2 gallon. When the water is at 1/2 gallon the mister is stopped and a message is sent to my phone letting me know I need to refill the water tank.

Wow. That easy? Ok, I'll try it.

On a side note - why does the tone() function not work to create the frequency?

Providing an external 24Vdc through the MOSFET. I'll need to find a MOSFET that can switch at the frequency needed. Apply the Uno frequency at the gate of the MOSFET and that "should" reproduce the frequency on the high current going through the MOSFET. Will also need to have an Optoisolator I think, just to be safe.

Floats. That definitely works too. :slight_smile:
Could have your Arduino control a solenoid or pump and autofill that tank?

swalinga:
Wow. That easy? Ok, I'll try it.

What else will the Uno do?

If you stop generating 1 and zero out of a pin, then no mist.

For instance, if you want the Uno to check the water level what will happen to the generate 1 and 0's routine to make mist?

Great point.
Using it to generate mist will dedicate it to that function.

Using it to check sensors will interrupt the mist...

So, I can use multiple Arduino boards OR go with the unreliable humidifier modules...

Well, first steps first. I tried the digitalWrite and waited for the 8.695652173913E-6 microseconds but not getting the vapour. The Piezo requires 40mA and the pin is capable of 40mA so that should be fine.

pinMode(11, OUTPUT);
digitalWrite(11, HIGH);
delayMicroseconds(8.695652173913);
digitalWrite(11, LOW);
delayMicroseconds(8.695652173913);

1 Like

delayMicroseconds(8.695652173913);

delayMicroseconds does not take ‘type’ float.

Allowed data types, ‘unsigned int’.

1 Like

delay uses an unsigned long integer not a float.

the volts from the pin cannot directly drive a mister refer to this question

How will you be upping the voltage of the signal being produced by the Arduino Uno to drive the transducers?

Have you considered using timer2 to generate the 113Khz?

In the interrupt of timer2 you can put something like this:

bool tickticok =false

void thetimerinterruptthingy()
{

if(ticktock)
{
pin high
ticktock=false
} else {
pin low
ticktock=true.

}

1 Like

see timer2

Ok. Thanks for your help here.
I'll go read up on the unsigned int and how to use it.
Still very new to Arduino so haven't tried different timers either.

The logic level MOSFETs are designed for low level voltage input like this. Usual voltage inputs are between 1.5V and 5V at the gate. Unless I'm missing something, I'm pretty sure they should work. I currently have a Grove MOSFET that is currently handling this which gives me 15V going to the humidifier module. Those little modules have a ceiling of 25V which is how I burned a few out.
The ADAfruit has a MOSFET module that works with Arduino as well, with a higher switching frequency.

As for the trick of floating - I've figured that one out. Hold the chips at 45 degrees. As long as they're touching the water, it's producing mist.

I think they are supposed to be submerged for the best efficiency and maybe so they don't overheat.

I also had a setup with a float that held the device at a constant depth. (It was all purchased. I didn't build any of it.)

to produce humidity

Technically, these things don't (directly) produce humidity. The mist is water droplets in liquid form. Humidity is water vapor as a gas. After the droplets fall to the ground and eventually evaporate you get humidity. (Steam is vapor which adds to humidity.)

1 Like

The 113KHz piezo units can't be submerged or they don't work. They need to be touching water but not submerged.
The 1.7MHz and 2.4MHz piezo units need to be submerged (and are much more violent in the water).

You're totally correct. :slight_smile:
Not vapour or humidity at all... Actually referred to as mist or water droplets.
I need to be more accurate in my descriptions.

1 Like

I use a mister to raise the humidity. I have a fan that energizes for 3 seconds, then is off for 5 seconds.

Before the mister my IAQ (indoor air quality index) was sitting >= 147.xx. Now the IAQ is sitting at 78.x%.

A mister does work to raise indoor humidity.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.