Ch3fk0ch
Posts: 58
Joined: Tue Apr 05, 2016 8:34 pm

Re: Raspberry(3b+)-PCA9685-12V Fans

Fri Sep 28, 2018 3:02 pm

I will try other liberies to create the pwm pf the raspberry.

Brandon92
Posts: 870
Joined: Wed Jul 25, 2018 9:29 pm
Location: The Netherlands

Re: Raspberry(3b+)-PCA9685-12V Fans

Fri Sep 28, 2018 3:05 pm

Did you do the measurements that I stated in my last post?
And what frequency are you currently using?

Ch3fk0ch
Posts: 58
Joined: Tue Apr 05, 2016 8:34 pm

Re: Raspberry(3b+)-PCA9685-12V Fans

Fri Sep 28, 2018 6:14 pm

Yes i did it on your way.
It was set to 25kHz as i messured the 5.xkHz output.

I read something that the original Pi library is bad for PWM.
Pi-Blaster or WiringPi library now to see if that makes a differnt.

Brandon92
Posts: 870
Joined: Wed Jul 25, 2018 9:29 pm
Location: The Netherlands

Re: Raspberry(3b+)-PCA9685-12V Fans

Fri Sep 28, 2018 6:58 pm

Okay. Can you show the scope image? So, that I can check the signals.

Ch3fk0ch
Posts: 58
Joined: Tue Apr 05, 2016 8:34 pm

Re: Raspberry(3b+)-PCA9685-12V Fans

Fri Sep 28, 2018 8:06 pm

Look at Post 47.

Brandon92
Posts: 870
Joined: Wed Jul 25, 2018 9:29 pm
Location: The Netherlands

Re: Raspberry(3b+)-PCA9685-12V Fans

Fri Sep 28, 2018 8:21 pm

Ch3fk0ch wrote:
Fri Sep 28, 2018 8:06 pm
Look at Post 47.
Yes. I saw that. And that is not the signal were I'm looking for. See my post below that one ;)

Ch3fk0ch
Posts: 58
Joined: Tue Apr 05, 2016 8:34 pm

Re: Raspberry(3b+)-PCA9685-12V Fans

Fri Sep 28, 2018 8:39 pm

Thats what i did.
Placed one at the Emitter and one at the Collector.

Brandon92
Posts: 870
Joined: Wed Jul 25, 2018 9:29 pm
Location: The Netherlands

Re: Raspberry(3b+)-PCA9685-12V Fans

Fri Sep 28, 2018 8:53 pm

Ch3fk0ch wrote:
Wed Sep 26, 2018 2:39 pm
(I put the black Cabel on GND and the Red on the Gipo)
I believe you measured at the output of your arduino and your Rpi. And not across the transistor. If you have two input you could also include the base signal as well.

So, the black one on the ground. And one channel on the base and the other on the collector.

Ch3fk0ch
Posts: 58
Joined: Tue Apr 05, 2016 8:34 pm

Re: Raspberry(3b+)-PCA9685-12V Fans

Sat Sep 29, 2018 8:04 pm

So Ok,
Standart Gipo library set to 25khz:

Yellow= RPi Direct
Blue= Transistor Emitter and Collector
IMG_4603.JPG
IMG_4603.JPG (155.4 KiB) Viewed 2046 times
Yellow= Emitter and Base
Blue=Emitter and Collector
IMG_4602.JPG
IMG_4602.JPG (144.32 KiB) Viewed 2046 times

Greetings

Ch3fk0ch
Posts: 58
Joined: Tue Apr 05, 2016 8:34 pm

Re: Raspberry(3b+)-PCA9685-12V Fans

Sat Sep 29, 2018 8:31 pm

I think first have to find a solution for the frequency.
I tested it and i cant get the 25kHz.
Unbenannt.png
Unbenannt.png (12.73 KiB) Viewed 2039 times
Same results when i use a Python script instead of NodeRed

Brandon92
Posts: 870
Joined: Wed Jul 25, 2018 9:29 pm
Location: The Netherlands

Re: Raspberry(3b+)-PCA9685-12V Fans

Sun Sep 30, 2018 7:33 am

The blue line is not what I was expecting. I expect the green and light blue one in the picture below to be present. Are you sure that you connected the transistor in the right way around. And do you have a other one for testing?

Image

Ch3fk0ch
Posts: 58
Joined: Tue Apr 05, 2016 8:34 pm

Re: Raspberry(3b+)-PCA9685-12V Fans

Sun Sep 30, 2018 10:42 am

Hi.
i will Build it up new with a new Transistor and test it again.

Ch3fk0ch
Posts: 58
Joined: Tue Apr 05, 2016 8:34 pm

Re: Raspberry(3b+)-PCA9685-12V Fans

Mon Oct 01, 2018 6:27 pm

Hi,
i build it up new with a new Transistor:
Same result.

Brandon92
Posts: 870
Joined: Wed Jul 25, 2018 9:29 pm
Location: The Netherlands

Re: Raspberry(3b+)-PCA9685-12V Fans

Mon Oct 01, 2018 6:56 pm

Strange, this should work. Did you measure by the way the voltage of the PWM pin of the fan. So, whith noting connected to it. It should be 5V.
Could you show a clear image of your setup, including the measurement.

And did you use the pwm pinnen of the Rpi?

Ch3fk0ch
Posts: 58
Joined: Tue Apr 05, 2016 8:34 pm

Re: Raspberry(3b+)-PCA9685-12V Fans

Mon Oct 01, 2018 7:29 pm

Hi,
i use BCM 18 (PWM0).

I found a strange way of the Full PWM control at 25kHz with PIGPIO.
So i make this in the Terminal:

Code: Select all

