Jump to content
APC Forum

Amp Hour Controller


WSM

Recommended Posts

I was responding to some comments in the Chemistry section under the (per)chlorate thread, when the discussion turned to amp hour controllers. My question there would probably better be placed here;

 

"Does anyone have a good circuit design for an amp/hour controller?"

 

WSM B)

Edited by WSM
Link to comment
Share on other sites

Can be relatively easily done with arduino (or clone for 4 dollars on ebay) and shunt.

http://www.vwlowen.co.uk/arduino/current/current.htm

Then from there just record your current every minute and store them. After counter reaches 60, sum all of the amp/min together and reset the counter. Store your amp/hour value if needed.

It all depends on what you want to control really. If it is dripping acid into the cell, then have an algorithm that turns solenoid on (through mosfet or relay) depending on the amp/hour value for X amount of time.

Where X amount of time allows Y ml of acid to pass.

Edited by ivars21
Link to comment
Share on other sites

What I would like it to do (WSM may think differently) is to fire a trigger pulse of controllable duration after a programmed number of amphours have passed. From that you could run a pump or solenoid for that controlled time. -so eventually you could let a controlled amount of acid into the cell every say 25, 50 or 100amp hours so that say every half or hour the pH creep due to normal cell reaction would be largely corrected. Initially Swede's figures would be a great start but fine tweaking may be needed.

 

I had suspicions while Swede was here that some failed electrodes were due to highly alkaline electrolytes eroding silica from glass reaction vessels and eventually effectively plating the silica onto the DSA passivating the surface.

Link to comment
Share on other sites

...

 

I had suspicions while Swede was here that some failed electrodes were due to highly alkaline electrolytes eroding silica from glass reaction vessels and eventually effectively plating the silica onto the DSA passivating the surface.

 

 

I wonder if the NaF additive common in industrial preparations helps prevent that.

Link to comment
Share on other sites

It's too hard to prove for me. There were debates about using drinking water and in some places that is harder than others, and in some places is fluoride treated more or less than others. Other people mentioned distilled, deionised and RO water. Some people have better lab technique than others and some people have access to better chlorides than others. Due to the problems with pH measurement I fear few people will run a cell at optimum pH, a time approximated system may offer some pH improvement and efficiency improvement

 

Realistically a glass cell wouldn't be my preference, I like the idea of PVC drain pipe with a cemented plug. I once made a photoprocessing tank line out of 4" PVC tube (five litres of dev did 15 plastic spirals of 35mm at a time).

 

Most home constructors could make a cell from PVC pipe and sheet and solvent cement that would satisfy their need for chlorate for life! The perc system would need better planning and workmanship and lab technique, but ultimately all you put in is chloride and electricity.

Link to comment
Share on other sites

Arthur, as I said, once you get digitalised amp reading in your arduino (from the provided link), the software side is just few lines really.

If anyone of you actually plan to implement this system I can draw up a schematic and write up some code...

Link to comment
Share on other sites

What I would like it to do (WSM may think differently) is to fire a trigger pulse of controllable duration after a programmed number of amphours have passed. From that you could run a pump or solenoid for that controlled time. -so eventually you could let a controlled amount of acid into the cell every say 25, 50 or 100amp hours so that say every half or hour the pH creep due to normal cell reaction would be largely corrected. Initially Swede's figures would be a great start but fine tweaking may be needed.

 

I had suspicions while Swede was here that some failed electrodes were due to highly alkaline electrolytes eroding silica from glass reaction vessels and eventually effectively plating the silica onto the DSA passivating the surface.

 

I could take a pulse and let it trigger one of the timer/controllers that Swede used, and let it reset and wait for the next pulse. If it would act (react) to every pre-determined number of amp hours as they occur, I imagine the whole pH controlling system would be very close to automatic, requiring minor adjustments as Arthur suggests.

 

I think you're right about the glass etching and electrode passivating problems some European members were having. It did cause Swede some headaches.

 

WSM B)

Link to comment
Share on other sites

I wonder if the NaF additive common in industrial preparations helps prevent that.

 

I believe NaF additives were common when graphite anodes were the industry standard. Fluoride ions in modern DSA (MMO) chlorate cells would poison the system by negatively affecting the titanium substrate (the same with platinized titanium and beta-form PbO2 plated titanium anodes in perchlorate cells). Fluorine seems to eat titanium vigorously, causing irrepairable damage.

 

I used glass pickle jars to house uncontrolled chlorate cells and never saw any such problems. There's no telling what types of glass, water, et cetera, our European associates were using, let alone the power reliability they had. All of these factors can negatively affect their cells. Here in the US, different regions have different conditions to deal with as well, so these sorts of problems can plague us as well. The more we know, the better we can analyse and overcome the various problems we might encounter.

 

WSM B)

Link to comment
Share on other sites

It's too hard to prove for me. There were debates about using drinking water and in some places that is harder than others, and in some places is fluoride treated more or less than others. Other people mentioned distilled, deionised and RO water. Some people have better lab technique than others and some people have access to better chlorides than others. Due to the problems with pH measurement I fear few people will run a cell at optimum pH, a time approximated system may offer some pH improvement and efficiency improvement

