element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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 First Arduino 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 16 replies
  • Subscribers 391 subscribers
  • Views 1257 views
  • Users 0 members are here
  • nano
  • lcd
  • dht22
  • real_time_clock
  • rtc
  • servo
  • mega2560
  • servo_motor
  • arduino
  • relay
  • servo_control
Related

First Arduino Project

dukeofmarshall
dukeofmarshall over 10 years ago

So I got my first Arduino (Mega 2560) two weeks ago. I've been playing around with it and learning the basics and what not. I have decided on a useful project and have been thinking through it and researching out the parts. The parts have been ordered and on the way. So I decided for the mean time I would go ahead and do a wiring diagram of how I think it will eventually go all together. But since this is my first project I thought it would be prudent to have the wiring diagram reviewed by those of you who know what you're doing already.

 

My project consists of:

  1. 20x4 LCD Module
  2. An RTC Module
  3. 2 9g Servo Motors
  4. A DHT22 Temperature and Humidity Sensor
  5. A 4 Channel Relay Shield to Control a 120 volt line and a 12 volt line

 

My plan is to provide a 5v line for the Arduino itself, a 5v line for the other 5v components, a 12v line, and a 120v line. I plan on using an Arduino Nano in the project so my Mega will still be available afterwards.

 

So if anyone has the time and is willing to look over the wiring diagram real quick, I'd sure appreciate any feedback or suggestions for improvement. Thanks.

 

image

  • Sign in to reply
  • Cancel

