dslreports logo
Search similar:


uniqs
1101
LittleBill
join:2013-05-24

LittleBill

Member

Water leak Alarm

This is a continuation from this thread

»water leak sensor

Well this is complete. it worked flawless for about 3-5 times, then all of a sudden the arduino would not power up off AC, only via USB. appears the voltage regulator died, which was a bit troubling. i am powering it with a 9v ac/dc converter. that said it appears the new one is working great.

pictures and link to video below

»youtu.be/1PkchIHCJhY
LittleBill

LittleBill

Member

Click for full size
Click for full size
Click for full size
Click for full size
LittleBill

LittleBill

Member

Click for full size
finished product
TheMG
Premium Member
join:2007-09-04
Canada
MikroTik RB450G
Cisco DPC3008
Cisco SPA112

1 edit

TheMG to LittleBill

Premium Member

to LittleBill
Few things...

1) No fuse on the incoming AC?

2) Appears some of the insulation on those AC cord wires are pinched under the terminals. Should be able to see some copper there.

3) That 9V power supply looks sketchy as heck... where did you get it from? Could you post some more detailed pictures of it (both sides if possible)?

4) What is that transparent wire you've used?

5) Terrible soldering job on those header pins. Since you're using solid copper wires you could get a wire-wrapping tool and you'd get much cleaner more secure connections. Wire-wrap works great on those square pins.

6) Hot glue to mount everything in place... not ideal. If something gets warm it could come loose and touch one of those mains AC connections!
LittleBill
join:2013-05-24

1 edit

LittleBill

Member

said by TheMG:

Few things...

1) No fuse on the incoming AC? bought some 5x20 fuses Thanks!

2) Appears some of the insulation on those AC cord wires are pinched under the terminals. Should be able to see some copper there.

no nothing is pinched, there is a bit of room under the screws.

3) That 9V power supply looks sketchy as heck... where did you get it from? Could you post some more detailed pictures of it (both sides if possible)? ebay item 181716582705

4) What is that transparent wire you've used?
random wire from my "wire" bag

5) Terrible soldering job on those header pins. Since you're using solid copper wires you could get a wire-wrapping tool and you'd get much cleaner more secure connections. Wire-wrap works great on those square pins., please provide video on better solder of said wires. wire wrap tools are a fortune, even the chines rip offs

6) Hot glue to mount everything in place... not ideal. If something gets warm it could come loose and touch one of those mains AC connections!

i guess, but literally nothing in there gets hot. takes a significant amount of heat to get that glue to get loose. what would you use?

answer in line

tschmidt
MVM
join:2000-11-12
Milford, NH
·Consolidated Com..
·Republic Wireless
·Hollis Hosting

tschmidt to LittleBill

MVM

to LittleBill
Great little project, glad you got it working.

This and the previous thread got me thinking about my leak detection project, guess I ought to push it up on the to-do list.

As far as fusing you can use either a 3AG or metric 5x20 fuse and holder. Those are available at any electronic supplier.

Depending on how water tight you need the enclosure to be you could also use an IEC connector with a built in fuse holder, as used on PCs. That would allow you to use a detachable line cord.
»www.ebay.com/itm/1x-Gree ··· cc159d06

Now that this one is in the bag, what's next? I find these home electronics projects rather addictive.

/tom
LittleBill
join:2013-05-24

1 edit

LittleBill

Member

said by tschmidt:

Great little project, glad you got it working.

This and the previous thread got me thinking about my leak detection project, guess I ought to push it up on the to-do list.

As far as fusing you can use either a 3AG or metric 5x20 fuse and holder. Those are available at any electronic supplier.

Depending on how water tight you need the enclosure to be you could also use an IEC connector with a built in fuse holder, as used on PCs. That would allow you to use a detachable line cord.
»www.ebay.com/itm/1x-Gree ··· cc159d06

Now that this one is in the bag, what's next? I find these home electronics projects rather addictive.

/tom

i didn't really need it waterproof, but its pretty darn close. the sensor wire is cat5 and is about 7 feet long so the box will stay up on a table out of harms way.

