Hello,
I found Arduino this week.
Can some one give me answers for my questions?
I have this situation:
I need:
20 inputs for buttons
1x 1-wire for thermometers
30 rele output
If is pressed button 1, turn on outputs 1,2,6,7,10,21. If is pressed button 1 again, turn off output 21 and wait 10minuts. After that turn of outputs 6,7,10.
If is pressed button 2, turn on outputs 1,2,6,7,10,22. If is pressed button 2 again, turn off output 22 and wait 10minuts. After that turn of outputs 6,7,10.
If is pressed button 3, turn on 3,6,7,10.
If is pressed button 6, If is pressed button 6 again, turn off output 22
If is pressed button 1,2,3,4,5 twice within 2sec, turn of outputs 26,27,28,29.
If is pressed button 1,2,3,4,5 longer then 5sec, turn of outputs 21-30.
Every 30minuts turn on output 10 and turn of after 10 minuts.
Today I can make it with TECO PLC, but Arduino price is much better.
I have lot of time, so I will play with Arduino, but I need to know if is it possible before I buy arduino.
Next question:
If is connected ethernet shield, how many inputs/outputs is used?
Is there any free pc simulator, where I can check it virtually ?
It is entirely possible to do this, but you'll need extra hardware (Which mostly isn't cheap assuming you already have the appropriate relays and buttons). On its own, an Arduino cannot individually handle that many inputs and outputs, but with both Serial to parallel and parallel to serial Shift Registers, it can easily handle it with plenty of pins to spare for your Ethernet shield. Additionally, for whatever your relays, you'll probably need the coil to be driven by DC, or otherwise you'll have to add possibly a small DC coil relay to act as a switch to turn on the AC for larger relays. Just remember that the Arduino cannot directly drive your relays, so you'll need to use some form of transistor switch.
I don't know how exactly you plan to organize this, since you say it is for a house. We can give suggestions if you can define your topology better (Are you putting an arduino per room or one total in the house? If so how are you running wires), but keep in mind that the relay shield you pointed out has a total of 8 relays on it, and would still probably require extra circuitry (See Shift register comment) if you wanted to run more. When you are going to this number of devices controlled, you will probably need something custom or that is designed to be expandable.
Short Answer: Not sure, you should do some research to see if you buy more than one, it will let you control 30 devices.
Requied:
I need:
20 inputs for buttons
1x 1-wire for thermometers
30 rele output
Slow down cowboy... Crawl before you walk. Yes, the Arduino can do what you want, with I/O expander ICs like the shift-registers mentioned above. Easy. But, you should get an Arduino and start doing some simple button-and-LED experiments before you go whole-hog on this.
Requied:
Is there any free pc simulator, where I can check it virtually ?
Yes, but no. When newbies to Arduino come in asking about simulators, they're usually looking for a sim that can virtually emulate their entire project. Which is not really possible. The CPU is easy to emulate, but all the external circuitry is not. It's best to give up on that idea for now, and learn how to debug elsewhere. Use circuit sims (like LTspice and Falstad Circuit Sim) for your electronics, and write good debug statements in your code. That's what everyone else does, and you'll get used to it with a little practice.
Also -- just about nobody that buys a Mega, actually needs a Mega. The same I/O can be accomplished by using cheap and easy I/O expanders. Other AVRs (like the 644P and 1284P) offer more flash and RAM, if that's what you need, but still come in DIP form for easy breadboarding.
Your project is not well defined. What should happen if you press 1, than press 2. If you define all the possible outcomes of button presses, you can code a number of state machines to control your relays. Forget about all 30 relays, try just two buttons and their necessary relays. Write down what should happen if you press 1 then 2, specifically on relay 21 and 22's delayed turn off.