Automatic Electrochlorinator

Tim ErwinNOV 19, 2020

Overview

I designed and built a device that produces sodium hypochlorite (bleach) by electrolysis of salt water. This process is known as electrochlorination. The bleach can be used as a cleaning solution, or when produced in low concentrations, to disinfect drinking water. To test my device, I used a salt water solution of 3.5% salinity by mass, which is similar to the salinity of the ocean. 

Through the Arduino serial monitor, the user can specify how long the device will run, and during the process, the saved pH, supply voltage, voltage across the electrodes, and current through the solution is displayed. The process can be paused with a remote in order to measure the pH with an analog pH sensor. The pH reading can then be updated and saved to the display.

Software and Services:

  • 3D Design: Onshape
  • Schematic Design: Altium Designer
  • Microcontroller and Software: Arduino

Demo:

This video demonstrates the function and user interface of my automatic electrochlorination device. The supply voltage, voltage drop, and current is displayed through the serial monitor. After pausing the process with a remote controller, the pH is measured with the analog pH sensor and saved to the display.

The production of bleach is verified by the whitening  of the pH paper and red rag. The red rag was bleached by a solution produced by running the device for one hour.

Data

I ran the device for one hour while streaming the voltage across the electrodes and the current through the solution into Microsoft Excel. The plotted data is shown below. Orange is voltage across the electrodes and grey is current through the solution. The constant current and decreasing voltage shows that as the device runs, the solution becomes more conductive. It can be concluded that the concentration of bleach in the solution increases over time because it is known that sodium hypochlorite's conductivity rises with concentration. 

I originally intended to display an estimated bleach concentration and have my device automatically stop electrolysis when the user-specified concentration is reached. However, there are too many variations, such as electrode spacing and water volume, so my device only stops electrolysis based on the specified run time. 

Circuit Diagram

A 15V 3A regulated DC power supply powers the electrolysis; the Arduino and control circuitry is powered by a computer via USB. 

To keep track of time passed, my device utilizes an Elegoo DS1307 Real Time Clock Module, and to measure pH, a DFRobot SEN0161 Analog pH Sensor and adapter board. The voltage across a .100 OHM shunt resistor is measured by the Arduino in order to calculate the current through the solution. Resistor voltage dividers are used to measure the source voltage and voltage drop across the electrodes. An IR receiver is used with a remote controller to pause electrolysis and save the pH measurement. Electrolysis is controlled by the Arduino via a nMOS switch circuit.

An LED indicator flashes when the electrochlorination process is complete and pulses when the process is paused. 

Code

My electrochlorination device is controlled by an Arduino Mega. Through the Arduino serial monitor, the user can specify how long the device will run. A remote control can be used to pause the electrolysis and measure the pH of the solution. 

The code calculates the voltage across the electrodes, the current through the solution, and runs the pH sensor. The time remaining and all of the measured values are displayed to the serial monitor. 

The code for this project can be viewed at https://github.com/t3rwin/Electro-Chlorinator

Wiring

All Electro Chlorinator device components are shown below. 

Electrode Holder 3D Design

I designed and 3D printed an electrode holder that separates the four carbon electrodes and fits over the glass jar. The 3D model is shown below.