Maker Pro
Maker Pro

preamp led driver help

dbutler6250

Jun 19, 2014
16
Joined
Jun 19, 2014
Messages
16
Hi all,
I was wondering if the attatched schematic would be alright to use.
I am going to have the headphone tsr jack in my phone, i will play a wav file that i created from my comouter.
The wav file will dontain different frequency square waves.
What i want to do is drive that led with this circuit, will it work?
Thanks
 

Attachments

  • Preamp circuit_01(1).jpg
    Preamp circuit_01(1).jpg
    160.7 KB · Views: 180

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,738
Joined
Nov 17, 2011
Messages
13,738
It should work, but the LED will be modulated by the ring tone. It will emit light that is on and off at the frequency of the ring tone. If that is o.k, with you, give it a try.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Hi there and welcome to Electronics Point :)

So you want to drive an LED from the headphone output of your phone. You want to play square wave signals through the headphone output, and you want the LED to reproduce the signal. So when the square wave is positive, the LED lights up, and when it's negative, the LED goes out. Is that right?

That circuit might work but it is not the best option. It's more complicated than you need, and its thresholds are poorly defined because it's actually just an amplifier with capacitor-coupled input. The potentiometer that you've added would not affect the threshold of the circuit; it would just have to be set near the bottom of its range, otherwise the LED would be illuminated constantly.

Here's my suggestion. This circuit uses two NPN transistors and operates from a supply voltage from 4.5V to 12V. I haven't tested it, and it may not be ideal. Some experimentation may be needed, and some component values may need to be tweaked.

269070.001.GIF

Input comes in on the tip of the stereo socket. This should be connected to the phone's headphone socket using a stereo cable with a stereo 3.5 mm jack plug at each end, wired pin-to-pin.

R1 provides a DC load on the phone's headphone output; this may be needed so the phone can detect that something has been plugged into the socket.

C1 passes the signal to Q1 which is an emitter follower. Its purpose is to boost the current available from the signal so it can drive Q2 cleanly.

Q1's base bias voltage is set by D1 and D2, which provide a constant voltage of around 1.3V which is relatively stable over a range of supply voltages. R3 and R4 drop this voltage to around 1.0V at Q1's base.

Q1 drops about 0.7V between its base and emitter, so the idle voltage on R5 will be about 0.3V. This is not enough to turn Q2 ON, so the LED will remain OFF while there is no signal.

When signal is present, it is buffered by Q1. Positive excursions on the signal will cause the R5 voltage to increase and current will flow through R6, turning Q2 ON and illuminating the LED.

C2 is important; it decouples the supply rail and provides current during changes in current drain.

The LED current is determined by the value of RLED in conjunction with the power supply voltage and the LED forward voltage. A small voltage is also dropped across Q2.

Here's an example calculation assuming the following:

Supply voltage (VS) = 4.5V
LED forward voltage (VLED) = 2.0V at desired operating current
LED desired operating current (ILED) = 30 mA

First calculate the voltage across RLED as (VS - VLED - 0.2V) (the 0.2V is the approximate collector-emitter voltage of Q2)
= 4.5 - 2.0 - 0.2
= 2.3V

Now use a rearrangement of Ohm's Law to calculate the value for RLED:
R = V / I
= 2.3 / 0.03 (remember, "I" in formulas is current in amps; 30 mA is 0.03 amps)
= 76.7 ohms.

You can get 75 ohm resistors, but a more common value is 82 ohms. This would theoretically give you slightly less current than you wanted, but the error will be swamped by variations in all of the other parameters - the battery voltage, the LED forward voltage, the Q2 collector-emitter voltage, and the tolerance of the resistor. So there's no need to be too fussy.

You can drive several LEDs in series (don't connect them in parallel) if you increase the power supply voltage. Use the formula above, but add the LED forward voltages together.

You should create your audio files at near maximum amplitude. -0.1 dB is a good choice. You should also turn up the headphone volume until the LED brightness stops increasing, then several steps more, to ensure it is turning ON cleanly and fully.

If the LED brightness has not reached a stable maximum by the time the headphone volume setting has reached about 75% of maximum, circuit changes may be needed. Let me know in that case.
 

dbutler6250

Jun 19, 2014
16
Joined
Jun 19, 2014
Messages
16
Thanks to both of you for the quick replies!
And that was a great reply kris, but if my circuit will be fine but not the best that is fine by me lol.
Also to harald, thats exactly what i want it to do is light up to that frequency, or whatever the terms are.
Thats perfect, i just wanted some opinions on the circuit, and see if it would work.
Thanks!
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Nice one Kris. Well it does work.

New Picture.png Fig1. Showing Circuit Diagram and D.C operating points.
tinadiag.jpg
Fig2. Showing Transient Plot 10Hz 1V Square Wave
You could adjust R2 and R3 if you wanted to straighten up VF1 and VF2.

Thanks Adam
 

dbutler6250

Jun 19, 2014
16
Joined
Jun 19, 2014
Messages
16
To harald,
I am making square waves from audacity and playing them on my phone.
That will blink the led, at a frequency which i will have an arduino read the frequency.
Then i will have the arduino say
If "this frequency" --》then do this.
The do this will be sending an ir signal to a tv from the arduino.
Basically like this,see attatchment.
I cant use the phone to control tv directly because the tvs use 38khz carrier frequency and most phones can go up to 16 maybe 20khz.
I will use an attiny to recieve frequencies from phone w/ preamp and if it recieves say 10khz from phone with led using a phototransistor, then it will output a certain tv ir code.
 

Attachments

  • Ir setup_01(2).jpg
    Ir setup_01(2).jpg
    132.8 KB · Views: 123

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Nice work Adam :) I wasn't expecting anyone to simulate it!

Actually my main concern was the input signal voltage. You've used 1V RMS, have you? I'm not sure that an iPod can produce that much signal.

I expected the first transistor's base voltage to be closer to 1V than that. What voltage do you get at the top of the diodes?

Actually the emitter follower can be removed. I put it there to avoid DC shift due to the rectifying action of the base-emitter junction, but that can be avoided by adding a reverse diode, and everything should work fine as long as there's enough signal.

269070.002.GIF

To the OP. All my comments from post #3 from the RLED calculation onwards apply to this circuit too.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
I will use an attiny to recieve frequencies from phone w/ preamp and if it recieves say 10khz from phone with led using a phototransistor, then it will output a certain tv ir code.
What distance are you hoping to achieve between the phone LED and the ATtiny? Without a tuned circuit, the receiver will be very susceptible to other light sources. That's why IR remote controls use a carrier frequency.
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
I was going to mention about the emitter follower. I-pod can put out over 2Volts I believe. 1V pk signal was used, no need for RMS conversion for this. Diode voltage is 865mV.
Adam
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Changed the diode to 1N4148 and top of diode 1.23V and base of T1 865mV.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
OK, cool. With the emitter follower and biasing removed, the simplified circuit will need about 2V peak-to-peak to saturate the transistor properly, I estimate. If the iPod can put out over 2V (whether you meant 2V peak-to-peak, 2V peak, or 2V RMS), that will be enough. Thanks for your input :)
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
So I suppose that would be 2V peak ish if 1V rms was measured on I-pod. Maybe they are all the same after all and what I read was peak output.?
 

dbutler6250

Jun 19, 2014
16
Joined
Jun 19, 2014
Messages
16
To kris,
I will have the attiny pocetsized and connected to the preamp circuit. I am going to have the led output of the preamp heatshrinked to the phototransistor of the attiny.
So the attiny is with the phone. I will have an led driver circuit to drive the ir led from the attiny to transmit to the tv,that way i get a good range. I want at least 10 feet range.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
So I suppose that would be 2V peak ish if 1V rms was measured on I-pod. Maybe they are all the same after all and what I read was peak output.?
Hmm. I don't know. It would be interesting to know for sure though. It's not hard to create a ~0dBm waveform and transfer it to an iPod, and test it (probably into a 33 ohm resistor - these headphones and ear buds are usually 32 ohms I think). I don't have an iPod myself. I have a Samsung smartphone and I'll do some tests on that in the next few days.
I will have the attiny pocetsized and connected to the preamp circuit. I am going to have the led output of the preamp heatshrinked to the phototransistor of the attiny.So the attiny is with the phone. I will have an led driver circuit to drive the ir led from the attiny to transmit to the tv,that way i get a good range. I want at least 10 feet range.
OK. Why do you want an LED involved? You could connect straight from the iPod headphone socket to the ATtiny. You could use an ADC input (if it has one) or a timer input. I don't see the need for the LED.
 

dbutler6250

Jun 19, 2014
16
Joined
Jun 19, 2014
Messages
16
OK. Why do you want an LED involved? You could connect straight from the iPod headphone socket to the ATtiny. You could use an ADC input (if it has one) or a timer input. I don't see the need for the LED.[/QUOTE said:
I didnt see that. I dont think it has adc or a timer input tho.
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Kris let me know what you find. I have an S3 and would be interested in what the output is. I would do it but I dont have a scope at home.
Adam
 

dbutler6250

Jun 19, 2014
16
Joined
Jun 19, 2014
Messages
16
Kris,
Yousaid that the pot in my circuit would have to be set to its lowest range, well then can i just take out the pot?
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
No, it needs to be set near the bottom of its range. Pin 3 should sit at about 0.5V for best sensitivity. You could replace the pot with two fixed resistors, e.g. 100k and 10k, if your supply voltage is stable at 5V.

My circuit in post #7 is all you need, provided that the iPod can generate at least 2V peak-to-peak (which is 1V peak, or 0.707V RMS) at the left headphone output connection.
 
Top