Loading...
  Show Posts
Pages: 1 ... 72 73 [74] 75
1096  Forum 2005-2010 (read only) / Interfacing / Re: Do I need a resistor with a piezo? on: February 11, 2010, 11:08:20 pm
That thread is about a magnetic buzzer, so the stuff about a resistor may not apply in my case.
1097  Forum 2005-2010 (read only) / Interfacing / Re: Do I need a resistor with a piezo? on: February 11, 2010, 08:38:05 pm
Hm...

This page says you shouldn't put over 100ohms on a piezo because it affects the high frequency response of it:

http://members.misty.com/don/pzfix.html


Sheesh.  You'd think it wouldn't be so hard to get trustworthy info about something so basic as hooking up a piezo speaker. :/
1098  Forum 2005-2010 (read only) / Interfacing / Re: Do I need a resistor with a piezo? on: February 11, 2010, 08:28:59 pm
I don't want to adjust volume, I just don't want to blow up the arduino.  

A 5K pot would let me adjust the resistance, but it won't really tell me what a safe resistance is, if in fact, a resistor is required.
1099  Forum 2005-2010 (read only) / Interfacing / Re: Do I need a resistor with a piezo? on: February 11, 2010, 07:56:21 pm
I thought you just said you didn't need a resistor with a pot though?

I posted the datasheets above.  They don't make any mention of a resistor.
1100  Forum 2005-2010 (read only) / Interfacing / Re: Do I need a resistor with a piezo? on: February 11, 2010, 07:41:49 pm
Okay, I'm gonna try to calculate the resistor I need myself since I really need to learn how to do this.  If someone could tell me if I've got this right, it would be a big help.

So, my little piezo there can only handle 1ma.  1ma is 1/1000th of an amp.  So, I (being in amps, not milliamps) = 0.001

V = 5v because that's what's coming out of the pin.

So, if ohms law says R = V / I then:

5 / .001 = 5000

So R being in ohms, I need a 5000 ohm resistor to protect my piezo which can handle only 1ma, from my 5v source which can safely put out up to 40ma.

Is that right?

[edit]

Also, based on that, I calculate that larger piezo which can handle up to 9ma requires a 556 ohm resistor.
1101  Forum 2005-2010 (read only) / Interfacing / Re: Do I need a resistor with a piezo? on: February 11, 2010, 07:25:34 pm
How large of a resistor should I have for each of those?  I'm thinking I need a larger one for the one which can only handle 1ma?

Also, I have the pro mini 5v from sparkfun, does that have the resistor on pin 13?  I don't see any mention of one on the hardware page.
1102  Forum 2005-2010 (read only) / Interfacing / Do I need a resistor with a piezo? on: February 11, 2010, 05:16:12 pm
Hi.

I don't know a whole lot about wiring up electronics.  I've built a few circuits, but I don't have a firm grasp of what exactly is going on yet.

Anyway, i'm thinking about getting a piezo speaker to use with my arduino. One of these two probably:

http://www.projectsunlimited.com/audioproducts/movieclips/products/drawings/AT-1438-TWT-R.pdf
http://www.projectsunlimited.com/audioproducts/movieclips/products/drawings/AT-1750-TFL-LW95-R.pdf

Both look like they can run off 5v, so hooking them up to one of the analog pins should be okay, but I noticed the smaller one can only handle 1ma of current, and I know the Arduino pins can put out much more than that.

So my question is, just because the Arduino pro mini CAN put out 40ma on a pin, WILL it, in the case of these piezos?  Do I need to stick a resistor in series with them to prevent them from being burned out, or what?  If not, would I need to do that if they could handle more than 40ma?


I was also wondering how well a magnetic transducer would work with the Arduino.  Would that need to be amplified like a speaker, or is it interchangable iwth a piezo?
1103  Forum 2005-2010 (read only) / Interfacing / Re: 10 segment array - Best way to physically connect? on: February 09, 2010, 02:22:47 am
Since you mentioned those IC sockets for the ribbon cable, do you know where to get them?  All my google searches have turned up nothing.
1104  Forum 2005-2010 (read only) / Interfacing / Re: 10 segment array - Best way to physically connect? on: February 08, 2010, 11:22:37 pm
I'm having no luck finding those connectors.  I've searched for dip and dil in combination with idc, on mouser, newark, allied, and google, but all I can find is plugs, not sockets.
1105  Forum 2005-2010 (read only) / Interfacing / Re: 10 segment array - Best way to physically connect? on: February 08, 2010, 11:02:55 pm
I tried stripping an old IDE cable with the scoring method, but that didn't work out too well.

