PDA

View Full Version : Stamp Network



knightofoldcode
02-10-2005, 03:58 PM
Board,

I purchased 10 BS2's, and 1 BSp40. I'd like to make the BSp40 the master, and connect to all the other BS2's.

6 of the BS2's are intended to be HID's (Human Interface Devices). A LCD screen, one relay, one DS1620, and a keypad. Then I'd like to network all of these into a house with distances of aproximately 50 to 150 feet max distance between the BS2, and BSp40. The other 4 BS2's are for other projects, and slaves to the same network reporting outside tempurature, workshop conditions, etc.

For the hardware aspect of it all I'd really prefer to have one lan cable sent to each BS2 (keypad) containing power (12V), Ground, Data lines. I was expecting to use CAT5e Lan cable to do so, which just for clarification has 4 pairs of wires, (8 wires total), and was considering using shielded cable. The cables will all go into the main "hub" (BSp40) and not be daisy chained but in a star topology format. I'd really rather use a TTL RS-232 comminications, however I think that the distances are going to diminish my voltages unless I went with the standard full 12+- swing, any thoughts on this? I took a spool of Cat5E that had been used and had probably in excess of 500 feet left, attached a 9v battery to one end and a Voltohmeter to the other and the 9V battery was right at 9 at the battery end and right at 8V's at the other side, so I'm seeing a drop of a volt, I did a resistance test and recall something in the range of 80-90 ohms. I'm not an Electrical Engineer, and after having spoken with one he said that the spool may have been amplifying the effects and that test was not accurate enough to base my readings on? (Stating that I needed to stretch the cable out then do the test) Any thoughts on this?

I'd like any suggestions on how to setup the BS2's, to communicate with the BSp40. Everything that I have read stricly adhears to the thought of a single master, and multiple slaves, but I'd like the BS2's to send things to the Master, and the Master to send things back with either side being capable of initiating the communication.

At the current conception of the product each BS2 does not need to speak with other BS2's.


MUCH thanx in advance,
David Bussanmas,
David@Bussanmas.com

Gadgetman
02-10-2005, 04:21 PM
The spools shouldn't amplify the resistance unless you send AC through it, then it turns into an inductor...

What kind of test load did you use when you connected the battery?

One tip here would be to use one pair of wires for GND and one pair for the +12V as this will effectively halve the resistance.

As for communications, those distances are 'not good' if you want to use plain RS232.
I would advise you to use 'Current loop'.
I think Maxim have a cheap set of driver ICs.

knightofoldcode
02-10-2005, 04:31 PM
Gadgetman said...
The spools shouldn't amplify the resistance unless you send AC through it, then it turns into an inductor...

What kind of test load did you use when you connected the battery?

One tip here would be to use one pair of wires for GND and one pair for the +12V as this will effectively halve the resistance.

As for communications, those distances are 'not good' if you want to use plain RS232.
I would advise you to use 'Current loop'.
I think Maxim have a cheap set of driver ICs.


I was going to run the power lines with the 12V+ as one pair and the Ground as another pair, as you said basically havling my resistance, and allowing more power to be used. Each stamp will have it's own power lines, so it shouldn't use much power, but there is the LED's of the LCD screens, exstimates are less than an amp @ 12V, which should be well within acceptable amounts.

This would allow 4 lines free for communication.

As to the test load, it was nothing. Just the battery, then the Vohm on the other side.


I'm not familiar with 'Current Loop'.

I'd rather not have to bother with driver IC's, and certainly not with having to have -12V's at each keypad! However if that's the only real way then I guess that's what it'll have to be. :)

TIA,
David Bussanmas.

knightofoldcode
02-10-2005, 04:36 PM
I looked up the 'Current Loop' theory, and if I'm correct this is alot more bother than I'd like to deal with. That's more basic level of electronics than I'm trying to do.

For reference for anyone else reading this, I found the Current Loop information at:


