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.
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
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...
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.
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.
Could have your Arduino control a solenoid or pump and autofill that tank?
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.
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.)
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.
Not vapour or humidity at all... Actually referred to as mist or water droplets.
I need to be more accurate in my descriptions.