element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Relay sketch required for a charity project.
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 15 replies
  • Subscribers 402 subscribers
  • Views 1344 views
  • Users 0 members are here
Related

Relay sketch required for a charity project.

Former Member
Former Member over 13 years ago

A big hello from the UK!

 

I have a charity car project that is ongoing to raise funds for Help for Heroes. Our vehicle will be customised with lights, motors and sounds.

 

I have a standard arduino and a 4-relay board which is working well using various sketches I have found on the net.

 

I was wondering if anyone could help me with a sketch that will turn on 3, or 4 of these relays at a time interval that I can set from a single N/O momentery switch. I also need it to reset after a certain time so that when the button is pressed again the sequence will start again.

 

I have an HD44780 LCD that I'd like to work into the design that could display text just before the relevent relay becomes active. (This is not essential as the relays are my priority just now)

 

As it stands my relays, 1-4 are connected to pins 2-5 although I don't need the 4th relay at this time.

 

Basically the car will loosely resemble a helicopter and will have a set up of lights, motors and a cheap MP3 player that has a physical switch that when made instantly starts the helicopter sound file.

 

If I'm totally honest i think I need a 'pro' to write me a sketch that is really basic as I lack the skills to do it myself.

 

The lights, motors and mp3 will be powered externally and will be initiated with the arduino like this:

 

1. User presses a N/O momentery switch.

 

2. Relay 1 makes & MP3 plays, engine start up - and remains on for duration of file (1:52).

 

3. After 10 secs - Relay 2 makes and Navigation lights iluminate.

 

4. After engine warm-up 22secs relay 3 makes and 'rotors' start.

 

5. After 1:40 relay 3 breaks, rotors stop.

 

6. After 1:52 relays 1 & 2 break.

 

7. Next press of button, steps 1-6 start again.

 

If it is easier I can use a locking switch, would that would solve the re-set?

 

I know this is a big ask but i severely lack the programming knowledge to do this.

 

I hope someone can help, i'm sure it's not too difficult for you pros!

 

I really appreciate people reading this and taking the time to reply.

 

Many thanks in advance.

 

VB

  • Sign in to reply
  • Cancel

Top Replies

  • ntewinkel
    ntewinkel over 13 years ago +2
    Here we go. I had forgotten the 10k resistor to ground, so it took me a while to figure out why the button press was behaving so oddly! I tested using a momentary-on switch (gives 5 volts (high) when pressed…
  • ntewinkel
    ntewinkel over 13 years ago +1
    Challenge... accepted!
  • ntewinkel
    ntewinkel over 13 years ago in reply to Former Member +1
    Hi Kris, I wrote it so that a line going HIGH means "ON", which I guess happens to be backwards To reverse that we just need to switch my HIGHs and LOWs wherever it says "digitalWrite(RELAY...". I just…
Parents
  • ntewinkel
    ntewinkel over 13 years ago

    Challenge... accepted!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • ntewinkel
    ntewinkel over 13 years ago

    Challenge... accepted!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube