This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Controlling AC fan using pwm library

HI team,

I am a beginner of Nordic nrf52840 DK, I would like to control the AC ceiling fan using the nrf52840 board with pwm library. As, I can see we can use either single channel or multi- channel for setting up the frequency of the pwm pin. In order to control the ac fan i am using zero crossing detector (H11AA1) so, that for every zero crossing the Triac(BT136) is triggered and pwm is set to the given duty cycle.  But, what i am getting is only PWM sampling output, and the ZCD is always showing '0'. I am taking the ZCD as input assigned to gpio pin 30 and for every zero crossing i should get the given duty cycle output on GPIO pin 31 which is connected to load.

Kindly, give me suggestions or some kind of related code for getting the output. 

Here, below is the code i am trying to execute.

Parents
  • Hi,

    So if pin 30 is low, you should have a PWM singal on pin 31? And when pin 30 is high, the PWM signal on pin 31 should stop?

    As a fast prototype, maybe you could try something like this?

Reply
  • Hi,

    So if pin 30 is low, you should have a PWM singal on pin 31? And when pin 30 is high, the PWM signal on pin 31 should stop?

    As a fast prototype, maybe you could try something like this?

Children
No Data