As for the IDC to DIP connector, that would be perfect!  

...if I can find one.  Looking on Mouser.com right now, but I don't see one.  Gonna check Newark next.

There is still one problem though, even if I find such a socket.  

The crimping tools they sell to make IDC cables are insanely expensive!  The ones I've found on Mouser are like $600.  And I don't know if you can crimp those connectors on reliably without such a tool.  Can you?
1106  Forum 2005-2010 (read only) / Interfacing / 10 segment array - Best way to physically connect? on: February 08, 2010, 01:15:27 pm
I'm going to need to connect a 10 segment display to my Arduino, but the 10 segment display isn't going to be placed in the same location as the Arduino.  Also, it's gonna be in a rather tight spot and there probably isn't gonna be enough room to stick it on it's own circuit board.  So, I've been trying to figure out a good way to wire the thing.  

I know .100 headers fit into IC sockets, so I toyed with the idea of trying to plug the dispay into a ribbon cable, but since the connectors on those are designed for headers and not IC pins, that probably wouldn't work too well.  Besides, the original plan was to use a 20 pin ribbon cable socket with two rows, which I just realized won't be the correct distance apart.  

And stripping ribbon cable probably won't work too well either, not with the tools I have.  So ribbon cable is probably out of the question.

So I guess that leaves using plain wire.  I guess I can bundle it together with electrical tape.  I would have liked having everything including the arduino plug into connectors on a common circuit board though.  I dunno how I'd do that with individual wires.  

That leaves just one question.  On this ten segment display, I wanted to try to get away with just using one resistor and one wire to go to ground or vcc by multiplexing the display.  But while this display:

http://mouser.com/Search/ProductDetail.aspx?R=DC10YWAvirtualkey60400000virtualkey604-DC10YWA

Says that it has a common anode, there's no mention of it in the spec sheet, and I only see 20 pins there, so unless there's something about 10 segment led arrays I don't know, I'd guess the Mouser description is wrong and if I do want to give all those led's a common anode, I'm gonna have to solder all the leads together.

I was wondering though, is there a GOOD way to solder all those leads together?  I'm afraid I'm gonna make a mess trying to get solder to bridge all those gaps.  I guess I could try to strip a long length of wire and lay it across them all but that doesn't seem a good solution either.

Anyway, sorry if I'm rambling. :-)  I'm just trying to find the easiest/cleanest way to hook this thing up.

Hm.. maybe I should get one of those 90 degree "display" sockets for IC's and mount a little circuit board vertically.  I hate to spend all that money on an IC socket and a circuit board just to mount one little 10 segment led array though.
1107  Forum 2005-2010 (read only) / Exhibition / Re: Couple of my props on: August 28, 2010, 11:50:45 pm
If you go to the youtube channel, some of he videos show earlier completed versions.  They were made from wood, and had a simpler 555 circuit, the new ones are made from plastic, but the shape is the same.

The shells I made by first making a wood shell out of wood you can find at hobby shops called basswood.  Then I made a mold box and placed the wood shell in the bottom halfway embedded in clay, then I sprayed mold release on it so the silicone wouldn't stick, then I poured the silicone over it, let it dry for 12 hours, then flipped the mold box over and removed the clay, sprayed more release, and poured the silicone again.  Then once I had a completed silicone mold, I just need to mix and pour resin into it and 15 minutes later it's hardened enough to remove.  

All the stuff you can get from smooth-on.com.

Here's some photos of the PKEs and mold making process though, I forgot I posted these:
http://www.therpf.com/f9/my-ghostbusters-pke-meters-90889/
1108  Forum 2005-2010 (read only) / Exhibition / Re: Couple of my props on: August 25, 2010, 09:38:20 am
Yep, I sell these mounted in plastic shells I mold.