sudo pigpiod
python
import pigpio
pi=pigpio.pi()
pi.hardware_PWM(12, 25000, 1e6*0.25) # 25000Hz 25% dutycycle(normaly)
And get this curve (not exectly):
Unbenannt.png
Unbenannt.png (59.62 KiB) Viewed 1973 times
I think this rounded pwm signal is also not the best for it:
IMG_4610.JPG
IMG_4610.JPG (167.75 KiB) Viewed 1973 times
I also tested the same transistor at the Ardruino there the signal looks normal.
Maybe its cause of the PWM Voltage form the Raspberry

THe PWM Pin of the raspberry only had 3.3V or not?
I will make new Pics tomorrow

Greeetings and thanks
Last edited by Ch3fk0ch on Tue Oct 02, 2018 8:21 pm, edited 1 time in total.

Ch3fk0ch
Posts: 58
Joined: Tue Apr 05, 2016 8:34 pm

Re: Raspberry(3b+)-PCA9685-12V Fans

Tue Oct 02, 2018 7:08 pm

The the Voltage of the Rasperry PWM Pin is 3,11V
Here are some photos of the circuit.
IMG_4612.JPG
IMG_4612.JPG (112.85 KiB) Viewed 1945 times
IMG_4613.JPG
IMG_4613.JPG (109.86 KiB) Viewed 1945 times
IMG_4614.JPG
IMG_4614.JPG (112.55 KiB) Viewed 1945 times

Brandon92
Posts: 870
Joined: Wed Jul 25, 2018 9:29 pm
Location: The Netherlands

Re: Raspberry(3b+)-PCA9685-12V Fans

Wed Oct 03, 2018 5:28 pm

Hello,

Is the last scope image with the fan connected? Because all the signals are not what I would expect. And by looking at your images, the connection looks good.

If your Rpi signal is 0V, so the yellow signal on the scope is at the same level as the "B'. If that is the case, I would expect the blue channel to be at a 5V level. Like the the image that I posed with the simulation.

So, you got it to work if I see your table. Its is kind of correct. Because when you are using one single NPN transitor in this way. Your PWM signal is inverted. So, this means that when you send a 0% duty cycle, the fan see it as a 100% duty cycle. And when you send a 100% duty cycle, the fan see a 0% duty cycle.

Ch3fk0ch
Posts: 58
Joined: Tue Apr 05, 2016 8:34 pm

Re: Raspberry(3b+)-PCA9685-12V Fans

Thu Oct 04, 2018 6:39 pm

Hi,
no it was without Fan.
The Raspberry just have 3.3V on The GPIO's not 5V.

I not really know what u mean with:
"So, you got it to work if I see your table. Its is kind of correct. Because when you are using one single NPN transitor in this way. Your PWM signal is inverted. So, this means that when you send a 0% duty cycle, the fan see it as a 100% duty cycle. And when you send a 100% duty cycle, the fan see a 0% duty cycle."

I know why the Signal is inverted^^

What i dont know is why the Signal fromt the Transisor at the Raspberry looks so strange.
With the Arduino i get a good looking Signal (ardruino uses 5V)

Brandon92
Posts: 870
Joined: Wed Jul 25, 2018 9:29 pm
Location: The Netherlands

Re: Raspberry(3b+)-PCA9685-12V Fans

Thu Oct 04, 2018 7:04 pm

Ehm okay. Let's go back to something simple.
Can you build this schematic:
Image

And connect the one probe to the base and the other to the emiter of the transistor. Amd the gnd to the gnd.

And use for r2 the same resistor as you use write now. And in this case is vcc the 5v rail. And use for r1 1000 ohm.

By the way, what is your value for r2, and did you measure it?

Ch3fk0ch
Posts: 58
Joined: Tue Apr 05, 2016 8:34 pm

Re: Raspberry(3b+)-PCA9685-12V Fans

Fri Oct 05, 2018 7:23 pm

Hi,
1. for r2 i use the 470ohm resistor
2. Connecting GND and Emitter ? I think u mean Base and Collector or?
IMG_4618.JPG
IMG_4618.JPG (93.45 KiB) Viewed 1869 times
Channel A= Collector
Channel B= Base

Brandon92
Posts: 870
Joined: Wed Jul 25, 2018 9:29 pm
Location: The Netherlands

Re: Raspberry(3b+)-PCA9685-12V Fans

Fri Oct 05, 2018 8:06 pm

I hope this diagram is more clear for you, about how to connect it correctly. If you have quistion about this, or I need to check it. Let me know.
pwmled_con_scope.png
pwmled_con_scope.png (101.62 KiB) Viewed 1863 times
Okay, your resistor is correct.

Ch3fk0ch
Posts: 58
Joined: Tue Apr 05, 2016 8:34 pm

Re: Raspberry(3b+)-PCA9685-12V Fans

Fri Oct 05, 2018 8:09 pm

Thats the way i make it.
Just that i connect Channel B to the Base and A to the Collector.

Brandon92
Posts: 870
Joined: Wed Jul 25, 2018 9:29 pm
Location: The Netherlands

Re: Raspberry(3b+)-PCA9685-12V Fans

Fri Oct 05, 2018 8:20 pm

Okay. That is good then. I also see that you have enabled the ac coupling option. And you need to turn it in dc coupling.
You can see this because the ground level of your signal is not at the same level as the channel label.

But despite that, your signals are looking good 😀

Wirepower84
Posts: 1
Joined: Sun Sep 15, 2019 7:29 am

Re: Raspberry(3b+)-PCA9685-12V Fans

Sun Sep 15, 2019 7:31 am

Did this ever get working? I’m in the process of doing the same thing with my raspberry pi.
Need to know what material I require, resistors, transistors etc :)

Return to “Beginners”