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
    About the element14 Community
  • 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
Crazy Arduino Automations
  • Challenges & Projects
  • Project14
  • Crazy Arduino Automations
  • More
  • Cancel
Crazy Arduino Automations
Crazy Arduino Automations Blog Raising the Bridge...Automation with Arduino: Pin Count
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Crazy Arduino Automations to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: colporteur
  • Date Created: 28 Mar 2023 11:22 PM Date Created
  • Views 3473 views
  • Likes 6 likes
  • Comments 21 comments
  • crazyarduinoautomationch
Related
Recommended

Raising the Bridge...Automation with Arduino: Pin Count

colporteur
colporteur
28 Mar 2023

image

The comments posted from my initial blog entry got me to thinking. Did I size this correctly?

The bridge spans the Mainland to Island. At either end of the bridge is a gate, an area to halt the bus and warning lights flashing when the bridge is closed. In addition to the lights, I've added a warning sound. At one end of the bridge is a ramp that enables the bridge to avoid the road bed as it rises. A trigger to raise the bridge will be the Tug and to lower the bridge the Turn-About. The bridge motor is using a L298 module and the bus halts, gates and ramp are servo motors. All toll I'm counting 14 pins required.

D2 Bridge Up limit
D3~ Ramp Servo
D4 Bridge Down Limit
D5~ Island Gate Servo
D6~ Mainland Gate Servo
D7 Bridge L298 Motor IN2
D8 Bridge L298 Motor IN1
D9~ Bridge L298 Motor EN A
D10~ Island Bus Halt Servo
D11~ Mainland Bus Halt Servo
D12 Warning Sound JQ6500
D13 Tug Sensor
D14 Turn-about Button
D15/A0 Island Warning Light
D16/A1 Mainland Warning Light
  • Sign in to reply
  • beacon_dave
    beacon_dave over 3 years ago in reply to colporteur

    The Uno pins D9 and D10 are mapped to AVR Port B1 and Port B2 which use the16bit AVR Timer/Counter 1 Output Compare registers A and B for generating PWM ( e.g. when you use Arduino analogWrite() ).

    imageimage

    The Servo library uses Timer Counter 1 to generate the timing to toggle the digital pins ( using Arduino digitalWrite ) to give you your servo signals.

    Resources are often shared, so if you use them for one task, then they are no longer available for another task.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • colporteur
    colporteur over 3 years ago in reply to beacon_dave

    I read in one post you needed to perform the disable and on another it was done for you. I never looked into the reason.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • beacon_dave
    beacon_dave over 3 years ago in reply to colporteur

    You'd probably have found out otherwise soon enough as the Servo library disables the use of analogWrite on D9 and D10   Slight smile

    "...On boards other than the Mega, use of the library disables analogWrite() (PWM) functionality on pins 9 and 10, whether or not there is a Servo on those pins..."

    https://www.arduino.cc/reference/en/libraries/servo/

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • colporteur
    colporteur over 3 years ago

    I just made a personal discovery, that SG90 servos do not require the signal pin to be connected to an Arduino PWM pin for operation. The signal pin can be connected to any arduino digital pin.

    The pinout layout for this project has the signal pins of the servos connected to ~ PWM pins. At least that was what I thought was necessary when I was doing the design. While researching code development I stumbled across this post https://forum.arduino.cc/t/digital-or-pwm-pin-using-servo-h/546624 on the arduino forum.

    Who knew? I didn't. I enjoy dabbling in this stuff but find my lack of knowledge slowing me down. Discoveries like this give me satisfaction but they also give me the feeling I'm the guy in the Studebaker in the first right hand lane, reserved for slower movers, on the information highway. If you happen to pass me give me a wave.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • beacon_dave
    beacon_dave over 3 years ago in reply to colporteur

    Hydraulic bascule then... pour beer into the counterweight ballast tank to raise the bridge and then drain it into your glass to lower the bridge....

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

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube