I'm trying to set up a circuit that'll detect power failure at a remote site
(approximately half a mile away by cable length).
Currently, we have 8 twisted pairs between the main centre and the remote
site.
I'd like to use one of those to detect a mains power fail, and use a PIC.
However, I'm not sure how best to detect circuit open/closed state remotely.
My initial thought was to ground one end of the twisted pair, at the main
centre end.
Then I would have the other end (in the main centre) of the twisted paid
connected to a PIC input pin, then I could read it (if PIN==0) then power
ON, else power OFF.
Would this work over such a long distance, or is there a better option that
I haven't thought of?
I only really need it to drive a lamp, so I was thinking of eliminating the
PIC altogether, but it seems better to keep it in, then I can add more
features (e.g. get it to page someone if necessary) - depends whether a
PIC/relay solution would work over this distance.
How about a "wall wart" transformer powered by the AC you are watching.
The DC output drives one pair of the cable directly. At the far end, a
resistor and LED indicates power is present. An LED based opto coupler
could be substituted for the LED to drive a PIC.
>
> How about a "wall wart" transformer powered by the AC you are watching.
> The DC output drives one pair of the cable directly. At the far end, a
> resistor and LED indicates power is present. An LED based opto coupler
> could be substituted for the LED to drive a PIC.
>
> Harold
>
> --
> FCC Rules Updated Daily at http://www.hallikainen.com - Advertising
> opportunities available!
> That was one of my thoughts, but won't the voltage drop over such a long
> cable make such a solution impracticable?
>
> On 24/10/2007, Harold Hallikainen <.....haroldKILLspam@spam@hallikainen.org> wrote:
>>
>> How about a "wall wart" transformer powered by the AC you are watching.
>> The DC output drives one pair of the cable directly. At the far end, a
>> resistor and LED indicates power is present. An LED based opto coupler
>> could be substituted for the LED to drive a PIC.
>>
>> Harold
It didn't sound like your cable pair was that long. Phone companies run
20mA current loops for Plain Old Telephone Service for several miles or
kilometres.
On 10/24/07, Picbits Sales <salesKILLspampicbits.co.uk> wrote:
> Possibly use a constant current source and an optoisolator.
>
> Using the constant current source makes sure that no matter how long the
> wire is the current remains constant at either end.
This is the sort of thing that 20mA current loop interfaces were thought up for.
The cable resistance is likely to be insignificant compared to the
series resistor (which I would place at the wall-wart end in case of a
short-circuit cable pair).
> That was one of my thoughts, but won't the voltage drop over such a long
> cable make such a solution impracticable?
>
> On 24/10/2007, Harold Hallikainen <EraseMEharoldspam_OUTTakeThisOuThallikainen.org> wrote:
> >
> > How about a "wall wart" transformer powered by the AC you are watching.
> > The DC output drives one pair of the cable directly. At the far end, a
> > resistor and LED indicates power is present. An LED based opto coupler
> > could be substituted for the LED to drive a PIC.
> >
> > Harold
> >
> > --
> > FCC Rules Updated Daily at http://www.hallikainen.com - Advertising
> > opportunities available!
> > --
1. is this a mission critical type sensing?
2. how reliable do you want it to be
Ben Wheare <piclistspam_OUTbwgames.net> wrote:
That was one of my thoughts, but won't the voltage drop over such a long
cable make such a solution impracticable?
>
> How about a "wall wart" transformer powered by the AC you are watching.
> The DC output drives one pair of the cable directly. At the far end, a
> resistor and LED indicates power is present. An LED based opto coupler
> could be substituted for the LED to drive a PIC.
>
> Harold
>
> --
> FCC Rules Updated Daily at http://www.hallikainen.com - Advertising
> opportunities available!
Not mission critical, more embarrassing when the calls start coming in and I
get asked why my circuit didn't detect this ;)
I just want something that will trigger if there is a power loss remotely.
Obviously it should work, but if it doesn't sometimes, no big deal.
Guess I should explain more - the remote site that I want to detect power
loss is a outdoor radio aerial installation. It has a (heated, and with a
fan and thermostat to maintain constant internal temperature and no
condensation) electrical cabinet nearby which contains all the electronics
and the wire terminates here. I want something that I can plug into the
mains supply and a twisted pair that'll do something if there's a power
fail.
Right now, I'm liking the sound of the opto-isolator, 20mA constant current
source or the wallwart. The equipment would go into an ingress-sealed box
inside the cabinet, so I don't think the fact its outdoors is a significant
issue.
Could I do this:
Remote site:
5V wallwart -> 20mA CCS (any recommendations? I was looking at the LM3950
CCS 'White LED Driver', but it requires a resistor to set the Iout, and its
only available in SOT23, would prefer DIP for this)
|
Twisted Pair with ground and LM3590 output from the remote site
|
Central Site:
The twisted pair terminates at an optoisolator (HCPL-2731) which is then
connected to a PIC.
>
> Guess need to ask
>
> 1. is this a mission critical type sensing?
> 2. how reliable do you want it to be
>
>
> Ben Wheare <KILLspampiclistKILLspambwgames.net> wrote:
> That was one of my thoughts, but won't the voltage drop over such a long
> cable make such a solution impracticable?
>
> On 24/10/2007, Harold Hallikainen wrote:
> >
> > How about a "wall wart" transformer powered by the AC you are watching.
> > The DC output drives one pair of the cable directly. At the far end, a
> > resistor and LED indicates power is present. An LED based opto coupler
> > could be substituted for the LED to drive a PIC.
> >
> > Harold
> >
> > --
> > FCC Rules Updated Daily at http://www.hallikainen.com - Advertising
> > opportunities available!
> > --
I have a PIC18C1320 at my gas well that goes fiber optic cable to a
RS-485 to the master, but could just as easily go direct RS-485, or I
use with 2 jumpers RS-232 for troubleshooting. I monitor 2 pressures and
a enclosure temperature, but you could monitor temperature, humidity,
and voltage or whatever easily. Either the PIC or other end of RS-485
could alarm on values and alert if still in within alarm limits, but out
of normal limits.
> Not mission critical, more embarrassing when the calls start coming in and I
> get asked why my circuit didn't detect this ;)
> I just want something that will trigger if there is a power loss remotely.
> Obviously it should work, but if it doesn't sometimes, no big deal.
>
> Guess I should explain more - the remote site that I want to detect power
> loss is a outdoor radio aerial installation. It has a (heated, and with a
> fan and thermostat to maintain constant internal temperature and no
> condensation) electrical cabinet nearby which contains all the electronics
> and the wire terminates here. I want something that I can plug into the
> mains supply and a twisted pair that'll do something if there's a power
> fail.
>
> Right now, I'm liking the sound of the opto-isolator, 20mA constant current
> source or the wallwart. The equipment would go into an ingress-sealed box
> inside the cabinet, so I don't think the fact its outdoors is a significant
> issue.
>
> Could I do this:
>
> Remote site:
> 5V wallwart -> 20mA CCS (any recommendations? I was looking at the LM3950
> CCS 'White LED Driver', but it requires a resistor to set the Iout, and its
> only available in SOT23, would prefer DIP for this)
> |
> Twisted Pair with ground and LM3590 output from the remote site
> |
> Central Site:
> The twisted pair terminates at an optoisolator (HCPL-2731) which is then
> connected to a PIC.
>
> How does that sound?
>
> On 24/10/2007, alan smith <RemoveMEmicro_eng2TakeThisOuTyahoo.com> wrote:
>
>> Guess need to ask
>>
>> 1. is this a mission critical type sensing?
>> 2. how reliable do you want it to be
>>
>>
>> Ben Wheare <spamBeGonepiclistspamBeGonebwgames.net> wrote:
>> That was one of my thoughts, but won't the voltage drop over such a long
>> cable make such a solution impracticable?
>>
>> On 24/10/2007, Harold Hallikainen wrote:
>>
>>> How about a "wall wart" transformer powered by the AC you are watching.
>>> The DC output drives one pair of the cable directly. At the far end, a
>>> resistor and LED indicates power is present. An LED based opto coupler
>>> could be substituted for the LED to drive a PIC.
>>>
>>> Harold
>>>
>>> --
>>> FCC Rules Updated Daily at http://www.hallikainen.com - Advertising
>>> opportunities available!
>>> --
> Not mission critical, more embarrassing when the calls start coming in and I
> get asked why my circuit didn't detect this ;)
> I just want something that will trigger if there is a power loss remotely.
> Obviously it should work, but if it doesn't sometimes, no big deal.
>
> Guess I should explain more - the remote site that I want to detect power
> loss is a outdoor radio aerial installation. It has a (heated, and with a
> fan and thermostat to maintain constant internal temperature and no
> condensation) electrical cabinet nearby which contains all the electronics
> and the wire terminates here. I want something that I can plug into the
> mains supply and a twisted pair that'll do something if there's a power
> fail.
>
> Right now, I'm liking the sound of the opto-isolator, 20mA constant current
> source or the wallwart. The equipment would go into an ingress-sealed box
> inside the cabinet, so I don't think the fact its outdoors is a significant
> issue.
>
> Could I do this:
>
> Remote site:
> 5V wallwart -> 20mA CCS (any recommendations? I was looking at the LM3950
> CCS 'White LED Driver', but it requires a resistor to set the Iout, and its
> only available in SOT23, would prefer DIP for this)
> |
> Twisted Pair with ground and LM3590 output from the remote site
> |
> Central Site:
> The twisted pair terminates at an optoisolator (HCPL-2731) which is then
> connected to a PIC.
>
> How does that sound?
>
> On 24/10/2007, alan smith <RemoveMEmicro_eng2TakeThisOuTyahoo.com> wrote:
> >
> > Guess need to ask
> >
> > 1. is this a mission critical type sensing?
> > 2. how reliable do you want it to be
> >
> >
> > Ben Wheare <piclistEraseME.....bwgames.net> wrote:
> > That was one of my thoughts, but won't the voltage drop over such a long
> > cable make such a solution impracticable?
> >
> > On 24/10/2007, Harold Hallikainen wrote:
> > >
> > > How about a "wall wart" transformer powered by the AC you are watching.
> > > The DC output drives one pair of the cable directly. At the far end, a
> > > resistor and LED indicates power is present. An LED based opto coupler
> > > could be substituted for the LED to drive a PIC.
> > >
> > > Harold
> > >
> > > --
> > > FCC Rules Updated Daily at http://www.hallikainen.com - Advertising
> > > opportunities available!
> > > --
> 5V Wallwart -> 470ohm resistor -> cable -> opto -> PIC.
>
> I don't see what the constant current source is going to give you
> with an ~constant cable resistance of up to a couple hundred
> ohms
Possibly/probably, OTOH if you wanted to get fancy and measure
some remote parameters .....
> > 5V Wallwart -> 470ohm resistor -> cable -> opto -> PIC.
> >
> > I don't see what the constant current source is going to give you
> > with an ~constant cable resistance of up to a couple hundred
> > ohms
>
> Possibly/probably, OTOH if you wanted to get fancy and measure
> some remote parameters .....
>
> Value-added service ?
>
WOW, you guys are really into feature creep!! More like a feature race! ;-)
KISS! Use a plain ol' CV wall wart and a series resistor to the twisted pair,
LED on the other side, and if you want comm (remember, no comm other than a
binary on/off constant needed so far), use a FET or transistor to short across
the pair and do it at 1 or 2 Hz and you'll have no sync/sample issues reading
it, minimal bandwidth, and still be able to send voltage and temperature once a
minute or more! No timing or freq. issues on reading it either.
You could even use just a pic on the sending end, gather the parameters you
need, and use morse code so it's person readable without add'l hw on the other
side...
> Sorry - forgot about feature-creep :-).
>
> Running RS485 mght then be an option (3 wires) - or a couple of old
> modems on the twisted pair.
>
> RP
>
>
>
> On 25/10/2007, Jinx <RemoveMEjoecolquittEraseMEEraseMEclear.net.nz> wrote:
>>> 5V Wallwart -> 470ohm resistor -> cable -> opto -> PIC.
>>>
>>> I don't see what the constant current source is going to give you
>>> with an ~constant cable resistance of up to a couple hundred
>>> ohms
>> Possibly/probably, OTOH if you wanted to get fancy and measure
>> some remote parameters .....
>>
>> Value-added service ?
>>
Haha. No it's not that so much, but nothing says ka-ching like
'features'. Even if it's not a lot of ka-ching, and it doesn't have
to be, giving the customer the ability to monitor the status of a
product does give them some comfort and reassurance
>WOW, you guys are really into feature creep!!
>More like a feature race! ;-)
<VBG>
>KISS! Use a plain ol' CV wall wart and a series resistor
>to the twisted pair, LED on the other side,
OK, but we can add a feature to this ;))))))))))
Use an AC output wall wart, then at the receiving end have an LED and an
optoisolator, with the LEds wired back to back. That way you have a visual
indicator as well as an isolated input into the next step.
I did consider a PIC on one end, and a RS232 link to monitor temperature,
but what about when the power goes?
I'd (ideally) need to build in some sort of battery backup, and with the
wide variations of temperatures (just below freezing in the winter, all the
way up to 60/70degC in the summer), a battery isn't a really good choice
IMO.
Not only that, if I didn't get a response from the remote PIC, it could be
due to a dodgy cable, wiring fault, the PIC might've hung, etc etc.
Of course, I have 8 pairs, no reason why I couldn't use one as a simple AC
monitoring system using a wallwart, and another one connected to a PIC for
serial comms.
Some questions:
1) Could I use an RS232 link at say 300 baud over such a link - is there
anything I would need to take into account? Can I seriously just connect
each end of the pair to the TX and RX pins on two PICs, or would using say a
MAX232 as well help?
2) I'm not alltogether keen on putting a wallwart plus resistor straight to
the cable for the simple AC monitoring, I'd prefer to have something
definitely limiting the current (yes I know this is what a resistor does),
but considering measuring the resistance of the cable is a bit impratical,
I'd rather just put a semiconductor that is designed to limit output current
to some value and use that between the AC and the cable.
On 25/10/2007, Jinx <RemoveMEjoecolquittspam_OUTKILLspamclear.net.nz> wrote:
>
> > WOW, you guys are really into feature creep!!
>
> Haha. No it's not that so much, but nothing says ka-ching like
> 'features'. Even if it's not a lot of ka-ching, and it doesn't have
> to be, giving the customer the ability to monitor the status of a
> product does give them some comfort and reassurance
>
> -
> connect each end of the pair to the TX and RX pins on two PICs,
> or would using say a MAX232 as well help ?
If it was me, I'd want *something* between the PIC and the wire,
even if it was just a couple of transistors, (a) for protection and
(b) for drive. 1/2 mile is quite a length, and will pick up noise like
RF, EMI, nearby lightning etc if it's in the open
Since this is a one-off, you don't strictly need to follow any "rules",
just make it work reliably, so any way that gets the job done is OK
Cable length is one of the most discussed items in RS232 world. The
standard has a clear answer, the maximum cable length is 50 feet, or
the cable length equal to a capacitance of 2500 pF. The latter rule
is often forgotten. This means that using a cable with low capacitance
allows you to span longer distances without going beyond the limitations
of the standard. If for example UTP CAT-5 cable is used with a
typical capacitance of 17 pF/ft, the maximum allowed cable length is
147 feet.
The cable length mentioned in the standard allows maximum
communication speed to occur. If speed is reduced by a factor 2 or 4,
the maximum length increases dramatically. Texas Instruments has
done some practical experiments years ago at different baud rates to
test the maximum allowed cable lengths. Keep in mind, that the
RS232 standard was originally developed for 20 kbps. By halving
the maximum communication speed, the allowed cable length increases
a factor ten!
> > connect each end of the pair to the TX and RX pins on two PICs,
> > or would using say a MAX232 as well help ?
>
> If it was me, I'd want *something* between the PIC and the wire,
> even if it was just a couple of transistors, (a) for protection and
> (b) for drive. 1/2 mile is quite a length, and will pick up noise like
> RF, EMI, nearby lightning etc if it's in the open
>
> Since this is a one-off, you don't strictly need to follow any "rules",
> just make it work reliably, so any way that gets the job done is OK
>
> http://www.lammertbies.nl/comm/info/RS-232_specs.html
>
> Cable length is one of the most discussed items in RS232 world. The
> standard has a clear answer, the maximum cable length is 50 feet, or
> the cable length equal to a capacitance of 2500 pF. The latter rule
> is often forgotten. This means that using a cable with low capacitance
> allows you to span longer distances without going beyond the limitations
> of the standard. If for example UTP CAT-5 cable is used with a
> typical capacitance of 17 pF/ft, the maximum allowed cable length is
> 147 feet.
>
> The cable length mentioned in the standard allows maximum
> communication speed to occur. If speed is reduced by a factor 2 or 4,
> the maximum length increases dramatically. Texas Instruments has
> done some practical experiments years ago at different baud rates to
> test the maximum allowed cable lengths. Keep in mind, that the
> RS232 standard was originally developed for 20 kbps. By halving
> the maximum communication speed, the allowed cable length increases
> a factor ten!
>
> RS232 cable length according to Texas Instruments
>
> Baud rate Maximum cable length (ft)
>
> 19200 50
> 9600 500
> 4800 1000
> 2400 3000
>
I can't believe how complicated this is getting.
All you need is a couple of resistors at the remote site on the relay
contacts, to make things easy 10K normal, 1K alarm.
Stuff some DC down the line through a current limiting resistor and use
a basic circuit to measure the current on the line.
You then have:
No current = open circuit
Max current = short circuit
10K current = normal
1K current = alarm
This is how we do things in the Fire Alarm industry
Woops - what happened there? - just sent a blank email while the
screen jumped around on me! Sorry about that.
Re long length RS232. I've seen problems, even over short lrngths 9but
higher bit rates) with crosstalk between the RX & TX lines. This
created problems since the RS232 line was feeding an RS232-RS485
converter & the whole thing sort of locked up.
But at 300baud you may be OK as the edges cause the problem & you
could slow them down with some series R.
But I'd strongly advise against connecting directly to PIC pins for
the reasons Jinx listed
A major advantage of the constant current method is the fault
detection capability. 20mA = "High", 4mA = low and 0mA = fault.
> > connect each end of the pair to the TX and RX pins on two PICs,
> > or would using say a MAX232 as well help ?
>
> If it was me, I'd want *something* between the PIC and the wire,
> even if it was just a couple of transistors, (a) for protection and
> (b) for drive. 1/2 mile is quite a length, and will pick up noise like
> RF, EMI, nearby lightning etc if it's in the open
>
> Since this is a one-off, you don't strictly need to follow any "rules",
> just make it work reliably, so any way that gets the job done is OK
>
> http://www.lammertbies.nl/comm/info/RS-232_specs.html
>
> Cable length is one of the most discussed items in RS232 world. The
> standard has a clear answer, the maximum cable length is 50 feet, or
> the cable length equal to a capacitance of 2500 pF. The latter rule
> is often forgotten. This means that using a cable with low capacitance
> allows you to span longer distances without going beyond the limitations
> of the standard. If for example UTP CAT-5 cable is used with a
> typical capacitance of 17 pF/ft, the maximum allowed cable length is
> 147 feet.
>
> The cable length mentioned in the standard allows maximum
> communication speed to occur. If speed is reduced by a factor 2 or 4,
> the maximum length increases dramatically. Texas Instruments has
> done some practical experiments years ago at different baud rates to
> test the maximum allowed cable lengths. Keep in mind, that the
> RS232 standard was originally developed for 20 kbps. By halving
> the maximum communication speed, the allowed cable length increases
> a factor ten!
>
> RS232 cable length according to Texas Instruments
>
> Baud rate Maximum cable length (ft)
>
> 19200 50
> 9600 500
> 4800 1000
> 2400 3000
>
What I'm currently looking at is having two circuits:
Circuit 1:
Remote Site
Standard 400mA 4.5V wallwart -> 470 ohm resistor -> twisted pair with ground
and 5V
--> CABLE --> Central Site
HCPL-2731 Opto-isolator -> PIC input pin.
This circuit will simply signify binary 1 for power on (i.e. the PIC input
pin will be held at +5V), else power fail.
Circuit two:
Remote site:
5V output from above wallwart -> PIC -> MAX232 -> Twisted Pair for RS232
---> CABLE ---> Central site
--> MAX232 --> PIC.
The MAX232 will be there to give a higher line drive across the cable and to
protect the PIC pins.
I could also add HCPL-2731 opto-isolators between the MAX232 and the PIC at
the RX ends to isolate it completely?
>
> Woops - what happened there? - just sent a blank email while the
> screen jumped around on me! Sorry about that.
>
> Re long length RS232. I've seen problems, even over short lrngths 9but
> higher bit rates) with crosstalk between the RX & TX lines. This
> created problems since the RS232 line was feeding an RS232-RS485
> converter & the whole thing sort of locked up.
>
> But at 300baud you may be OK as the edges cause the problem & you
> could slow them down with some series R.
>
> But I'd strongly advise against connecting directly to PIC pins for
> the reasons Jinx listed
>
> A major advantage of the constant current method is the fault
> detection capability. 20mA = "High", 4mA = low and 0mA = fault.
>
> RP
>
> On 25/10/2007, Jinx <joecolquittSTOPspamspam_OUTclear.net.nz> wrote:
> > > connect each end of the pair to the TX and RX pins on two PICs,
> > > or would using say a MAX232 as well help ?
> >
> > If it was me, I'd want *something* between the PIC and the wire,
> > even if it was just a couple of transistors, (a) for protection and
> > (b) for drive. 1/2 mile is quite a length, and will pick up noise like
> > RF, EMI, nearby lightning etc if it's in the open
> >
> > Since this is a one-off, you don't strictly need to follow any "rules",
> > just make it work reliably, so any way that gets the job done is OK
> >
> > www.lammertbies.nl/comm/info/RS-232_specs.html
> >
> > Cable length is one of the most discussed items in RS232 world. The
> > standard has a clear answer, the maximum cable length is 50 feet, or
> > the cable length equal to a capacitance of 2500 pF. The latter rule
> > is often forgotten. This means that using a cable with low capacitance
> > allows you to span longer distances without going beyond the limitations
> > of the standard. If for example UTP CAT-5 cable is used with a
> > typical capacitance of 17 pF/ft, the maximum allowed cable length is
> > 147 feet.
> >
> > The cable length mentioned in the standard allows maximum
> > communication speed to occur. If speed is reduced by a factor 2 or 4,
> > the maximum length increases dramatically. Texas Instruments has
> > done some practical experiments years ago at different baud rates to
> > test the maximum allowed cable lengths. Keep in mind, that the
> > RS232 standard was originally developed for 20 kbps. By halving
> > the maximum communication speed, the allowed cable length increases
> > a factor ten!
> >
> > RS232 cable length according to Texas Instruments
> >
> > Baud rate Maximum cable length (ft)
> >
> > 19200 50
> > 9600 500
> > 4800 1000
> > 2400 3000
> >
> > --
Any reason you can't simply listen to see if the radios are active?
Alternately, do you have access to the power going out to the building
- install a current sensor there (An led or optoisolator with several
loops of wire around one conductor of the cable)
A light on the outside of the building, or the antenna?
> Hi there,
>
> I'm trying to set up a circuit that'll detect power failure at a remote site
> (approximately half a mile away by cable length).
> Currently, we have 8 twisted pairs between the main centre and the remote
> site.
>
> I'd like to use one of those to detect a mains power fail, and use a PIC.
>
> So far, my plan consists of a voltage-controlled relay (
> http://www.crouzet.com/c-lynx/html/en/c-lynx-voltage-control.htm - the
> MUS260ACDC) at the remote site, connected between mains and one of the
> pairs. If power fails, the relay is de-energized.
>
> However, I'm not sure how best to detect circuit open/closed state remotely.
> My initial thought was to ground one end of the twisted pair, at the main
> centre end.
> Then I would have the other end (in the main centre) of the twisted paid
> connected to a PIC input pin, then I could read it (if PIN==0) then power
> ON, else power OFF.
>
> Would this work over such a long distance, or is there a better option that
> I haven't thought of?
>
> I only really need it to drive a lamp, so I was thinking of eliminating the
> PIC altogether, but it seems better to keep it in, then I can add more
> features (e.g. get it to page someone if necessary) - depends whether a
> PIC/relay solution would work over this distance.
>
> Suggestions?
>
> Thanks,
>
> Ben
1 pr could run power, and yes, the fault possibilities are many, which is why
simple is better.
I should have also mentioned that you could just run a wall wart to power a
relay and have it short the line. Then, all of your 'electronics' and power are
on your side... open=power off, closed=power on. I'm not sure why a resistor
isn't good enough though... It's a perfect solution, especially since you have
serial resistance in the cable.
To measure the cable resistance, short one end and measure across the wires at
your end...
You could also just put a resistive divider on the power, or out of a
transformer, or some combination of both, to divide by 10 (for example), and
put it right on the line. Now run a voltmeter at your end and monitor voltage
directly... If cable resistance is high, measure across a resistance at your end.
Use 2 pr and set up one with a thermistor of appropriate range (accounting for
cable R). Now everything at the remote end is passive and simple, you get temp
and V, and you can do what you want at your end and upgrade to your delight any
time you want to... ;-) DMM today, PIC and graphing and alarms and sirens
tomorrow... Even both (for when the fancy stuff breaks). And the remote end is
simple and pretty foolproof.
If you remote power it, and direct reading the thermistor is too rough (the
cable R is too great), remote power a 555 with the thermistor as part of the RC
circuit at the other end. Send the output down the line and measure frequency.
[make higher temps=higher freq, audio range, and it's also an overtemp siren HAHA]
Put a scope on the line and look at waveform quality on the first pr this way
too. It'll impress the boss. ;-)
> I did consider a PIC on one end, and a RS232 link to monitor temperature,
> but what about when the power goes?
> I'd (ideally) need to build in some sort of battery backup, and with the
> wide variations of temperatures (just below freezing in the winter, all the
> way up to 60/70degC in the summer), a battery isn't a really good choice
> IMO.
> Not only that, if I didn't get a response from the remote PIC, it could be
> due to a dodgy cable, wiring fault, the PIC might've hung, etc etc.
> Of course, I have 8 pairs, no reason why I couldn't use one as a simple AC
> monitoring system using a wallwart, and another one connected to a PIC for
> serial comms.
>
> Some questions:
> 1) Could I use an RS232 link at say 300 baud over such a link - is there
> anything I would need to take into account? Can I seriously just connect
> each end of the pair to the TX and RX pins on two PICs, or would using say a
> MAX232 as well help?
> 2) I'm not alltogether keen on putting a wallwart plus resistor straight to
> the cable for the simple AC monitoring, I'd prefer to have something
> definitely limiting the current (yes I know this is what a resistor does),
> but considering measuring the resistance of the cable is a bit impratical,
> I'd rather just put a semiconductor that is designed to limit output current
> to some value and use that between the AC and the cable.
>
>
> On 25/10/2007, Jinx <KILLspamjoecolquittspamBeGoneclear.net.nz> wrote:
This is part of my thinking - its not an *extremely* hostile environment,
its heated and with a fan etc, but its still relatively exposed, and I'd
prefer to keep the remote hardware relatively simple.
I'd still like to have a PIC at the remote end, if only for the
possibilities an RS232 link would give, but I would still like one pair to
be a simple 'fail-safe' solution.
(We have various other bits built into the cabinet, like a door microswitch
- a LED to say "hey, someones opened this door! hopefully they should be
there" would be nice, and can be done via RS232.
Not sure why I didn't think of remote-powering the PIC! That would be the
best solution!
So, plan:
One pair connected with a relay and wallwart. One end of the pair (at my
end) is connected to 5V. If the PIC input is high, its powered, if not, the
relay is de-energized and powers off, hence the PIC input is floating.
Thats the 'fail-safe' approach.
Actually, couldn't I take 5V from the above pair, and use it to power the
PIC. What about the differences in ground? Any way to get around that?
Probably not....
OK, so:
second pair: 5V and ground from my end to the PIC, which has a temperature
sensor (and whatever else I come up with) attached to it.
Third pair: RS232 link back to a PIC at my end, with opto isolators at the
RX ends of each wire.
I'd rather not bother with a thermistor, and just attach a SPI one to the
PIC and read that via RS232. If the powers off, the least of my concerns is
the temperature ;)
>
> 1 pr could run power, and yes, the fault possibilities are many, which is
> why
> simple is better.
>
> I should have also mentioned that you could just run a wall wart to power
> a
> relay and have it short the line. Then, all of your 'electronics' and
> power are
> on your side... open=power off, closed=power on. I'm not sure why a
> resistor
> isn't good enough though... It's a perfect solution, especially since you
> have
> serial resistance in the cable.
>
> To measure the cable resistance, short one end and measure across the
> wires at
> your end...
>
> You could also just put a resistive divider on the power, or out of a
> transformer, or some combination of both, to divide by 10 (for example),
> and
> put it right on the line. Now run a voltmeter at your end and monitor
> voltage
> directly... If cable resistance is high, measure across a resistance at
> your end.
>
> Use 2 pr and set up one with a thermistor of appropriate range (accounting
> for
> cable R). Now everything at the remote end is passive and simple, you get
> temp
> and V, and you can do what you want at your end and upgrade to your
> delight any
> time you want to... ;-) DMM today, PIC and graphing and alarms and sirens
> tomorrow... Even both (for when the fancy stuff breaks). And the remote
> end is
> simple and pretty foolproof.
>
> If you remote power it, and direct reading the thermistor is too rough
> (the
> cable R is too great), remote power a 555 with the thermistor as part of
> the RC
> circuit at the other end. Send the output down the line and measure
> frequency.
> [make higher temps=higher freq, audio range, and it's also an overtemp
> siren HAHA]
>
> Put a scope on the line and look at waveform quality on the first pr this
> way
> too. It'll impress the boss. ;-)
>
> This project just BEGS for simple hardware...
>
>
> Ben Wheare wrote:
> > I did consider a PIC on one end, and a RS232 link to monitor
> temperature,
> > but what about when the power goes?
> > I'd (ideally) need to build in some sort of battery backup, and with the
> > wide variations of temperatures (just below freezing in the winter, all
> the
> > way up to 60/70degC in the summer), a battery isn't a really good choice
> > IMO.
> > Not only that, if I didn't get a response from the remote PIC, it could
> be
> > due to a dodgy cable, wiring fault, the PIC might've hung, etc etc.
> > Of course, I have 8 pairs, no reason why I couldn't use one as a simple
> AC
> > monitoring system using a wallwart, and another one connected to a PIC
> for
> > serial comms.
> >
> > Some questions:
> > 1) Could I use an RS232 link at say 300 baud over such a link - is there
> > anything I would need to take into account? Can I seriously just connect
> > each end of the pair to the TX and RX pins on two PICs, or would using
> say a
> > MAX232 as well help?
> > 2) I'm not alltogether keen on putting a wallwart plus resistor straight
> to
> > the cable for the simple AC monitoring, I'd prefer to have something
> > definitely limiting the current (yes I know this is what a resistor
> does),
> > but considering measuring the resistance of the cable is a bit
> impratical,
> > I'd rather just put a semiconductor that is designed to limit output
> current
> > to some value and use that between the AC and the cable.
> >
> >
> > On 25/10/2007, Jinx <@spam@joecolquitt@spam@spam_OUTclear.net.nz> wrote:
Ben Wheare wrote:
> BRILLIANT reply! Thanks!
:)
> So, plan:
>
> One pair connected with a relay and wallwart. One end of the pair (at my
> end) is connected to 5V. If the PIC input is high, its powered, if not, the
> relay is de-energized and powers off, hence the PIC input is floating.
> Thats the 'fail-safe' approach.
> Actually, couldn't I take 5V from the above pair, and use it to power the
> PIC. What about the differences in ground? Any way to get around that?
>
If I understand it, you'll use the relay closure at the remote end on
one pair, to a local pic input, and possibly tap the line for PIC power
which will signal some data on another pair, right?
Think of the line as a smallish value resistor when closed, and infinite
when open. If going right to a pic, I wouldn't float it, but perhaps if
the line was 50 ohms, put a 1-2k resistor to 5v, then the other side of
the resistor to pair1 line 1, pair1 line 2 then goes to local gnd. Pic
input is off the pair1 line 1 local connection. Closed, it's pulled down
to <.5v and open it goes high through the 1-2k. Measure the cable and do
the calcs. You could also just drive an opto.
I would also probably use 12v or so if also powering remote electronics,
but remember the relay will be shorting the lines, so you don't get much
V that way... ;) I'd use a local 5v reg on the remote side, and send
comm back to an opto. The best way would be separate lines for power,
and by using a local reg, you circumvent any changes in copper
resistance over temperature changes, unless you're flexible in when you
need power.
IF you only needed the pic to operate when remote power was on, or only
when it was off, you could use 12v, change the local series resistor,
and put a 5v reg input across the relay contacts. Depending on if you
use a NC or NO relay, you get to power the pic if power is on or if off.
In the opposite state, there's no input to the remote reg. because it's
shorted. So, a NC relay would allow the pic to be powered remotely if
the remote site was up AND you get basic signaling to the local pic
input on the same line. It may or may not work depending on power draw
remotely and line resistance, et al. I suspect that if you can't find
values that will source enough power to your load AND give you nice
levels locally, you could use an A-D input instead of a digital one and
look for whatever closed and open values turn out to be. There should be
a wide enough difference unless you end up drawing mega-power remotely,
which you shouldn't do anyway. A heavy load remotely will look more like
a closed relay locally... It's easy enough to just run the calculations
for your particular values.
Another idea: save one pair, or be able to switch it from some other
use, for use as an intercom or remote audio pickup. Then you can have
people do your bidding at the remote site as well as listen for whatever
is worth listening for out there... ;)
Richard Prosser wrote:
> Or:
>
> 5V Wallwart -> 470ohm resistor -> cable -> opto -> PIC.
>
> I don't see what the constant current source is going to give you with
> an ~constant cable resistance of up to a couple hundred ohms.
Not disagreeing with your statement, but the opto-isolators might save
his bacon.
Now that he's mentioned this is a radio tower site, the requirement to
deal with lightning hitting the tower and equipment just came into
play... in my mind, anyway.
I was thinking of a 12VDC wall wart...that way it takes care of any drop, and then put a resistor and LED... so what if you drop a few volts across it? He answered the question..one off design, semi-reliable, and not mission critical. LED off....you got trouble!
KISS! Use a plain ol' CV wall wart and a series resistor to the twisted pair,
LED on the other side, and if you want comm (remember, no comm other than a
binary on/off constant needed so far), use a FET or transistor to short across
the pair and do it at 1 or 2 Hz and you'll have no sync/sample issues reading
it, minimal bandwidth, and still be able to send voltage and temperature once a
minute or more! No timing or freq. issues on reading it either.
You could even use just a pic on the sending end, gather the parameters you
need, and use morse code so it's person readable without add'l hw on the other
side...
> Sorry - forgot about feature-creep :-).
>
> Running RS485 mght then be an option (3 wires) - or a couple of old
> modems on the twisted pair.
>
> RP
>
>
>
> On 25/10/2007, Jinx wrote:
>>> 5V Wallwart -> 470ohm resistor -> cable -> opto -> PIC.
>>>
>>> I don't see what the constant current source is going to give you
>>> with an ~constant cable resistance of up to a couple hundred
>>> ohms
>> Possibly/probably, OTOH if you wanted to get fancy and measure
>> some remote parameters .....
>>
>> Value-added service ?
>>