Show Posts
Pages: 1 ... 3 4 [5] 6 7
61  Using Arduino / General Electronics / Re: Bizarre phenomenon happening! Trying to use camera flash w/ Optocouplers & SCR on: February 03, 2011, 10:43:31 pm
The flash was measuring around 120 volts when I put the multimeter across the leads.  The batteries are a bit low at the moment, not sure if that makes a difference, I could have sworn I thought I had measured it at 150v before.

I am willing to change out to some better components, such as the MOC3051 as suggested earlier.  Or any others that would work well.  It would be nice if I could simply find a single optocoupler that is able to work, rather than this setup I have now linking an optocoupler and scr.

I just tested this thing out for the first time and am definetly having an issue with too much delay.  I popped some balloons, and also did some other high speed movements, but the photo was going off late.  I'm guessing by possibly as much as 1/30th or 1/15th of a second, (roughly 33-66 milliseconds), which is a very long time for high speed photography.  I had the sound go off only about 3 inches from the microphone to minimize any sound travel. 

I had done many hours of reading about high speed photography and arduino before doing this, and I had heard before of people having to actually use the delay function of arduino to delay for like 10-20 milliseconds because the photos would actully snap way too instantly.  So I have no idea why I would be experiencing such delay.  I was under the impression that optocouplers and scr's work in microseconds or even faster, and that flashes are pretty instant, and my arduino code is pretty basic.  So not sure where this delay is coming from.
62  Using Arduino / General Electronics / Re: Bizarre phenomenon happening! Trying to use camera flash w/ Optocouplers & SCR on: February 03, 2011, 01:10:07 pm
Thank you for that explanation, apparently there are a lot of things related to electrical theory that I don't know.  I had no idea the gate could just pick up enough voltage right out of the air to trigger it.  I always thought voltage and current went hand in hand, that voltage was the speed that current travels at.  I had no idea that voltage could exist with no current.

I'm still trying to wrap my head around this.  I had always thought it was kind of like this analogy comparing to an automobile. Where the size of the vehicle is the current, and the speed it travels is the voltage.  So like you could have a semi truck traveling slow, would be high current low voltage.  Or a ferrari traveling fast, would be low current at high voltage.  Or any combination of such.  However if no vehicle were to exist (no current), than how can there be a measurement of how fast something that doesn't exist is moving?

And just to confirm, the pulldown resistor should be about 2k, and go from the gate of the SCR to the negative terminal of the battery that triggers the SCR?

63  Using Arduino / General Electronics / Re: Bizarre phenomenon happening! Trying to use camera flash w/ Optocouplers & SCR on: February 02, 2011, 06:18:41 pm
So I was putting everything back together getting ready to put that 2k resistor in place as was suggested (I'm curious what the purpose of that is), and before I got a chance to, it seemed to end up functioning pretty close to the way it should, I even had arduino triggering it.  Not sure why its different, perhaps I have a couple bad scr's or optocouplers in the batch and grabbed a different one, the circuit is the same as what I had quadrouple checked before.

There still is some weird stuff going on though, is anyone able to explain?  For some reason, as I'm plugging wires in, almost every single wire I plug in causes the flash to go off.  Even when it should not such as when there is no current at all to the gate of the scr (or nothing even attached to the gate), it always fires, even though no current should be able to pass through the scr with no gate current.  Then once that's hooked up, when I'm hooking up the wires to the optocoupler the flash starts going off, even though there is no current at all to the gates of the optocoupler, there should be no reason any electricity should flow through it and trigger the scr, but for some reason it does.  There should be no current passing, but somehow there is.  So the flash fired about 6 times while hooking up the wires.  Although once they were all hooked up, the arduino input did seem to be correctly triggering it.  Why is that happening?

64  Using Arduino / General Electronics / Re: Bizarre phenomenon happening! Trying to use camera flash w/ Optocouplers & SCR on: February 02, 2011, 12:25:11 pm
OK, I made an image to demonstrate.  This is only a couple of the many things I tried the past 20-30 hours.  And only a couple of the bizarre phenomenon I've been experiencing.

I'm willing to change components if necessary, although all my research indicated these should work.  Can anyone explain why that bizarre phenomenon is happening, or explain a way to make this work (either with the components I have or different ones)?


65  Using Arduino / General Electronics / Bizarre phenomenon happening! Trying to use camera flash w/ Optocouplers & SCR on: February 02, 2011, 12:37:27 am
I have seriously wasted about 20-30 hours trying to hook up this vivitar 283 camera flash to be triggered by arduino, and am completely at a loss, and have been experiencing bizarre phenomenon that completely defy's everything I have ever learned about electronics.

Now to begin the vivitar 283 flash is measuring about 120 volts across its leads, so I know I have to isolate the voltage.  First I had tried with a CNY17-3 opto-isolator, which worked just fine with a different camera flash (cheap neeweer), but would not work with this vivitar.  So someone told me I could use an SCR to trigger the flash (and recommended a MAC97A8 600V triac).  The idea is the arduino would trip the optocoupler, which would complete a circuit with a seperate battery triggering the SCR.  Sounds simple, yet for some reason it wouldn't work.  I've tried testing all the parts seperate, replacing them (i have 5 optocouplers and 5 scr's), and right now I have the arduino completely out of the equasion, just trying to use batteries to trigger the flash through the optocoupler/scr, and that's when I began experiencing all sorts of absolutely bizarre phenomenon.  For example, these 4 things.

1. Whenever I connect the camera flash leads to the SCR, the flash fires, even though I have nothing at all hooked up to the gate.  It should not be letting any current through at all without a gate current right?
2. Same thing with the optocoupler.  For some reason as soon as I hook the camera leads to an optocoupler (or multiple optocouplers hooked up in parrallel), the flash fires, even though there is no current going through the led portion of the optocoupler, there should not be any current passing through the other side, yet it does.  I've tested these optocouplers over and over again, I know how to use them, but for some reason this flash defies all the rules.
3. This is the most bizarre of all. I had the flash hooked up to the main pins of the SCR, with the positive of the flash on pin 3 of the scr, and the negative of the flash on pin 1 of the scr.  For some reason, if I took a simple scrap of wire, and touched it to pin 2 of the scr, the flash would fire.  It was happening consistently.  I must stress, the other end of the wire was not touching anything at all, just in the air.  Not even touching me since I was holding the insulated part of the wire.  It makes no sence at all, nothing at all should happen simply touching one end of a wire to something, if the other wire is not touching anything.  Theres no circuit at all, it defies all electrical logic I know, yet for some bizarre reason it was causing the flash to fire.  Even if I would just touch that wire to the same slot of the breadboard the middle pin was in, it was still making it fire, how can that be?

Can anyone explain why these things are happening, and help me get this camera flash safely hooked to, and triggered by arduino?  I'm seriously not exaggerating when I say I've wasted 20-30 hours trying to do this seemingly simple task over the course of the past couple weeks.  I've hooked up and triggered a modern flash with lower voltage across the terminals just fine, and without seeing any strange phenomenon, yet I just can't find a way to make this higher voltage one trigger, and can't figure out why its causing all these bizarre things to happen that make no sence.

66  Forum 2005-2010 (read only) / Syntax & Programs / Re: Any more user friendly way to program sketches? on: January 18, 2011, 02:15:15 pm
I think my biggest frustration is inconsistencies, especially with the data out there.  There is definetly a lot of good tutorials out there, lots of good examples, lots of good learning.......but only for some of the functions.

I've been finding myself getting stuck for hours upon hours on something like one single line of code.  Search for hours trying to find the documentation, trying to figure out how to make it work, even just trying stuff at random, and just not being able to get past that one little line of code and move on.

I will know the name of the function I need to use, and know what I want it to do, and should be able to type it out in seconds, but instead it will take an hour just to figure out the "correct" way to type the thing you already know, like if it needs a space here, or an extra set of brackets here, or needs an ' ', or some other silly little symbol that makes what should have been a 5 second to write code, become an 1 hour to write code.
67  Forum 2005-2010 (read only) / Syntax & Programs / Re: Any more user friendly way to program sketches? on: January 18, 2011, 01:41:23 am
I have been learning bit by bit, but its just all the annoying things like certain things not working and you cant figure out why, and eventually it turns out to be some stupid thing like certain commands/symbols need spaces between and others don't, or things like empty brackets, or tiers of brackets and one command is on the wrong side of one.  Some that need brackets and some that don't, or you forget to capitalize a letter and it doesn't work, or stupid things like that.  

And most of the time the error messages make no sense, etc.  I wish you could type stuff out in a more straightforward, english manner, and let the program decide what sort of empty brackets, tiers, goofy punctuation, etc. goes where.
68  Forum 2005-2010 (read only) / Syntax & Programs / Any more user friendly way to program sketches? on: January 17, 2011, 08:02:35 pm
This might sound like a very wimpy question, but I'm a total newbie to c++ programming, and I have been absolutely struggling, with about 10-20 hours of research/tinkering to get the most simple piece of code to work right, and its still not working.  Which by the way, if anyone wants to help, I have a thread here . Anyways.....

All these different commands that have to have the absolute perfect syntax or else you'll get a cryptic error that usually won't make sense.  You know what you want to do, but if your missing one little bracket, or space, or symbol that your not aware of and it won't work, and you spend hours searching the net trying to figure out just the right syntax.  

I wish there was a easier GUI.  Similar to those HTML programs that let people design websites without specifically knowing HTML.  It would be nice if you could use buttons or dropdown menus to do stuff in plain english like "When pin3 is high, output to pin 8", and then have the software do all the proper coding for you.  Or say you want to do switch case statements, it would be nice to just have a "add switch case statement" type form where you just fill out the boxes with the various variables and results, and let the software handle all the colons, brackets, spaces, syntax, etc.  Does any sort of c++ editor like that exist that is arduino compatible?
69  Forum 2005-2010 (read only) / Interfacing / Quickest sound sensor for triggering a flash on: January 11, 2011, 06:15:44 pm
I just got my first Arduino, and am completely new to this stuff.  My first project is going to be a sound sensor that triggers a camera flash, for high speed photography.

I have searched around and seen this done a couple different ways.

One way used a "piezo element" to detect the sound.

Another used a microphone and amplifier to detect the sound.

Can anyone tell me which would be faster, better, more consistant, and what the benefits of each way would be?  Or even if there is another better method?  

My guess (and I could be very wrong about this), is the piezo element would likely be faster, cheaper, and easier, but may not be as sensitive?  And the mic with amp might be a little slower since its traveling through more stages, but may have the abilty of being adjustable for various sound levels.  Again, just a complete guess.  I have no idea which method would be more consistent, but consistency would be nice, because I'm guessing you could make fine adjustments to the timing by putting the sound sensor closer or further away from the object making the sound.
70  Forum 2005-2010 (read only) / Troubleshooting / Re: Can't install drivers in windows 7 64 bit on: January 14, 2011, 01:07:15 am
There we go, problem solved.  Thanks.

I found the windows 7 64 bit drivers on this page.
71  Forum 2005-2010 (read only) / Troubleshooting / Can't install drivers in windows 7 64 bit on: January 13, 2011, 04:46:44 pm
I recently bought an arduino nano and arduino duemilanove, and cannot get them to install or work in windows 7 64 bit.  I have read multiple guides, but no luck.

Heres what I've done.
-Downloaded the latest arduino 0022 software.
-Plug in arduino, getting an error message that driver wasn't installed
-Go to device manager, right click, update driver
-manually browse to the FTDI usb drivers folder and attempt to update
-I just get an error message "windows could not find driver software for your device"

I've tried with both arduinos and neither works.  Any help?
72  Forum 2005-2010 (read only) / Interfacing / Re: Newbie having trouble with IR remote servo project on: January 18, 2011, 08:31:45 pm
I've almost got everything working, but I'm trying to fix one bug.  Luckily I think I know the culprit.  It seems as though my "current" variable, is able to exceed above and below the servo limits of 0 and 179.  For example say the servo is at 5 degrees, and I push my button to decrease by 10 degrees, well the value goes below 0 (I'm guessing to -5), and ends up causing issues with it not going to, or saving the right position.

Is there a way to perhaps define the "current" variable to limit it to between 0 and 179?  So that if you do try and for example have it at 175 and add 10, it will automatically know to make it 179 since that's the max defined variable?

I was thinking I could possibly use some "if" statements, like inbetween these 2 lines of code.....

     current += 10;  //moves servo 10 degrees
.... I could put
if (current > 179) {current = 179;}

I think that would effectively set limits if I put it in all the right places, but I'm trying to figure out if there is a better way to do it.
73  Forum 2005-2010 (read only) / Interfacing / Re: Newbie having trouble with IR remote servo project on: January 18, 2011, 02:40:25 pm
AWOL: Thanks so much for the help, I was indeed missing breaks on each of those statements.  Should have known, but somehow I was so focussed thinking the current += type statemtnes were somehow wrong, that it had me looking in the wrong place for the problem.

As far as adding the suffix L, does that change any number to a "long"?  I've gone through all the ladyada tutorials, read the whole arduino notebook, most of the ASKmanual (still going through it), and also cruised the website, and had never known that you can do that.  Thats the main reason I'm struggling so much, although many things are documented well, I keep running into a few little things that aren't.

In any case, since all the other buttons worked without the "L", so I actually continued on the trend and didn't use it.  Your right, that number is higher than an "int", so it in theory shouldn't work, but I'm guessing that maybe they are all just rolling over, but always rolling over to the consistent value.

Anyways right now everything is almost done, just need to implement eeprom storage and it will be good.  I plan on posting some sort of tutorial or something when I'm done to help other newbies trying to do the similar thing.
74  Forum 2005-2010 (read only) / Interfacing / Re: Newbie having trouble with IR remote servo project on: January 18, 2011, 01:57:25 am
Well I've spent a bunch of time juggling stuff around, and although there are parts I still don't quite understand, I almost have everything working except for one bug.  Here is the code, I'll explain the bug below.

#include <IRremote.h>
#include <Servo.h>
int RECV_PIN = 11;
Servo myservo;   // create servo object to control a servo

int position1;   //servo position 1
int position2;   //servo position 2
int position3;   //servo position 3
int codeValue;   //the code from the remote
int current;     //keeps track of current servo position

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
  position1 = 0;    //default servo positon 1
  position2 = 90;   //default servo position 2
  position3 = 179;  //default servo position 3
  irrecv.enableIRIn(); // Start the receiver
  myservo.attach(9);  // attaches the servo on pin 9
  myservo.write(position3);   //start the servo out at position 3

void loop() {
  if (irrecv.decode(&results)) {
    codeValue = results.value;
    switch (codeValue) {
    case 16753245:    
      current = position1;
    case 16736925:    
      current = position2;
    case 16769565:    
      current = position3;
    case 16761405:
    case 16748655:
    case 16712445:
      current += 10;
    case 16754775:
      current -= 10;
    case 16720605:    
      current = 0;
    case 16769055:    
      current = 179;
    case 16738455:    
      position1 = current;  //stores current position as servo position 1
    case 16750695:    
      position2 = current;
    case 16756815:    
      position3 = current;
irrecv.resume(); // Receive the next value

The problem is with this section of code, I've read it over and over and just can't figure out why it doesn't work.

case 16761405:
    case 16748655:
    case 16712445:
      current += 10;
    case 16754775:
      current -= 10;

What it is supposed to do is a allow to be able to increase/decrease the servo position from wherever its at 1 or 10 degrees at a time.  The current position is always monitored by the "current" variable (as far as I know it seems to be working fine in the rest of the code), so I thought that adding/subtracting the correct # from the current value, and then writing current to the servo should work, but they generally either do nothing, or cause the servo to go all the way to 0.  I've also tried it a slightly different way with slightly different syntax like this.

      current = ++current;
    case 16748655:
      current = --current;
    case 16712445:
      current = current += 10;
    case 16754775:
      current = current -= 10;

but it still isn't working.

75  Forum 2005-2010 (read only) / Interfacing / Re: Newbie having trouble with IR remote servo project on: January 17, 2011, 09:09:46 pm
Actually I just got that particular thing working, producing consistent results, I think I might have put a == instead of an =, but when I've been experimenting with other variable replacement, bizarre things happen that don't make sence, like why does...

Serial.println(results.value, HEX);

give different results than

    codeValue = (results.value, HEX);

They should be identical, yet the second one doesn't work at all, only gives me the #16 on every button.

PS: I still lost on getting this switch case statement to work, I posted the code above, think I'm doing it wrong, missing a colon or space, or something.
Pages: 1 ... 3 4 [5] 6 7