Pages: [1]   Go Down
Author Topic: Using a Square Wave Output  (Read 993 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I am constructing a clock, using the Maxim DS32B35 RTC; this has a Square Wave Output (configured to 4kHz).  I want to use it to drive a piezo buzzer, and to be able to turn the buzzer on / off using an Aruino pin.  Here is how I have it set up currently:

(see the next post)

The problem is that I don't think the Square Wave Output is saturating the transistor?  It is much quieter than when driving the buzzer directly from Arduino pins (through a transistor).

What is the best way to improve the circuit?  I suppose I could change the 5k pull-up resistor to a lower value, but this would needlessly increase the current usage (plus require the RTC to sink more current).

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I don't think the Square Wave Output is saturating the transistor?
If that is the case use a darlington of a FET for T2.
Logged

Rob Gray aka the GRAYnomad www.robgray.com

0
Offline Offline
Edison Member
*
Karma: 0
Posts: 1103
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I don't think the Square Wave Output is saturating the transistor
On the contrary :-) Through the 5k the transistor is always open. It might have difficulties to close, however... But it looks like an OC output.. I'll check in the datasheet. Yes, it is.

You generally do not implement a (N)AND gate at the driver end, but at the control end, i.e at the base of the (driving) transistor.
In your scheme you will loose 2x0.4Volts at the two emitter collector diodes!

In this special case (assumed OC SQW), you can connect the buzzer-out directly to the gate of the first transistor T1. Also change the base transistor to the Arduino pin then to 4.7k (rather  than 1k). T2 is no longer needed.

As you use the transistor for current gain only, you can also consider to put the buzzer between emmitter and ground (voltage follower circuit). Note that the circuit then is no longer in an inverted mode...
« Last Edit: September 21, 2010, 01:02:54 am by mpeuser » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here are the improved circuits I came up with based your help.  I have implemented the one on the right, and it works well; the downside is the extra voltage drop associated with the darlington transistor is presumably limiting the loudness somewhat.  I think the circuit on the left would avoid this, but with the downside that it is wasting at least 5ma regardless of the inputs.

In order for the 2N2222 transistor to pass enough current, my testing has indicated I need at least 2ma of base current (hence the 1k resistor, which provides some leeway).

Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33362
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
extra voltage drop associated with the darlington transistor is presumably limiting the loudness somewhat.
No it is not. The extra volts drop only applies to the base emitter, not the collector base. You will have the same voltage swing across your buzzer with either circuit.
Quote
I think the circuit on the left would avoid this
No.
« Last Edit: September 25, 2010, 02:01:13 am by Grumpy_Mike » Logged

0
Offline Offline
Edison Member
*
Karma: 0
Posts: 1103
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There are a lot of different piezo buzzers  in the world, the most common go from 2V 5mA to 12V 30mA.

The2N2222 is not the most fit transistor for this
- it has an unneeded high output current (800mA)
- it has a very low (but typical) current gain (of around 30)

Any 5 cents transistor would have helped you better....
However there is no need for a darlington or 2-transistor solution.

IF you have a "high" voltage buzzer an increase of the voltage swing might help considerably . You generally use a "bridge" circuit for this. Any 74HCxxx inverting chip can be used for this. Have a look at this example
http://www.discovercircuits.com/DJ-Circuits/beeper.htm

Edit:
You might even get good results connecting it to 2 Arduino pins, changing their polarity as you can do it with 2-color LEDs. For safty reasons put a  47 or 100 ohms resistor in seriesparallel. (which however will reduce the volume)
« Last Edit: September 25, 2010, 07:26:27 am by mpeuser » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33362
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
For safty reasons put a  47 or 100 ohms resistor in parallel.

Parallel?

Don't you mean series?
Logged

0
Offline Offline
Edison Member
*
Karma: 0
Posts: 1103
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes. Of course. Thank you. Luckily it is generally obvious what i mean, or isn't it?
Logged

Pages: [1]   Go Up
Jump to: