The bathroom of the old apartment will always have some strange smell, but at present I cannot afford to buy a new house. Then I had to buy an ozone machine (shown below) to improve the air quality. The helpless power is too small to achieve the effect of fast deodorization. So here came up with the idea to make my own ozone generator. Searching DIY ozone generator in Internet, a lot of ozone producing device show.
My Arduino work
Introduction
The ozone machine is operated by a TFT touch screen as a switch. The screen has six touch buttons. The four green buttons represent O3A (No.1 Ozone generator), O3B (No.2 Ozone generator), LGT and FAN. The blue button represents all ON button. And one red button, represents the timing button (timing to turn off in 30 minutes).
Materials in Need
4. Actuator:
Ozone generator module x1
Wiring
Just put the TFT touch screen directly to the MEGA sensor expansion board, with three relays connected to ports 20, 21, 22. And the Three RGB wires are connected to ports 25, 26, 27.
Programming
This programming is focused on the touch screen.
Define the button shape:
char str1[]="O3A";
tft.fillRectangle(19, 29, 98, 108, GREEN);char str1[]="O3A";
tft.fillRectangle(19, 29, 98, 108, GREEN);
Define the button ON/OFF function:
if((x>=19&&x<=98) and (y>=29&&y<=108))
{
{ buttonState =buttonState+1;// Read the value from the specified digital pin, high or low.
delay(300);
if (buttonState %2==1)
{digitalWrite(20,HIGH);}
else
{digitalWrite(20,LOW);}
}
}
Click here to download Code zip.