Pi Pico random switching by interference?

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
RdR24
 
Posts: 2
Joined: Fri Jul 30, 2021 12:10 pm

Pi Pico random switching by interference?

Post by RdR24 »

Hello all,

I'm starting up with the Pi Pico and circuitpython, it's quite a learning curve but fun!

My question handles about interference with using a Pi Pico

I've made a circuit and soldered it to a PCB (see drawing) , it serves to ring a separate bel (a standard 14V doorbel) or flash a light etc. when my Hikvision DS-KV6113 doorbell is pressed. The whole setup works fine now except for one thing, I got trouble with interference.

When I turn on my airco unit it's quite obvious, the relay then starts to switch on and off constantly while nothing is pressed!
Sometimes the relay gets activated out of the blue... This then hap[pens with the frequence as programmed in circuitpython. So my guess is that the Pi Pico gets triggered somehow and sends the outgoing signal.

Is this interference? How sensitive is the Pi Pico for common interferences? And how can I prevent that?
I don't want the doorbel to function randomly in the middle of the night when nothing is pressed...

regards

Rob
Pi Pico for Hikvision doorbel.jpg
Pi Pico for Hikvision doorbel.jpg (707.82 KiB) Viewed 72 times

The code: (not optimal yet but i'm working on it..)

import board
import time
import digitalio

led = digitalio.DigitalInOut(board.GP15)
led.direction = digitalio.Direction.OUTPUT
button = digitalio.DigitalInOut(board.GP2)
button.switch_to_input(pull=digitalio.Pull.DOWN)

while True:
if button.value:
led.value = True
time.sleep(0.3)
led.value = False
time.sleep(0.3)
led.value = True
time.sleep(0.1)
led.value = True
time.sleep(0.3)
led.value = False
time.sleep(0.3)
led.value = True
time.sleep(0.1)
led.value = False

User avatar
RdR24
 
Posts: 2
Joined: Fri Jul 30, 2021 12:10 pm

Re: Pi Pico random switching by interference?

Post by RdR24 »

Update!

The source of the interference is found!

When the Pico was connected to the iMac the interference took place every time the airconditioning started. When the Pico was connected to a normal seperate 5V power source there was no interference anymore!

Also on advice of my brother (who is very capable in electronics) i've made some adjustments in the circuit:
Pi Pico for Hikvision doorbel.jpg
Pi Pico for Hikvision doorbel.jpg (707.82 KiB) Viewed 66 times
also little adjustments in the code (removed internal pull down resistor):

import board
import time
import digitalio

led = digitalio.DigitalInOut(board.GP15)
led.direction = digitalio.Direction.OUTPUT
button = digitalio.DigitalInOut(board.GP2)

while True:
if button.value:
led.value = True
time.sleep(0.7)
led.value = False
time.sleep(0.3)
led.value = True
time.sleep(0.5)
led.value = False
time.sleep(0.3)
led.value = True
time.sleep(0.3)
led.value = False

When anybody has other tips, feel free to reply.

Rob

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”