www.bb-elec.com/tech_articles/current_loop_app_note/basics_of_current_loop.asp (http://www.bb-elec.com/tech_articles/current_loop_app_note/basics_of_current_loop.asp)

Gadgetman
02-10-2005, 05:01 PM
Well, you could try with RS232. There's a lot of driver ICs which can generate the +/-12V just from 5V(Do a search at www.maxim-ic.com)

Or maybe RS-422 or RS-485 drivers would work better?
(Haven't used them myself)

knightofoldcode
02-10-2005, 05:07 PM
Gadgetman said...
Well, you could try with RS232. There's a lot of driver ICs which can generate the +/-12V just from 5V(Do a search at www.maxim-ic.com)

Or maybe RS-422 or RS-485 drivers would work better?
(Haven't used them myself)


I'll have to look into that, but I was hoping to not have to use any Driver ICs. :)

Gadgetman
02-10-2005, 08:21 PM
Drivers are your friends...

Take a look at what they have over at Maxim.
for the small nodes you'll only need two channel types(One in, one out) but for the main BS2p you could use a few of those with multiple channels to save on the IC count.

As most of these only need a capacitor to create the +/-12V, they're not that difficult to use. And the bump ut to those levels will make the transmission much more stable.

Jon Williams
02-10-2005, 08:28 PM
Yes, to use a master-slave setup in a multi-drop system RS-485 would be more appropriate. Lon Glazner did an article for Nuts & Volts on this topology (you can get a PDF of the article from our web site), and Jan Axelson's book "Serial Port Complete" is excellent in this regard.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA

allanlane5
02-10-2005, 09:07 PM
So, you're using CAT5e to send power AND signal. You're using 12V DC as the power -- I assume each 'satellite slave' will have its own regulator to drop that to +5 for the chip -- or you can just drive the Vin of the BS2 and use its regulator.

The BS2 does support a 'high-current' RS-232 TTL signal, that at low baud rates (1200) may be able to get through the cable. One problem you'll run into is that the cable will low-pass filter the signal. This means your nice sharp square-wave gets 'rounded over'. CAT5e may do this less than other cables.

Testing 'on-the-spool' is quite valid. Any inductive effects of being in a coil should be quite small. After all, it's a really large spool, right?

One other problem is the resistance of the wire. This will lower the amplitude of your sent signal.

One other problem is lightning effects. This is one nice thing about drivers -- they're cheap. One lightning strike nearby can take out all your drivers, or all your stamps (if you don't use drivers). This may or may not be a consideration in your installation.

Conclusion: All these negative effects may not be enough to keep it from working. One thing you can do is take two BS2's and connect them through the CAT5e spool you have now. See if one can recieve from the other. Send a 'Fox' message (which is "The quick brown fox jumps over the lazy dog") again and again and see if it gets through.

Best case -- it will work just fine at 1200 baud. Worst case -- you'll find you do need the MAXIM Max232 driver chip (which should work over the distances you are calling out). Either way, you'll know.

Unfortunately, it is the way of the world that robustness and reliability require additional parts. It's not magic.

Post Edited (allanlane5) : 2/10/2005 2:10:12 PM GMT

Jim McCorison
02-10-2005, 11:24 PM
If you are going to be using two wires for + and two for ground, combine + and ground in each of two pairs, not + in one pair and ground in another. Cat5 cable pairs are twisted. The twists in each pair will eliminate inductive signal transfers to adjacent cables. Yes, adjacent cables are twisted, but why increase the likelihood of problems.

Jim

knightofoldcode
02-11-2005, 03:38 AM
Wow, a bunch of replys.

First, on the lighting issue, that shouldn't be an issue, each "keypad" will be in the house, and never go outside the house, all cat5 cables are going to be shielded from the house, the ones that go to the workshop are ina buried PVC pipe, so that's not an issue either.


I'll look into using a driver IC, I didn't realize that they don't require you to source the -12V's yourself.

I saw the N&V's issue mentioned, but was hoping for something more simplistic, however it is already fairly simplistic. :) I'm just a lazy and just want to "get it to work", however it's likely I'll just need to invest some more time and a little bit more money into it to get it more robust and reliable.

Yes, each BS2 is a BS2 OEM, with a 7805 on it, which will reduce the 12V from the cat5 to the chips 5V, also a fairly large cap will be used on the incoming 12V, just to make sure everything is nice and consistant.

Yes, it's a large spool, somewhere around 16-18 inches in diameter, and the bend radius of the cat 5 has to be at least 16 inches at the smallest point.

The entire reson I didn't want to use IC's is 1) I want to setup this up so that a person could read my webpage and easily understand what's going on. Not a huge concern, its relativly easy to understand that. 2) I want to keep the IC count on each keypad down to a minimum, I'm running the power for each keypad off the cat 5, and I want to use as little power as needed.


Jon Williams said...

Yes, to use a master-slave setup in a multi-drop system RS-485 would be more appropriate. Lon Glazner did an article for Nuts & Volts on this topology (you can get a PDF of the article from our web site), and Jan Axelson's book "Serial Port Complete" is excellent in this regard.


I have seen this setup, and am very likely to use it, however this setup strickly adhears to the master slave concept and does not allow for the slave to initiate communication, could this be changed via software or is this a inheret problem with the hardware design?

Just to give everyone an idea of what I'm doing. I'll have keypads at each location, ie each room. I'm remodeling a new house down to stripping out drywall, and am going to be installing a HVAC system with dampers. Therefore each room will need to have it's own thermostat to control the damper's for that room. The dampers control wires will go back to the main "hub" (BS2p40) and the keypads will go to the hub. Then I want to add in whole house audio. I have some multiplxers designed for audio signal routing. I'll use these for routing the signal from the inputs to the rooms. The main unit will have audio amplifiers, somewhere on teh range of 30-40 watts. I can find simple IC's to do this for this amount, and I _don't_ crank up my music. (commonly listen to symphony) Then the speakers for each room will go to the main hub and get sent via some speakers wires to the speakers, amplified.

Intending to have 6 rooms (zones). With 8 audio inputs.

1) G/F's CD jukebox, (400 disc capability, and she's already got it filled, with current music ($15 each) I'l have to daisy chain two)
2) My CD Jukebox, again have to daisy chain three.
3) Sirius (Alt Nation)
4) Sirius (Symphony)
5) Sinlge CD player (for temporary access of new cd's, etc.)
6) Second Single CD Player
7) Future expansion.
8) Future expansion.

