Show Posts
Pages: 1 ... 42 43 [44] 45 46 ... 98
646  Using Arduino / General Electronics / Re: Should transistors switch Vin or Gnd? on: December 11, 2013, 06:55:05 pm
Because it is easier to supply a steady current current into the NPN base when it has a hard reference to ground. If the base is at VCC, the voltage may have to rise *above* that for current to flow into the base. Also, once it turns on, the base current may vary wildly if the effective emitter resistance changes.

If you want a high side switch, use a PNP.
647  Using Arduino / Project Guidance / Re: Small area (25m²) multiple objects tracking on: December 11, 2013, 06:16:00 pm
Making a live version of LavaRand? 8^)
http://en.wikipedia.org/wiki/Lavarand

I think your image is a pretty good way to do it by incorporating PeterH's idea. Put different colored "sweaters" on each puppy, and use a webcam to periodically capture an image, use Matlab or some other image processing tool to find the "blobs" of different colors, find the centroid of the blobs and there you go.

ETA: The reason we suggest this is that no one has come up with a good way to track position in small areas, Arduino or not.
648  Using Arduino / General Electronics / Re: Op-Amp as a voltage switch on: December 11, 2013, 05:41:15 pm
I think a single discrete transistor - either MOSFET or BJT would work better here, they can supply more current than your typical opamp.
649  Using Arduino / General Electronics / Re: real noob question. measuring current on: December 11, 2013, 03:09:46 pm
Since you have the known resistor already, all you need to do is measure the voltage across it. Using a voltage divider to bring the voltage down to the 5 V level of the arduino, simply measure the voltage at the 12 V point and the other end of the 100 ohm resistor. The current is then (V12 - V100ohm) / 100.

If the 12 V is well regulated and you know it is 12 V, you don't need to measure it.
650  Using Arduino / Programming Questions / Re: 'simulate' arduino math on: December 11, 2013, 02:41:32 pm
Agreed, but when using binary math with pencil and paper, you are strongly encouraged to keep the types the correct size to keep from doing extra work!
651  Using Arduino / Programming Questions / Re: Help with program on: December 11, 2013, 02:39:16 pm
To amplify what Delta_G is saying, you probably need:
Code:
if (state == HIGH)
{
    if (set == HIGH)
    {
       //Do state is HIGH and set is HIGH stuff here
    } else {
      // Do state is HIGH and set is LOW stuff here
    }
} else {
    if (set ==HIGH)
    {
      // Do state is LOW and set is HIGH stuff here
    } else {
      // Do state is LOW and set is LOW stuff here
    }
}
652  Using Arduino / Programming Questions / Re: 'simulate' arduino math on: December 11, 2013, 12:53:38 pm
Disregarding the floats, I was assuming he would do the math in long form binary, not decimal. 8^)

653  Using Arduino / General Electronics / Re: Transistor as two diodes on: December 11, 2013, 12:10:10 pm
Another way to think of it is that a transistor is NPN. The only thing you can do with two diodes is NP-PN which is not the same.
654  Using Arduino / Programming Questions / Re: How convert word to bit array? on: December 11, 2013, 12:02:31 pm
Treat it that way. A word *is* a 16-bit array, you just can't use the
Code:
a[i]
syntax on it.

The arduino provides a number of handy bit setting functions just for this kind of thing.
655  Using Arduino / Programming Questions / Re: 'simulate' arduino math on: December 11, 2013, 11:59:21 am
It would probably do you a world of good in a "get off my lawn" kind of way to use pencil and paper.
656  Using Arduino / Programming Questions / Re: Possible Syntax Error? on: December 09, 2013, 03:37:33 pm
Are the same values printed with the initial code with one LED?
657  Using Arduino / Programming Questions / Re: Possible Syntax Error? on: December 09, 2013, 03:15:17 pm
What kinds of values are being printed?

658  Using Arduino / Programming Questions / Re: Serial communication with SCPI Instrument on: December 05, 2013, 12:07:32 pm
You are sending hundreds of IDN? commands a second that way. Set up your software to send only one per about 5 seconds, and then listen for a while. Check out the blink without delay for an example.

659  Using Arduino / Programming Questions / Re: Serial communication with SCPI Instrument on: December 05, 2013, 09:54:02 am
Here is some unwanted advice:
If the Arduino is just going to be a translator between the PC and the unit. Chuck it and get a National Instruments GPIB-USB adapter. No more hardware communication issues. GPIB is much better for controlling instruments. It must be - it has hung on since the late 60's!

Anyway, you might have a DCE/DTE problem. If you are hoking pin 2 to pin 2 and pin 3 to pin 3 as it says in the Keithley manual, try hooking pin2 to pin3 and pin 3 to pin 2. The shield may be DTE rather than DCE.
660  Using Arduino / Programming Questions / Re: Serial communication with SCPI Instrument on: December 04, 2013, 07:03:23 pm
Assuming that you have set the baud rate correctly and have the connections right, I would hardwire a "*IDN?" command rather than sending a command from the PC.

Then at least you are only testing one loop.
Pages: 1 ... 42 43 [44] 45 46 ... 98