The illuminated pushbuttons I got from Mouser.com, but you can find them on lots of sites.  Digikey.com, and Newark.com/Farnell.com also carry them.  I think radio shack even sells one.

Here's the ones I'm using:
http://www.mouser.com/Catalog/catalogusd/642/1667.Pdf

You have to buy the switch, led, and lens for these ones seperately, but they're all together on the same page in the catalog.
1109  Forum 2005-2010 (read only) / Exhibition / Couple of my props on: August 23, 2010, 09:13:46 pm
These are HD, so you might wanna go view em on youtube.


[media]http://www.youtube.com/watch?v=0XrAIwZvBkE[/media]


[media]http://www.youtube.com/watch?v=Klh7bslfpBI[/media]


1110  Forum 2005-2010 (read only) / Exhibition / Re: Replica prop with multiplexed LED array on: July 10, 2010, 07:45:44 am
Oh, and if you'd like to take a look at the method I used to update the array, here's the code for that.  Feel free to use it however you wish:

Code:
// LED array variables:

  const int rows = 8;                                   // Number of rows in array.
  const int columns = 8;                                // Number of columns in array. (My array is arranged such that one whole column is illuminated at a time, rather than one whole row, as you might have in a standard array.)

  byte matrix[rows][columns];                           // Data for array.  Brightness of each led in array 0..255.   = {{1, 3, 7, 15, 31, 63, 127, 255},{0}};
  
  const int rowPin0 = 0;                                // First row pin.  
  const int colPin0 = 10;                               // First column pin. (Not used at this time.)
    
  const int hz = 70;                                    // Number of times per second display is updated.  Changing this value will not affect the rate at which the display is updated, it is simply a reflection of a 2048 microsecond per-column duty cycle.  61hz was default.
                                                      
  const int columnduty = 1792;                          // 1000000.0 / hz / columns - The duty cycle for each column.  The number of microseconds for which leds in it will be lit before we move onto the next column.  2048 = 61hz. 1792 = 70hz.  1536 = 81hz.  
  const float dutyscale = columnduty / 256.0;           // Compute factor by which brightness should be scaled by to bring the duty cycles for the leds in line with the duty cycle of each column.
  
  unsigned int dutycycle[256] = {0};                    // Duty cycle lookup table.  Index is LED brightness 0..255.  Data is duty cycle for LED in microseconds.

  float fade = 1.0;                                     // This is an overall scalar for the display brightness.  Setting it to 0 will render a completely dark display, setting it to 0.5 will set the display to 50% brightness.
  

// Sensor variables:
  
  const byte potPin = 5;                                 // Analog pin the potentiometer is on.
  float pot[1] = {0};                                    // Current value of potentiometer 0..1.


// VU meter bars:

  float barValue[4] = {0};                               // Current value of bars on display.
  const byte barMax = 16;                                // Maximum height for a bar.
  const byte barMinAverage = 2;                          // Minimum average bar position which can be set with potentiometer.  Setting this to greater than 0 allows the bars to move up and down a bit when speed at it's lowest value.
  const byte barMaxAverage = 16;                         // Maximum average bar position which can be set with potentiometer.  Setting this to less than 16 allows for more movement of bars when speed is maxxed out. (12 was originally default.)
  const float barVariance = 0.75;                        // Percentage which bar's value can deviate from average position defined by potentiometer setting.
                                                         // Ie, if barMaxAverage is 12, and barVariance is 0.5, then when speed is maxxed out bars can range in value from 6..18.

// State data:
 
  int state = 0;
  unsigned long lastStateChange;                         // Time of last state change, in milliseconds.    

  int mode = 0;
  const int MODE1 = LOW;
  const int MODE2 = HIGH;
  
  int soundState = 0;                                     // Used by sound update function and wing update function.
  int beep = 0;  
  
// Timing:

   unsigned long time;
   unsigned long oldTime;
   unsigned long timeDelta;
   float timeDeltaSec;    


/* ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

  void setup() {                
    
    for (int x = rowPin0; x < (rowPin0+8); x++) { // Set row pins to output mode.
      pinMode(x, OUTPUT);
    }
    
    for (int y = colPin0; y < (colPin0+8); y++) { // Set col pins to output mode.
      pinMode(y, OUTPUT);
    }
    
    pinMode(9, OUTPUT);
    
    //digitalHIGH(colPin0);
    
    for (int x = 0; x < 256; x++) { // Create lookup table to convert brightnesses to duty cycles. (Duty cycles are LOW period!)
      dutycycle[x] = columnduty - x*dutyscale; // Linear brightness. (127 does not look half as bright as 255.)
      //dutycycle[x] = columnduty - pow(x/255.0, 2)*255.0*dutyscale; // Logarithmic brightness. (127 looks as you would expect it to.)
    }  
    
  }

Code:
// These functions set pins faster than the digitalWrite() function, and record their current state in the pinState[] array.
// They do not check to make sure you have attempted to set a valid pin, nor do they make sure the pin is not set to PWM mode before attempting to set it.
 
#include "pins_arduino.h"

//byte pinState[20] = {0}; // The current state of each pin, if set with the digitalHIGH() and digitalLOW() functions.
 
void digitalHIGH(uint8_t pin)
{
        uint8_t bit = digitalPinToBitMask(pin);
      uint8_t port = digitalPinToPort(pin);
      volatile uint8_t *out;

      out = portOutputRegister(port);

      *out |= bit;

        //pinState[pin] = HIGH;
}  

void digitalLOW(uint8_t pin)
{
      uint8_t bit = digitalPinToBitMask(pin);
      uint8_t port = digitalPinToPort(pin);
      volatile uint8_t *out;

      out = portOutputRegister(port);

      *out &= ~bit;

        //pinState[pin] = LOW;
}

Code:

void updatematrix() {
  
  byte index;  
  unsigned long columnstart;
  int timeelapsed;
  int rowpin[rows];
  int rowduty[rows];
  int nextduty;
  
  for (int x = 0; x < columns; x++) { // Step through each column.

    // Turn on this column.
      digitalHIGH(colPin0+x);
      
    // if (x < 1) { // Do not update any columns after the first. *TEST CODE*

      // Illuminate column:
        
        // Store pin numbers and their coinciding duty cycles in two arrays:
          for (int y = 0; y < rows; y++) {          
            rowpin[y] = (rowPin0+(rows-1)) - y;
            rowduty[y] = dutycycle[int(matrix[x][y]*fade)];
          }

        //  Sort duty cycle list, keeping pin numbers synchronized with it. (Bubble sort)
        
          register int i, j, temp;
          
          for (i = (rows - 1); i >= 0; i--) {
            for (j = 1; j <= i; j++) {
              if (rowduty[j-1] > rowduty[j]) {
                temp = rowduty[j-1];
                rowduty[j-1] = rowduty[j];
                rowduty[j] = temp;
                temp = rowpin[j-1];
                rowpin[j-1] = rowpin[j];
                rowpin[j] = temp;
              }
            }
          }
    
        index = 0;  
        timeelapsed = 0;
        nextduty = rowduty[index];
        columnstart = micros();
                
        while (timeelapsed < columnduty) { // Wait for this column's duty cycle to complete.
          while (timeelapsed >= nextduty) { // If timelapsed is greater than or equal to the time at which the next brightest led in this column should turn on...
            digitalHIGH(rowpin[index]);
            index++;
            if (index < rows) { nextduty = rowduty[index]; } else { nextduty = columnduty; }
          }  
          timeelapsed = micros()-columnstart;
        }

        
      // Blank column:
      
        for (int y = 0; y < rows; y++) {
          //if (pinState[rowPin0 + y] == HIGH) {
            digitalLOW(rowPin0 + y);
          //}
        }

      // Turn off this column.
        digitalLOW(colPin0+x);
      
    //}
///    else {
//      delayMicroseconds(columnduty); // Removing this delay when testing would make the leds brighter when fewer are lit, and could burn them out if we are pulsing them at higher than their rated current.
//    }  
    
  }
  
}
Pages: 1 ... 72 73 [74] 75