Show Posts
Pages: [1]
1  Using Arduino / General Electronics / Difference with UNO on USB power vs 9V external wall wart on: August 14, 2012, 04:33:43 am
Hello,

I hope this is something that I am overlooking but I have a simple sketch that does an analogWrite to set the brightness of an LED.  When I run it powered via USB it runs with the proper delays and everything is timed correctly.  Although when I plug in a 9V 1A power supply in it doesn't run as expected.  My question is why is there a difference in the sequence when I use the external power supply?  My power supply's voltage seems to be OK, my only thought is that the amperage is too high.  From my understanding the PS will only supply the current that is asked for so it shouldn't be the PS current.

Here is a video of what is happening.
http://youtu.be/qrAX4ok1jnk

Here is my sketch.
Code:
/*
Test Program to dim a UV LED
*/

typedef struct{
  byte brightVal;  // Value to set the LED to
  int waitVal;     // The integer part of the wait value
  int x10;         // The power (*10^) value of the wait value.
} pUnit;

const byte numSteps=6;
const byte thePin=11;

pUnit Pattern[numSteps] =
{
  {10,5,2},
  {40,5,2},
  {90,5,2},
  {150,5,2},
  {255,2,3},
  {0,1,4}
};

void setup(){
  pinMode(thePin,OUTPUT);
}


void loop(){
  byte i;
  for(i=0;i<numSteps;i++){    //Step through each of the steps.
    analogWrite(thePin,Pattern[i].brightVal);    //Set the brightness
    delay(Pattern[i].waitVal*pow(10,Pattern[i].x10));    //Wait based on waitVal*10^x10
  }
}

Thank you.

-Andy
2  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: Updated Wiki - Please read and critique on: June 07, 2009, 06:40:03 pm
Sweet, thanks.

BTW... for some reason I can't seem to find any info on how to upload images for use in the wiki.  (I am probably just missing something.)  Is that allowed?  The reason I ask is that I have some schematic symbols that I created for the site and I am unable to use them.  

Also are there more suggestions for components that should be listed?
Like light dependent resistors, thermistors, pots, etc...

-Andy
3  Forum 2005-2010 (read only) / Bugs & Suggestions / Updated Wiki - Please read and critique on: June 07, 2009, 05:37:12 pm
Hello all,

