Control Peristaltic Pump With TA7291P and an Arduino

75,294

87

34

Introduction: Control Peristaltic Pump With TA7291P and an Arduino

About: A crazy mix between a physician and a mad scientist...

This is my first Instructable and a few evenings invested in trying to understand how to use the TA7291P with a peristaltic pump without frying it convinced me that someone, somewhere, could probably be happy to get this information without loosing too much time.

The objective is to use an Arduino to control a peristaltic pump both in forward and reverse pumping while avoiding the risk of frying everything because of the back EMF generated when stopping the pump.

This project could be used to :

  1. Control the level of fluid in a vessel (that was my primary objective);
  2. Create a temperature-controlled variable flow liquid cooling unit;
  3. Plant watering (scheduled or as needed, if you add a sensor);
  4. Scheduled addition of nutrients (aquariums, hydroponics, etc).

Be imaginative!

It is part of a much bigger project and I will probably post it once it is completed.

Warning : French is my first language. I apologize in advance.

As I hate instructables that don't give you all the necessary details, there is no tricks nor missing secret ingredient in this one. I tried to be as complete as possible but if something could be improved, please comment!

Step 1: Background

If you already know all this stuff or just don't care, please jump to the next section.

For the others...

Back EMF : When you suddenly stop the current flowing in any solenoid (relay, motor, pump, electromagnet, inductor, aka anything with a coiled wire in it), the magnetic field will collapse and create an opposing current (going the wrong way) with a voltage being many times the original voltage. This is likely to fry any IC despite the very short duration of the voltage spike.

As a general rule, never directly connect any circuit to any inductive load without some kind of protection from back EMF. You can find a much detailed explanation here.

Flywheel diode : One of the technique to avoid damage caused by back EMF is to use a flywheel diode that will divert the pulse away from your IC (back into the coil actually).

However, you cannot use the flywheel diode with a peristaltic pump as someone would have to reverse the diode depending if the pump is used in forward or reverse pumping.

You could probably use a MOV (Metal-Oxyde Varistor) instead of the flywheel diode, but to tell you the truth, I don't have any to test and I only thought of it after starting writing this...

If I can get a few of them, I'll make some tests and post and update. If you have some, try it and share your results!

Peristaltic pump : Works like your gut, squeezing a tube to get the stuff out. However, unlike your gut, most of them will simply work in reverse when you reverse polarity (inverting the positive and the negative connection on the pump), so you can fill or empty a vessel with the same pump. Always check the characteristics of your stuff before plugging it (ideally, before buying it!). Also, some pump may or may not be destroyed by "dry pumping" (being used to pump an empty tube).

Current draw : Also called Inrush current, power-on surge, etc. This is the other reason why you want to use a PWM-based control for your pump. Every electric motor doesn't like two things : starting and stalling. When they do so, they will draw a current that is mostly limited to their (very small) internal resistance.

Avoiding Back EMF :

The more sudden the change in the current (if you suddenly "pull the plug"), the more severe will be your back EMF (now, there is a limit to this, but it is way too high anyways for your precious IC...)

The secret is reducing/increasing the current slowly.

And slowly here means a few milliseconds, not minutes...

Now, the easy solution if you have an Arduino is to use 2 PWM pins to slowly increase and decrease the amount of energy in the coil, thus avoiding the back EMF issue as we don't abruptly cut the power (actually, there is always some back EMF, but this way it is within the IC tolerances). By the way, this is a great way to power up or down power transformers or charging supercapacitors, as these little things are thirsty for current and will behave like short circuits. However, this is a completely different story (and Instructable). I'm only throwing it here to tickle your intellect.

Now, I will not start explaining how all that PWM stuff is working, as some great tutorials are already waiting for you.


Step 2: Get the Stuff...

This project only needs a few basic parts...

Hardware

1- Arduino

I used an Arduino UNO R3 (But you probably could use any of them... as long as 2 PWM pins are free and you can output 5V)

2- TA7291P

It is a 0-20V 1A (2A peak) Bridge Driver. It is quite cheap. I used the through-hole 10 pins version. Available at my local electronic surplus for 3.98$ CDN but close to 2$ at Digikey...

Datasheet : TA7291P

Link to Digikey : Part number TA7291PO-ND

3- 12V Peristaltic pump

I selected the 12V peristaltic pump from Adafruit for two reasons :

1- I really needed a peristaltic pump

2- It only draws 300-400mA

It is not cheap, but it works as advertised. You could probably pay less on Ebay... Just don't use any heavy duty 12V pump here... Remember, your bridge is rated 1A...

4- LED (your choice of color)

Completely optional... Just for debugging. Absolutely no other use, and please remove it if you want to reduce your energy usage. You could also use the LED already on your Arduino...

5- Resistor

The mandatory resistor if you use an external LED. Value is not critical, just make sure no more than 20mA will get through your LED. I used a 330 Ohm resistor.

6- A bunch of wires

To connect everything...

7- A 12V battery

8- The USB cable to upload your sketch and power the Arduino

9- Obviously, a breadboard!

Software

1- Arduino IDE

I'm assuming it is already installed, working, and that you know how to upload a sketch... If not, go straight to www.arduino.cc and you will get some great tutorials!

Step 3: Connect All the Stuff...

On a breadboard, place the TA7291P in any convenient spot.

Connect according to the following :

  1. Arduino GND (any of them) to TA7291P pin 1 and 12V GND
  2. Arduino (+)5V to TA7291P pin 7 (Vcc)
  3. Arduino D5 to TA7291P pin 5 (IN1)
  4. Arduino D6 to TA7291P pin 6 (IN2)
  5. Arduino D13 to R1 (if the optional external LED is used)
  6. R1 to (+) leg of LED
  7. (-) leg of LED to GND
  8. TA7291P pin 2 (OUT1) to (+) terminal of your pump
  9. TA7291P pin 4 (Vref) and pin 8 (Vs) to (+)12V
  10. TA7291P pin 10 (OUT2) to (-) terminal of your pump
  11. TA7291P pin 3 and 9 are not used

Step 4: Upload the Sketch...

Here is a (very) basic sketch to test your pump. No libraries, nothing complicated... The code is self-explaining, just read the comments.

What you are supposed to get is a pump that starts, stays at maximum speed for ten seconds, slow down to a complete stop, then reverse the pumping action to pump back the fluid.

If you installed the optional LED, you will see it increasing/decreasing its luminosity, shadowing the speed of the pump.

Step 5: In the End... to Heat Sink or Not to Heat Sink... That Is the Question!

My biggest concern was more related to the thermal effect of powering the pump for a few minutes or even hours. With a pumping rate of 100ml/min, I would realistically need to power it for up to 10-15 minutes at a time (each few hours in the worst conditions, each other day typically) for my project. When they are not in use, both pump and bridge will have plenty of time to cool down to room temp.

As the pump is rated for continuous use, 10-15 minutes is not an issue, but this is something you really have to check, especially with relays, solenoids and pumps! The real problem is the TA7291P heating up...

According to the datasheet, the P version I used as a power dissipation of 12.5 W at room temp (25 degrees Celsius). Now, this is called lab conditions and it relies on an interesting concept, the infinite heat sink. It doesn't in any way reflects real life, where ambient air temperature, humidity, air circulation, definite heat sink capabilities, phase of the moon, etc, will influence your circuit. However, as our pump only draws 300-400 mA, we are sitting right in the middle of the comfort zone here, far from the 1 A max. However, according to the datasheet, power dissipation drops to less than 2.5 W (a mere 200 mA) when the bridge is used without heat sink, but it doesn't say if it is for burst (less than 1 minute), short usage (1-5 minutes) or long term (more than an hour). The safe design would add a heat sink. But I was wondering if we could go without one.

As I got two TA7291P, testing one without a heat sink was worth a try... As the absolute operating temperature is 75 degrees Celsius, I decided to push the test to a maximum of 65 degrees, with complete cool down between the experiments.

It is easy to modify the sketch to make the pump work for a longer period. Using an infrared thermometer (a nice gadget to have by the way, put it on a wish list for a Birthday present!) I was able to verify that without heat sink, in an environment of 18.5 degrees Celsius, and only with natural convection (no fan) the bridge would stay at less than 20 degrees Celsius after 10 minutes pumping 25 degrees Celsius water. This gives you an idea of the real performances, but these numbers will likely change depending of your local temperatures and if the bridge is enclosed in a case, reducing the natural convection.

Here is a small graph of temperature vs time of the bridge in two different experiments.

For me, in the end, it seems unnecessary to add a heat sink.Time will tell if I was right. I'll keep you posted!

And by the way, no, the graph was not reversed by mistake. In both experiments, it looks like the temperature was slowly drifting down. That makes no sense, but as it is within the error margins of the infrared thermometer, I disregard it as noise until I get more time to investigate!

Step 6: What Can Go Wrong?

Common mistakes (at least I made them)...

1- You have to tie your Arduino GND to the PIN 1 of your bridge AND to the 12V Battery GND.

2- Don't increase the value of PIN 5 and PIN 6 at the same time. One should stay at 0. If not, it is like pushing the brakes on your pump. Look at table FUNCTION on page 3 of the Datasheet.

3- PIN 2 (OUT1) on your bridge goes to the (+) terminal of your pump and PIN 10 (OUT2) goes to the (-) negative terminal. Don't connect the second pump terminal to GND! However, you can switch terminals. The pump will work in reverse, at least for the model I tested.

4- Don't use a flywheel diode, unless you will not use the reverse pumping. Using one will create a short when the pump is switched in reverse pumping. This is why you slowly increase/reduce the current using PWM pins to reduce the negative impact of back EMF.

5- Don't pull the plug suddenly. Doing so will create a back EMF that could probably fry your bridge and/or your Arduino. Always bring the pump to a full stop (PIN 5 and PIN 6 LOW, not HIGH which is full brakes!). This is why in the sketch, I inserted a pause, so you can plug or unplug everything during that time.

Step 7: Conclusion

I hope you have a working peristaltic pump by now and that you learned a few things along the way. I'll try to answer comments and questions to the best of my knowledge and in a timely manner. This being said, I'm quite busy, so do not despair if you don't get a reply within the hour.

1 Person Made This Project!

Recommendations

  • Game Design: Student Design Challenge

    Game Design: Student Design Challenge
  • Make It Bridge

    Make It Bridge
  • For the Home Contest

    For the Home Contest

34 Comments

0
jmperou
jmperou

10 months ago

Thanks! This worked like a charm!

Finding the chips was a bit of a chore but found some shipped from China.

0
gracelp
gracelp

Question 3 years ago

Hello, thank you for your tutorial. I want to ask something about the peristaltic pump and silicone tube. What is that thing that connect silicone tube in peristaltic pump to the external silicone tube? I try to search about but can't find it. Thank you.

sambungan tubing silikon.PNG
0
fmarquis
fmarquis

Answer 3 years ago

Look for "barb connectors" or "barb tube fittings".

0
AndrewC479
AndrewC479

4 years ago

Hi, what if i wanted to install an activation button for a non aquarium based project

0
AndrewC479
AndrewC479

4 years ago

Hi, what if i wanted to install an activation button for a non aquarium based project

0
udischwager
udischwager

Question 4 years ago on Step 5

Hi, Thank you posting it, it is very helpful. I have a question about the current limitation resistor that is mentioned in the datasheet - "Note 2: To protect against excess current, current limitation resistor R should be inserted where necessary"

