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 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
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Piface Digital - Relais
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 5 replies
  • Subscribers 663 subscribers
  • Views 621 views
  • Users 0 members are here
  • digital
  • relais
  • piface
Related

Piface Digital - Relais

Former Member
Former Member over 11 years ago

Hallo zusammen,

 

erstmal zu meinem Setup:

- Raspberry Pi Mod. B

- Piface Digital 2.1

- Raspbian Wheezy 7.2

 

Ich habe dasProblem, wenn ich das erste relais (0) schließe, kann ich das zweite relais (1) nichtmehr ansteuern. Andersherum ist es aber kein Problem. Habe auch schon andere Pifaces getestet, allerdings das gleiche Problem. Hättet ihr da eine Idee?

 

Besten Dank im Voraus :-)

  • Sign in to reply
  • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 11 years ago

    Can you please provide a wiring diagram and the code your using for this, I may then be able to help (Pictures too will help), also please refer to http://www.element14.com/community/community/raspberry-pi/blog/2014/03/07/raspberry-pi-usb-power-cables-crashing-and-other-problems?et=blogs.comment.created#comment-31786 as you may be experiencing a power issue depending on the quality of your supply to the PI. using Google translate for this response so please forgive it it is worded badly.

     

    Können Sie bitte ein Schaltbild und den Code Ihr mit für diese, kann ich dann in der Lage zu helfen (Fotos zu helfen), auch finden Sie unter http://www.element14.com/community/community/raspberry-pi/blog/2014/03/07/raspberry-pi-usb-power-cables-crashing-and-other-problems?et=blogs.comment.created#comment-31786 wie Sie vielleicht erleben eine Machtfrage abhängig von der Qualität der Versorgung des PI. übersetzt mit Google Trans für diese Antwort, so bitte vergib es ist schlecht formuliert.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to Robert Peter Oakes

    Hi Peter,

     

    thanks for your reply.

     

    The code looks like this:

    #Import piface library
    import  pifacedigitalio
    
    #create and initialise pfd object
    pfd = pifacedigitalio.PiFaceDigital(init_board=False)
    
    #Access relay
    def access_gpio(pin, value):
             pfd.relays[pin].value = value

     

    And those are the installed packages

     

    ii  python-pifacecommon               4.0.0-1                            all      The PiFace common functions module.
    ii  python-pifacedigitalio            3.0.4-1                            all      The PiFace Digital I/O module.
    ii  python3-pifacecommon              4.0.0-1                            all      The PiFace common functions module.
    ii  python3-pifacedigital-emulator    2.0.2-1                            all      The PiFace Digital I/O emulator.
    ii  python3-pifacedigital-scratch-handler 2.0.5-1                            all      The PiFace Digital Scratch Handler.
    ii  python3-pifacedigitalio           3.0.4-1                            all      The PiFace Digital I/O module.

     

    Wiring:

    Fullscreen contentimage_176360.html Download
    <html><head><title>Jive SBS</title></head>
    <body><font face="arial,helvetica,sans-serif">
    <b>Error</b><br><font size="-1">
    An general error occurred while processing your request.
    </font></font></body></html>
    

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • iagorubio
    0 iagorubio over 11 years ago in reply to Former Member

    I don't know too much about the piface digital, but from the code ( https://github.com/piface/pifacedigitalio/blob/master/pifacedigitalio/core.py ) looks like if you pass False to  init_board on the constructor the GPIO pins are not initiallized.

     

    Can you try this ?

     

    #Import piface library
    import  pifacedigitalio
    
    
    #create and initialise pfd object
    pfd = pifacedigitalio.PiFaceDigital()
    
    def access_gpio(pin, value):
             pfd.relays[pin].value = value

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to iagorubio

    i don't initialise the board at this point because it already gets initialised when the pi boot. When i initialiase the board at this point. it will reset the states of the relays.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 11 years ago

    I would suggest then to take out the auto init at boot time and focus on the code above first, it would be a simple matter to re-establish the auto mode once the debugging is complete. this way you can easily drive the relays on and off manually in order to better understand what is happening

     

    Also did you measure the supply voltages between TP1 and TP2, or on the GPIO connector to see if your experiencing any issues there. I have not seen the schematics for the PI Face so don't know if it is powered from the PI or via a separate adapter. Relays when switching on and off can cause power spikes if suitable protection circuits are not in place, this is why assuming your code is correct, it could be the power issue. make some measurements and let us know

     

     

    thanks

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