Showing posts with label electronics. Show all posts
Showing posts with label electronics. Show all posts

Saturday, May 28, 2011

Tinkering Loudspeakers

It has been quite a while here in this blog lately, but it does not mean that nothing is happening.

I am working on an interesting performance project with a singer and a sound recorder. This performance requires quite expensive equipment, so we need to get external support for financing before we can continue further. However, this project has made me study more deeply programming languages such as Processing, VVVV and Pure Data.

In the mean time I have continued in my other project where I will make "an audiobook" of my own. For this project I need to have loudspeakers that are as flat as possible. This has proven to be quite difficult task.

Passive speakers as such are not a good option, because Arduino (+ Mp3 player) will not be able to feed enough power to them. You can get some signal out, but the sound is so silent that it is practically useless. I tested several passive speakers with Arduino/MP3Trigger and the results were poor. Therefore I needed to have some kind of powered amplifier to get reasonable loud sound out of the system.

I could have tried to make a powered amplifier by myself, but it would not be flat enough for my purposes. Then I finally remembered that what I need was actually already  in my storage !! Cheap, ready-made speakers intended for MP3 players.

I had bought some HAMA loudspeakers couple of years ago. At that time, I was not satisfied them, because they were too bulky. Because I was not using them, I though it does not matter if I broke one down to see if there is something useful inside.



And there was everything what I needed: a very small and neat power amplifier and quite flat loudspeakers!! I just needed to remove one led (only indicating that the device was powered).  I also modified the circuit so that the device is always on if the external power is connected. I got what I wanted easily and much cheaper than if a have bought parts and build everything from scratch (HAMA loudspeakers costed about 10 €)

The lessons learned could be that tinkering your old useless gadgets might be more worthwhile that buying new stuff.


p.s. While looking for some help from internet, I found interesting link that showed how to make very flat loudspeaker from fabric. Although they are not very practical to my "audiobook" project, I will definitely try making my fabric speakers in the near future.

Monday, January 10, 2011

The most stupid Arduino mistakes I have made

Lets face it! There are stupid mistakes, and most of them are repeated time after time. At least I do it !

Luckily you will gradually learn to check the most common causes before panicing and causing more severe mistakes than the original one. Here are a list of the most common and "stupid" problems I have faced while working with Arduino.

ARDUINO

Actually I have been lucky and I have never broke any arduino board by causing short circuits  etc. I think the reason is that I am always using RED wire for the power and BLACK wire to the ground. And I never ever use these wires to connect data ports. 

I have also learned to CONNECT FIRST ALL GROUND WIRES before connecting anything else.  Possibility to have some kind of voltage peaks while connecting the circuit to the power source is diminished.



One weird error happened once with my robot - it started to move by itself when I put my hand near it!!

It took some time to figure out the reason. My robots have two arduino board that are connected together. The first arduino was controlling the motors and the second one was handling all the communications and data from sensors. Obviously the data signal that commanded first arduino to steer motors was floating. When I approached the robot, the state of that data signal changed due to my capacitive load I was introducing to the circuit.

The reason was naturally as simple as that these two aduino boards did not had a common ground. The correction was easy. I just connected all the ground signals to one common ground. Since this, I have remembered to check that my circuit will allways have only one common ground. The lesson was learned.

ARDUINO + MP3 PLAYER

1) You connection should  be OK, but the MP3 files are not playing

- Are you sure that you have correct memory card in the MP3 player?
- Are you sure that you have turned the loudspeaker on?
- If you use serial connection : are the RX and TX signals cross-connected?  the RX port of the arduino should be connected to the TX port  of the MP3 player, and vice versa.
- Have you renamed your files in PC having Windows operating system? Windows may add EXTRA suffix at the end of the file without showing it!! You may think that name of your file is for example TRAC0001.MP3 but actually it is TRAC0001.MP3.MP3. In this case the MP3 player will not recognize the file. I have learned to check the filenames by using MS-DOS/Windows promt before moving them to the memory card.

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.