Thursday, November 25, 2010

Electric Pea : How to connect vibration motor to arduino

I wanted to make an "electric pea" to my artwork : The Real Princess ( based on H.C.Anderssens fairytale the Princess and the Pea).  The idea was that when a person lays down to the bed, he/she would feel some odd vibration in his/her back. He or she could then imagine actually feeling the pea that was put under 20 mattresses.


The idea was to implement this by sewing a textile switch on to the  upper side of a thin matress (about 3 mm thick) and the vibration motor to the backside of the mattress. The weight of the person would trigger the textile switch and start the motor.

 I though that this task would be quite easy to manage.  I already had bought a pressure sensitive textile switch made by PlugandWear


I just needed a small vibration motor. They are easily available from any electric shop that sell Sparkfun products (product code ROB-08449).


The basic consept was that when someone was laying above the pressure sensitive switch, Arduino receives a signal to one of its input ports. Arduino would then steer the motor to vibrate until the pressure sensitive switch was again open (no pressure detected).

However I didn't want to use Arduino as a power source for the vibration motor for safety reasons. (Arduino is pushing 3,7 V - 4.9 v through the pins, and the vibration motor is operating at 2,5 - 3,8 V range.) Thus I needed external power source for the motor, a transistor to control the motor, and couple of resistors.

I was even able to draw the circuit diagram by myself:


Then troubles began.

I made an initial circuit to the protoboard.I downloaded the datasheet for transistor (BC639) from the web in order to figure out the correct pin order. I was sure that I had not made any mistakes - but the vibration motor was not running!!! I debugged sw and calculated the correct resistor values - nothing helped.

Luckily my husband still remembered how transistors can be used as diodes by short circutting the base and the collector of a transistor and using its two terminals as two terminals of PN junction diode. By measuring all the pins this way, he figured out the the datasheet that I had downloaded was not valid to my transistor (even the name of the transistor was the same !!) After figuring out the correct pin order of the transistor - everything worked fine.

The next problem was related to the pressure sensitive textile switch. The wires in the switch are very weak and almost as thin as human hair. They broke easily and are very difficult to connect to any "normal size" wires. The manufacturer instructs to use small uninsulated boothlace ferrules. I did have those, but still the connection was very sensitive to any movement of the wire. Finally I got the pressure sensitive switch working on top of my table (hard material below the thin matress), but the switch was not working properly on top of a soft matress I intented to use in my princess bed. :-(

I also noticed the the vibration of the motor was not strong enough to be noticed if there was any soft material below the motor.  :-(

And I also heard that the museum where the work was exhibited had to forbid people to climb to the bed. The bed is 280 cm high and does not have any safety railings. Still the parents were allowing very small kids to climb into it. Seems that parents do not have any common sense any more. :-(

Even though the project did not progess how I wanted, I learned many good lessons about transistors and textile switches. I am still planning to make a pressure sensitive switch totally by myself someday in the future.

No comments:

Post a Comment