Realistically a glass cell wouldn't be my preference, I like the idea of PVC drain pipe with a cemented plug. I once made a photoprocessing tank line out of 4" PVC tube (five litres of dev did 15 plastic spirals of 35mm at a time).

Most home constructors could make a cell from PVC pipe and sheet and solvent cement that would satisfy their need for chlorate for life! The perc system would need better planning and workmanship and lab technique, but ultimately all you put in is chloride and electricity.

 

I may have stated this before, but it bears repeating; "Proper pH control is not trivial, but it's worth the effort". Various cells fabricated from PVC (or even CPVC) pipe and sheet using proper cements and techniques, are probably our best bet for an affordable, effective and durable chlorate and/or perchlorate system.

 

I still think the most practical perchlorate system is a two-part system; separately making and purifying the sodium chlorate feed stock and then making and purifying the sodium perchlorate, from which other perchlorates are produced for our use.

 

This is my opinion based on my own study and research on the subject for the past decade or so (I'm losing track of the time).

 

WSM B)

Edited by WSM
Link to comment
Share on other sites

Arthur, as I said, once you get digitalised amp reading in your arduino (from the provided link), the software side is just few lines really.

If anyone of you actually plan to implement this system I can draw up a schematic and write up some code...

 

Hi ivars21,

 

I'd like to see the schematic and see if I can apply the system to the other parts and controllers I've already assembled or accumulated components for. Rather than dedicate a computer to operate the system I'd like it to run as a stand alone device, if that's possible. Any further thoughts along these lines?

 

Edit: Or am I missing something?!

 

WSM B)

Edited by WSM
Link to comment
Share on other sites

You are missing out that this "dedicated computer" is 3 dollars on ebay :D

http://www.ebay.com/itm/1-mini-USB-Nano-V3-0-ATmega328-16M-5V-Micro-controller-CH340G-Board-Arduino-/181591402576?pt=LH_DefaultDomain_0&hash=item2a47b0e850

 

I will give a go on schematics when I have a spare time. But there is nothing to it really.

Edited by ivars21
Link to comment
Share on other sites

You are missing out that this "dedicated computer" is 3 dollars on ebay :D

http://www.ebay.com/itm/1-mini-USB-Nano-V3-0-ATmega328-16M-5V-Micro-controller-CH340G-Board-Arduino-/181591402576?pt=LH_DefaultDomain_0&hash=item2a47b0e850

I will give a go on schematics when I have a spare time. But there is nothing to it really.

 

Ah, yes; I missed that detail.

 

Sorry, my electronics knowledge is a bit dated and limited. I can see this project will make me stretch my exposure and understanding, but hopefully I'll grow into it. Thanks for your help.

 

WSM B)

Link to comment
Share on other sites

You are missing out that this "dedicated computer" is 3 dollars on ebay :D

http://www.ebay.com/itm/1-mini-USB-Nano-V3-0-ATmega328-16M-5V-Micro-controller-CH340G-Board-Arduino-/181591402576?pt=LH_DefaultDomain_0&hash=item2a47b0e850

I will give a go on schematics when I have a spare time. But there is nothing to it really.

 

Okay, I'm on board. I just ordered one of those mini processor boards and should have it in hand in a week or two (ten day delivery from China is typical for small electronic components to my area).

 

Are there other specialized parts I should obtain to progress my efforts? Please let me know. Thanks.

 

WSM B)

Link to comment
Share on other sites

I attached the schematic and the simple code below. In calculations I am assuming you would be using something like this . I couldn't remember how much current you are using for the chlorate cell, so the code below is for up to 33A, but can be easily changed. You just need to set op-amp to gain of 200 with variable resistor (R5) - what you do is open Arduino serial port, take your multimeter, set it to 200mV range and measure the voltage across op-amps pins 2 and 3. Multiply that value with 200 and compare with the value you get on serial screen, adjust potentiometer (R5) accordingly.

 

I didn't have a time to test it, neither I have the cell setup to test it, but it should work.

/*
  Autonomous acid feed system for chlorate/perchlorate cell
 
 */
const int analogPin = A0; // output signal from op-amp goes in here
const int solenoidSignal = 2; // signal to mosfet to turn on the solenoid

const int OpAmpGain = 200; // assuming op amp gain of 200, max current measuring capability of ~33A for 75mV 100A shunt

const float shuntMaxVoltage = 75; // in mV
const int shuntMaxCurrent = 100; // in A

const int interval = 1;           // interval at which to check the reading (in seconds), so 60 - every minute, 3600 - every hour

const int everyAmpHours = 25; // change this value depending after how many amp-hours you want to turn the valve, to let the acid in.
const int valveOpenTime = 1000; // in miliseconds, so you need to calculate your flow rate (ml/per second), so that you can adjust how much time you need. (1000 - second, 60 000 - minute)



unsigned long previousMillis = 0;   
float currentAmpHour = 0;
float intervalInHours = 0;
float totalAmpHours = 0;
// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
  pinMode(analogPin, INPUT);
  pinMode(solenoidSignal, OUTPUT);
  intervalInHours = 1/(3600/interval); // convert the interval to the part of hour, so 1 second is 1/3600 of hour
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(analogPin);
  // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
  float voltage = sensorValue * (5.0 / 1023.0);
 
  // print out the voltage value you read:
  Serial.print("Voltage: ");
  Serial.println(voltage, 7); // 7 digit accuracy
 
  float shuntResistance = (shuntMaxVoltage/1000)/shuntMaxCurrent; // shuntMaxVoltage is in mV, converting back to volts, for proper R=V/I
 
  float amps = (voltage/OpAmpGain)/shuntResistance;


  // print out the ampere value you read:
  Serial.print("Amps: ");
  Serial.println(amps,7); // 7 digit accuracy
 
  Serial.print("Total amp-hours: ");
  Serial.println(totalAmpHours,7); // 7 digit accuracy

  unsigned long currentMillis = millis();
 
  if(currentMillis - previousMillis > interval*1000) {
    // save the last time you checked value
    previousMillis = currentMillis;  

    // add just measured ampere value to amphours.
    currentAmpHour = currentAmpHour + amps*intervalInHours;
    
    // for the total hours adding up
    totalAmpHours = totalAmpHours + amps*intervalInHours;
    
     Serial.print("Current amp hours: ");
     Serial.println(currentAmpHour,7); // 7 digit accuracy
     
     
  }
 
  // solenoid valve logic below
  if (currentAmpHour > everyAmpHours) {
     Serial.println("Valve opened");
     digitalWrite(solenoidSignal, HIGH); // give a signal to mosfet, which in return open the valve for acid to flow in the cell
     delay(valveOpenTime);
     digitalWrite(solenoidSignal, LOW); // close the valve
     Serial.println("Valve closed");
     currentAmpHour = 0; // reset the amp-hour counter, assuming the acid in ml is linearly proportional to the amp-hours period of everyAmpHours.
  }
    
 //delay(100); // un-comment for slower Serial refresh
}

Sheet1.PDF

Edited by ivars21
Link to comment
Share on other sites

Ivars21 Thank you for your coding, I'm impressed, (my last coding was in Algol (hell))

 

25A is fair for a DIY cell, some people may look for more but your post shows that you have covered that.

 

I'd propose that we find the graph of pH vs current efficiency and plan to start at the lowest ph and let the pH rise for an interval then pump a little acid in, If the pH zig zags about in the high efficiency range we should be good for production, and have least foul gas output.

 

Could you code a amphour counter with numbers showing? Fill a cell up and calculate the 100% efficiency current needed for complete reaction and manually switch off the cell at that point. (current must not stop with the electrodes in the solution.)

Link to comment
Share on other sites

For semi-professional setup, I wonder how long would this sensor survive in the cell? Apparently they can operate continuously for 12 months before recalibration is recommended.

There are cheaper Chinese alternatives though I have no idea how accurate they are and do they even work.

 

I edited the code, so that you get current amp-hour value on the Serial screen all the time until you reset the system. (note, to see the serial screen you need to connect your Arduino to a computer).

For stand alone setup 2 usd LCD from ebay would be nicer and easy to implement as well.

Link to comment
Share on other sites

Swede's experience with pH electrodes was BAD. Even the best would die in the electrolyte. I'm hoping that there will be a narrow range indicator paper suited to the task but the bleaching power of the liquid means that the colour is transient. -Hence the automated pH control based on the acid needed per amp hour. Get the acid addition right and you only need to check pH daily or less.
Link to comment
Share on other sites

Several years ago, Swede and Tentacles did a search among suppliers of pH sensors and found that very few probes could endure the electrolyte of chlor-alkalai systems without being poisoned, and those that could were very expensive (about $900 each), making them impractical for amateurs. So direct control by pH sensing was eliminated from our consideration for the time being.

 

Swede learned from experienced people (at science madness, I think) that industry has determined a rule of thumb for the amount of HCl required per amp-hour to achieve the pH ideal (of 6.8) for highly efficient chlorate production, where the "bulk reaction" is optimized. That rule of thumb as shared by Swede is: 0.057ml 32% HCl per amp-hour, cut by 33% after chlorate crystals begin to form. This, of course, is for potassium chlorate since Swede avoids sodium salts to prevent sodium contamination of his final products.

 

Edit: The rule-of-thumb is probably applicable to sodium chlorate cells, also.

 

So the logical step is an amp-hour controller to switch on a pump circuit to add measured doses of dilute hydrochloric acid to the chlorate cell to maintain a pH of 6.8 (or near enough to be effective). This is why I'm pursuing a rock-solid circuit design to build one, rather than buy a commercial unit off-the-shelf (which may or may not work for our purpose, and cost a lot of money).

 

ivars21 seems to have a handle on this and is offering much guidance. I've ordered several components online from eBay and await their arrival from China to continue this effort. I'll also get some components from a local electronics supply store nearby, so I can get right on it, when everything is here.

 

Thanks, ivars21; I'll post my progress when I get going on this part of the project.

 

WSM B)

Edited by WSM
Link to comment
Share on other sites

×
×
  • Create New...