OpenSprinkler › Forums › OpenSprinkler Unified Firmware › Couple of questions
Tagged: Aeroponic, current sensor, OSPi, water flow
- This topic has 15 replies, 4 voices, and was last updated 7 years, 10 months ago by Csaba Toth.
-
AuthorPosts
-
October 3, 2016 at 2:03 am #44200
951calguyParticipantWhat type of flow sensor is actually working with the OSPi? I have been trying to use the data industrial, cst(creative sensor technollogy), and the netafim reed switch flow sensors without success, I have tried in 2 different boards. This is the data industrial one which is used the most on landscaping applications, this is the cst sensor, and this is the netafim one as well. The netafim would be the easiest to use with OSPi since it doesn’t require any K and Offset values to be entered to the timer in order to read flow, netafim is already configured to provide a set value of for example 1 pulse per gallon but not even this flow sensor works with OSPi, I get a reading right after connecting but that’s it, it doesn’t continue to read anymore with any of the sensors.
Question 2. How often is the flow value refreshed? Being able to have a real time flow reading is crucial to troubleshoot hydraulic problems, Example I can learn the flow of each station free of breaks and keep that data with me, if at a later time I get a higher value I will know that there is a break if I get a lower value I will know that probably the valve is not opening all the way.
Question 3. How hard is it to implement current sensing and have the values displayed on OSPi? Again this is crucial for electrical troubleshooting.
Question 4. How much data does OSPi require to make full use of Weather underground and normal programming/monitoring of system? Again this is very important when using this timer remotely with a 3g or 4g connection that usually is very expensive.
Thank you very much, I look forward to your replies.
October 11, 2016 at 2:13 am #44306
RayKeymaster1) Both the sensors you mentioned should work with OSPi. You can simulate a flow sensor by connecting a switch (or simply two wires) to the sensor port, and clicking the switch a few times (or equivalently shorting the two wires a few times) to simulate the clicking of flow sensor, and the real-time flow rate shown at the bottom of the homepage should change (it updates every 30 seconds I believe).
2) As I said, the refresh rate is 30 seconds I believe. This is because it needs to accumulate at least several clicks before it can measure the flow rate accurately. This is especially the case for flow sensors that have low pulse rate (i.e. smaller number of clicks per gallon). You can increase or decrease the refresh time by changing the parameter in defines.h and re-compile the firmware.
3) The microcontroller-based OpenSprinkler (either AC or DC) has current-sensing circuit already. OSPi doesn’t have current-sensing yet — but it’s possible in future revision since there is a ADC chip on board.
4) The data is very small because the weather script is hosted on our cloud server, so when it queries for weather, it merely sends a request to the cloud server and the script on the cloud server does the computation and return the result to OSPi. By default the firmware queries the server once per hour, but you can make it less frequent by increasing the time interval.
October 14, 2016 at 1:14 pm #44328
Csaba TothParticipantHi Ray,
Where I can find the solution for current-sensing? I have surfed the github hw content there is no change.
I have just designed and tested a current sensor, what can be used for OsPi and Os as well.
I make a drawing soon and attach it.I also separated the sensor inputs: rain switch, flow-sensor, and soil moisture sensor either switch or analogue version.
I also attach the hw solution.I have seen in a different post, where you inform about the new firmware version is on the way.
Do you think the current sensor and the separate sensor inputs can be fitted in that version?Thanks, Csaba
October 14, 2016 at 1:59 pm #44330
Csaba TothParticipantThe sensors schematics.
Attachments:
October 31, 2016 at 12:08 am #44418
RayKeymasterAh, I just realized the schematic in the github is not the most up-to-date — there was a minor update that adds the current sensing circuit. I will check that in soon. Attached here is the current sensor part that’s relevant. I just used a low-cost LM358-based precision rectifier circuit. What you have designed is probably more sophisticated and accurate that mine. Note that the GND pins on the zone expander connectors are also connected to the current sensing resistor, this way all stations on the expansion board also return current through the sensor.
Attachments:
October 31, 2016 at 1:28 am #44438
951calguyParticipantThe sensors I mentioned do not work with OSPi on every timer I have tested there is a 5v dc that’s why the sensor has a red and black leads and the manufacturer says not to invert connections I do not think they arevsimply reed switches.
November 6, 2016 at 10:13 am #44477
RayKeymasterGenerally, black is ground, and red is 5V power, and there is a third wire that connects to the data pin. On OpenSprinkler’s sensor port, the right pin is ground, left pin is data, and you need to solder a wire from the pinout area to get 5V (it’s marked VIN). It should work this way.
November 6, 2016 at 12:52 pm #44483
951calguyParticipantThese sensors only have 2 wires a black and a red.
November 7, 2016 at 8:28 pm #44508
RayKeymasterOh, that’s interesting. Do you have a link or spreadsheet of the sensor? How is the sensor supposed to be wired?
November 7, 2016 at 8:36 pm #44509
951calguyParticipantYes I thought I had posted the links but I will post them again, over a year ago I sent you one of these flow sensors.
November 8, 2016 at 9:12 am #44519
951calguyParticipantYes I thought I had posted the links but I will post them again, over a year ago I sent you one of these flow sensors. The links are on the first post Ray.
November 10, 2016 at 11:01 pm #44562
BrianNOLAParticipantAfter lots of surfing I can’t believe I found you guys talking about exactly what I am researching.
Has anyone found a flow sensor that can sense low volumes relative quickly?
I am developing an aeroponic irrigation system and would like to be able to monitor each flow, more importantly to insure that the water was delivered, but also to keep tabs on the dosage volume. Flow is only about 5 seconds about every 4-5 minutes.
Any suggestions or direction would be greatly appreciated.November 15, 2016 at 3:04 pm #44597
Csaba TothParticipantRay, replying to the current sensor topic. Since my post I have brushed a bit the circuit. Pobably the LM358 one opamp version can be used well for current trouble sensing. Does the firmware handling the current sensor in the new version 2.1.7? As I seen the user manual, the UI not yet prepared to process the current deviations.
November 16, 2016 at 4:58 pm #44609
Csaba TothParticipantWhen you use one OpAmp for current sensing there is no amplification. Assuming 3 valves the output voltage range is around 0,75A * 0,2ohm = 150mV. Depending on the offset it could be worse. The LSB of ADC is 3,2mV using the 3.3V supply as reference. Full scale swing is 50 LSB for 3 valves, 16 LSB for one valve. This still could be enough for current fault detection, but the resolution is quite low.
In my solution there is an amplification, to make sure the wider swing, the resolution for one valve is 137 LSB what definitely enough for valve diagnostics.
As most OpAmps are dual version, the 2 OpAmp solution has no cost increase, and LM358 vs MCP602 doesn’t make a serious difference.
This circuit was not working well using LM358 due to the limited output swing.
For protection I like the 5V TVSS solution vs. the the BAV199 diodes.Attachments:
November 20, 2016 at 10:16 am #44664
RayKeymasterThe way the current sensor is implemented on OpenSprinkler circuit is basically a current sensing resistor (0.2 ohm), combined with an op-amp based precision rectifier to convert AC voltage to DC voltage. So you are right that there is no amplification. Since LM358 has two op-amps in one package, and the other one is currently left unused, it’s possible to use that one for amplification. Because Arduino’s analog pin is 10-bit precision, so one bit of change corresponds to 3.3V / 1024 volt change, that divided by the resistance of the sensing resistor (0.2 ohm) leads to about 16mA, which means the precision of the circuit cannot be better than 16mA. Generally since sprinkler solenoids draw a couple hundred of milliamps, this is not a big problem.
Alternative options are to use a dedicated current sensing IC, such as ACS712.
OpenSprinkler firmware handles reading current sensor value, specifically here in the code:
https://github.com/OpenSprinkler/OpenSprinkler-Firmware/blob/master/OpenSprinkler.cpp#L771November 21, 2016 at 11:14 am #44706
Csaba TothParticipantI have found the code meantime.
But As I see nothing happens with the current in this version, no display no log, no alarm.
Or I just couldn’t find it.I am planning an alarm condition handling for flow and current faults.
Also I have separated the sensor functions to 3 inputs.
Rain / Program Switch
Flow Sensor
Soil Moisture SensorThe system specification and hardware is close to finish. I have some experience in coding, but this job beyond my present knowledge.
The coding should fit into the present logic of the firmware what again is not my level of understanding.
If there is somebody with skills required and interested in this project to complete, I would be happy to work together.I have studied the ACS712 to use for this purpose. The smallest range is +-5A (10A swing). One valve is around 0,25A, what makes 46 mV change on the output. Because the output is quite noisy I think this would not work well for this job. Moreover there is a half-supply output bias so the amplification would make some pain.
After several circuits tested I have made the 2 OpAmp choice what I have shown in my previous post.
Tested under real environment using max. 4 valves it has been proved to be fine for the project.And also your solution is fine for fault detection. Solenoids used to break and wires are cut or short. Never seen shorted solenoid. Valves draw 200 – 275mA So the 16mA resolution should be enough.Some autozero routine would make the current measurement more precise avoiding the OpAmp offset errors.
-
AuthorPosts
- You must be logged in to reply to this topic.
OpenSprinkler › Forums › OpenSprinkler Unified Firmware › Couple of questions