So I've got some code that looks like this:

import pifacedigitalio as p
import time

while True:
    p.digital_write(0, 1)
    p.digital_write(1, 0)

As the input changes, the indicator LED switches on and off. As it does, it makes an audible clicking sound. Doesn't seem right to me! What could be causing this?

  • 2
    When you say indicator led, is it pi's internal led's or external led's that you have connected for the project? Thanks Dec 29 '15 at 8:19
  • Output pins 0 and 1 :) Cheers!
    – Koobz
    Dec 29 '15 at 8:32

The PiFace includes a relay (2 actually) the clicking sound you hear is the relay (the small black boxes) activating and deactivating. Inside the relay is a small metal arm that moves to make electrical contact. The clicking is normal. This video explains how a relay works.

  • 1
    You don't really want to switch mecahnical relays too often. They have a limited number of cycles. 5 times a second might not be too bad.
    – joan
    Dec 29 '15 at 9:18
  • Yeah - My car has a relay without any contacts (a solenoid?) just to make a tick-tick noise when I use the indicators (turn-signals) as the flasher unit is electronic and totally silent and the Car manufacture thought that a sound was needed for those.
    – SlySven
    Dec 30 '15 at 2:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.