CASACURSOSESTUDANTESDOAÇÕESVÍDEOSEVENTOSTUTORIAISLINKSNOTÍCIACONTATO


TUTORIALS 》 Arduino UNO - RO Water Purifier Controller

Here is a Youtube VLOG of my DIY RO Water Purifier Controller done via Arduino UNO. I want the Arduino UNO to control the RO pump, so that it pumps for a specific duration and stops automatically. This is done via Opto-isolated 4 Channel 5V 10A Relay Board meant for Arduino UNO, Raspberry Pi or similar SoC boards which offers GPIO pins. To this relay I have connected the RO water purifier booster pump which works at 24V DC connected via 220V AC to 24V DC power supply adaptar. I have also connected a small active 5V buzzer to notify the progress and completion as it fills the tank/canister.
Arduino UNO - RO Water Purifier Controller

Here is my detailed Youtube VLOGs (and a followup) of the same and the Arduino UNO device driver code:
/* The Linux Channel
 * Code for Video Episode: 0x1eb Arduino UNO - RO Water Purifier Controller
 * Author: Kiran Kankipati
 * Updated: 03-Mar-2020
 * Version: 02
 */

//before writing to Arduino, do:
//sudo chmod 777 /dev/ttyACM0

//Debug/Test
//unsigned long SECOND = 10;

unsigned long HALFSECOND = 500;
unsigned long SECOND = 1000;

unsigned long MIN = SECOND*60;
int PIN8_SW1_ROFILTER = 8;
int PIN4_SW4_BELL = 4;
int PIN2_SW3_HEATER = 2;
int RELAY_ON=LOW;
int RELAY_OFF=HIGH;

int cycle=0;

void setup() 
{
  pinMode(PIN8_SW1_ROFILTER, OUTPUT);
  pinMode(PIN4_SW4_BELL, OUTPUT);
  pinMode(PIN2_SW3_HEATER, OUTPUT);
}


void loop() 
{ 

  digitalWrite(PIN8_SW1_ROFILTER, RELAY_OFF);
  digitalWrite(PIN4_SW4_BELL, RELAY_OFF);
  digitalWrite(PIN2_SW3_HEATER, RELAY_OFF);

  if(cycle==0)
  {   digitalWrite(PIN4_SW4_BELL, RELAY_ON); delay(HALFSECOND); digitalWrite(PIN4_SW4_BELL, RELAY_OFF); delay(HALFSECOND);
      digitalWrite(PIN4_SW4_BELL, RELAY_ON); delay(HALFSECOND); digitalWrite(PIN4_SW4_BELL, RELAY_OFF); delay(HALFSECOND);
          
      //RO Filter Cycle
      for(int i = 0; i < 8; i++) 
      { if(i<=6)
        {
          digitalWrite(PIN8_SW1_ROFILTER, RELAY_ON); delay(MIN*10);
          digitalWrite(PIN4_SW4_BELL, RELAY_ON); delay(HALFSECOND); digitalWrite(PIN4_SW4_BELL, RELAY_OFF); delay(HALFSECOND);
        }
        else if(i==7)
        {
          digitalWrite(PIN8_SW1_ROFILTER, RELAY_OFF);
          digitalWrite(PIN4_SW4_BELL, RELAY_ON); delay(HALFSECOND); digitalWrite(PIN4_SW4_BELL, RELAY_OFF); delay(HALFSECOND);
          digitalWrite(PIN4_SW4_BELL, RELAY_ON); delay(HALFSECOND); digitalWrite(PIN4_SW4_BELL, RELAY_OFF); delay(HALFSECOND);
          digitalWrite(PIN4_SW4_BELL, RELAY_ON); delay(HALFSECOND); digitalWrite(PIN4_SW4_BELL, RELAY_OFF); delay(HALFSECOND);
        }
      }
      digitalWrite(PIN8_SW1_ROFILTER, RELAY_OFF);
  } 
  else 
  { delay(MIN*1000); } //long indefinite wait
  
  cycle++;  


}

NOTE: I have modified, and removed that calling bell with a tiny low-voltage Active buzzer which can work as it is with Arduino output pins without relay. And as well modified the code accordingly and refined existing code and fixed couple of bugs. I did my first field-test, seems to be working fine. I have to do couple of more times and see.
Here is my updated code:

