Pages: [1]   Go Down
Author Topic: Breadboarding question  (Read 2242 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 1
Posts: 18
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?  
« Last Edit: January 10, 2011, 10:15:39 pm by Danrosey » Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27427
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 362
Posts: 17307
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.  smiley-wink

Lefty
Logged

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

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.
« Last Edit: January 10, 2011, 11:26:50 pm by Danrosey » Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27427
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

« Last Edit: January 11, 2011, 03:10:14 am by CrossRoads » Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

SE USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yea 2 and 3 are all connected to the same point bypassing the resistor
Logged


Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 362
Posts: 17307
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.  smiley-wink

Lefty
Logged

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

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!
« Last Edit: January 11, 2011, 12:13:32 am by Danrosey » Logged

London, GB
Offline Offline
Sr. Member
****
Karma: 8
Posts: 332
Nothing works.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27427
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
// 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:
   // 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.

« Last Edit: January 11, 2011, 03:14:55 am by CrossRoads » Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

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

That is a very cool project
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27427
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27427
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: January 11, 2011, 10:49:49 pm by CrossRoads » Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: