Pages: 1 [2]   Go Down
Author Topic: Water Filter RO system controller  (Read 1189 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

"56 Bytes of Non-volatile memory available to user" - this is RAM, not EEPROM.

I'm interested in this Shield, one thing on my mind that I need is, like CR2032 3V Battery and MicroSD memory at the same time that enough to power and save the data on schedule respectively. Which one can you suggest Paul?

You can plug the battery backup to the wall to keep it charging at all times, and then power the arduino with one of the 2 USB outputs. At least in the one ive got, this works perfectly, so if there is a power failure it will keep running from the battery for quite a long time. Then you would just need to make a way of knowing that a power failure has happened, which should be easy with a digital pin.

Very interesting your project. - Thank you I appreciate it.

I have a long experience on Lithium battery for multiple application, it always end blown up internally when there is a long exposure on atleast medium temperature and 24/7 charging. This is a great battery backup but RO system is Run and Forget type of appliance, sometimes the only time it needs to check is when the water taste differently and on this case I can't wait when the Lithium battery would behave like this.

I have a 24VDC PS for booster pump, for solenoid valve and separate TDS meter. I'm decided to unify the Power Supply even for a controller but separate wall-wart, to avoid confusion on troubleshooting when necessary. On separate wall-wart PS for controller that also powering TDS meter which I can not exclude on the system, I prefer to step down 24VDC to 12VDC for UNO and invest on Shield battery and gives an advantage for compact housing.

I greatly appreciate all the suggestions, it means to me that these are all possible.
Logged

NSW Australia
Offline Offline
Edison Member
*
Karma: 35
Posts: 2385
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm interested in this Shield, one thing on my mind that I need is, like CR2032 3V Battery and MicroSD memory at the same time that enough to power and save the data on schedule respectively. Which one can you suggest Paul?

That sounds a bit too complicated.

The idea of this module, which has its own CR2032 battery only for storing the data and keeping the time, is that you write data into it until either it "fills", or a time interval occurs, at which point you write that to EEPROM and then delete that data and mark it as empty - in that order.

If a power outage occurs, in the process of recovery you examine the data in the BBRAM, see if it that data has been put in the EEPROM, check the EEPROM data in general (in case the outage occur at the moment of it being written) and complete the above procedure as necessary.  This is essentially the same process as you expect your PC disk system to do in "journalling".
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The two most obvious solutions to me are:

1. Use a capacitor to power the Arduino for a fraction of a second when power is lost, and add a mechanism to detect loss of incoming power. If you power a Uno from 12V via the barrel jack and you don't connect anything that takes much current to the +5V pin or the output pins, then a 2200uF capacitor connected between Vin and ground will power the Uno for about a quarter of a second, which is way more than you need to save important data to EEPROM. You can detect impending loss of power using an Arduino input pin.

Seems this point would work for me, I'm still not decide which power supply level do I have to use either 12V or 5V, one thing on my mind is to use the Arduino power as shown on the link below:

http://www.ebay.co.uk/itm/5V-4-channel-Relay-Interface-Board-for-Microcontrollers-Arduino-PIC-AVR-MCU-DSP-/130937144756?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item1e7c7645b4

If you do decide to use a 12v supply so as to have time to write to EEPROM when the power goes off, then you should use a 12V relay board instead of a 5V one. These are also available on eBay.

Now, I have this coffee flow sensor that it has pulsating output but input to the Arduino I/O terminal, the flow sensor has a magnetic contact inside to open and close the circuit and gives 5VDC at stationary position and 0V at the other way, but when it is rotating at a different speed everyday due to the pressure that pushes the water out, the voltage output or input to Arduino may read 2.5 or 3.3VDC, is the UNO or other controller can set to threshold voltage of 1 (ON) and below 1V is 0 (OFF) depending on the voltage or current input?

Are you saying that the sensor provides 5V or 0V, but the average voltage may be 2.5V or 3.3V?
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If a power outage occurs, in the process of recovery you examine the data in the BBRAM, see if it that data has been put in the EEPROM, check the EEPROM data in general (in case the outage occur at the moment of it being written) and complete the above procedure as necessary.  This is essentially the same process as you expect your PC disk system to do in "journalling".

I still don't get the idea on writing environment and trying to catch it up; in layman's term, having CR3032 Shield would protect my data from power failure or it would still remain?

Are you saying that the sensor provides 5V or 0V, but the average voltage may be 2.5V or 3.3V?

I am using an analog volt meter when the sensor is engaged during my testing, my meter show 2.5V to 3.3VDC, may be because I am using analog meter while the actual input to sensor voltage is 5V, but I believed oscilloscope or Arduino may able to read the 2.5V on my eye as 5VDC, I agree, analog tester will not provide the actual peak voltage on 200Hz to 400Hz of square wave but I believe Arduino can catch the peak voltage enough to tell On and Off through input terminal. My previous elaboration is not complete, but here it is, I'm hoping UNO can catch it but how it manage to take up that input voltage?
Logged

NSW Australia
Offline Offline
Edison Member
*
Karma: 35
Posts: 2385
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I still don't get the idea on writing environment and trying to catch it up; in layman's term, having CR3032 Shield would protect my data from power failure or it would still remain?

In broad terms, what you write to the Battery Backed RAM will be protected from loss by the battery, and could survive for years.  But you want it in EEPROM, especially as that has much more space.

You therefore create a system which writes the data as you collect it to the BBRAM.  Every so often, either when you have collected a certain number of events (BBRAM is full, or nearly so) or else after a certain period of time on which you have decided, you write this information to the EEPROM.  Only when you have checked that the information has been completely written to the EEPROM, do you wipe the BBRAM clean, ready to collect more data.  You check this by writing a serial number to the BBRAM and (only after all the data has been written and checked) to the EEPROM, if the serial numbers are equal when you do the check (which you have to do whenever the power has been lost), then the EEPROM is up to date and you can clear the BBRAM to collect more data.

If data occurs whilst the power is off, well, you lose it.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Paul

I'm planning to get one now of Arduino Micro at this stage for programming purposes on I/Os to understand more closely about all these information and data storage environment.

Is there any difference to avail Micro than UNO for learning purposes? I don't want to spoil UNO as if my final choice.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I made the test of my flow sensor by flowing water at varying speed through push button program, the sensor is acting a push button and redirect the output to LED. While the flow is slow, the LED blink as per the wave lenght but when the flow is fast, visually the LED is stationary. I aware that I need to put 10k ohm as pullup resistor when on Off status due to sensitivity of the I/O, but if I have like 3.3VDC of average pulsating input voltage from sensor, do I have to alter the 10k ohm to appropriate?

Also, I've got UNO, nothing else like LCD display where I can see the counts and time. Is there any way through Arduino software would accept back the information I want o see what's happening on the data?


* UNO flow sensor test.jpg (215.21 KB, 861x683 - viewed 15 times.)
Logged

NSW Australia
Offline Offline
Edison Member
*
Karma: 35
Posts: 2385
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You should not have to alter the pull-up for different voltages - but you should not need a pull-up if you are enabling internal pull-ups in the Arduino.

More than that I cannot say without a reference (URL) to the flow sensor - did I miss this earlier?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

More than that I cannot say without a reference (URL) to the flow sensor - did I miss this earlier?

yes seems you missed that earlier, this is the URL, but 10k looks good on my testing but can I use 330 ohm instead, to increase the current sink from 0.33mA at 10k to 10mA of 330 ohm with 3.3V?

http://www.ebay.co.uk/itm/G1-4-0-3-3L-min-Water-Coffee-Flow-Hall-Sensor-Switch-Meter-Flowmeter-Counter-1-/271254826118?pt=UK_BOI_Electrical_Test_Measurement_Equipment_ET&hash=item3f280c2c86

This is my current concern as per the attached image. The microprocessesor picks up multiple High state like 2 to 40 count per peak phase on cycle produced by the sensor, and it depends on Tank capacity of the speed on flow sensor due to pressure.  Attached has the image of my input test with actual water speed on faucet while at mid filled tank using push button type source code.

To switch the UV light i need only the starting/rising point of cycle and the falling end like on the attached image says "Desire data input" and I would use later the frequency input for metering counts. But this simple "Desire input data" complicates the simple switching process. Interrupt is my last option but if there is better idea I could get from the Forum how to take up this pulsating input, I'll be very grateful about that. The quantity of the High state per peak on cycle may vary as the source code increases due to total loop cycle time.

Anyone can share me descriptive code how to deal this type of input?




* pulse input.png (9.81 KB, 939x312 - viewed 5 times.)

* on faucet flow sensor frequency.jpg (85.61 KB, 546x581 - viewed 15 times.)
Logged

NSW Australia
Offline Offline
Edison Member
*
Karma: 35
Posts: 2385
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yes seems you missed that earlier, this is the URL
So I did!  Didn't fancy reading everything prior.

but 10k looks good on my testing but can I use 330 ohm instead, to increase the current sink from 0.33mA at 10k to 10mA of 330 ohm with 3.3V?
I don't follow.  Why would you be using a pull-up on the output from a Hall sensor?  Where does it say you might need this?  And why would you ever want to increase the current wasted in the pull-up if it did require  a pull-up?  One useful thing is that if it does (and only if it does) require a pull-up, you have no problems with interfacing, as you just connect the pull-up to whichever logic level the Arduino expects (IOREF).

Interrupt is my last option
No, it simply isn't an option at all.

If there is better idea ... The quantity of the High state per peak on cycle may vary as the source code increases due to total loop cycle time.
With the possible exception of serial output which I gather will not be in your final design, nothing should delay the main loop to any significant extent, it simply polls the sensor each cycle through, counting each change from a previous state.  The "delay" function in the language is just for demonstration, it has little relevance to actual projects.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why would you be using a pull-up on the output from a Hall sensor?  Where does it say you might need this? 

I'm not sure of the impedance on I/O terminal, but instead trying to sink in consistent current input to make sure signal is delivered, I might be wrong on this idea.

No, it simply isn't an option at all.

great, just to catch expert's advise.

counting each change from a previous state. 

This is where my brain is bleeding, by replacing delay with clock frequency monitoring. Can I change processor timer or frequency to align within the window of sensor?

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I want to share back the progress on my project, those who are interested I can share my design and program while we're doing it in parallel to say my gratitude, I'm calling it "ROUVuino Controller" for 7 stage filtration with UV added but no DI.

1) Power Sensing and Indication - done
2) Booster Pump Sensing and Indication - done
3) Flush out timer - inprogress
4) Auto Shut-Off Sensing, setting working and idle window - straight forward
5) UV light switching - great challenge
6) Filter Monitoring and Alarm - great challenge

The system has without DI or De-Ionization stage, but I am getting 2-4 TDS (Total Dissolved Solid) which is not bad at all while the inlet has 450 TDS  and having 50% water production with few innovation at waste and inlet port. This is a heads-up for someone might done already doing TDS metering using Arduino, I really want to catch that idea which I can add on the list above by not being dependent on 3rd party TDS meter.
Logged

NSW Australia
Offline Offline
Edison Member
*
Karma: 35
Posts: 2385
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm not sure of the impedance on I/O terminal, but instead trying to sink in consistent current input to make sure signal is delivered, I might be wrong on this idea.
Sounds as if you are not familiar with digital circuits!  smiley-lol  In general, impedance need not worry you - you connect outputs to inputs.  You may need a pull-up if you encounter an open-collector device, but nothing in the information I can see suggests that might be the case for that particular Hall sensor.

great, just to catch expert's advise.
Hardly, but the point is made, your task, including looking for pulses on your flowmeter, is very slow compared to a microcontroller, so interrupts introduce unnecessary complexity and a serious risk of (logic) mistakes.

This is where my brain is bleeding, by replacing delay with clock frequency monitoring. Can I change processor timer or frequency to align within the window of sensor?
No, no no!  It is not your business to change things that have been set up especially for your convenience.  Nothing needs changing.

You have a counter that each time you look at it, gives a clock in milliseconds.  If you wish to know how long something took, or when to do the next thing, you simply take a note of the time, figure out what time you have to do the next thing and look at the clock every time you "think" of it to see whether that appointment is due.  That's how you organise your daytime tasks, and that's how you do it here.  You have to organise your other tasks so that they do not occupy you for such unreasonable lengths of time that you "forget" to look at the clock.  You probably have a number of tasks that will be due or complete at certain times so for each one, you note when it is due and then you check the clock and see for each task on the list, whether it is due.

But you might be boiling the kettle too, so you don't look at the clock, you look at the kettle (or your flowmeter).  You look at the clock, look at the kettle, look at the clock, look at the kettle, back and forth, whichever experiences an "event", you deal with that event and go back to your watch.  That's what your "loop" is for.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sounds as if you are not familiar with digital circuits! 

I'm more on discreet but not the same on digital which xp is far off, and program is intermediate.  smiley-lol

I have more than 14 I/Os on my list, I am looking forward of Mega 2560, what complicates me if I go with it?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

  My RO controller is getting finished, I would like to say your all support is really helpful and I really appreciate it.
  I made a long test and programming on the breadboard and I hope the final connection of the panel and controller be a successful.

  Here's the panel with attached, I will update you on the progress.



* ROUVuino panel3.jpg (369.27 KB, 1218x697 - viewed 17 times.)
Logged

Pages: 1 [2]   Go Up
Jump to: