Show Posts
Pages: [1] 2 3 ... 5
1  Using Arduino / Motors, Mechanics, and Power / Circuit to drive brushless fountain pumps on: September 11, 2014, 02:05:37 pm
...attached please find the circuit diagram of my current project. As it is my second diagram at all and I want to do a PCB with it, please let me know if you think I should change or add things.
The circuit will be used to control the speed of seven brushless fountain pumps (with integrated electronics). To drive the pumps I'm using a PWM signal which is amplified (to 12V) by a darlington array, then connected to a low pass filter and an adjustable voltage regulator (input: 12V).
With the help of a schottky diode I'm "converting" the tacho signal from the pumps to 5V.
The above part of the circuit has been tested on a breadboard and works fine.
To be able to drive the pumps' speed according to the surrounding sound level I added a lm386, which I did not test together with the rest of the circuit, but some time before. The input of the lm386 is connected to an electret microphone and the output is connected to an analog input pin of the arduino. The noise level will be high, as digital and analog signals are mixed. As the lm386 gets its power from the Arduino micro which again is powered from a 12V source I wonder if it will draw too much current for the regulator!?
I got recommendations to use high side instead of low side switching with the mosfet (which is used to be able to switch of the power completely, as the lowest possible voltage of the regulators is ~1,5V), but low side switching works fine.
I never used an acs712, but I want to try to use it together with the tacho-signal of the pumps to be able to find out if a pump is blocked, not connected or sucking air.
Regarding the safety of the circuit I'm fine with using only a polyfuse, no reverse current protection and no voltage protection (regarding the latter I count on the power supply)! - Thanks for the answers in advance!
2  Using Arduino / Motors, Mechanics, and Power / Re: Brushless pumps; tacho(speed)-signal problems on: August 18, 2014, 03:30:11 pm
Check your BAT47 diode. If the pump produced an inductive spike, it may have exceeded the voltage rating of that diode and fused it.

I assume that the pump has only 3 wires (+ve supply, -ve supply and tacho), in which case you will have a problem with noise on the common ground wire. Instead of the BAT47, I suggest using an NPN transistor. Connect emitter to Arduino ground, collector to Arduino input pin (with pullup resistor enabled), 4K7 resistor between base and emitter, and 47K resistor between base and tacho output from the pump. That will give you much better noise immunity, and better protect the Arduino from any spikes on the tacho output.
...I checked the diodes, they are o.k.!
Your idea with the transistor is definitely the better choice, but I want to have as little to solder (on the pcb that I will create at the end of the test period) as possible. I now let the pumps run for hours and often stopped and restarted them with the button without problems. One thing I might change is that I will switch to high-side switching. Especcially after I recognized that when I set the pwm values of the pumps to zero so that there is less than 2V at the output of the regulators, and also "switch off" the mosfet, but keep the pullup resistors of the inputs, where the tacho is connected, activated, that then (still) current flows from the arduino-pin through the diodes. This current must flow via the + cable of the pump backwards through the regulator. From there it will flow through the 2,2kOhm resistor, that is connected to adjust, to gnd!(?)
3  Using Arduino / Motors, Mechanics, and Power / Re: Brushless pumps; tacho(speed)-signal problems on: August 16, 2014, 04:00:43 am
You probably created a large inductive spike when you switched off the pump.

