Hi, I never did anything that should survive outside for longer time so I would like to ask for advice from someone more experienced.
My goal is to measure amount of water in our well. The "sensor" is already in place - wires of different length, connecting the longest one to GND and the rest to LEDs you can see which wires are conducting (meaning they are immersed in water). The well is outside, about 20m from our house and you have to go to it to measure the water level. I would like keep this setup for now but measure via "Arduino" and send it wirelessly inside to be able to read the result effortlessly.
For now I plan this setup: wireless comunication will be via nRF24L01+. The device inside will be connected to mains with unlimited power, it will wait for data from the device at well all the time. It looks easy. On the other side the device at well will have resources very limited and will be in "hostile" enviroment.
So the device at well will consist of standalone ATMega powered from batteries. It wil run from internal oscillator and keep time via 32kHz crystal and Timer2. If possible only other IC will be the nRF. Both will be in deep sleep as much as possible - probably ATMega waking up every 4s when Timer2 overflows to clear Watchdog and update time. Level of water will be probably transmitted every hour - I guess it will not change faster. So total power consumption should be very small - average should be in order of uAs + power needed for transmitting. Since there will be very little data to send I hope total will be well under 100uA average - let say 2mAh per day. So far it looks good. But I see two problems:
The lesser(?) problem is water: rain and condensation - I hope I will solve it with some sealed box. Does a plastic box "sealed" by hot glue count as "water tigth"? Also I am afraid it will not be as easy as sealing the box filled with room air - I should get dry air inside somehow to prevent condensation in winter?
The worse problem is temperature. The inside device will have temperature more or less fixed. But the device outside will have to survive temperature from (about) -20°C to +30°C. Since it will be battery powered I think I cannot afford heating - I have no idea how much power would heating of well insulated device take but it will be probably much more than the rest of the circuit. The chips should be safe - they are rated from -40°C to +85°C.
But what about crystals? Is there risk the 32kHz time-keeping crystal will stop oscillate? And worse - is it possible the nRFs will get out of sync due to different crystal speeds caused by different temperature?
What will batteries do at -20°C? I thought about using 2 AA cells without regulator (and probably buffered with large cap to cover power consumption of the nRF when transmitting). It should work well at room temperature. But what about this temperature range? What is good battery chemistry? At first I wanted to use low self discharge NiMH batteries. How will they take the cold? Will they be able to be recharged or will the capacity of the cells suffer? Maybe using alkaline batteries will be better? Or do you think I should use some other chemistry?
Thanks for reading and any inputs.
Even if it were 10% out time wise...I wouldn't worry about it. You can timestamp the data packet on the receiver end. This doesn't sound like a very "time critical" application.
You could make this project very small and easy to waterproof by maybe getting a PCB printed?
It doesn't take long to learn...and they are quite cheap if they are small.
You not tempted by an ESP8266? It could wake up every hour, connect to your router and upload the data to a PHP backend. It is basically the Arduino and the WiFi in one small package. I use one for a weather station project...it takes readings every 15 minutes and it lasts about 3 months on 4AA batteries in series (via a 3.3V regulator).
Here is the basic set-up to have it so that it sleeps and buttons to burn new code:
Johnny010:
Even if it were 10% out time wise...I wouldn't worry about it. You can timestamp the data packet on the receiver end. This doesn't sound like a very "time critical" application.
If I understand it right nRF takes 16 MHz from crystal and multipies it a frequency between 2400MHz to 2525MHz (selectable from SW). The signal should stay in 1MHz band - I concluded at least 500 ppm precision of the crystal (over whole temp and voltage range!) is needed to maintain communication. I don't understand RF communication much but I think also some passives are needed to connect to the antenna. Their value will also shift possibly making the signal weaker, adding to frequency shift problems. But I never did something like that - maybe there is some compensation inside or the effect is neligible?
Johnny010:
You not tempted by an ESP8266? It could wake up every hour, connect to your router and upload the data to a PHP backend. It is basically the Arduino and the WiFi in one small package. I use one for a weather station project...it takes readings every 15 minutes and it lasts about 3 months on 4AA batteries in series (via a 3.3V regulator).
I though about it. But I have no idea what "PHP backend" is and also I think power consumption of such solution will be a lot higher - much more data to send, etc. Apart from learning all internet related stuff I will have to learn about sleep modes and other features of the ESP. But I will check if the router has signal reaching to the well and if so I may try it one day.
What batteries are you using? Do they endure low temperature in winter?
The Nordic nRF24L01+ datasheet states the Absolute Max Operating Temperature range as -40 to +85. That suggests you will have a good margin for error.
For excluding moisture would it be practical to "paint" the completed device with epoxy potting resin?
...R
"Conformal coating" is used to coat the PCB with a layer that keeps moisture out. It's essential for anything that might get moisture on the PCB. Often it's called "solder through coating" because you can still use a soldering iron to melt the coating and make changes on your PCB.
You can buy it in electronics stores. You can also buy clear nail polish and use that: it's really the same stuff. Just paint it all over the board and every metal part which doesn't move.
MorganS:
You can also buy clear nail polish and use that:
That sounds like a sexist remark. What would be wrong with a nice pink?
But I agree it would be much simpler than epoxy. And it is very easy to remove with nail polish remover if necessary.
...R
Clear is nice because you can see the PCB through it.
This is the first time I've been questioned on the choice of colour. Most other shades raise questions and generate opinions on the best colour.
Sealed boxes have a big problem: air leakage. During the day it's warm, and air pressure goes up. Any tiny leak will cause air to leak. At night it cools down and moist air is pulled in. Moisture starts to build up inside the container. So if you go for sealed, make sure it's sealed to handle some serious pressure differences (you're talking about 40-50 deg differences, that's a lot of pressure!).
pV=nRT and if T changes by 40-50 degrees that's about 20% of -273 degrees (0 K) so your air pressure will also vary by 20%, so between say 0.9 and 1.1 Atm (if you start at average temperature). That's a mighty strong box to withstand such pressures.
I'm having quite good success myself with some poorly sealed 12V adapters in waterproof boxes here. They withstood some massive rainstorms and typhoons over the past two years, and the only time my power went out was a week ago when one of the boxes ended up in 3 cm of water and the RCB tripped... they're NOT sealed, so water reached the mains power. The lid just slides on and in the bottom are some huge holes for the cables. Yet they keep the inside dry. Exposed to the atmosphere, but because of that no chance of moisture building up.
So that's my current strategy, and with experience of leaky "waterproof" boxes (those geocaches always get water in them over time) I have the feeling it's the better way. Do apply conformal coating to your PCB as extra protection, as your environment will be a bit more moist than inside your home. I'm not sure if it's too necessary as I can't imagine those cheap 12V adapter PCBs have it, yet they don't show much if any corrosion.
MorganS:
You can buy it in electronics stores. You can also buy clear nail polish and use that: it's really the same stuff. Just paint it all over the board and every metal part which doesn't move.
Thanks for the tip, it looks easy. But I think I still should cotrol humidity anyway because I cannot cover everything - i.e. batteries, programming port must be exposed. But I can the nail polish to the rest to be sure.
wvmarle:
pV=nRT and if T changes by 40-50 degrees that's about 20% of -273 degrees (0 K) so your air pressure will also vary by 20%, so between say 0.9 and 1.1 Atm (if you start at average temperature). That's a mighty strong box to withstand such pressures.
I didn't think about this! I doubt extra strong box is needed - AFAIK such difference in pressure happens when you go to mountains or fly by an aircraft. Sure, if you open plastic bottle up, close it and take it down it may collapse a bit. But I have never seen a bottle exploding when taken to high altitude. But my pathetic hot glue "seal" may be the weak point - I need to be carefull about it.
Currently I tend to use sealed box + some desiccant, I hope it will work nicely.
Hi again, I have nearly finished the project by now. For all ICs I used sockets instead of soldering them directly - I have considered it very clever since this way the ICs are not in risk being damaged by my poor soldering skills and even if some IC get killed by ESD or something I can easily replace it. But is it really so clever? Now when everything is new and shiny it works well but what will happen after a few years? I remember disassembling old garden lights - there were rust everywhere, conductors nearly eaten by the rust. I am afraid the same will happen with my board and when rust covers legs of my ICs they will lost connection with the sockets. Is it inevitable fate of all sockets outside or when I prevent water to reach the contacts this will not happen? The sockets should be gold covered (the eBay manufacturer claims - I don't see gold inside) but AFAIK IC legs are not...
Even with the ICs directly soldered to the PCB there is a risk of corrosion. I don't think using sockets makes the risk significantly worse and, as you said, their use eliminates some more immediate risks.
You do need to keep all electronics as dry as possible - if for no other reason than the fact that a film of water can conduct electricity where it is not wanted.
...R
You can spray your project with a conformal coating. That should at least extend the lifespan of your project. Keeping it dry is another thing of course. Keeping water out of an enclosed box is VERY difficult (temperature differences cause air pressure differences, and that sucks in water). I prefer to make my boxes closed but well ventilated, though after a year or two in a humid climate I do see corrosion (which is worse than the corrosion of stuff that is used indoors - it's that humid here most of the year).
I have a similar development based on an ATmega328p and nrf24l01. It is fixed to the back of my mailbox at the street end of the garden. It is exposed to rain etc. and survives that. I use this box for it: Waterproof ABS enclosure F2-P1 158x90x60mm - Electronics Cases - Boxtec Onlineshop. I have to open it say every 9 months to change the batteries (2 AA cells). Part of the information the transmitter sends is the battery voltage.
wvmarle:
...... Keeping water out of an enclosed box is VERY difficult (temperature differences cause air pressure differences, and that sucks in water).....
Sealing a rigid box is difficult. However you could put a lot of the electronics within a latex or rubber bladder, and put that in the box. If the air pressure in the box changes the bladder simply expands and contracts so the air within the bladder remains dry. The only trick bit is getting the electronics in through the neck of the bladder without tearing it.
you could put a lot of the electronics within a latex or rubber bladder,
I wish that I had not read that. Now I have an indelible image in my head of an Arduino in a condom !
It will probably do the job just fine.
Condoms have seen many engineering uses over time (such as to helping soldiers to keep sand out of their rifle barrels).
I wonder if the electronics will be happy with the lubricant on the condoms? It help to put it inside but... Also I know condoms are supposed to survive a lot but adding a dessicant and letting it to freeze and thaw a few times is a bit "out of specs" I guess. I will try to find some other "bladder" for this application ![]()
A condom is not a bad choice, you could probably get an Uno in without tearing if you were careful. You could then tie a knot in it along with any wires to the outside. You might want to experiment with glues though to get a really good seal. Having some excuses for having a lot of dead condoms might be a good idea.
P.S.
Don't forget to post pictures of your finished project.
I worked in the cell phone industry, we used condoms to do volume measurements of the phones... you have to suck the air out with a straw, so that was our initiation ritual for new hires - but everyone had to get over the "yuck factor" and do it on a semi regular basis.
I would say that socketing the IC's definitely will reduce the lifespan of the project. It's more stuff to corrode and corrosion always likes to get into the small spaces between things that touch. Corrosion can't get into the inside of a solder joint - it has to attack the outside.
Also the additional complexity means that spraying it with coating makes it more likely that the coating won't get under the chip into the spaces that actually need protection.