the next project is a sump pump controller. my buddys float control is busted on his pump. im going to build a electronic version of the pedestal type float switch, which will also be programed to keep the pit as low as possible.

might be a bit though. i burned up my last controller, and i have a deck and a foundation on my house to paint. work never ends it seems

thanks for the help with the sensor, mine was very similar to yours with the transistor etc. it got me going down the right path.

like you said, it couldn't run crap it seems on its own
TheMG
Premium Member
join:2007-09-04
Canada
MikroTik RB450G
Cisco DPC3008
Cisco SPA112

TheMG to LittleBill

Premium Member

to LittleBill
said by LittleBill:

ebay item 181716582705

I tend to be wary of cheap power supplies especially from places like eBay, that aren't listed/approved to meet some form of safety and EMC standards.

For one, it doesn't look like that power supply contains any of the components normally required to satisfy EMC compliance. While it may work fine and might not bother you, any amateur radio operators near you or anyone trying to listen to AM radio stations might have a thing or two to say about the interference it could be generating.

While it's difficult to tell from pictures, the power supply may or may not have the required safety isolation between primary and secondary. The most common issue is insufficient insulation between primary and secondary windings in the transformer, and insufficient creepage distance between components and traces on the PCB.

Additionally, they tend to be unreliable and have short life spans. By the sounds of it, you've already had one fail?
said by LittleBill:

please provide video on better solder of said wires. wire wrap tools are a fortune, even the chines rip offs

The "automatic" gun-style tools are but the manual ones you have to turn with your fingers can be had fairly cheap (under $20) and work just as good, just takes a bit longer to make the connections.

Anyways, as far as achieving better solder connections goes, it would help to use wire that doesn't melt so easily. Wires from CAT5 cable melt too easily for convenient soldering. Yes, I've been there and done that too in my early days of electronics hobby. These days I've picked up a few small spools of cheap PVC insulated hookup wire and it's much easier to work with than the CAT5 stuff.

You could use a pair of small needlenose pliers or tweezers to wrap the wire at least a couple of time around the pin, making sure the end of the wire is tight against the pin (trim it off if necessary). Apply heat and apply just enough solder to wet the connection (no blobs). Applying a bit of flux beforehand can also help get a bit better solder flow.

Anyways, I'm sure you'll get better with practice and as you learn new techniques. I'm not trying to be negative here just trying to provide some constructive feedback on how you can improve on this and future projects both on a general workmanship as well as a safety perspective.
said by LittleBill:

i guess, but literally nothing in there gets hot. takes a significant amount of heat to get that glue to get loose. what would you use?

True, normally, but if something fails it can get hot.

One idea would be to install a backplate (either plastic or metal) inside the box, and secure the various boards with screws and standoffs. Or, if keeping the box completely watertight isn't too much of a concern you could also just drill through the box to place the screws.

Silicone or epoxy could also be used instead of hot glue. Epoxy is rather permanent but silicone can be cut out if needed. Once cured, silicone is quite heat resistant and usually adheres to most surfaces better than hot glue does. Also hot glue can detach if the unit is subjected to an impact, but silicone won't and will actually absorb a bit of the shock.

mackey
Premium Member
join:2007-08-20

mackey to LittleBill

Premium Member

to LittleBill
said by LittleBill:

i guess, but literally nothing in there gets hot. takes a significant amount of heat to get that glue to get loose.

Until the power supply fails. Those things can get HOT! I don't mind the glue on the other boards, but I'd never use it on a power supply.
mackey

mackey to LittleBill

Premium Member

to LittleBill
said by LittleBill:

the next project is a sump pump controller. my buddys float control is busted on his pump. im going to build a electronic version of the pedestal type float switch, which will also be programed to keep the pit as low as possible.

I'm not convinced this is a good idea. While those sensors are fine for the occasional water contact like this alarm, I'm concerned about the corrosion and crud buildup that comes with constant water contact. A high quality one designed for such use /might/ work, but an el cheapo like the one used for the alarm I suspect will fail in short order. There is a reason all "professional" pump systems use sealed float switches.
LittleBill
join:2013-05-24

LittleBill

Member

said by mackey:

said by LittleBill:

the next project is a sump pump controller. my buddys float control is busted on his pump. im going to build a electronic version of the pedestal type float switch, which will also be programed to keep the pit as low as possible.

I'm not convinced this is a good idea. While those sensors are fine for the occasional water contact like this alarm, I'm concerned about the corrosion and crud buildup that comes with constant water contact. A high quality one designed for such use /might/ work, but an el cheapo like the one used for the alarm I suspect will fail in short order. There is a reason all "professional" pump systems use sealed float switches.

never said i was using these sensors for that project. i have regular float switches i will be using
TheMG
Premium Member
join:2007-09-04
Canada
MikroTik RB450G
Cisco DPC3008
Cisco SPA112

TheMG to LittleBill

Premium Member

to LittleBill
said by LittleBill:

the next project is a sump pump controller. my buddys float control is busted on his pump. im going to build a electronic version of the pedestal type float switch, which will also be programed to keep the pit as low as possible.

If you want to build this strictly as an experiment to play around and learn with, go ahead, however I wouldn't depend on such a homebrew device to keep the basement from flooding. If you're going to attempt that for your buddy I hope he's got a backup pump in place. Otherwise, I hope you have very good liability insurance.

Especially if you're going to build this with parts of questionable quality like that power supply which could pretty much fail at any moment.

I'd say the regular float switch that comes with these pumps is likely to be more reliable than any kind of electronic control you could put together as a beginner hobbyist. The regular float switches are virtually immune to events such as power surges, and there are no other internal components to fail other than the switch itself.

In fact, the relay you use in your electronic control probably has just about as much chance of failing as the plain old float switches that comes with these pumps, which are generally quite reliable to begin with.

I'm not trying to discourage you from doing this project, just saying that if I were you I wouldn't depend on it as being the ONLY thing preventing the sump from flooding.
LittleBill
join:2013-05-24

LittleBill

Member

basement already floods, so anything is an improvement. lol if it makes you happy, i bought a different psu as i bought 12v coil relays.

»www.ebay.com/itm/AC-to-D ··· d981efe3

how soon is that one going to catch on fire?

to be honest you haven't really said a single positive to me yet, but its ok im taking it in stride
LittleBill

1 edit

LittleBill

Member

on a side note, who makes quality relays?

and what recommendation do you have for psu modules?

and to be honest your right, i agree the stuff for the most part is junk, and after the voltage regulator burned out on the arudino, i got a bit stressed rebuilding it, but some of this stuff is not available, we tested the unit at the parents house, they can hear it on the second story of the house, they are thrilled, i just hope like you said it lasts.

that said i have had very very few failures, we also have had boards go bad in name brand appliances. so to be honest its all a crap shoot
TheMG
Premium Member
join:2007-09-04
Canada
MikroTik RB450G
Cisco DPC3008
Cisco SPA112

3 edits

TheMG

Premium Member

said by LittleBill:

to be honest you haven't really said a single positive to me yet, but its ok im taking it in stride

Sorry, it's easy to get hung up on the negatives sometimes.

On the bright side, you've taken a problem (water leaks) and come up with a solution (alarm device) that you were able to put together yourself and it works. Most people these days just go to the store and pick something up off the shelf but you've decided to turn it into a project and further your knowledge of electronics through that, and I think that is great.

I like the fact that you've built it into a proper electrical box. I cringe whenever I see people building electronics projects into (flammable) cardboard boxes or things like that! The finished product from the outside looks nice and clean.

Also I see that you're switching the live (brown) wire with the relay in your device. Whether that was intentional or not, you've got it right.

Use of heatshrink tubing instead of electrical tape is good.

Oh, just one more suggestion for improved safety, add a wire to the ground connection and crimp a ring connector to the end of it. Place that ring connector under one of the bolt that hold the siren in place. Also make sure to remove a bit of the paint where the screw touches the metal bracket of the siren so you have a good ground on it.

Keep up the good work and keep on learning!
said by LittleBill:

on a side note, who makes quality relays?

Any of the well known major manufacturers. To name a few:

Omron
Weidmuller
Potter & Brumfield
Panasonic

Selecting the proper relay for the task is also important to ensure reliable operation. Of particular note, larger power relays typically have several ratings. Usually, you'll find a voltage and amperage rating for DC, one for AC, as well as a horsepower rating or inductive amps.

When using a relay to power a motor (such as a pump), you need to go by the horsepower rating on the relay. The relay should be rated for greater than the motor's horsepower rating.

This is because of the high inrush current involved with starting a motor as well as the inductance of motor windings, so relays are typically de-rated significantly for motor applications, since motors put a lot more stress on the relay contacts.

Refer to the relay manufacturer's datasheet for more detailed information and ratings.

Oversizing the relay a little isn't a bad idea and will generally improve contact life, at the expense of higher cost and greater weight, size, and power consumption.
said by LittleBill:

and what recommendation do you have for psu modules?

TDK-Lambda, Delta Electronics, and a few other manufacturer make power supply modules of various different voltages, sizes, and configurations.

Yeah, they're a bit more expensive that the stuff on eBay but at least you can count on it being safe and somewhat reliable.

For a few projects in the past I've also "recycled" power bricks that came with devices I no longer have or use. In fact I never throw power bricks away as you never know when they'll come in handy. I've got a whole box of them of various sizes and voltages that came with laptops, monitors, network equipment, etc.

tschmidt
MVM
join:2000-11-12
Milford, NH
·Consolidated Com..
·Republic Wireless
·Hollis Hosting

tschmidt

MVM

said by TheMG:

I've also "recycled" power bricks that came with devices I no longer have or use.

Second the use of wall wart power supplies for low power devices. They are readily available and make changing them out easy. Many of my projects need a 9V supply so I mount a NEMA 5-15R receptacle within the enclosure. This arrangement makes it easier to keep low voltage stuff separate from line voltage and provides a mechanical mount for the supply.

As far as the quality of eBay electronics parts it tends to be hit or miss. I'm using similar multi-channel buffered relay modules as the OP for several projects and so far have not had a problem but I'm using them for low voltage DC. My concern with using them at line voltage is the modules tend to have poor creepage distance separation. I'm actually using one of the Songle relays to control our greenhouse CFL lights. I originally used a SSR but the snubber caused the lights to occasionally flash when the relay was off. I mounted the EMR on a perf board to match the SSR footprint . It has been working fine for a couple of years.

I've also use a bunch of Fotek DC input AC output SSRs I purchased on eBay and except for the fact they need more than the rated minimum of 3V control voltage have not had a problem. However in another forum I frequent there are reports of counterfeit versions of the relay. Luckily mine turned out to be genuine. As with a lot of the cheap Chinese stuff need to assume specifications are not really hard specs but merely a suggestion.
»cocoontech.com/forums/to ··· r-reset/

Having said all that on balance I've had good luck with eBay stuff and the price is great. Just need to be careful - don't push the components.

One last thought about these home automation projects is they will be in service for years so think about sparing. If a part fails 5 or 10 years down the road what are you going to do? I try to keep spares on hand for anything I think might be hard to replace (plus I tend to be a packrat but that is another story). That way if a part fails you can quickly put your widget back into service and then either purchase another spare or redesign the unit using newer components.

/tom

LittleBill
join:2013-05-24

LittleBill

Member

so where do you guys buy the higher quality stuff like mentioned? digikey? mouser?

and themg, please be specific what is so bad about the psu i used that scares you other the RFI, what are they skimping on that makes you question the reliability?

tschmidt
MVM
join:2000-11-12
Milford, NH
·Consolidated Com..
·Republic Wireless
·Hollis Hosting

tschmidt

MVM

said by LittleBill:

so where do you guys buy the higher quality stuff like mentioned?

I have to admit I get a lot of my stuff from eBay, other sources:
»www.mpja.com/
»www.allelectronics.com/
»www.surpluscenter.com/ (mostly mechnical stuff)

We have a local electronics surplus store nearby that occasionally has great finds:
»www.esssurplus.com/

/tom
TheMG
Premium Member
join:2007-09-04
Canada
MikroTik RB450G
Cisco DPC3008
Cisco SPA112

1 edit

TheMG to LittleBill

Premium Member

to LittleBill
Click for full size
Click for full size
Click for full size
said by LittleBill:

and themg, please be specific what is so bad about the psu i used that scares you other the RFI, what are they skimping on that makes you question the reliability?

Creepage/clearance distance between primary and secondary circuitry on the PCB. Look at the underside of the board carefully, and you'll see that in one spot there is no more than 2 or 3mm clearance between traces or solder pads between the two halves of the power supply.

While this does not present an immediate danger under normal circumstances, in the event of a transient surge or spike, electricity could potentially arc between these two points. Additionally, any surface contamination on the bottom of the board could create a path for the electricity to flow. Another scenario would be if a small bit of metal were to get in there, it wouldn't take much to bridge the gap.

For this reason, best practice in the industry is to keep the space between the primary and secondary connections on the transformer clear of any components, traces, and solder pads. Additionally, when using small surface mount optoisolators most manufacturers will put a slot in the PCB underneath it to increase the safety gap.

The clearance on both the 9V and 12V power supplies you linked to are tight enough to worry about. With the 12V power supply, the manufacturer tried to do the right thing by cutting out a slot under the transformer, only to ruin it all by running a trace across to the Y capacitors!!! It actually boggles my mind why they would go through the trouble to cut out a slot to increase creepage distance then ruin it by running a trace within a couple millimeters of the secondary side!

The other potential issue, very common with these cheap units, is insufficient insulation between primary and secondary windings on the transformer itself. However, this can't be determined without dissecting the transformer.

Here's a good read on the subject if you want more information:

»www.ieee.li/pdf/essay/sa ··· sign.pdf

Dave from EEVBlog also made a nice teardown video touching on this subject:

»www.youtube.com/watch?v= ··· b9k-0KfE


I've also attached a third picture showing an example of good power supply design. This one in particular is 12V 3.33A rated, and believe it or not it's made in China by Li Shin International (not everything from China is bad!). I have a couple of these and one has been running my network router reliably for the past 8 years and is absolutely RF quiet. Note it's a brick type power supply that came with an HP monitor many years before I started using it for my router, I've opened it up for the picture.
LittleBill
join:2013-05-24

LittleBill

Member

good read, where does the rfi issue come, same thing components too close?
TheMG
Premium Member
join:2007-09-04
Canada
MikroTik RB450G
Cisco DPC3008
Cisco SPA112

3 edits

TheMG

Premium Member

Click for full size
said by LittleBill:

good read, where does the rfi issue come, same thing components too close?

Switching power supplies operate at relatively high frequencies and the transistors switch on and off quite rapidly, therefore producing electromagnetic energy in the lower end of the radio spectrum from the power supply's operating frequency (usually anywhere from 20kHz to a couple MHz) and several harmonics thereof.

For obvious reasons, it is undesirable for these frequencies to radiate out from the power supply, or to be conducted through the AC or DC wiring in and out of the power supply, as this creates radio interference.

Therefore, power supply circuit designs must typically contain components to filter/block this RF energy from being conducted out of the power supply.

Typically you'll find one or more chokes (inductors) and capacitors ("X") at the AC input of the power supply, usually a capacitor (referred to as a "Y" capacitor across the primary and secondary, and depending on the power supply operating frequency and output power rating, may also find inductors/chokes on the DC output side.

Not that not all power supply designs (especially small low-power ones) require all of the mentioned components, but most will have at minimum a choke on the AC input and a "Y" capacitor.

In the example photo I've identified most the commonly used methods for EMC compliance in power supplies. Not shown in the picture, there is a copper shield over the bottom of the board (which I have removed to take the picture of the underside of the board in my previous post). It is clear the manufacturer of this supply took EMC compliance seriously. Additionally, although this has nothing to do with EMC, they've included an MOV for surge protection, which is a nice touch that will increase reliability.

Your 9V power supply doesn't appear to have any such filtering components however the 12V one appears to be ok.

Interference noise from switching power supplies can usually be heard in a nearby AM radio. Note that all switching power supplies generate a little bit of RF noise to some extend, but those that lack proper filtering will generate significantly more (usually objectionable) levels of noise.