Top Replies

  • Robert Peter Oakes
    Robert Peter Oakes over 10 years ago +3
    Double check your connections for SDL and SCL to the RTC, you may find it should be A4 and A5 (On an UNO and many other arduinos), then on the mega typically pin 20, 21, not A0, A1 here is a great pinout…
  • Robert Peter Oakes
    Robert Peter Oakes over 10 years ago +2
    SAFETY ISSUE HERE !!! DANGER The Arduino Sheild is NOT ment to handle mains voltages. Like so many other projects we have helped with or provided feedback on this community, the use of a Sheild to directly…
  • Workshopshed
    Workshopshed over 10 years ago in reply to Robert Peter Oakes +2
    A very valid point Peter, I agree, don't use that shield for mains voltages. There's lots of exposed metal on the shield which would be in close proximity to the Arduino (and user). The design of the board…
  • Robert Peter Oakes
    Robert Peter Oakes over 10 years ago

    Double check your connections for SDL and SCL to the RTC, you may find it should be A4 and A5 (On an UNO and many other arduinos), then on the mega typically pin 20, 21, not A0, A1

     

    here is a great pinout diagram to help you

    http://pighixxx.com/megapdf.pdf

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Cancel
  • Workshopshed
    Workshopshed over 10 years ago

    Hi Todd,

    Some observations. You mention you are using a Mega but the schematic uses the Nano. I don't know what schematic tool you are using but there's some libraries over on the Eagle section of this site if that's what you are using. Your I2C port for the RTC does not seem to be connected up to the standard pins, see

    http://www.pighixxx.com/test/portfolio-items/mega/?portfolioID=314

     

    The servos can be attached to any digital pin on the Mega and it will easily handle 2. So they are ok.

    http://playground.arduino.cc/Code/MegaServo

     

    You'd need to include a link to the datasheet for your LCD module and specific relay shield to let us know if that's wired correctly. For example does the LCD need 8 data pins attached? Also not all relays can handle 120v (AC?) so that's something you'd want to check with the data sheet.

     

    Cheers,

     

    Andy

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • Workshopshed
    Workshopshed over 10 years ago in reply to Robert Peter Oakes

    You can type faster than I can Peter image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • dukeofmarshall
    dukeofmarshall over 10 years ago in reply to Robert Peter Oakes

    Thanks for catching that. I looked further into it and it should be pins A4 and A5 instead of A0 and A1 on the Nano.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • dukeofmarshall
    dukeofmarshall over 10 years ago in reply to Workshopshed

    I plan on using the Nano in the final version of the project. I plan on continue to use this device for quite some time and didn't want to tie up my Mega.

     

    Here is the relay shield I'm going to tie into. I tried to make sure it would handle the voltage and from everything I've looked up on this, our should be able to handle that much voltage. If I'm reading that incorrectly please let me know. Sure don't want to burn anything down.

     

    http://www.ebay.com/itm/200984268296?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

     

    And here's the LCD Module I have ordered.

     

    http://www.ebay.com/itm/131373850431?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

     

    The wiring I learned about for this HD44780 interface is from here:

     

    http://m.instructables.com/id/Connecting-an-LCD-to-the-Arduino/

     

    Sorry for the wiring diagram as well. This was also my first schematic in eagle and had to create a few of the components that I couldn't find libraries for. The relay shield was one of them. I did get the Nano component from the element 14 library I find.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • Workshopshed
    Workshopshed over 10 years ago in reply to dukeofmarshall

    Ah yes, just read the data sheet, the HD44780 has a switchable 8bit and 4bit data bus so you can connect that up with just 4 data lines.

    The HJR-4102-L 5V relays are rated high enough and you've got thick traces on the shield. Just be aware that the screws will be live when it's connected up so don't stick a screw driver into one of the holes unless you are certain the power is off. You'd want to box up your project for similar reasons.

    The schematic is fine, I was just a bit confused by your comment about the mega and then the Nano in the diagram. One of the key things to watch for on these arduinos (particularly when adding lots of accessories) is that not all of the pins have the same capability and sometimes they are shared (SCL/SDA on the Uno is a class for that). That's why the Pighi diagrams can be useful

    http://www.pighixxx.com/test/portfolio-items/nano/?portfolioID=314

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • Robert Peter Oakes
    Robert Peter Oakes over 10 years ago

    SAFETY ISSUE HERE !!! DANGER image

     

    The Arduino Sheild is NOT ment to handle mains voltages. Like so many other projects we have helped with or provided feedback on this community, the use of a Sheild to directly control mains is just plainly a BAD idea

     

    Even though the relays on the sheild are rated at mains and several amps, the circuit board, the fact it is pluged into the Arduino and people are so used to handling a powered ardiono like it was a toy all adds up to a disaster waiting to happen... a fatal one

     

    the sheild you linked in does not specify what it will handle but it is pretty safe to say a good comparison would be the Raspberry PI Digital Board.

     

    As a general rule, this kind of board is limited to switching about 24V maximum. If you want to switch MAINS, 120V or 240, you need to get a much more appropriate relay and mounting. ie a solid state relay like this

    image

    that should be put in a seperate and secure box with low voltage on one side far away from the mains side, there are loads of other CODE and general safety issues to also consider so get help from a qualified person if needed,

     

    Switching 12 or 24 volt AC loads or DC LED lighting with the sheild is perfectly OK but not mains.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
  • Workshopshed
    Workshopshed over 10 years ago in reply to Robert Peter Oakes

    A very valid point Peter, I agree, don't use that shield for mains voltages.

     

    There's lots of exposed metal on the shield which would be in close proximity to the Arduino (and user). The design of the board puts the switched voltages very close to the pins of the shield. If you look at the SSR, that has significantly higher separation between the low and high voltages.

    If you look at the SSR above or this board from Sparkfun, you can see how the separation is might wider. https://www.sparkfun.com/products/10684

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
  • dukeofmarshall
    dukeofmarshall over 10 years ago in reply to Workshopshed

    Thanks for the input guys. That's the reason I wanted to run this by people who knew what they were doing first.

     

    So if I understand you guys correctly, the danger comes from possibly touching the exposed relay with the 120 volts and also a danger to the Arduino. Not sure if it helps or not, but the final device will be one that has one cord and only plugged in when being used. Also, I planned on using a separate 5v line for the relay shield itself instead of pulling power from the arduino and only hooking up two control lines from the arduino to the relay shield. And finally I had planned on placing all the boards, including the rtc, flat and beside each other instead of stacking them like I've seen some shields placed.

     

    So with all that in mind and maybe a separate cover for the relay shield, would that change things in your mind or would the same advice and dangers remain?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Robert Peter Oakes
    Robert Peter Oakes over 10 years ago in reply to dukeofmarshall

    What is it you want to control with the relay board (The Mains stuff)

     

    Peter

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
>
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