Hello, I'm a new to Arduino and this forum

Hello, I would like to make a 2 relay sequence with the Arduino nano. Here's the logic: only one input goes high, relay 1 goes on for as long as the input lasts then relay 1 goes off. As soon as relay 1 goes off, a 10 second timer is started if during the 10 seconds the input goes high again the relay 2 this time will go on for as long as the input lasts then relay 2 goes off, if the 10 seconds expire without a new input, sequence can start from the begining. I would appreciate if someone can give me the scripts for programming the Arduino nano. Thanks in advance. Mauror58

Thank you for your answer, maybe I misunderstood the forum. I'm a newbie and it's the first time I'm approaching the programming. Therefore I do not have any script. I want to buy the Arduino nano to make what I posted and would like to know how to program and what to program.

Kind regards
Mauror58

Welcome to the forum

You started a topic in the Uncategorised category of the forum when its description explicitly tells you not to

Your topic has been moved to a relevant category. Please be careful in future when deciding where to start new topics

Thank you so much...

Forum is not a free give away shop. Show what You have done and forum will help You fault finding.

Once you make a drawing by hand of where the wires are connected and show us all your code in code tags we can start to help. Pretty much a guessing game until then.

Thank you for your answer, maybe I misunderstood the forum. I'm a newbie and it's the first time I'm approaching the programming. Therefore I do not have any script. I want to buy the Arduino nano to make what I posted and would like to know how to program and what to program.

Kind regards
Mauror58

Ok, thank you for your help. I'll make a drawing of what I need but I have to admit that I have never programmed Arduino because I'm new and it's the first time of approaching. If I am on the wrong forum please feel free to tell me and maybe you can suggest where I can find what I'm looking for.

Kind regards
Mauror58

You can learn and practice coding here:

What made you select the Nano? Which of the many boards having Nano in their name are you talking about?

I'm curious about the application for this simple button/relay/timing problem; your description seems unambiguous but it might be clearer if you said what the deployment scenario is.

Any Arduino board like the UNO or the Nano (old original) can handle this. You could experiment and learn the basic coding skills necessary with just the Arduino board and a few pushbuttons, LEDs and resistors.

There are many places to start. The IDE makes available example sketches starting from scratch.

You might like to play for free. This simulator is quite good, and with a problem this siml,e you could get the software nearly perfect before you bought anything:

HTH

a7

That's the wrong question. There's no single place where the code for every project is stored. You have write the code for your own project yourself.

Yes, You did, a bit, but You’re not the first member doing that.

Ok, finally I understand.
Thank you so much.

Thank you so much.

You're right. What I need to do is an application for a burglar alarm system. There are 2 one shot inputs on the alarm control unit one for each of 2 zones of the house, the alarm system has a classic key transponder but I would like to install a keyboard with combination and also a token but the keyboard has only a one contact relay. Therefore I need to make a 2 relay sequencer from only one input so I thought that Arduino can be the right thing.

OK, my understanding of your task just went down…

Walk me through how this helps you. Just tell a story about when you need to activate your one input, two relay outputs device, in response to... what?

What is wrong with goosing both relays no matter which zone needs attention?

a7

I have an alarm system in my home, I have 2 zones of protection. Zone 1 has all the windows contacts, zone 2 all the ir sensors inside of the house. When I go out, I activate the zones 1 or 2 or both zones by means of electronic key transponder. I would like to replace the key and transponder system with a combination keyboard but the keyboards only have one contact so practically the keyboard can activate only one zone when I go out. And here's where the Arduino can help me. All this because I also want to implement my alarm system with a remote control using the internet with wifi relays like Shelly so I can activate the alarm system remotely and receive notifications of it's status.

This should be a very simple project.
As suggested before, experiment with the Wokwi simulator, it has all you need including LEDs to show which relay is activated.

I also suggest you to read "Blink without delay" as it will help you understand how to deal with time and how to make several things at the same time.

I surely appreciate your suggestion Etienne, many thanks

different people have different notions of how to help. find projects like the one you want to build in the Project Hub: Arduino Project Hub

search the ninnynet for Arduino relay control

study in a stepwise way. find burglar alarm projects. find relay control projects

print programs you find interesting and study them. you will find that they always have a block of code at the top where variables are assigned, libraries are invoked, et cetera

there are blocks of code that begin with: void function_name() These are functions. don’t be the guy who writes all your code as one big block of code. study how others use and implement functions.

read this: Arduino: Getting Started With Arduino: The Ultimate Beginner’s Guide

Very interesting project. But do you have a monitoring service that will call you when there is an alarm? I doubt they will continue after you have modified the system