You do have a free wheel diode don't you?  Always needed with inductive loads.
...I expected the electronics inside the pumps to have diodes, but to be on the save side i installed diodes - Thanks for the hint!
4  Using Arduino / Motors, Mechanics, and Power / Re: Brushless pumps; tacho(speed)-signal problems on: August 15, 2014, 09:16:25 am the Arduino micro is dead! Attached you can find a picture which I took with my digital microscope. Seems that there is something burned. It happened after I moved some of the pumps a bit and those then produced more splatter, so I think that a little drop hit the micro (although it seems not to be wet) and caused a short. The water is a bit salty, caused by the rocks, so the resistance of the water is low I assume.
It happened after I switched off the pumps with the button. The grounds of the pumps were not connected to the mosfet (at the moment), but were connected directly to gnd. I checked the rest of the circuitry by connecting the inputs of the TD62783AP(darlington array) directly to 5V and all pumps went on as expected, so there is nothing wrong with the darlington array or the voltage regulators or the pumps. The only thing left (beside the water drop) that could be the reason (for my taste very unlikely) is that the 12V tacho signal has something to do with the killed atmega. Would be nice, if someone could comment on the digram I posted (especcially the connection of the tacho), before I connect another (my last) micro to the breadboard (and then move the breadboard completely under the barrel to prevent it being hit by drops)! - Thanks in advance!
5  Using Arduino / Motors, Mechanics, and Power / Re: Brushless pumps; tacho(speed)-signal problems on: August 14, 2014, 04:38:14 pm
Perhaps a diagram then we can figure out whether the diode will work as
you hope (if so then its OK).
...attached please find a picture with the diagram for one pump (the mosfet and the darlington array are for all pumps, everything else is there 7 times)!
6  Using Arduino / Motors, Mechanics, and Power / Re: Brushless pumps; tacho(speed)-signal problems on: August 12, 2014, 04:36:02 pm
So you'll just back-power the pump from the schottky, pulling the 5V rail
higher than it should be in the process?  No, high-side switching is needed,
or proper level-shifting/opto-isolation is needed in the tacho line I think.
...maybe there is a missunderstanding! I don't use pwm on the mosfet, I just switch it "on" at the beginning of the program and switch it off, when the user presses a button to stop all pumps. The speed of the seven pumps is controlled via seven lm317 which are accessed by the arduino as follows:

pwm -> TD62783AP (as level shifter) -> lowpass -> lm317

As the lm317 cannot be driven to 0V, I use the mosfet to be able to switch the power off completely!
The Tacho works as follows: When there is a HIGH on the tacho there is e.g. 12V at the diode, but it won't pass (because it's inverse direction). When the tacho is LOW the voltage sourced by the arduino input pin's pullup resistor will pass the diode and cause the input pin to go low! - and this works. I just created a program that controls the pump's speed just via tacho, so the individual pump is set to full speed when the tacho-signal length is higher than desired and is set to lowest possible speed when the tacho-signal length is lower than desired. Doing this with high frequency lets the pumps create a fountain height as desired.
The advantage of this compared to working with pwm values is that you can have higher dynamics, because the pumps are always fully on until they reach the desired tacho ( = speed = fountain height)!
The desired tacho-signal length (pump speed) is controlled by an animation sequence in an array. I wrote a pump (fountain) animation program with processing that creates the animation arrays.
7  Using Arduino / Motors, Mechanics, and Power / Re: Brushless pumps; tacho(speed)-signal problems on: August 12, 2014, 11:19:40 am
I think you may be in danger of damaging your circuitry.

You seem to be low-side switching the power to the pumps (MOSFET to the ground lead),
yet have the tacho signal running from pump to Arduino?

That's going to put the motor supply voltage straight into an Arduino pin, and these pumps
are normally 12V??  Not good.

...I put schottky diodes in-between tacho from the pumps and the input pin of the arduino, so the supply voltage of the pumps won't reach the pin, but with high side switching I could get rid of the resistance in gnd caused by the mosfet, which could help to get rid of the erratic tacho values! - THANKS!
8  Using Arduino / Motors, Mechanics, and Power / Re: Brushless pumps; tacho(speed)-signal problems on: August 12, 2014, 05:30:05 am
...I found the problem (but I still don't know why it is only a problem for the micro)!
I conected the pump's grounds first via a white cable into the first breadboard and from there via a blue cable to the mosfets drain. I now removed the blue cable and connected the white one directly to the drain. Now the tacho values are good. Seems that the arduino micro does not like the conection of white and blue cables!? smiley-wink
There are seldomly still wrong values, but I can filter out those in software easily. Nevertheless I had the idea, that to not beeing dependent on the "quality" of the mass through the pump and the mosfet I decided to connect a 10 kOhm pulldown resistor in front of the diodes (looking from the pump's side), so that when the tacho signal goes low the current that comes from the arduino's pullup resistors can "exit" to gnd without having to flow through the pump and the mosfet. With 10k Ohms I still get a few wrong values (as before), so I would like to try it with a pulldown resistor with lower resistance, but as during the high cycle of the tacho-signal the voltage is as high as the pump's supply voltage (<=11V) I don't know, if the hall sensor of the pumps can stand the current. As those few wrong values also might not be caused by ground problems, I think I will live with those wrong values and remove the pulldown resistors.
9  Using Arduino / Motors, Mechanics, and Power / Brushless pumps; tacho(speed)-signal problems on: August 11, 2014, 04:25:04 pm
...I'm working on a problem for a few days, but I can't get rid of it. I'm really clueless at the moment. I attached two pictures. On picture "Pic1" you can see the project. It is consisting of a barrel with rocks, water and seven brushless pumps (with integrated control). The pumps have three cables: phase, ground and tacho. As the pumps don't like unfiltered pwm as supply, I'm using the following elements to be able to control the speed of the pumps:

Arduino micro pwm pins -> TD62783AP(darlington array; current source; 8x) -> RC-member(530 Ohm; + 1uF ceramic capacitor to gnd + 2,2kOhm to gnd) -> lm317 -> pump

Additionally the ground of the pumps is connected to gnd via a mosfet (IRL3803) to be able to completely switch off the lm317s.
As the tacho is a signal between supply voltage (<=11V) and gnd I connected it with a schottky diode to the micro's input pins with activated pullups.
I'm using the following code (modified extract of a bigger program) to print out the duration of the half waves of the tacho-signal (in microseconds) on the serial monitor:
byte pump[] = {13, 10, 5, 11, 6, 9, 3}, pumpTacho[] = {0, 4, 12, 1, 8, 7, A0},
     pumpNo, xorVal[7] = {0};
unsigned long mics[7] = {0}, dMics[7] = {0}, time, time2wait = 0, micsNow;

void setup()
  pinMode(2, OUTPUT);  // pin for Mosfet
  pinMode(3, OUTPUT);  //seven pins for PWM (->lm317)
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(13, OUTPUT);
  pinMode(0, INPUT_PULLUP);  //seven inputs with pullup for tacho
  pinMode(1, INPUT_PULLUP);
  pinMode(4, INPUT_PULLUP);
  pinMode(7, INPUT_PULLUP);
  pinMode(8, INPUT_PULLUP);
  pinMode(12, INPUT_PULLUP);
  pinMode(A0, INPUT_PULLUP);
  pinMode(A1, INPUT_PULLUP);  //input with pullup for button
  pinMode(A2, OUTPUT);  // output for led
  digitalWrite(2, HIGH);  //Mosfet "on"
  digitalWrite(A2, HIGH);  //led on
  for (pumpNo = 1; pumpNo < 7; pumpNo++) analogWrite(pump[pumpNo], 80);
  analogWrite(pump[0], 240);

void loop()
    if (digitalRead(pumpTacho[pumpNo]) ^ xorVal[pumpNo])
      micsNow = micros();
      dMics[pumpNo] = micsNow - mics[pumpNo];
      mics[pumpNo] = micsNow;
      xorVal[pumpNo] ^= 1;
    time = millis();
    if (time > time2wait)
      time2wait = time + 1000;
The very strange thing is that an arduino uno which is connected to a tacho-pin of the arduino micro (s. "pic1") with exactly the same program, but only the one pin connected, shows good values. Attached you can find a screenshot ("pic2") with two serial monitors running simultaneously with tacho-values of the micro ("com15") and the uno ("com13") which shows that the values are completely different. I tried this on two different tacho-pins on the micro("A0" and "0") with the same result. I tried it with an external pullup resistor (2kOhm), but no change. The only thing that helps is to connect the pumps' ground directly to gnd, without the mosfet in-between. With this the values of the micro are good except a few seldomly occurring unfitting ones. The values of the uno are still good (of course). So the mosfet is the disturbing factor, but only for the micro, not for the uno - why????? I tried it with a different mosfet (irliz44n), but the same result. What is wrong with the micro? smiley-wink
The mosfet's gate is connected to pin2 of the micro with a 220 Ohm resistor and to gnd with 10 kOhm. The drain is connected with hte pump's grounds and source is connected to gnd. The voltage drop, with 8.7V between VCC of the pumps and gnd, at the mosfet is 0.3 volts. With a current of 1.3amps this gives a inner resistance of the mosfet of ~0,23 Ohms.

10  Using Arduino / General Electronics / Darlington (or better) driver with 7 inputs/outputs on: June 18, 2014, 04:43:51 pm
I am searching for a darlington (or better) driver IC with 7 inputs/outputs that can SOURCE at least 80mA/output and where 5V(ARDUINO) is sufficient for the inputs(bases)! At the moment I'm using two l293, but to save space I would prefer to have only one IC, comparable to the ULN2003A. - THANKS for the answers in advance!
11  Using Arduino / Motors, Mechanics, and Power / Re: Speed regulation brushless fountain pump on: May 31, 2014, 06:49:56 pm
You have the RC filter resistor between the "1Y" pin and the "adj" pin of the LM317 with the filter cap from the "adj" pin of the LM317 and GND ?
12  Using Arduino / Motors, Mechanics, and Power / Re: Speed regulation brushless fountain pump on: May 31, 2014, 06:37:17 pm
...oops, "490" for "fg" is completely rubbish. I don't want to let the pwm-signal pass!
I think I have to use the maximum frequency with which I want to switch the motor speed to get the best filter (with least ripple) - right?
So if I want to switch the speed 5 times a second I had to calculate
"R * C = 1 / (2 * pi * 5)"
-> "R * C = 0,032" - right?
Beside current what are the criterias to dimension "R" and "C" then?

13  Using Arduino / Motors, Mechanics, and Power / Re: Speed regulation brushless fountain pump on: May 31, 2014, 05:13:32 pm
which pin of the L293 are you using for the voltage input to the RC LOW PASS FILTER ?

...I'm using the "1Y"-pin!
14  Using Arduino / Motors, Mechanics, and Power / Speed regulation brushless fountain pump on: May 31, 2014, 03:50:58 pm
after several tries with no or little success to control the speed of a (cheap) brushless mini-fountain-pump (with integrated electronics; 12V, ~300mA; like this: I found a solution with

L293d + RC-member + LM317 (s. picture).

The PWM signal from the ARDUINO is "amplified" by the L293d, the amplified (12V) signal then is analogized by the RC-member(51 Ohm; 100 µF)  and connected to the "adjust"-pin of the Lm317. There is no connection of the "adjust"-pin to "output" or gnd!
This solution works perfectly, I am able now to smoothly change the speed of the pump.
However, there are a few questions left:

1.: Did I understand the datasheet right that the voltage at the output of the LM317 is alway 1.25V higher than the voltage at "adjust"?

2.: In the final circuit I want to control seven pumps individually. Therefore I want to use an "ULN2003A" (instead of the L293d). To stress the driver as little as possible I want to know how to calculate RC. I read in the datasheet of the "LM317" that the "adjust" current is very small, so I could use a high Ohm R!?
If that is true is the equation

"R * C = 1 / (2 * pi * fg)"

to calculate RC correct?
With the standard PWM-frequency of 490Hz the equation would be

"R * C = 1 / (2 * pi * 490)" - right?

As the current over "adjust" is small I would choose a big R to minimize the capacitors charging current and therefore to minimize the stress of the driver with the positive side effect to only need a small capacitor!?
Another conclusion of the formula is that the higher the PWM-frequency is the lower the value of "R * C" can be!
What is the highest frequency that is possible/would make sense?

Thanks for the answers in advance!
15  Topics / Product Design / Re: My first own PCB with Atmega328 (programmed with ARDUINO-IDE via programmer) on: February 01, 2014, 09:29:33 am
I want to implement Atmega328 on PCB in such a way that I can put my programmed ATMEGA#@* from UNO in PCB and can use it. I also want to do serial communication. Can you help me with the schematic please?
...maybe you should first try this :
Afterwards add every IC you want to use on your PCB to the breadboard and connect it to the ATMEGA (if you want to use ICs which are not available in DIP package try to find breakout boards with those ICs!).
If everything is running you can start with the PCB-CAD!
Pages: [1] 2 3 ... 5