Also, each room that has a keypad should be able to access the alarm system, so each keypad is an alarm.

At some point I'm considering integrating video sharing into the keypads, but that'll come later.

Everything that I've found commercially wants a outrageous amount for these capability's, plus I'd have to have a THREE keypads in EACH room, to do what I'm wanting, this is obviously not feesable.

TIA,
David Bussanmas,
David@Bussanmas.com.

allanlane5
02-11-2005, 03:53 AM
Neat. And since the BS2 is a single-tasking processor, it is very difficult to have a 'slave' "interrupt" a master. In BS2-land, the 'Master' has to be 'waiting' for a 'slave' to speak -- which is a pain for the 'master'. On the other hand, if all you want the 'master' to do IS to monitor the 'slaves', this can work. In this case, you have to allow for the 'master' missing a 'slave's message, so the 'master' should acknowledge the 'slave', and the 'slave' retry its message if it doesn't get an acknowledge. This is a little harder to code, but might be better use of your cable bandwidth.

However, it's usually a much better use of resources if the 'master' requests a message from each 'slave' on a periodic basis. Note that the 'master' can do this several times a second, so it LOOKS like immediate response to the user.

steve_b
02-11-2005, 03:55 AM
Have you looked in to Crestron or AMX?
Basically, they're all just glorified PLC's.· But they will allow you to have one touch panel per room....however, these are what the movie stars order!· so the $$ might be too high.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·

Steve
http://members.rogers.com/steve.brady (http://members.rogers.com/steve.brady)
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."

Paul Baker
02-11-2005, 04:05 AM
A more true to form method would be to use an SX as your master running SX/B (BASIC for the SX) with port B configured for interrupt by a slave. But that maybe too low-level for your likeing. Allan's polling method would work at the cost of some computational overhead, the more reponsive you want the system to be the less computation you'll have for other tasks (additionally polling requires querying every device connected to it, interrupts don't). It just depends on what other tasks your master will be performing.

knightofoldcode
02-11-2005, 04:28 AM
allanlane5 said...
Neat. And since the BS2 is a single-tasking processor, it is very difficult to have a 'slave' "interrupt" a master. In BS2-land, the 'Master' has to be 'waiting' for a 'slave' to speak -- which is a pain for the 'master'. On the other hand, if all you want the 'master' to do IS to monitor the 'slaves', this can work. In this case, you have to allow for the 'master' missing a 'slave's message, so the 'master' should acknowledge the 'slave', and the 'slave' retry its message if it doesn't get an acknowledge. This is a little harder to code, but might be better use of your cable bandwidth.

However, it's usually a much better use of resources if the 'master' requests a message from each 'slave' on a periodic basis. Note that the 'master' can do this several times a second, so it LOOKS like immediate response to the user.


See, this is where it gets fun.

I was considering having all of the units connected on the network. Then each keypad would have a line back to the master. Similiar to the setup of current DB9 serial ports on computers. The keypad has a line direct to the master, the keypad keeps this line high when it wants to send a message to the master. The master continually checks each of these lines to see when a slave wants to talk, once the master ealizes that the slave wants to talk, the master sends a message to the slave via the network and says something similiar to "go ahead", the slave then sends it's message and turns the line low, indicating to the master that it's done with the message.

Might even get a little more complicated than that. Each slave has 4 wires used for power, 2 wires used for serial RS-485 A+B network, then the other two wires are used for indicating. Wire 1 is for slave, slave drives this wire high when ready to talk to master, master then drives like 2 high when ready for slave to communicate. After that slave drives line 1 low, and master in response drives it's line low, and allow itself to then continue to monitor other slaves.

The master won't need to do anything but monitor the slaves. The master will monitor the slaves, and monitor the alarm panel information which is a slave, but it's a bs40p slave. When a slave requests that a audio channel be changed, it will accept info from the slave to change it, change it then continue to monitor the other slaves.

Another side question. If I did it taht way, in which there is a line from the master to the slave, and a line from slave to master, and it turns these lines on, then off when communicating, it should be capable of sending this packet of info very fast, maybe less than 500ms. Is the OScope that Parallax sells capable of reading this fast information? I've never owned a OScope, and just would like one for basic small things like this, I'm not an EE, and don't intend to be. My career is Law Enforcement, so I'm not going to be doing this forever. :)

Creston and AMX were the original thoughts, but they are expensive require dealers to hook it up, and so forth, hopefully this entire thing will be less than $1000, which is the cost of a "nuvo" (4 rooms, 2 inputs), which is JUST whole house audio.

As to the part about making sure that the master gets the answer, if the slave waits until the master drives it's line high, then the slave should be able to get it's message through. :)

TIA,
David Bussanmas,
David@Bussanmas.com

Post Edited (knightofoldcode) : 2/16/2005 3:44:39 AM GMT

knightofoldcode
02-11-2005, 04:29 AM
Paul Baker said...
A more true to form method would be to use an SX as your master running SX/B (BASIC for the SX) with port B configured for interrupt by a slave. But that maybe too low-level for your likeing. Allan's polling method would work at the cost of some computational overhead, the more reponsive you want the system to be the less computation you'll have for other tasks (additionally polling requires querying every device connected to it, interrupts don't). It just depends on what other tasks your master will be performing.


I think this would be more low level than I'd like. I'm not familiar with the SX's, but I will look into this approach.

Thanx,
David Bussanmas.

knightofoldcode
02-16-2005, 10:44 AM
knightofoldcode said...


allanlane5 said...
Neat. And since the BS2 is a single-tasking processor, it is very difficult to have a 'slave' "interrupt" a master. In BS2-land, the 'Master' has to be 'waiting' for a 'slave' to speak -- which is a pain for the 'master'. On the other hand, if all you want the 'master' to do IS to monitor the 'slaves', this can work. In this case, you have to allow for the 'master' missing a 'slave's message, so the 'master' should acknowledge the 'slave', and the 'slave' retry its message if it doesn't get an acknowledge. This is a little harder to code, but might be better use of your cable bandwidth.

However, it's usually a much better use of resources if the 'master' requests a message from each 'slave' on a periodic basis. Note that the 'master' can do this several times a second, so it LOOKS like immediate response to the user.


See, this is where it gets fun.

I was considering having all of the units connected on the network. Then each keypad would have a line back to the master. Similiar to the setup of current DB9 serial ports on computers. The keypad has a line direct to the master, the keypad keeps this line high when it wants to send a message to the master. The master continually checks each of these lines to see when a slave wants to talk, once the master ealizes that the slave wants to talk, the master sends a message to the slave via the network and says something similiar to "go ahead", the slave then sends it's message and turns the line low, indicating to the master that it's done with the message.

Might even get a little more complicated than that. Each slave has 4 wires used for power, 2 wires used for serial RS-485 A+B network, then the other two wires are used for indicating. Wire 1 is for slave, slave drives this wire high when ready to talk to master, master then drives like 2 high when ready for slave to communicate. After that slave drives line 1 low, and master in response drives it's line low, and allow itself to then continue to monitor other slaves.

The master won't need to do anything but monitor the slaves. The master will monitor the slaves, and monitor the alarm panel information which is a slave, but it's a bs40p slave. When a slave requests that a audio channel be changed, it will accept info from the slave to change it, change it then continue to monitor the other slaves.

Another side question. If I did it taht way, in which there is a line from the master to the slave, and a line from slave to master, and it turns these lines on, then off when communicating, it should be capable of sending this packet of info very fast, maybe less than 500ms. Is the OScope that Parallax sells capable of reading this fast information? I've never owned a OScope, and just would like one for basic small things like this, I'm not an EE, and don't intend to be. My career is Law Enforcement, so I'm not going to be doing this forever. :)

Creston and AMX were the original thoughts, but they are expensive require dealers to hook it up, and so forth, hopefully this entire thing will be less than $1000, which is the cost of a "nuvo" (4 rooms, 2 inputs), which is JUST whole house audio.

As to the part about making sure that the master gets the answer, if the slave waits until the master drives it's line high, then the slave should be able to get it's message through. :)

TIA,
David Bussanmas,
David@Bussanmas.com




Any one else have any thoughts on the feasability of this plan?

TIA,
David Bussanmas,
David@Bussanmas.com