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 What is the problem?
  • 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
  • State Verified Answer
  • Replies 33 replies
  • Answers 3 answers
  • Subscribers 394 subscribers
  • Views 2117 views
  • Users 0 members are here
  • flickering
Related

What is the problem?

rishi2628
rishi2628 over 10 years ago

I have made the following circuit, can anyone please tell me why the seven segments are flickering. I have used multiplexing, don't tell me it is because of that. I have tried it prototyping on an arduino uno and it worked perfectly.SO its not because of the multiplexing!! and its not the code. I think something is interfering or resetting the microcontroller because it does not store the values on the seven segments.The motors on the right are not connected. Any clue what is wrong?

  • Sign in to reply
  • Cancel

Top Replies

  • balearicdynamics
    balearicdynamics over 10 years ago in reply to rishi2628 +2
    RIshi, mcb1 told that there is a power problem NOT because the 7805 is a crap component but because, with a reasonable difficult we are trying to decode your info and seems that your schematic has issues…
  • mcb1
    mcb1 over 10 years ago in reply to balearicdynamics +2
    rishi2628 The syntax highlighting that Enrico is referring to is a little hidden. It's a shame there isn't a simple icon, but we struggled to get it added, so it's better than nothing. past you code, then…
  • clem57
    clem57 over 10 years ago +2
    Why do you automatically discount multiplexing? Just because it worked one place does not mean it works in ALL places... You could have affected other wires while hooking up from the old Uno. Many factors…
Parents
  • rishi2628
    0 rishi2628 over 10 years ago

    This is the circuit ................. i am trying to upload the video........it will be up soonimage

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • balearicdynamics
    0 balearicdynamics over 10 years ago in reply to rishi2628

    Again ... I am not an expert in circuit interpretation but I don't see any GND connected to the LEDs...

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • michaelkellett
    0 michaelkellett over 10 years ago in reply to rishi2628

    If your schematic is accurate the complete absence of any decoupling capacitors won't help.

     

    You need at least 10uF + two or three 100nF ceramics close to the processor from VCC to ground.

     

    Unless the LED display has built in current limiting resistors you should put a resistor in each of the segment connections to limit the current.

     

    MK

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • rishi2628
    0 rishi2628 over 10 years ago in reply to michaelkellett

    ok i have uploaded the video on youtube:-

    https://www.youtube.com/watch?v=hdxqWKZSfso

     

    please note that upto 20 seconds everything works fine, then the 7 segments start to flicker

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • rishi2628
    0 rishi2628 over 10 years ago in reply to balearicdynamics

    ok i have uploaded the video on youtube:-

    https://www.youtube.com/watch?v=hdxqWKZSfso

     

    please note that upto 20 seconds everything works fine, then the 7 segments start to flicker

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mcb1
    0 mcb1 over 10 years ago in reply to rishi2628

    rishi2628

     

    This has echos of this post, where the same circuit worked when the servo was disconnected.

    http://www.element14.com/community/thread/42034/l/servo-problem

     

    Despite several people helping, you stopped replying on the 27th, yet this new post suggests the problem wasn't resolved.

     

     

     

    I see several problems if this is built as shown.

    1.    The ground from R1, R2 is missing....I'm assuming its is a simple error of the schematic, but maybe not.

    2.    I see no capacitors across the supply. and especially the digitally noisy 7 seg LED's.

    3.    Pin 13 (PD7) is floating, so either the schematic has another error, or that is the way it's been wired.

     

    This battery is driving the microcontroller and 2 pwm servos that will be connected at pins  16 and 17

    In nearly every 'HELP' call when servos are included the OP has failed to add a 1000uF capacitor or power the servos separately, and this has been the cause of various issues.

    Does it perform Okay with the servos disconnected.?? (Your previous post suggests the answer is YES)

     

    I might help if you include your code, however I do think its is a supply issue.

     

     

    In future it is always beneficial to those trying to help to include ALL the schematic.

    This includes the Regulator, Filtering capacitors, and connections to the device ...7 seg LED's PWM Servos.

    Enrico is correct the ground connection is not shown on this schematic.

     

    While the internet is great at passing information, it doesn't work well with crystal balls, and visibility beyond what is supplied ...image

     

    Mark

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • rishi2628
    0 rishi2628 over 10 years ago in reply to mcb1

    This is the code:-

    i have not written the code for the set button and the servos up until now, but it works fine in the simulation

     

    #include <avr/io.h>

    #define F_CPU 16000000UL

    #include <util/delay.h>

     

     

    void display(int i)

    {PORTD&=0x80;

    if(i>9)

    i=i%10;

    if(i==0)

    PORTD|=0x01;

    else if(i==1)

    PORTD|=0x67;

    else if(i==2)

    PORTD|=0x12;

    else if(i==3)

    PORTD|=0x42;

    else if(i==4)

    PORTD|=0x64;

    else if(i==5)

    PORTD|=0x48;

    else if(i==6)

    PORTD|=0x08;

    else if(i==7)

    PORTD|=0x63;

    else if(i==8)

    PORTD|=0x00;

    else if(i==9)

    PORTD|=0x40;

     

    _delay_us(1000);

    }

     

     

    int main(void)

    {DDRB=0b001100;

    DDRC=0x0F;

    DDRD=0x7F;

    int th=0,h=0,t=0,o=0;

         while(1)

    /*   

      //else if((PIND & 0b10000000) == 0b10000000)

      

      

    */ {if((PINB & 0b100000) == 0b100000)

       {th++;

        while((PINB & 0b100000) == 0b100000)

       {}

       }

       else if((PINB & 0b010000) == 0b010000)

       {h++;

        while((PINB & 0b010000) == 0b010000)

       {}

       }

       else if((PINB & 0b000010) == 0b000010)

       {t++;

        while((PINB & 0b000010) == 0b000010)

       {}

       }

       else if((PINB & 0b000001) == 0b000001)

       {o++;

        while((PINB & 0b000001) == 0b000001)

       {}

       }

       else

    {  PORTC=0x01;

          display(o);

       PORTC = PORTC << 1;

       display(t);

       PORTC = PORTC << 1;

       display(h);

       PORTC = PORTC << 1;

       display(th);

       PORTC = PORTC << 1;

    }

    } 

    }

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • rishi2628
    0 rishi2628 over 10 years ago in reply to mcb1

    Also, you told me that it is a supply problem. Can you suggest be another ic similar to 7805 or any other circuitry that doesn't cause any interference?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • balearicdynamics
    0 balearicdynamics over 10 years ago in reply to rishi2628

    RIshi,

     

    mcb1 told that there is a power problem NOT because the 7805 is a crap component but because, with a reasonable difficult we are trying to decode your info and seems that your schematic has issues related to the powering.

     

    Then - I associate to the suggestion - when you need for help, we expect that are you the first to give all the possible information: more than one time we have asked to post the FULL schematics, that means: all that is used to make this stuff working (or not working). This includes also the power schematics. Then, please read the suggestions, if we see a floating signal, no ground where it is expected to be, check in depth the design and try to see if what we are deducting is true. In this case, please correct it, try again and let know us if the changes works, solve the issue etc.

     

    Last, but not least, please when you paste some kind of code, (better if you take a look on the many how to are on Element14 to use the posts, posting correct etc.) use the syntax higlight feature. So we too can read the code and eventually copy it somewhere to see if it works, compile etc.

     

    So, the wrong written code like the one you wrote

     

    {  PORTC=0x01;

          display(o);

       PORTC = PORTC << 1;

       display(t);

       PORTC = PORTC << 1;

       display(h);

       PORTC = PORTC << 1;

       display(th);

       PORTC = PORTC << 1;

    }

     

    become perfectly readable, well syntax highlighted and can be easily copied and pasted in any IDE.

     

    {  PORTC=0x01;
          display(o);
       PORTC = PORTC << 1;
       display(t);
       PORTC = PORTC << 1;
       display(h);
       PORTC = PORTC << 1;
       display(th);
       PORTC = PORTC << 1;
    }

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • rishi2628
    0 rishi2628 over 10 years ago in reply to balearicdynamics

    ok i will provide you with the full schematics tomorrow, its currently 3 am in my country. i am going of to sleep.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • balearicdynamics
    0 balearicdynamics over 10 years ago in reply to rishi2628

    image G'Night

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mcb1
    0 mcb1 over 10 years ago in reply to balearicdynamics

    rishi2628

     

    The syntax highlighting that Enrico is referring to is a little hidden.

    It's a shame there isn't a simple icon, but we struggled to get it added, so it's better than nothing.

     

    past you code, then highlight it all and

    Select the >> symbol, then Syntax Highlighting, then C++

    image

    It does have issues with blank lines, and tries to make it Excel, but I'm sure you'll sort it out.

     

    Mark

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • mcb1
    0 mcb1 over 10 years ago in reply to balearicdynamics

    rishi2628

     

    The syntax highlighting that Enrico is referring to is a little hidden.

    It's a shame there isn't a simple icon, but we struggled to get it added, so it's better than nothing.

     

    past you code, then highlight it all and

    Select the >> symbol, then Syntax Highlighting, then C++

    image

    It does have issues with blank lines, and tries to make it Excel, but I'm sure you'll sort it out.

     

    Mark

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • 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