Loud Buzzing in my Relay

Thread Starter

Big Dingus

Joined Oct 22, 2018
32
Hi all.
I put together a couple of little off the shelf boards.
I have a 5v supply for these. (USB)
I want the first light sensor board to switch a relay board.

Light sensor: Light Sensor Photoresisor LDR Module For Arduino Raspberry Pi ESP
https://www.ebay.co.uk/itm/314932843191

Relay board: 5V 1-Channel Low Level Trigger Relay Module With Optocoupler. To switch a slightly heavier load than the LDR could handle.
https://www.switchelectronics.co.uk/products/5v-1-channel-low-level-trigger-relay-module-with-optocoupler?currency=GBP&variant=45339594162485&utm_medium=cpc&utm_source=google&utm_campaign=Google Shopping&stkn=bbf1d20e1ed7&gclid=EAIaIQobChMIsNvAz8mygwMVlYBQBh0EYAz7EAQYAiABEgIxh_D_BwE

The problem I'm having is, when the photoresistor is hovering on it's trigger level, but not over it. It has the relay trying to switch. This causes a buzzing in the relay.
My question is: Would using a capacitor across the DO stop this, or is ther another solution?
The reason I don't just try it, is that the access to the boards is now so difficult.
 
Last edited by a moderator:

KeithWalker

Joined Jul 10, 2017
3,603
What kind of light are yo detecting with your sensor? If it is domestic electric lighting, don't forget that it is flickering on and off at twice the mains frequency. It will definitely need smoothing out.
 

Thread Starter

Big Dingus

Joined Oct 22, 2018
32
No Keith it's daylight. Using just a timer doesn't adjust for the various lighting at the same time.

sghioto I didn't consider a diode.

Thanks guys.
 

Reloadron

Joined Jan 15, 2015
7,857
Your relay board looks to include a flyback diode across the relay coil. Labeled D1.

Less seeing your code you may want to include some hysteresis in your code to eliminate relay chatter when the ambient light is close to your relay trip point.

Ron
 

KeithWalker

Joined Jul 10, 2017
3,603
I agree with Reloadron. A bit of hysteresis should stop the buzzing. I think it is happening because you are using the same 5V supply for the detector and the relay. When the relay energizes, the extra load is probably dropping the supply voltage a little bit. I suspect that you don't have the 5V and common for the logic and relay individually star-connected back to the supply.
 
Top