Go Down

Topic: Breadboarding question (Read 2502 times) previous topic - next topic

Danrosey

Jan 11, 2011, 04:14 am Last Edit: Jan 11, 2011, 04:15 am by Danrosey Reason: 1
I've got a really beginner question that is giving me some trouble.  I'm following along with the Learning Tone (http://arduino.cc/en/Tutorial/Tone) example.  I've been able to successfully produce the tone example, but I am a bit confused with the breadboard layout.

The following three pictures help show what I am referring to:


The black wire you see going to the breadboard is the positive, while the black cable going to the GND is GND.  The left-most photo is the first setup I begin with--unsuccessful.  The middle photo was my second attempt--successful--positive, resistor, jumper stacked in same column.  And the right-most photo is my "just testing to see what happens" attempt--also successful--with the positive and jumper cable in same column, while the resistor is in the same position as the left-most image.

My question is: why didn't the first layout work?  From some of the basic examples with LEDs and pushbuttons, the resistor and jumper cable were oriented in this manner.  From what I can gather, the middle is obviously the correct layout, while the right-most is bypassing the resistor all together. Is that correct?  

CrossRoads

It appears to me that the middle also bypasses the resistor - you have both sides of the resistor connected together (confirm this with a multimeter).
What value resistor are you using?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

retrolefty

Draw your circuit on paper first. And share that with us if it doesn't work. Trying to figure out your photos where wires leave and come into the photo makes a difficult task even harder.  ;)

Lefty

Danrosey

#3
Jan 11, 2011, 05:22 am Last Edit: Jan 11, 2011, 05:26 am by Danrosey Reason: 1
Quote
It appears to me that the middle also bypasses the resistor - you have both sides of the resistor connected together (confirm this with a multimeter).
What value resistor are you using?


I grabbed 100K ohm but I realize now I should be using 100 ohm. Is the first actually now correct but I simply used too large of a resistor?

Quote
Draw your circuit on paper first. And share that with us if it doesn't work. Trying to figure out your photos where wires leave and come into the photo makes a difficult task even harder.  


Is this more helpful?


Edit:  I think I answered my own question.  Popped in a 220ohm resistor and the sound was a bit muted but it worked properly with the "1st" layout.

CrossRoads

#4
Jan 11, 2011, 05:49 am Last Edit: Jan 11, 2011, 09:10 am by CrossRoads Reason: 1
Excellent work.
Are you trying to drive a speaker? It will be awfully quiet, you get at most 5V x 40mA = 200mW of power out. If you can connect to a powered speaker, like an amplified computer moniter speaker, the sound will be much more impressive.
Or you can build up your own amplifier, I have this circuit for my Arduino to drive with a Tone melody.

Is just a classic MOSFET AC amplifier, as found here: http://fourier.eng.hmc.edu/e84/lectures/ch4/node13.html

Only in this case, we are not worrying about trying to stay in any linear region, we are just letting the output swing peak to peak from the +12V supply ground.  I only have it warble from between C6 & A5 a few times, sounds nice thru a high power 2.5" speaker. Plenty loud :-)

Ignore the 2nd RL resistor, I was playing with switching 2 resistors to make a hi/lo volume control. 68 ohm/34 ohm does not make much difference.

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Osgeld

yea 2 and 3 are all connected to the same point bypassing the resistor
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

retrolefty

Quote
Edit:  I think I answered my own question.  Popped in a 220ohm resistor and the sound was a bit muted but it worked properly with the "1st" layout.


What you really need to do is to buy a digital multimeter. It's a mandatory thing if you are going to be building stuff with an arduino. Using it's ohm meter function you can tell if points are conducting as you think or not, also you can test components and measure current and voltage. Many available on-line cheap these days. Don't wait, find and order one now. OK, tomorrow at the latest.  ;)

Lefty

Danrosey

#7
Jan 11, 2011, 06:11 am Last Edit: Jan 11, 2011, 06:13 am by Danrosey Reason: 1
Thanks for the help y'all.

Quote
Are you trying to drive a speaker? It will be awful quiet, you get at most 5V x 40mA = 200mA of power out. If you can connect to a powered speaker, like an amplified computer moniter speaker, the sound will be much more impressive.

Yep, just driving a small 8ohm speaker.  The sounds isn't too bad actually--I've had a great time playing with the Tone Libraries and tone.h. CrossRoads, your amplifier sounds like a project I can get behind.  What sort of tone melodies do you use it for?
Quote
What you really need to do is to buy a digital multimeter. It's a mandatory thing if you are going to be building stuff with an arduino. Using it's ohm meter function you can tell if points are conducting as you think or not, also you can test components and measure current and voltage. Many available on-line cheap these days. Don't wait, find and order one now. OK, tomorrow at the latest.  

You're darn right, I need to pick one up.  SparkFun has their "Free Day" on the 13th so maybe I'll try my luck then!

u0421793

Initially, you refer to two black wires, but I can only see one.

CrossRoads

#9
Jan 11, 2011, 09:07 am Last Edit: Jan 11, 2011, 09:14 am by CrossRoads Reason: 1
I just have it making a nice warble sound when a touch is made in my fencing scoring machine.
We fence in a 40'x40' room with lots of swords clashing, the amp is very hearable above that without being the obnoxious squeal that other fencing machines put out.
Found the speaker at www.mpja.com, $1.49 each.

Gento P/N ZSP99023A,
Mini, 2" , Foam edge, paper cone speaker with 1oz. ferrite magnet.
Imp: 4 ohm
Sen: 90db
Freq: 400-8KHz.


pre-setup code:
Code: [Select]
// notes in the melody to play when a touch is scored:
int thisNote = 0;
int noteDuration = 0;
int pauseBetweenNotes = 0;
int melody[] = {
NOTE_C6, NOTE_A5, NOTE_C6, NOTE_A5, NOTE_C6, NOTE_A5, NOTE_C6};
// note durations: 4 = quarter note, 8 = eighth note, etc.:
int noteDurations[] = {
12,12,12,12,12,12,4};


playing a sound when called in void loop:
Code: [Select]

   // create a warble once
   for (thisNote = 0; thisNote < 8; thisNote++)
   {
     // to calculate the note duration, take one second
     // divided by the note type.
     //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
     noteDuration = 1000/noteDurations[thisNote];
     noTone(17);       //apparent known bug - need this for the tone to play next.
     tone(17, melody[thisNote],noteDuration);
     // to distinguish the notes, set a minimum time between them.
     // using the note's duration + 10%:
     pauseBetweenNotes = noteDuration * 1.10;
     delay(pauseBetweenNotes);
     // stop the tone playing:
     noTone(17);
   }
   digitalWrite (speakerOut, LOW); // turn off the amp -> capacitor coupled & gate pulled low, should not need this now.


Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Danrosey

That is a very cool project

CrossRoads

Yes - only more like small scale production at this point :-)
Got to remember the camera and take some pictures of the installations tonight to show you guys.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

#12
Jan 12, 2011, 04:49 am Last Edit: Jan 12, 2011, 04:49 am by CrossRoads Reason: 1
Okay, here's links to pics showing the fencing scoring machines as currently installed.

http://www.crossroadsfencing.com/club_space12.jpg
http://www.crossroadsfencing.com/club_space13.jpg
http://www.crossroadsfencing.com/club_space14.jpg
http://www.crossroadsfencing.com/club_space15.jpg
http://www.crossroadsfencing.com/club_space16.jpg
http://www.crossroadsfencing.com/club_space17.jpg
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up