| ??? 01/09/04 07:48 Read: times |
#62221 - RE: cable length problem in water level cont Responding to: ???'s previous message |
I agree with Manjeet. A simple solution to a simple problem. I remember a pool alarm using the very same technique. The other side of the problem is connecting remote switches into a microprocessor - it is bad practice to have unprotected port pins go out into the real world. A few metres of wire makes a wonderful antenna for RF, lightning strikes ,mains interference and static discharge - we don't want our water alarm sounding when someone uses a mobile phone nearby or the micro going up in smoke when there is a storm. May I suggest the following: |->4k7 ->5v outside world -> 22k ->10nF ->0v |->sa5.0 transzorb -> 0v |->port pin The signal 'outside world' connects via a switch to 0v. It would also be advisable that shielded cable be used and the shield connected to ground. When the switch is activated, the port pin will read 0. The unit would have a reasonable chance of surviving the real world with a long cable. Also some thought should be given to the application - the micro can sample the inputs in microseconds - you don't want a transient setting off an alarm of giving a false reading so you should only cause an output change when the inputs have settled for a given time (maybe seconds in this instance). With a bit of ingenuity and some more components you can have the micro detect if the cable is broken. But I think we're getting ahead of ourselves here..... |



