Project released: 20 PICs controlling my home via CAN

General discussion on mikroBasic.
Author
Message
piccy
Posts: 31
Joined: 20 Jun 2005 16:30
Location: Germany

Project released: 20 PICs controlling my home via CAN

#1 Post by piccy » 28 May 2008 09:20

Hello,
I am really glad about mE products and this great forum. So I would like to tell you something I am working on.

After 1.5 years of development (OK, I also have had to build the house itself) the first step of my home automation system is now released and operating!

Architecture:
Bus Nodes
Each group of switches on the wall contains one bus node (max. 8 buttons)
Circuit board 50mm diameter, 15 mm high adapted for normal UP-sockets
Connection for room temperature sensor and window contacts, one LED for status info
Bus node sends CAN messages according to an event (temperature, pressed button, window opened)
For power saving, sleep mode of PIC is used. Wake-up on CAN possible

All nodes and actors are linked together with one serial CAN bus line (200m, 125kBaud)
CAN cable also contains 12V power supply for the nodes
Each lamp, power socket or shutter has its own power cable to one of the 2 electric control cabinets in the base and first floor.

Bus Actors
In each cabinet is one bus actor. It contains LC-display, 4 buttons for manual control and 64 relays
RS232 connector for bootloading of new software
Bus actors analyses the CAN messages and controls the relays accordingly

Processors PIC18F2580 / PIC18F4580 with 4 / 8 MHz, programmed on EasyPic4 with mikroBasic from MikroElektronika

HW was made with single and double layer PCBs, using standard electronic components, so soldering was easly possible

Advantages for this architecture:
only few electronic units necessary
intelligence and program effort concentrated on the 2 bus actors
all types of cables are centralized, maximum flexibility

Disadvantages:
huge wiring effort. I installed about 2000m of cables (230V power, ISDN, TV, video, ethernet)
But wires are still cheaper and more reliable than electronic components

Yes, I know, there were already commercial solutions available, but they seem to expensive to me
Yes, my system is yet an other home control, but mine is already operating in a real house… :wink:

Already realized functionality:
light dimming, light central off/on, light scenarios, central shutter control
next steps:
display unit for status information, automated shutter control
GSM modem for alarm functions (water, fire, open windows)

:idea: I am also looking for an CAN bootloader. Does anyone can help me on that?

Skyline
Posts: 267
Joined: 10 Jan 2006 09:35

#2 Post by Skyline » 28 May 2008 09:38

You are awesome 8)

yo2lio
Posts: 1878
Joined: 19 Sep 2006 12:57
Location: Romania, Arad City
Contact:

#3 Post by yo2lio » 28 May 2008 10:26

Congratulations, nice work !
Best regards, Florin Andrei Medrea.

http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/

mail : florin@microelemente.ro

tass
Posts: 1
Joined: 28 May 2008 10:35

#4 Post by tass » 28 May 2008 10:38

take a look to this project http://www.abcelectronique.com/bigonoff ... ?par=5cfad
it my help you for your project

vneto
Posts: 94
Joined: 09 Jan 2006 18:37

#5 Post by vneto » 28 May 2008 14:56

i'm working on a similer project (different design), can you please share the code and electronic schmatics.

Do you have bi-directional communication via the CAN?
How did you implament the Protocol?

Jack Flanders
Posts: 337
Joined: 17 Apr 2008 02:53
Location: Fantasy Land

#6 Post by Jack Flanders » 28 May 2008 15:15

Awesome job, piccy! It sounds like you did a great job of planning to make it all work. I have given some small amount of thought to this for my own home as well and have a question or two.

1. You said you have the system running with 12V power and can bus. Do you have one 12V supply or many small ones?

2. What type of short-circuit protection do you have for the 12V?

3. Other protections? Lightning? Static? Overtemp?

4. Did you build in some sort of fail safe mode to allow you to operate your lights, etc. in the event of a system crash?

5. Is there connection to the outside world for emergency messages? Such as telephone modem or voice message or email?

If you have the time, some photos would be really cool! :D

piccy
Posts: 31
Joined: 20 Jun 2005 16:30
Location: Germany

#7 Post by piccy » 28 May 2008 15:54

1. You said you have the system running with 12V power and can bus. Do you have one 12V supply or many small ones?
Each of the 2 actors/cabinets have their own supply
2. What type of short-circuit protection do you have for the 12V?
The supply itself is protected, for the output I use 2 electronic fuses (one for the bus, one for the relais)
3. Other protections? Lightning? Static? Overtemp?
each node has a voltage regulator, which convers short-circuit protection
4. Did you build in some sort of fail safe mode to allow you to operate your lights, etc. in the event of a system crash?
If only the nodes or the bus is down, I am able to control each relais within the actor menu buttons
5. Is there connection to the outside world for emergency messages? Such as telephone modem or voice message or email?
One of my next ideas. The actor has RS232 already on board. So connection to an GSM modem is no big deal.
If you have the time, some photos would be really cool! :D
Where I should upload them? I have no own server :roll:

neske
Posts: 45
Joined: 04 Sep 2007 10:34

#8 Post by neske » 28 May 2008 16:50

piccy wrote:Where I should upload them? I have no own server :roll:
One of the best image upload site: http://imageshack.us/

User avatar
zristic
mikroElektronika team
Posts: 6608
Joined: 03 Aug 2004 12:59
Contact:

#9 Post by zristic » 28 May 2008 22:28

piccy wrote:
If you have the time, some photos would be really cool! :D
Where I should upload them? I have no own server :roll:
You can send them to us (zristic att mikroe.com) and we will upload them to our server, then give you back the links for accessing them.

piccy
Posts: 31
Joined: 20 Jun 2005 16:30
Location: Germany

#10 Post by piccy » 29 May 2008 10:47

I have send some pictures, scematics and code to mE.
The current CAN protocol is really pure simple:
Each pushbutton of the bus node send 3 states:
short press, long press and release after long press.
So I can use simple dimmer modules, which where normally controlled with pushbuttons directly. The CAN bus acts just as an extention.
The protocol for the buttons is therefore just one data byte, where I can see, which button is in which state.
the actors are receiving the byte and here I have a table, to see which button should switch which relais.
So mostly all SW changes are only here necessary.

The 2 way communication is in preparation for status indication etc.
Here I will need more bytes, so to distinguish, I can just use the length of the comands...

The bus nodes are in sleep mode to reduce the power consumption on the long bus line. They were just waked by a key press for a short time.

For back communication, they have to be waked-up.
The wake-up on CAN functionality was a little tricky, but now it works at least on my desk.
Piccy

vneto
Posts: 94
Joined: 09 Jan 2006 18:37

#11 Post by vneto » 29 May 2008 10:55

Thank you, Great job
We are all wating for mE to upload your files so we can all see and use your work, thanks again for Sharing


vneto
Posts: 94
Joined: 09 Jan 2006 18:37

#13 Post by vneto » 29 May 2008 11:20

The links dosent work

User avatar
zristic
mikroElektronika team
Posts: 6608
Joined: 03 Aug 2004 12:59
Contact:

#14 Post by zristic » 29 May 2008 12:11

I modified the links, it all has to be in lowercase without spaces.
Now it is all OK.

orga
Posts: 240
Joined: 04 Jun 2008 20:08

#15 Post by orga » 04 Jun 2008 20:18

congratulations!!!

Includefile and projectfile missing

include "SubMod_OG"
include "SubMod_Receiver"

Post Reply

Return to “mikroBasic General”