so here's a link to my schematic so far, I understand that I will need improvement.
So the project I'm working on uses the arduino's DC power to make sound, kinda nuts I know but it works. A modulating digital wave can create sound just as an ac wave, no doubt ac is probably better but this is due soon and I don't have time to do it that way.
So the way it works is that it outputs on's and off's across the lines at different times to emulate volume based on the pin (10 pins, 10 degrees of volume resolution). Since each pin is hooked up in series the lower you go in pins the softer it gets as there is more resistance to travel across. I have diodes to permit the power from shorting back into the arduino, and a potentiometer to adjust overall volume.
My main problems so far are:
How can I tone the volume down to 1 power source. I know I can do it with a transistor and I have tip 122's and npn 2n 2222's. I think that the 2n's amplify but I'm not sure, I guess I need a transistor that vary's output based on the base power. however if 4 of my pins happen to play at once its going to be a more drastic sound, and what I need is something more level. Like I guess I need to multiply the final output by say .5 if 2 pins are on, .33 if 3 are playing and so on. What kind of devices can I do this with? I think I am going to need an amp at some point but I'm worried about that because this system is off the audio grid in some ways.
My resistance values have been based off of my headphones, but I would like to optimize this for speakers or other headphones, should I drop the output down a lot like regular audio does or should I keep it high as it would be after amplification?
hmmm yeah I have a 5k logerithmic bt I need to figure out some way to really tone down the sound for like headphones, thats the main purpose of my project but it would be nice if they could safely plug into speakers as well.
The Led's are there to just act as diodes, even tho I state my pins as output I think there's a possibility that the current could go backwards into the chip, or so I have been told.
OK -- ordinary diodes would be better because they only have a 0.7V drop as opposed to a LED with a 2V drop. But to make a betetr digital-to-analog converter, you might like to have a look at the R-2R network:
You'll need more resistors, but you'll only need two values. Or just one value, if you wire two in series to make 2R. I think you'll get better results with a DAC like this (no diodes required, either). Of course, you can buy ready-made DAC chips such as the old ZN426:
More modern chips use the I2C interface (supported by the Arduino with the "Wire" library), e.g. the TI DAC5571:
You don't really need the diodes at all, seconding the suggestion of an r2r ladder. There is a good reference for both of types of resistive D/A - and also some discussion of digital sine wave generation in CMOS Cookbook (Lancaster).
yes, but I think the highest resolution on pwm is like 1024 which restricts some frequencies, and this allows for more pins to be used in action. For coding I thought it would be best to get some for loops goin with destinations and start points to allow for sounds to get a shape. Since the decamilia chip can run at such high speeds, resolution above 1024 can happen but it takes more code, which is cumbersome but more rewarding.
Your transistor is not connected in a way that will lead to the correct amplification of an analog signal. I always found analog amplification to be pretty mysterious; the easiest solution is to replace the chip with an audio amplifier chip like an LM386...