Microcontroller networks

W

Will Rouesnel

Guest
I'm trying to create a home automation system at the lowest cost I can. My
current idea is to do all logic on a PC, and then have a daisy chain of
microcontrollers flicking relays to control my lights etc. What I can't find
though it anything on how I might accomplish linking the microcontrollers
together (PIC, AVR whatever).

I don't want to run multiple parallel wires, I want either a common bus or
daisy chain or something like that, and then be able to communicate with an
individual microcontroller so it can be given it's instructions (or signal
to activate something etc). Does any one have any experience/links etc. in
this department?

- Will Rouesnel
 
I don't want to run multiple parallel wires, I want either a common bus or
daisy chain or something like that, and then be able to communicate with an
individual microcontroller so it can be given it's instructions (or signal
to activate something etc). Does any one have any experience/links etc. in
this department?
You could use an RS-485 network. Or RS-232 with signal regeneration at
each node. Or even TTL.


Wouter van Ooijen

-- ------------------------------------
http://www.voti.nl
Webshop for PICs and other electronics
http://www.voti.nl/hvu
Teacher electronics and informatics
 
Depends on how much you are willing to spend.

Even using PIC chips, with multi I/O, they are sold as tubes only, not
singles where I am and they cost as little as $2 each. You could program
them to accept a unique code (first byte) and then the command, whether it
be on, off, or otherwise.

Understand fully, this will be a big undertaking and that there is not a
quick way of doing it, even learning how to program PIC chips and then to
get the code right etc.

You will also need support circuitry, as PIC chips don't drive 240VAC
directly at all well, they tend to smell like burnt semiconductor after a
few milliseconds.

Many thanks again to Wouter who sent me off into the world of PIC, they are
very good and quite a headache when you don't get the code right :)

Paul
 
"loedown" <zero242@internode.on.net> wrote in message news:<41a4feee@duster.adelaide.on.net>...
Depends on how much you are willing to spend.

Even using PIC chips, with multi I/O, they are sold as tubes only, not
singles where I am and they cost as little as $2 each. You could program
them to accept a unique code (first byte) and then the command, whether it
be on, off, or otherwise.
You may also ask for a few sample directly to microchip they are
willing to collaborate, i got some free sample at no cost at all,
don't abuse of this, off course, but it's not a commercial
application!!!
 
Will Rouesnel wrote:

I'm trying to create a home automation system at the lowest cost I can. My
current idea is to do all logicraisesPC, and then have a daisy chain of
microcontrollers flicking relays to control my lights etc. What I can't
find though it anything on how I might accomplish linking the
microcontrollers together (PIC, AVR whatever).

I don't want to run multiple parallel wires, I want either a common bus or
daisy chain or something like that, and then be able to communicate with
an individual microcontroller so it can be given it's instructions (or
signal to activate something etc). Does any one have any experience/links
etc. in this department?

- Will Rouesnel


Hi,

I'm having the same problems myself. And keeping in mind that I have very
little, close to none, experience with hardware design it raises even more
questions.

You may want to take a look at http://caraca.sourceforge.net

I was considering this project as probably a good starting point, but it
seems the project is dead for quite some time and the authors are not
reachable.

Any way good luck,
Nick
 
Will Rouesnel wrote:

I'm trying to create a home automation system at the lowest cost I can. My
current idea is to do all logic on a PC, and then have a daisy chain of
microcontrollers flicking relays to control my lights etc. What I can't
find though it anything on how I might accomplish linking the
microcontrollers together (PIC, AVR whatever).

I don't want to run multiple parallel wires, I want either a common bus or
daisy chain or something like that, and then be able to communicate with
an individual microcontroller so it can be given it's instructions (or
signal to activate something etc). Does any one have any experience/links
etc. in this department?

- Will Rouesnel
Have a look at the 1-wire protocol (www.maxim.com) or USB (www.elektuur.nl)
or I2C (www.philips.nl)

Good luck

Peter
 
"Tito Daniele Scicutelli" <tds_box@yahoo.it> wrote in message
news:3a34a72a.0411260510.4c1c2737@posting.google.com...
"loedown" <zero242@internode.on.net> wrote in message
news:<41a4feee@duster.adelaide.on.net>...
Depends on how much you are willing to spend.

Even using PIC chips, with multi I/O, they are sold as tubes only, not
singles where I am and they cost as little as $2 each. You could program
them to accept a unique code (first byte) and then the command, whether
it
be on, off, or otherwise.


You may also ask for a few sample directly to microchip they are
willing to collaborate, i got some free sample at no cost at all,
don't abuse of this, off course, but it's not a commercial
application!!!
I'm currently stuck in choosing a good microcontroller (PIC or AVR are the
ones which have the price range I'm after), but the real issue in that
decision is the implementation of the network. RS-485 seems to be where I
want to be at, but I'm having difficulty finding some good source code
examples of how it's done on either. I come from a computer programming
background, so naturally I want to look at the code to know if it'll work
for me.

Currently I'm thinking of just buying two $5 PIC's from my local electronics
store and playing around with getting them to communicate with each other.
 
Have you got a programmer?

source code for PIC looks like this, it's RISC based and very easy, once you
have an understanding

include "p=12675.inc"

org 0000 ; origin of code

bcf status,5 ; clears status register bit 5 for low
memory access registers
movlw b'00000111' ; sets W register as 7
movwf trisio ; sets output register bits


Paul
 
"loedown" <zero242@internode.on.net> wrote in message
news:41a9cf12$1@duster.adelaide.on.net...
Have you got a programmer?

source code for PIC looks like this, it's RISC based and very easy, once
you have an understanding

include "p=12675.inc"

org 0000 ; origin of code

bcf status,5 ; clears status register bit 5 for low
memory access registers
movlw b'00000111' ; sets W register as 7
movwf trisio ; sets output register bits


Paul
For what model PIC's does that work on? I'm currently coming down on the
side of AVR since the chip seems better for the same price as the PIC's. How
important should getting a built in UART be though for my purposes (i.e. is
it programmable on other chips, or what is the cost of doing that?)
 
Hi All,
This code was for the PIC 12F675, but as an example it's what
the code looks like almost globally.

Paul
 
"Will Rouesnel" <electricitylikesme@hotmail.com> wrote in message
news:45Sod.46517$K7.46023@news-server.bigpond.net.au...
I'm trying to create a home automation system at the lowest cost I can. My
current idea is to do all logic on a PC, and then have a daisy chain of
microcontrollers flicking relays to control my lights etc. What I can't
find though it anything on how I might accomplish linking the
microcontrollers together (PIC, AVR whatever).

I don't want to run multiple parallel wires, I want either a common bus or
daisy chain or something like that, and then be able to communicate with
an individual microcontroller so it can be given it's instructions (or
signal to activate something etc). Does any one have any experience/links
etc. in this department?

- Will Rouesnel
What it sounds like your asking for is a CAN bus or an I2C bus. CAN being
Controller Area Netwrok was originally desinged with an automotive
environment in mind -- cars have many uControlers in them now. I2C is the
Inter Intergrated Circuit bus (it's actually I squared C) designed decades
ago to allo the chips in TVs to talk to each other.

Microchip PICs have on chip support for both I2C and CAN. Many other
ucontrollers have CAN. I know there are also chips that can have 8 bit IO
ports and a I2C tranceiver to behave as a quick IO expander.

I2C is a 3-wire bus (Rx, Tx, and Clock) whereas CAN is a 2-signal bus, (RX,
TX).

I'd recommend the CAN bus. Grab the most appropriate ucontroller you need.
There are 12 PICs that support CAN on chip and Microchip offers a CAN
peripheral chip for chips that don't support it natively.

CAN only defines the data link layer of the protocol model. (remember the
7-layer OSI model?) For the physical layer you can either grab proper CAN
drivers to drive a differential pair or you can use a RS485 driver to do the
same. Essentially the physical layer is a modified RS485. This takes your
two signals across four wires. Not to worry, ethernet cable is suitable for
the physical medium, that has 8 wires.

I hope you find this helpful

Tom M
 

Welcome to EDABoard.com

Sponsor

Back
Top