/* The Linux Channel
 * Code for Video Episode: 0x1eb Arduino UNO - RO Water Purifier Controller
 * Author: Kiran Kankipati
 * Updated: 05-Mar-2020
 * Version: 03
 */



//before writing to Arduino, do:
//sudo chmod 777 /dev/ttyACM0

//Debug/Test
//unsigned long _SECOND = 8;

unsigned long HALFSECOND = 500;
unsigned long SECOND2 = 2000;
unsigned long SECOND = 1000;
unsigned long _SECOND = 1000;

unsigned long MIN = _SECOND*56; //adjusted for buzzer
int PIN8_SW1_ROFILTER = 8;
int PIN13_BUZZER = 13;
int PIN4_SW4_BELL = 4;
int PIN2_SW3_HEATER = 2;
int RELAY_ON=LOW;
int RELAY_OFF=HIGH;

int cycle=0;

void setup() 
{
  pinMode(PIN8_SW1_ROFILTER, OUTPUT);
  pinMode(PIN4_SW4_BELL, OUTPUT);
  pinMode(PIN2_SW3_HEATER, OUTPUT);
  pinMode(PIN13_BUZZER, OUTPUT);
}

void _buzzer_sequence(int count)
{
  for(int i=0; i < count;i++)
  {
    digitalWrite(PIN13_BUZZER, HIGH); delay(SECOND); digitalWrite(PIN13_BUZZER, LOW); delay(SECOND);
  }
}

void _end_buzzer_sequence()
{
  digitalWrite(PIN13_BUZZER, HIGH); delay(SECOND*5); digitalWrite(PIN13_BUZZER, LOW);
}

void loop() 
{ 
  
  digitalWrite(PIN8_SW1_ROFILTER, RELAY_OFF);
  digitalWrite(PIN4_SW4_BELL, RELAY_OFF);
  digitalWrite(PIN2_SW3_HEATER, RELAY_OFF);
  //digitalWrite(PIN1_BUZZER, LOW);
  delay(SECOND2);
  
  if(cycle==0)
  {   _buzzer_sequence(3);
          
      //RO Filter Cycle
      for(int i = 1; i <=7; i++) 
      { if(i<=7)
        {
          digitalWrite(PIN8_SW1_ROFILTER, RELAY_ON); delay(MIN*10);
          _buzzer_sequence(i);
        }
      }
      digitalWrite(PIN8_SW1_ROFILTER, RELAY_OFF);
      _end_buzzer_sequence();
  } 
  else 
  { delay(MIN*1000); } //long indefinite wait
  
  cycle++;  


}

Featured Video:



Suggested Topics:


☆ Tutorials :: Arduino UNO Projects ↗


☆ Tutorials :: Network Software Development ↗


☆ Tutorials :: Research and Projects ↗


☆ Tutorials :: Linux (user-space), Systems Architecture ↗


☆ Tutorials :: Linux Kernel Software Development ↗


☆ Tutorials :: Linux Kernel Internals (PDFs) - by Ramin Farajpour ↗


☆ Tutorials :: Software Development (Programming) Tools ↗


☆ Tutorials :: Embedded Projects ↗

Join The Linux Channel :: Facebook Group ↗

Visit The Linux Channel :: on Youtube ↗


💗 Help shape the future: Sponsor/Donate


Tópicos recomendados:
Featured Video:
Assista no Youtube - [393//0] 329 Tweaking Network Latency - Live Demo - via TOFFEE-DataCenter ↗

Adding your own Kernel Modules into Linux Kernel Source | Linux Kernel Programming ↗
Thursday' 13-Aug-2020
Whenever you do custom kernel modules, you can optionally make it a part of existing Linux Kernel source. This does not mean you are submitting your kernel module to the mainline kernel source (i.e kernel.org Linux Kernel Foundation). What I meant is, you can make your kernel module(s) part of Linux Kernel source so that when you compile your kernel you can automatically compile your kernel module(s) too. As well when you create/modify kernel .config configuration file (such as via make menuconfig, etc), you can enable or disable your kernel module(s) too.
To do the same you have to register (and include) your custom Kernel Module's Kconfig and Makefile to the existing Kconfig and Makefile of the Linux Kernel source Here is a detailed multi-episode video of mine which gives the overall idea and the big-picture.

Linux Kernel Programming | with or without Kernel Modules | Device Drivers ↗
Thursday' 13-Aug-2020
When learning Linux Kernel programming, often I notice my students and viewers gets confused and they start with learning writing Linux Kernel modules. And so they develop the common misconception about Kernel Programming in general. They assume writing code in Linux Kernel means writing kernel modules. Which is absolutely not. Kernel modules are an optional choice and are part of Linux Kernel. But besides modules, Linux Kernel has lot of other mainstream code. Hence if anyone wants to be a Kernel Developer, you should be aware that sometimes you add new code via modules, sometimes without them. And if you ask me, I am not much in favor of writing Kernel modules. Instead in my code, I try to integrate and make them a part of Linux Kernel so that they all get initialized during boot time. Here is an extensive Youtube video of mine on Linux Kernel Programming, with and without Kernel Modules.

Roadmap - How to become Linux Kernel Developer - Device Drivers Programmer and a Systems Software Expert ↗
Thursday' 13-Aug-2020
Many viewers and even sometimes my students ask me how I can become a kernel programmer or just device driver developer and so on. So I shot this video (and an add-on video) where I summarized steps and a roadmap to become a full-fledged Linux Kernel Developer.

Weekly News Digest - Week 03 - July 2020 ↗
Thursday' 13-Aug-2020
The Linux Channel :: Weekly News Digest - Week 03 - July 2020
> Linux founder tells Intel to stop inventing 'magic instructions' and 'start fixing real problems'
> QNAP launches its first 2.5GbE network switch - QSW-1105-5T
> Japan's ARM-based Fugaku is the world's fastest supercomputer
> FreeBSD Back To Seeing Progress On 802.11ac WiFi Support, Ath10k Driver
> Sparkfun Launches the ZED-F9R GPS Dead Reckoning Raspberry Pi pHAT for Mobile Robots
> ODROID-N2 Plus SBC Gets Amlogic S922X Rev. C Processor Clocked at up to 2.4 GHz
> Rock Pi E SBC Comes with WiFi, Bluetooth, Two Ethernet Ports, and Optional PoE

Linux Software Development and Tools ↗
Thursday' 13-Aug-2020

Compiling a C Compiler with a C Compilter | Compile gcc with gcc ↗
Thursday' 13-Aug-2020
The fundamental aspect of a programming language compiler is to translate code written from language to other. But most commonly compilers will compile code written in high-level human friendly language such as C, C++, Java, etc. to native CPU architecture specific (machine understandable) binary code which is nothing but sequence of CPU instructions. Hence if we see that way we should able to compile gcc Compiler source code with a gcc Compiler binary.

Programming Language Performance and Overheads ↗
Thursday' 13-Aug-2020
A detailed Youtube video series of various programming language performance and overheads - a big picture

PyDelhi + PyData + ILUG-D + Linux Chix meetup mash @ Sarai on 17-Dec-2016 ↗
Thursday' 13-Aug-2020

C Programming Language Basics - Pointers in C ↗
Thursday' 13-Aug-2020

IP-in-IP Tunneling Demystified - VPN Tunnels ↗
Thursday' 13-Aug-2020
There can be many ways one can architect VPN Networks. The end objective is to tunnel private IP (typically LAN subnets) within public IP Networks (such as Internet). You can establish such a tunnel in various creative ways, such as Transport Mode, Tunnel Mode, IP-in-IP tunneling, etc. Also you can choose any transport layer protocol of your choice such as send VPN traffic via TCP, or via UDP and so on.


Trending Video:
Assista no Youtube - [333//0] 328 Network Latency and Bandwidth Assessment - for Network Admins and Infrastructure Architects ↗

Linux Kernel dst_entry data-structure ↗
Thursday' 13-Aug-2020



Recommended Video:
Assista no Youtube - [6218//0] 327 Linux Kernel FileSystems Subsystem - Role of VFS (Virtual File System) - Episode 3 ↗