Page 3 of 3
Re: Raspberry(3b+)-PCA9685-12V Fans
Posted: Fri Sep 28, 2018 3:02 pm
by Ch3fk0ch
I will try other liberies to create the pwm pf the raspberry.
Re: Raspberry(3b+)-PCA9685-12V Fans
Posted: Fri Sep 28, 2018 3:05 pm
by Brandon92
Did you do the measurements that I stated in my last post?
And what frequency are you currently using?
Re: Raspberry(3b+)-PCA9685-12V Fans
Posted: Fri Sep 28, 2018 6:14 pm
by Ch3fk0ch
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.
Re: Raspberry(3b+)-PCA9685-12V Fans
Posted: Fri Sep 28, 2018 6:58 pm
by Brandon92
Okay. Can you show the scope image? So, that I can check the signals.
Re: Raspberry(3b+)-PCA9685-12V Fans
Posted: Fri Sep 28, 2018 8:06 pm
by Ch3fk0ch
Look at Post 47.
Re: Raspberry(3b+)-PCA9685-12V Fans
Posted: Fri Sep 28, 2018 8:21 pm
by Brandon92
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

Re: Raspberry(3b+)-PCA9685-12V Fans
Posted: Fri Sep 28, 2018 8:39 pm
by Ch3fk0ch
Thats what i did.
Placed one at the Emitter and one at the Collector.
Re: Raspberry(3b+)-PCA9685-12V Fans
Posted: Fri Sep 28, 2018 8:53 pm
by Brandon92
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.
Re: Raspberry(3b+)-PCA9685-12V Fans
Posted: Sat Sep 29, 2018 8:04 pm
by Ch3fk0ch
So Ok,
Standart Gipo library set to 25khz:
Yellow= RPi Direct
Blue= Transistor Emitter and Collector

- IMG_4603.JPG (155.4 KiB) Viewed 2048 times
Yellow= Emitter and Base
Blue=Emitter and Collector

- IMG_4602.JPG (144.32 KiB) Viewed 2048 times
Greetings
Re: Raspberry(3b+)-PCA9685-12V Fans
Posted: Sat Sep 29, 2018 8:31 pm
by Ch3fk0ch
I think first have to find a solution for the frequency.
I tested it and i cant get the 25kHz.

- Unbenannt.png (12.73 KiB) Viewed 2041 times
Same results when i use a Python script instead of NodeRed
Re: Raspberry(3b+)-PCA9685-12V Fans
Posted: Sun Sep 30, 2018 7:33 am
by Brandon92
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?

Re: Raspberry(3b+)-PCA9685-12V Fans
Posted: Sun Sep 30, 2018 10:42 am
by Ch3fk0ch
Hi.
i will Build it up new with a new Transistor and test it again.
Re: Raspberry(3b+)-PCA9685-12V Fans
Posted: Mon Oct 01, 2018 6:27 pm
by Ch3fk0ch
Hi,
i build it up new with a new Transistor:
Same result.
Re: Raspberry(3b+)-PCA9685-12V Fans
Posted: Mon Oct 01, 2018 6:56 pm
by Brandon92
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?
Re: Raspberry(3b+)-PCA9685-12V Fans
Posted: Mon Oct 01, 2018 7:29 pm
by Ch3fk0ch
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 (59.62 KiB) Viewed 1975 times
I think this rounded pwm signal is also not the best for it:

- IMG_4610.JPG (167.75 KiB) Viewed 1975 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
Re: Raspberry(3b+)-PCA9685-12V Fans
Posted: Tue Oct 02, 2018 7:08 pm
by Ch3fk0ch
The the Voltage of the Rasperry PWM Pin is 3,11V
Here are some photos of the circuit.

- IMG_4612.JPG (112.85 KiB) Viewed 1947 times

- IMG_4613.JPG (109.86 KiB) Viewed 1947 times

- IMG_4614.JPG (112.55 KiB) Viewed 1947 times
Re: Raspberry(3b+)-PCA9685-12V Fans
Posted: Wed Oct 03, 2018 5:28 pm
by Brandon92
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.
Re: Raspberry(3b+)-PCA9685-12V Fans
Posted: Thu Oct 04, 2018 6:39 pm
by Ch3fk0ch
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)
Re: Raspberry(3b+)-PCA9685-12V Fans
Posted: Thu Oct 04, 2018 7:04 pm
by Brandon92
Ehm okay. Let's go back to something simple.
Can you build this schematic:
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?
Re: Raspberry(3b+)-PCA9685-12V Fans
Posted: Fri Oct 05, 2018 7:23 pm
by Ch3fk0ch
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 (93.45 KiB) Viewed 1871 times
Channel A= Collector
Channel B= Base
Re: Raspberry(3b+)-PCA9685-12V Fans
Posted: Fri Oct 05, 2018 8:06 pm
by Brandon92
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 (101.62 KiB) Viewed 1865 times
Okay, your resistor is correct.
Re: Raspberry(3b+)-PCA9685-12V Fans
Posted: Fri Oct 05, 2018 8:09 pm
by Ch3fk0ch
Thats the way i make it.
Just that i connect Channel B to the Base and A to the Collector.
Re: Raspberry(3b+)-PCA9685-12V Fans
Posted: Fri Oct 05, 2018 8:20 pm
by Brandon92
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

Re: Raspberry(3b+)-PCA9685-12V Fans
Posted: Sun Sep 15, 2019 7:31 am
by Wirepower84
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