I wonder if you can tell me how to calculate its value (generic way)?

Thanks!

0
fmarquis
fmarquis

Answer 4 years ago

Max current should be around 1 amp max on average with peak current max 2. If your current is drawing more than that, your ic will burn. V=RI so R must minimally be equal to your voltage... just make sure the power rating of that resistor is good enough. By don't worry too much, and check the power rating of your motor and make sure it doesn't draw more than one amp.

0
udischwager
udischwager

Reply 4 years ago

Thanks for your fast reply! In your answer, 'V' is the voltage of the motor that I am connecting to the IC, right?

So if my motor is 6V and I want to limit it to 1A, I need 6 ohm resistor with a power of 6W?

Thanks again!

0
fmarquis
fmarquis

Reply 4 years ago

I don't think you need any resistor. It is only needed if you have a very low resistance load. I'm quite sure your motor doesn't need a resistor in serie. I didn't use one on mine.

0
wp444
wp444

5 years ago

Hi, I'm wondering how exactly to power the pump - I can't tell from the photos. I have a 12V AC/DC adapter; would that work, and if so, how? Thanks a lot!

0
fmarquis
fmarquis

Reply 5 years ago

The power is coming from the IC. This is why you can attach a heatsink to it. Please refer to the ic datasheet form max power.

0
rogu10
rogu10

5 years ago

Hi, nice tutorial.

I know that this post is a bit old, but I'm currently working woth some of these pumps and I would like to know if you can control their speed, or it's just ON and OFF.

Thanks for your help!

0
fmarquis
fmarquis

Reply 5 years ago

I only used them as on/off, varying time to get a specific volume. I would suspect it could be controlled by pwm but you could run into torque issue and not being able to pump you fluid against gravity or if you have elevated resistance or high viscosity.

0
JoãoM41
JoãoM41

7 years ago

Hey thanks for the tutorial. I have a couple of these pumps to run a washing system of a cells in a microscope at the lab. I'm running a 12V power source through the pumps and with those resistances it is really hard to slow them down. Could I use the TA7291 to do so but using a potentiometer? Any other circuit that would allow me to do this? Thanks!

0
fmarquis
fmarquis

Reply 7 years ago

When you say "resistance" you are talking about the fluid being pumped or the electrical resistance? When you say "washing system" what is important? A constant flow? Pulse flow?

0
JoãoM41
JoãoM41

Reply 7 years ago

I need a PWM right?

0
fbeissel
fbeissel

Reply 6 years ago

A common trick even on high end equipment is to split the fluid flow. put on a t or y splitter and clamp the wash line to restrict flow mechanically. Divert the other large volume flow back to the wash reservoir and you will have little waste. A 0.2 micron filter inline would also help keep everything sterile.

0
JoãoM41
JoãoM41

Reply 7 years ago

Ordered a couple of 10usd pwm with all that. It would be ore expensive to make one with a timer or h-bridge and mosfers so I opted the ready to go option. Thanks!

0
JoãoM41
JoãoM41

Reply 7 years ago

I meant current sorry. I would need a rheostat with a lot of heat dissipation. So I have one of those pumps going from a tube with media to the plate and another pump to take out the media from the plate to a waste tube. both pumps work at the same rate. however I have like 40ml/min now, and I need to reduce the flow. I need to control the rate of flow. meaning dropping the voltage. I tried to use a resistance I had laying around to do a voltage dropper (parallel to the pumps) but the resistors fumed :p. So the idea is to control the voltage I guess. I didn't want to change from the 12V power source. This is kinda my system now (I only have two 3.6 resistors in parallel now, they can handle the current draw.

DTiRe.png
0
fmarquis
fmarquis

Reply 7 years ago

Yes, you need some PWM control for that. There is a lot of easy schematics using a 555 chip on the net. Try one of them to control a MOSFET (ideally through a MOSFET driver). I should work without an Arduino.