Shop OBEX P1 Docs P2 Docs Learn Events
My New Project And A Quest For Sound — Parallax Forums

My New Project And A Quest For Sound

idbruceidbruce Posts: 6,197
edited 2010-12-30 04:11 in Propeller 1
Hello Everyone

I am sharing this post, because I am certain that it will interest more than a few.

As some of you may know, I am building several CNC machines, and I am almost finished with two of them, except for the programming. However, one of the machines that is near completion, has a user interface board, and I would like to add sound capabilties to this board before buttoning everything up for programming. I don't want or expect too much, I just want to play a small WAV file to produce a faint but clear and audible sound over a headphone speaker. As discussed in a couple of previous posts of mine, there are several sound amplifiers and headphone amplifier ICs available that will output nice sound, but the problem with these ICs is the fact that they are tiny itty bitty chips and interfacing them to a proto board would be difficult without having some type of adapter. Additionally, I would have to order the chips, pay shipping, and wait for it to arrive, meanwhile designing a PCB etc... I am an impatient man and I want to button these machines up. So here is what I am attempting.

In my quest for sound, I went searching throughout the house looking for items that I knew would contain a desirable headphone amplifier. After tearing apart two CDROM players, I finally found a decent chip to suit my needs. At first, I was going to attempt to desolder the chip, and the support components, but as I previously mentioned, this stuff is tiny. After mulling it over for a couple days, I took another look at the CDROM player. The player contains two circuit boards, with one of course having the chip I desire. The chip is a LM4808M, which is a dual audio power amplifier capable of delivering 105mW per channel of continuous average power into a 16W load with 0.1% (THD+N) from a 5V power supply. The circuit board where the chip resides has two main connection areas for wires, one has a header, and the other has the wires soldered directly to the board. After desoldering the wires, I will attempt to reverse engineer the circuitry going to the headphone amplifier. As I see it, I should only have to find six connections, which are as follows:
  1. Input A+
  2. Input A-
  3. Input B+
  4. Input B-
  5. VDD
  6. VSS
*Of course Output A and Output B are already wired to a 1/8 inch headphone plug.
*And of course volume control is already wired :)
I am not 100% certain, but it is my hope that after finding these six wires, I should have a nice daughter board capable of producing sound from the proto board.

I have attached the LM4808M datasheet for your viewing pleasure and I will keep you all apprised of my progress.

Bruce

Comments

  • w4fejw4fej Posts: 264
    edited 2010-12-27 06:14
    What's wrong with the Parallax item 31316?? I assume your project is of a comerical nature (not a hobby venture) so $129.00 is chump change in the grand scheme of things.

    If that doesn't do it for you then do a search for "Chipcorder" by ISD. I use one of them in my R/C submarine project and they are really easy to use. If you don't want to invest in their programming board I would be glad to program a chip for you with mine. I have the 240 second (4 minute) version. Radio Shack sells them also for under $20 if I remember right. With the 240 version you can have up to 240 seconds or 255 .WAV files, which ever limit you reach first.

    With ISD's demo board or programming board either one will drive you out of the room with a 3-4 inch 8 ohm speaker..

    Mike B.
  • idbruceidbruce Posts: 6,197
    edited 2010-12-27 06:26
    w4fej

    I have dumped thousands of dollars into these machines and the well has run dry. However that is not the point. The 31316 is way beyond what I need and I would even consider it extravagant for my needs. And besides that, what I am attempting is a learning process and I may possibly save $130. But if you care to donate the chump change, sure I'll buy it and forego the education I may receive.

    The speaker is 1" in diameter, but thanks for your response.

    Bruce
  • w4fejw4fej Posts: 264
    edited 2010-12-27 06:30
    Well excuse me for trying to help.

    Mike B.
  • JonnyMacJonnyMac Posts: 9,208
    edited 2010-12-27 07:50
    If that doesn't work out look into the TDA7052 (1.2w) single-channel amp. A friend of mine works for a major amusement park (that happiest place on earth) and used this amp with a little Propeller circuit (based on the 31316 that I designed) that plays a WAV file from a uSD card. The prop the he had to put the audio into is hand-held, hence used a very small speaker.

    You can even get that chip in a kit for experimenting: http://www.kitsrus.com/pdf/k27.pdf
  • wjsteelewjsteele Posts: 697
    edited 2010-12-27 07:53
    Some of the guys with CNC machines like my MakerBot have actually just used the servos to create musical notes. Check out the "Martha Vader" bot for a great example.

    http://blog.makerbot.com/2009/05/18/martha-vader-a-makerbot-sings-the-imperial-march-and-makes-a-darth-vader-head/ (You can skip ahead to about 1:00 in the video for the sound.)

    Bill

    (EDIT: Does anyone else see the "notes." duplicated in my text above? When I edit it, it's not in the text, but when I save it, it's there!)
  • idbruceidbruce Posts: 6,197
    edited 2010-12-27 08:33
    Jon

    Yea someone else mentioned the TDA7052 in another post. It would definitely do the trick. However, I want to button up the machines today or tomorrow and start programming. If I can't reverse engineer this board by tomorrow, I will probably just add a four pin header to the proto board, attach a four wire harness for the future addition of an external sound amplifier, and close up the main electronics box. However, I do believe I can whip this board to fit my needs and enclose it inside the electronics box. I hope that I succeed, because I am certain there are a few other people out there that can benefit from my experimentation.

    Bruce
  • idbruceidbruce Posts: 6,197
    edited 2010-12-27 12:49
    Okay the results are in.

    I found the inputs and got sound coming out of a set of headphones, however, the sound is very low with the volume turned all the way up. I tested the setup with Lord Steve's sine_to_headphones.spin code, which I have attached below. I know the headphones can put out a lot more sound then what is coming out. I am just wondering if there is any way to increase the volume in the code. If not, then perhaps I am missing a critical connection somewhere.

    I will keep you posted

    Bruce
  • idbruceidbruce Posts: 6,197
    edited 2010-12-27 14:52
    Hello Everyone

    Well I changed the code and the speaker now produces high quality sound in an audible range that can be heard with the headphones off my head.

    In other words, it was a major success for what I was attempting. I am currently only producing sound out of one speaker, because I am using only 1 pin. If I added another pin, I could add the other speaker to make it even louder.

    Bruce
  • idbruceidbruce Posts: 6,197
    edited 2010-12-28 08:23
    Hello Everyone

    From 35 feet away, I can clearly hear an EEPROM wav file. Good enough for my needs.
  • Invent-O-DocInvent-O-Doc Posts: 768
    edited 2010-12-28 13:25
    Glad to hear to got it working well!

    I always think it is cheaper in the long run to keep a volume of components around the shop such as op-amp chips and I have LM386s and TDA7052s (per Jon's earlier advice to me) as well as voltage regulators, passives etc. In the past, every time I tried to do a project, it would end up being expensive because of 1-2 parts needed that either had to be purchased locally at high expense or shipped with a high shipping charge/item purchase ratio. After building up a nice library of general components, I have spent hundreds just for that, it may not be cheaper but it sure gives peace of mind and less aggravation.
  • idbruceidbruce Posts: 6,197
    edited 2010-12-28 14:59
    Invent-O-Doc

    I definitely agree with you, I also try to buy spare parts when I can afford it and when I am thinking of it. I also have a nice library of parts. Mostly specialized ICs, transistors, leds, resistors, and wire. In my next order with Parallax, I am definitely going to buy several extra chips of EEPROM. But you know how it goes, there is only so much money to go around and there is always the OOOOOPPSS factor. "I should have ordered that!" DUH

    Bruce
  • Lord SteveLord Steve Posts: 206
    edited 2010-12-29 21:38
    Hey, Bruce. Was there some problem with my sine to headphones code? Just curious.
  • idbruceidbruce Posts: 6,197
    edited 2010-12-30 04:11
    Lord Steve

    I did not take the time to evaluate the code very closely, I just knew that the speaker could put out a lot more volume, so I just tried other code. I don't imagine that there was anything wrong with the code, because I definitely got sound from the code. I would probably suspect the frequencies and duration. I am sure the code is fine, it was just low volume.

    Bruce
Sign In or Register to comment.