I spent a few moments today working on one of the wiki pages.  If you have a few moments please give it a read and tell me what needs to be corrected.  Or edit it and make the corrections. (you won't hurt my feelings)  I am fairly new to the world of electronics so I am sure there are plenty of misconceptions and issues to be corrected.  Thank you and have a great day.

Page that was edited:
http://www.arduino.cc/playground/Main/Components

-Andy
4  Forum 2005-2010 (read only) / Interfacing / Interpretation of Pins on a component on: May 11, 2010, 12:18:57 pm
Hello all,

I have been thinking about using a component in project.  After reading the datasheet I have a few questions for those of you who are more experienced than I am.  Here is what I have interpreted the pins on this component to be and would like to see where I am wrong or right.

The datasheet is here:
http://www.nteinc.com/specs/1800to1899/pdf/nte1834.pdf

Vcc1:  This is the voltage that will be used when the current flows from pin 10 to pin 2 or pin 2 to pin 10.

Vcc2:  This is the voltage that will be used when the current flows from pin 10 to pin 3 or pin 3 to pin 10.

Vr:  This is the voltage that is used to compare the input for High vs. Low on the Inputs 1, 2, and 3.  I will be using a Mega to trigger this so I would use the 5V supplied by the board.

So if I want to run the motor with 12V I would hook 12V up to Vcc1 and 5V to the Vr.  If I also want to run the motor with 9V I would hook 9V up to Vcc2 and 5V to the Vr.

Am I even close in my understanding?  Thank you for your time.

-Andy
5  Forum 2005-2010 (read only) / Interfacing / Re: Triggering electromagnets on: April 25, 2010, 12:20:20 pm
Hello all,

Thank you for your comments.  I think they got me headed in the right direction.  After looking up the topics you all suggested here is what I have come up with.




This is only the circuitry required to trigger one coil.  I would need to build one of these for each coil I want to use.

My thoughts are: (I am listing these so that you can tell me where I am right or wrong.)

C1 is charged by the voltage from my power source.  This charge is released through L1 when a voltage is applied to the gate on T1.

R1 is used to control the rate C1 charges.  I want C1 to charge very quickly...so I might not need it.

R2 is used to control the rate C2 discharges.  Thereby allowing me to control the amount of time the magnet is on and hopefully not burn up the coil.  For my test article I may use a variable resistor to tune the discharge time.

D1 is there to control EMF from the permanent magnet that will be moving near the coil.  When the magnet moves near the coil it induces an EMF and the diode allows the current to flow to the other side of the coil.  During operation D1 prevents current from flowing "back" through thereby forcing the current through the coil creating a magnetic field.  (Am I understanding this correctly?)

T1 is a mosfet (as suggested by zoomkat).  In the example I looked at, the transistor had a zener diode it it,hence Z1.  I will need to look at the specs of the transistor and determine if one is built in.  I am assuming that it is there to allow any undesigned large currents to flow through the diode instead of through the transistor..?

Does that look more reasonable?  Any other thoughts?

Thank you again.

-Andy
6  Forum 2005-2010 (read only) / Interfacing / Triggering electromagnets on: April 21, 2010, 06:39:54 pm
Hello,

I am thinking of using the arduino to switch on a series of electromagnets.  These magnets would pull on a permanent magnet that is allowed to pivot in response to the change in magnetic field.  My diagram only has 3 coils but in the finished project I think there will be about 8 coils.

I haven't really done anything beyond the blinking LED sketches.  This would by my first application of both the sketch and electronics in general.

The premise of the circuit is to have a dedicated capacitor and transistor for each coil.  When I want to turn the coil on I will do a digitalwrite to a pin on the arduino that is wired to the base on the transistor.  This should "complete" the circuit, draining the capacitor through the coil causing a magnetic field.  The permanent magnet would then swivel toward the coil.  Right now the power source would be either the 5V power that would be shared with the arduino or a seperate 9V battery.  (IIRC there needs to be additional circuitry if I want to use the 9V battery)


My questions are as follows:

1) Does this sound like I am on the right track in my thought process/design?

2) Should there be any diodes in the circuit?  I am wondering if the magnet is moved near the coil if it will create an EMF that could blow out any of the components in the circuit.  Possibly put it between the coil and the transistor.

3) Do I need to put any resistors after the capacitors to prevent too large of a current flowing through the transistor and coil too quickly?  I am looking to have the reaction speed be fairly quick (<.5s).  The intention is that these electromagnets would be turning on and off faster than a human could notice.

4) Am I missing anything else?

Thank you for your advice and time.

-Andy
7  Forum 2005-2010 (read only) / Interfacing / Re: Multiple pushbuttons - one digital input on: June 12, 2009, 01:34:22 am
Would it be possible to use an resistor and capacitor in series to differentiate which switch is pushed?  In the same vein as using a resistor and an analog pin.  Instead of measuring the voltage you would measure the length of time the capacitor takes to discharge.

Maybe something like this:



I am new to this stuff so I could be completely off my rocker.  If R3>>R5 then when the button is pressed C1 should discharge through the digital pin.  This should take a consistent time.  The time it takes to discharge would give you which button was pressed.  (Now that I look at it R1 and R2 might not be needed)  Any thoughts? (other than that I am nuts...) smiley-grin

-Andy
8  Forum 2005-2010 (read only) / Interfacing / Re: Common Cathode vs  Anode in design of LED display on: June 04, 2009, 12:40:53 pm
Thank you all for the responses.  I see that I have alot to learn.  I will start looking at the chips you all suggested before I build my boards.

Thank you Grumpy_Mike.  When I read your response it was one of those "Well duh, that makes sense moments"  I appreciate it.

I will post the results of my work.

-Andy
9  Forum 2005-2010 (read only) / Interfacing / Common Cathode vs  Anode in design of LED display on: May 28, 2009, 10:58:55 pm
Hello everyone,

I have been enjoying my time reading the wonderfully informative posts on this forum.  I am a proud new owner of an ArduinoMega.  I have had a great time with it since its arrival on Saturday.  I am amazed by the amount of information and code available for it.

I am thinking of creating a custom designed led display.  It would be similar in concept to a 7-segment display with a small PCB and smt LEDs.  My question to the group is this:  Would it be more beneficial to make the display a common cathode or a common anode?  Does it really matter?  My other hope would be to string up to 6 of these together to create a clock interface (HH:MM:SS).  So if an arduino couldn't drive all of the leds then I would need to add some sort of multiplexing IC.  I could see that in one scenario I would need to drive both the data pin and the ground pin to be HIGH in order for no voltage to be created and thereby deactivating that segment.  I think this would require more current to flow through my circuit.  This leads me to believe that I should design it so that I only need to set the pin HIGH to create the voltage difference.  Am I correct in my assumption?

My current design has 10 leds in it and would have 11 pins.  So I don't think a BCD->7 Seg chip would work for my plan.

My knowledge is based more in the software and mechanical side of things and not so much in the electronics side.  (Think calculus based physics, but no actual electronics classes)

Thank you for your time and please keep up the fantastic work everyone!

-Andy
10  Forum 2005-2010 (read only) / Interfacing / Re: Project ideas please? on: May 28, 2009, 11:04:02 pm
How about an animated 3d LED pumpkin.  The mouth and eyes could be driven by a duino while the sides and back could be static.  Add some green leds on top for a stem and you are good to go.

Best of luck on your project.  Hope it all works well for you.

-Andy
11  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Beginners help on year long High School Project on: June 05, 2009, 01:52:13 am
OK, as far as I know you should be able to detect sounds with and trigger events.

It is possible to get the arduino to turn off wall current.  You will need to put some circuitry in between the arduino and the power line though.  For normal AC you will want to use a relay.  Make sure you find one that can handle the current load of the fog machine or fan or strobes.  The relay will close a large(r) switch when a small(er) current is sent to the coil.  Depending on the amount of current needed in the coil you will probably want to use a transistor to initiate the relay.  So the arduino would turn on the transistor with a very small current, which in turn triggers the relay.  I found this site to be helpful in researching how to switch AC on and off with a relay.

http://www.kpsec.freeuk.com/trancirc.htm#relays
12  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Beginners help on year long High School Project on: June 04, 2009, 07:10:12 pm
Hi,

Will the sound input (frequency & db level) be prerecorded or are you looking for an interactive solution?  (ie...do you expect to react to what people are saying/singing in real time or are you trying to sync the "light show" to a prerecorded song/movie)

I believe the number of microphones or inputs will probably be more critical than the outputs.  As from what I remember there tend to be more digital I/O lines than analog I/O lines.  So your inputs, especially the analog ones (which I would assume you will use to measure the sound intensity) will have fewer available.  If you run out of analog lines you could use an external ADC chip to turn your digital lines into analog inputs.  As to which one would be best for your application I will have to let the other board members chime in on that.

As for the interaction with strobe lights, smoke machines, etc.  Those could be triggered by the digital output lines.  You will want to use the output line to trigger a relay or transistor that switches these items on for the amount of time needed.  I doubt any arduino you choose will have enough current to directly run the device you want, plus you would run the risk of damaging your board.

If what you are trying to do a lightshow with is a predetermined song or movie you might want to consider basing your triggers on timers instead of listening for input.  You could wire the arduino to start an mp3 player or dvd player that is hooked into the sound/display system.  This would allow you to synchronize the events to the music without the need to listen for sounds.

Good Luck, it sounds like a fun project!

-Andy
13  Forum 2005-2010 (read only) / Bar Sport / Re: Liquor + Arduino = need a pointer or two on: June 07, 2009, 12:55:42 pm
I would imagine that this stuff is pretty spendy, but it seems quite versatile.

http://www.tslots.com/
Pages: [1]