A Remotely Programable Relay Controller (Christmas Lights or Home Automation Controller) by drj113
Featured

Step 4: The Software


Here is the .pde sketch file.

Just download this sketch and load it into your AtMega328 chip and you are off and running!

The code has almost exhausted the RAM capacity of the ATMega328 - if you decide to make any changes, you will need to be very careful not to let the buffers corrupt the stack space.

All of the code is commented - and should be able to be followed.


 
Remove these adsRemove these ads by Signing Up
axe512 says: May 19, 2012. 7:26 PM
Please help me, where can I find: etherShield.h ?

I have this error like below when compiling the code:

Ethernet_Relay_Controller.pde

error: 'Time' does not name a type In function 'void do_zone_selection_ACT_GOVT()':
In function 'void setup()':
In function 'void loop()':
In function 'uint16_t print_time_page(uint8_t*)':

Please advise.

Thanks!
sv1elf says: Jan 20, 2012. 3:03 AM
Hi
I have a New Arduino Uno - R3 board .
Can i program with this board the atmega IC?
Is it possible to add a port like ' 7000 ' in case i want forward the ip- port to router?
Thanks
George
drj113 (author) says: Jan 20, 2012. 3:37 PM
The UNO should be able to program an Atmega328 for you - as long as your UNO has the Atmega chip socketed.

As far as changing ports, the ethernet library that I used is very limited - it can only allow ports from 1 - 255 (8 bits). It is able to be changed in software though.

Please do not use the project over an external ethernet connection without some extra security. THE LIBRARY USES QUITE A FEW SHORTCUTS THAT ARE VERY INSECURE AND OPEN TO HACKING. Even if you add a login screen, then there is no guarantee that you can mahe it unhackable :-)
crorat says: Jan 13, 2011. 5:07 AM
realy good project, i have prroblem finding atmega in my countri could you please tell me is anyone of this useble, thanks

http://www.chipoteka.hr/?module=moduli%2Fshop&moduleS=index&moduleLinkID=22&search=atmega&traziField=atmega
chax says: May 17, 2011. 9:06 AM
I'm from croatia too. A/D Electronic shop has Atmega168 microcontroler. I'm planing to buy one to build arduino myself. http://ad-electronic.hr/vmchk/mikrokontroleri/atmega168-20puisp-mc-27-55v-16k-flash-20mhz.html
It's Arduino compatible microcontroler, unfortunately, they don't have Atmega328 which has double amount of flash memory.
Or you can always buy Atmega328 from ebay.
drj113 (author) says: May 22, 2011. 8:57 PM
If you do buy from eBay, make sure that you get ones with an Arduino boot loader.

If anybody does need some 328 chips, email me (doug@doughq.com) and I can post one out to you.

Doug
va2phl says: Nov 7, 2010. 11:21 PM
Super !

I upload this code and it works really fine. Will be able to use it on the lan and on the wan side.
Darksead says: Sep 26, 2010. 11:53 AM
Thanks!!!
Now I can start making a board for this project. I searched for project like this in russian sites but a couldn’t find. This site and your project help me!
Darksead says: Sep 25, 2010. 1:51 PM
Hi,
I’m Russian student, so I don’t speak English very good! This project is so interesting, but I have sum trouble:
1) What kind of compiles you have used?
2) Can you give me .hex file for Atmega88, that I can load into my processor?
drj113 (author) says: Sep 25, 2010. 2:58 PM
Thats never a problem - you already speak enough English for us to communicate!

1) I use the Arduino compiler which is built into the IDE.
2) There is no .hex file. The IDE programs the AtMega168 for me.....

Have a look at the Arduino - the micro in this project looks like that!


rod27cn says: Sep 22, 2010. 7:43 AM
Hi drj113,

Great!
I got the files now there is no error, thanks for your help!
rod27cn says: Sep 22, 2010. 3:01 AM
Hi,

Please help me, where can I find: etherShield.h ?

I have this error like below when compiling the code:
25: error: etherShield.h: No such file or directory In function 'void setup()':

Please advise.

Thanks!
drj113 (author) says: Sep 22, 2010. 4:54 AM
You will need the Ethershield library from Nuelectronics.com

Here is the link..

http://www.nuelectronics.com/download/projects/etherShield.zip
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!