Dear all,
I need to control multiple vibrating mini motors (at least 6).
I bought the Adafruit Vibrating Mini Motor Discs and the DRV2605 Haptic Controller.
I want to control them with an Arduino Mega 2560.
So, I followed the Adafruit step by step guide to wire-up one of the motors to the driver, and the driver to the Arduino Mega and everything worked out just fine.
Now the problems: what I need is to put at least 6 of these disks in line. Then I need to start vibrating the first one, fade and start the second one, and so on up to the last one. That is, I need to imitate something like a touch, a caress moving on the skin.
As I said, the guide is for only ONE mini motor. In fact, the motor is soldered directly onto the driver.
Does it mean that I need a separate driver for every single mini motor? That sounds quite unrealistic (and expensive).
Also, if that was the case, the guide says to connect the SCL and SDA pins on the board to the SCL and SDA on the Arduino mega (pins 21 and 20). So, what if I buy 6 separate drivers but then only have 1 SDA and 1 SCL pin? Actually, I can check by myself whether connecting the driver to different pins other than 20 and 21 will work all the same. I will do as soon as I can.
Finally: If I really need a separate driver for each Mini Motor, can I instead use the motors WITHOUT the driver? That is, just wire the motors to the breadboard and turn them on and off?
This could actually be quite useful as I intend to run the entire thing with Matlab. And it looks like it is possible. For instance: http://tinkbox.ph/learn/tutorial/how-control-vibration-motor-using-arduino-uno/wiring-diagram The problem is that I do not understand the diagram. Should I mention that I am Psychologist? I am learning to use the Arduino, but I am still really bad about electronics.
P.S.
I remember that in Project 9 of the Arduino starter kit (motorized pinwheel), we used a Mosfet and a Diode to connect a motor stepper to the Arduino.
But again, I don't quite understand the diagram. Should I connect the first pin of the mosfet to power, the third to ground and the middle one to a PWM pin? Then how and where do I connect the mini motor?
As I said, the guide is for only ONE mini motor. In fact, the motor is soldered directly onto the driver.
Does it mean that I need a separate driver for every single mini motor? That sounds quite unrealistic (and expensive).
You always need a separate driver for separate motors doing separate things - how could it be otherwise?
Last update.
So, I didn't get much feedback on how to wire the motors without using the driver. Anyway, I kept searching online and I tried to connect it.
This is the result:
I haven't tried it yet. Could anybody give me some feedback? Do you think this makes sense?
Please remember, I need to use at least 6 of these motors. I want to turn them on progressively so to imitate something like a caress on the skin. Do you think I could repeat this wiring for every single one of them?
P.S.
I know is not extremely clear. Basically, I thought: after all this is still a motor. So I tried to follow the tutorials on how to use motors. Especially, i referred to tutorial 9 on the arduino projects book and this tutorial: I Mosfet e Arduino, come pilotare carichi | danielealberti.it
So, I connected the first pin of the mosfet to a PWM pin through 2 resistance (not really clear why they advice using the second resistance).
Pin 3 of the mosfet is connected to ground.
Pin 2 is connected to line 9 of the breadboard. Then I connected the same line to the ground pin of the motor. Next I put a diode going from line 9 to power. Finally I connected the power pin of the motor to power on the breadboard.
The SCL/SDA pins are the lines associated with the Inter-Integrated-Circuit (I2C) bus. A bus means that you connect many devices to the same lines as shown in Fig1 here, for example.
Trouble is of course, that each device needs an address to distinguish it from its siblings. So you'll need to look at your datasheet to see if the address can be changed on individual devices.
I have even seen people just connecting the vibrating motor to power and ground...like this one for instance: - YouTube
Is that safe? Don't I need resistance, Mosfet, capacitors and so on ??
No its not safe. Inductive loads kick-back, and can kick back hard enough to take out a board.
Sharing supplies between logic and motors/relays is often a source of problems.
If you switch an inductive load you need to suppress the inductive spike somehow (even
physical switches erode rapidly from the arcing). For DC a free-wheel diode is often used as
its simple and cheap.
If the voltage is suitable for the motor no series current limiting resistor is needed. Extra decoupling
on the supply can be a good idea to reduce noise from the motor. If you want to switch the motor you
would need a switching device.
So, at this point I would prefer to just connect each motor individually without the driver.
I did connect the first motor and it looks like it is working. Only, I don't know whether it is still safe te way I did it.
I changed a few things from the last post, this is what I did:
it says CC 3V, 0.1ADC 1.5V, 0.05A, so I figured the 3.3 Volts should suffice.
The connection to the first pin of the transistor is still the same as in the last post. That is, it is connected to PWM pin 4 through 2 resistance:
Pin 3 of the Mosfet is connected to ground:
Pin 2 is connected on line 11 of the breadbord. On the same line in succession I have placed the ground of the motor, then a diode. The diode goes to line 14 of the breadboard and there I have placed the power of the motor and a Jumper connected to power on the breadboard:
I hope that this is clear enough. Once again, IT WORKS, I just don't know how safe it is.
I was thinking of putting a 1uF capacitor between the power and ground of the motor. Would that be ok?
Finally, if this is ok, my idea was to just repeat the entire setting for the other motors and just connect them to different PWM pins. Maybe it is not parsimonious but I just need it to work.
Then I would turn them on and off in succession.
MarkT:
If the voltage is suitable for the motor no series current limiting resistor is needed. Extra decoupling
on the supply can be a good idea to reduce noise from the motor. If you want to switch the motor you
would need a switching device.
Could you clarify what you mean by switching device? Any example? Thank you =)
One more thing, let me see if I get this.
As I said, I did put 2 resistance in my circuit but I did not really calculate how much resistance I needed.
So, I tried to understand how to calculate the needed resistance.
According to the website, this is how much Volts/Amps the motor uses: Nominal Tension and actual tension: CC 3V, 0.1ADC 1.5V, 0.05A
According to the ohm's law, the resistance is: R = V/I.
Now, if I use the 5 Volts supply, minus 1.5 used by the motor, that means 3.5 Volts. So, 3.5/0.05a = 70. So, I should use a 70 ohm resistance, is that correct? Am I getting this all wrong?
Or otherwise, let's say that I use the 3.3 Volts supply (as I did), that means: 3.3-1.5= 1.8.
1.8/0.05A = 36. So, again, use something close to 36 Ohm resistance. Correct or wrong again?
Finally, what is nominal vs actual tension? Which one should I consider?
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
You pictures are helpful, but with wires crossing and obscurung features of your project, it is hard to see your signal flow.
Please include your motor and power supply.
Thanks.. Tom..
You are right, the pictures are not very clear. I'm sorry. As I said, I'm not familiar with any of these things.
That said, following your comment I searched online and found out about Fritzing. I'm really getting excited XD
So, this is my circuit
I don't really know how to read the schematic. That looks quite messy to me, so I tried to rearrange it a little bit but I'm not sure about the result:
Jus one word of comment:
As I said, I am not sure about the resistance (not sure about anything, to be honest). I tried to do some math (just looked online about how to calculate resistance, Ohm's law and so on) and I don't even understand why is working.
The Mosfet is the type that comes with the Arduino Starter Kit. On the Mosfet it says:
IRF520N
IORP55ID
28DL
Does it mean that this is an N type?
I was thinking of adding a capacitor to the circuit. What do you think?
About the power supply: as you can see I'm using the 3.3v by the arduino. I didn't use the 5v just because I was afraid it could be too much. I want to use this for an experiment, so I will just keep it plugged in the USB port and try to control it via Matlab.
Didn't read the whole post.
Just saw that you are powering the motor from the Mega's 3.3volt pin.
Can't do that.
The 3.3volt chip is tiny (150mA absolute max), and could release the magic smoke with just one motor.
Leo..
Wawa:
Didn't read the whole post.
Just saw that you are powering the motor from the Mega's 3.3volt pin.
Can't do that.
The 3.3volt chip is tiny (150mA absolute max), and could release the magic smoke with just one motor.
Leo..
Hi Wawa, thank you for your tip. So, should I use the 5V? I thought that using the 3.3 was safer because I was introducing fewer volts in the circuit.
So, if I use the 5V, should I use a different resistance?
Also, notice that I don't want to power all of them at the same time but turn them on and off progressively. So, I will be powering either 1 at the time or, at the most, 2 at the time (one fading, the next one rumping on...).
Use a separate motor supply if at all possible - no chance of trashing the logic chips that way.
In general capacitors don't have energy storage for more than a few milliseconds with large loads
like motors. The exception being supercaps, but they have limited voltage, and need a while
to charge up on power up. Just ensure the power supply can provide more than enough current
for the maximum load.
Hi,
The IRF520N is not a logic level MOSFET, so it will not be turned fully ON with 5V gate voltage.
(You have to wonder about the intelligent of these people who put together these kits.)
Gluce:
Hi Wawa, thank you for your tip. So, should I use the 5V? I thought that using the 3.3 was safer because I was introducing fewer volts in the circuit.
So, if I use the 5V, should I use a different resistance?
Also, notice that I don't want to power all of them at the same time but turn them on and off progressively. So, I will be powering either 1 at the time or, at the most, 2 at the time (one fading, the next one rumping on...).
Could a capacitor be helpful in this situation?
Ok, so if I use a 12V battery, is that better? Don't I need a much greater resistance in that case? If I understand correctly, the motors are only 3V. Doesn't that mean that there are 9 volts that I need to "eliminate" somehow?
TomGeorge:
Hi,
The IRF520N is not a logic level MOSFET, so it will not be turned fully ON with 5V gate voltage.
(You have to wonder about the intelligent of these people who put together these kits.)
OOOHHH FUDGE !! I JUST bought 5 more of those things -__-' So, does it mean that the one I have is completely useless? Could you suggest me a different one in that case?
I would use a TPIC6B595 (or another member of that family) to control the six motors.
One chip ($0.50 on ebay) can do eight, and many chips can be daisy-chained.
But w8, you also did buy a DRV2605 motor driver board. Are you going to use that?
That (expensive) board can drive ONE motor (no mosfet needed).
Leo..
Wawa:
I would use a TPIC6B595 (or another member of that family) to control the six motors.
One chip ($0.50 on ebay) can do eight, and many chips can be daisy-chained.
But w8, you also did buy a DRV2605 motor driver board. Are you going to use that?
That (expensive) board can drive ONE motor (no mosfet needed).
Leo..
Yes, I did buy one of those drivers, but then I found out that I would need one for each motor. So, I decided to try and build the circuit myself to make it cheaper and also to try and learn something in the process.
About the TPIC6B595, thank you very much for your suggestion. I will look into it =)
Sorry, just one clarification, just to be sure I get it: what you mean by "One chip can do eight"? I could use just 1 chip for 8 motors?