Show Posts
Pages: [1] 2 3 ... 45
1  Using Arduino / Project Guidance / Re: Green Laser 3VDC Ebay on: April 22, 2014, 10:35:19 pm
Attached is the circuit that I was talking about. It provides regulated 3.3 volts (3.28 actually) and the ability to turn the laser on and off with the Arduino.
2  Using Arduino / Project Guidance / Re: enc28j60 no miso signal on: April 22, 2014, 12:10:10 pm
hello, first i appologize for my english because i am francophone

(google traduit)
Je ne comprends pas ce que le circuit est que vous avez indiqué.
Si je regarde le module de l'interface réseau ENC28J60 SPI, je vois que le module possède un port SPI. Il vous suffit de connecter directement à l'Arduino.
Quel est le PIC et bus émetteur-récepteur pour?

(original)
I don't understand what the circuit you attached is.
If I look at the ENC28J60 SPI interface network module, I see it has an SPI port. It should simply connect directly to the Arduino.
What is the PIC and bus transceiver for?
3  Using Arduino / Project Guidance / Re: Mimic a 12v potentiometer on: April 22, 2014, 11:56:02 am
While all of this is true, the OP still hasn't actually said what the pot is doing in the circuit.  He probably needs to grab his multimeter and start measuring.  While it is most likely going to be a 0-12V or some such input, this isn't guaranteed.  It could be a current loop, or it could be some other resistance controlled loop (Like adjusting the frequency in an oscillator circuit).

Yes. It's important for the OP to know the range of the control voltage (if it is a control VOLTAGE and not a current loop) as well as if the control signal is referenced to ground. If it's not referenced to ground, the problem gets bigger because now some kind of isolation between the Arduino and the machine will be necessary.

Without knowing this info, it's impossible to even get started on a design.......
4  Using Arduino / Project Guidance / Re: Green Laser 3VDC Ebay on: April 22, 2014, 11:50:42 am
I found out the ebay seller from China wired black (-) and red (+) backwards.  It works with 3v (2 x AAA batteries).  Is there a cheaper way to step down from 3.3v to 3.0v without buying the step-down voltage chip?  I don't want to over work this laser.  

You don't need to step down the power supply. Laser diode modules have built in current regulators. That module would probably run just fine on 5 volts (but don't try it because if I'm wrong you would fry the diode in a nanosecond!).

I would suggest getting a stand alone 3.3 volt regulator (maybe an LM-317) and drive the laser diode that way.

Now picture the LM-317 circuit and add a small NPN transistor (say a 2N2222) to the LM317 control pin (collector) and ground (emitter) and drive the base through a 470 ohm or so resistor. When the Arduino port is high, the transistor is saturated and the LM-317 control pin pulled to ground (causing it to output only 1.25 volts). The laser diode goes off. Turn off the Arduino port. The transistor goes open and the LM-317 output returns to 3.3 volts and the laser turns on.

Bingo... voltage regulated power supply and on/off control all in one!  smiley
5  Using Arduino / Project Guidance / Re: Green Laser 3VDC Ebay on: April 22, 2014, 11:45:16 am
50 mW = 3.3 V * 15 mA
Hardly a problem.

50 milliwatts is the optical output power. Lasers are very inefficient and the INPUT power is much higher. I suspect the OP's laser module draws 1/2 to 3/4 ampere at 3.3 volts......
6  Using Arduino / Project Guidance / Re: Mimic a 12v potentiometer on: April 22, 2014, 11:36:40 am
When you say 12V Pot, what do you mean?  How does it function in your circuit?
1) Voltage divider/Fixed voltage fed into a high impedance input?
2) Change in resistance?

#2 requires a digital Potentiometer (Separate part), #1 could be done with an op-amp amplifier circuit fed by a low pass filtered output of a PWM pin.  (You will need lots of filtering)

The low pass filter could be a part of the op-amp circuit (and indeed using the op-amp would make the filter more effective for a given set of filter values).
7  Using Arduino / Project Guidance / Re: Mimic a 12v potentiometer on: April 22, 2014, 11:35:38 am
Hi All,

I am new to Arduino and electronics in general but am steadily getting the hang of it.

The project I am working on will require me to mimic a potentiometer using the arduino. The main issue I have is that the potentiometer has a 12 volt supply.

Can anyone suggest how I could go about this?

Thanks,

Rod.

Depends on what type of output you expect.

A "potentiometer" connected to a 12 volt supply will provide, at the wiper, anywhere from 0 to 12 volts depending on the position of the pot's shaft.

If you want a circuit to do that with the Arduino (which only puts out 0 to 5 volts via PWM), you will need to do 2 things:

(1) Low pass filter the PWM signal from the Arduino so that it is DC with as little AC (PWM) ripple on it as you desire.

(2) Use that adjustable DC signal to drive an op-amp with sufficient gain (i.e. gain = 12/5 minimum) to convert the 0-5 volts into 0-12 volts.

Since this sounds to me like a school project, I'm not going to provide code and circuit examples. From the assignment, I assume you should know how to do at least the op-amp circuit (and the Arduino part is equally easy).

We can, however, give you guidance on code or circuit design if you first post what YOU tried to do.


(edit to add):
After reading your later posts, I see this is not a school project. Your servo circuit MAY just take a 0-5 or 0-12 volt signal and run it into a comparator which is part of the servo loop (which means the Arduino may be able to drive it directly). You need to find out how your control pot works and if one side of it (as well as the control signal) are referenced to ground.

Maybe you can do the same thing that I did... use a gear motor and a pot as a servo rotational controller and use it to physically drive your machine's control potentiometer.


Lastly, a bit off topic... but something I did quite a while ago mostly for fun was to have a DC gear motor drive a 10 turn linear potentiometer with feedback (a servo loop).

I used this as part of a digitally controlled DC power supply which is a switching / linear hybrid (there is a switching part to control the input voltage to an LM-317/MJE2955 voltage regulator).

When I set a certain voltage on the power supply display, the motor rotates the potentiometer to adjust the LM317 circuit to give me the right voltage, and the Arduino also runs the switching side of the supply to provide "voltage + 5" to the regulator input side (to minimize power waste at low output voltages).
8  Using Arduino / General Electronics / Re: Ua 741 OpAmp how to connect it to get a gain of 2? on: April 16, 2014, 10:10:45 am


this part works fine.
Now instead of just a voltage follower at the end I'm trying to increase the voltage 2 times.

I'm amazed that so many posts have been made and yet nobody has helped you yet.

Use the circuit you have, but instead of connecting the op-amp output directly to the inverting input, connect it as follows:

* 10K resistor from output to inverting input.
* 10K resistor from inverting input to ground.

That will set your op amp to have a gain of 2 (it currently has a gain of 1).

Also, your circuit will only produce about +7 or so volts max with a +/-9 volt supply (the output obviously cannot go higher than the supply voltage). If you need more than +7, then increase the supply voltage to +/-12 or +/-15 volts.

Usually, the supply voltages do not have to be equal. If you only need a positive output, a +5, -15 volt supply would be OK.

Lastly, although the 741 op-amp is an older design, there's nothing wrong with it and there's no reason to use something different.

Good luck.
9  Using Arduino / General Electronics / Re: Instead of IR transmitter / receiver, wire directly? on: April 16, 2014, 09:58:26 am
Hy

I currently use an Arduino to control a device over an IR LED.
Is it possible to use two wires directly from the Arduino
output to the IR of the device and use the same code I used
before to control it via the IR LED?

Andy

Probably the easiest way to do it (and avoid any ground loop or polarity problems) would be to use an opto-isolator.

The circuit that drives the IR LED would go to the opto input and it's output would go to the IR receiver circuit.
10  Using Arduino / Programming Questions / Re: Need help - Array with different size elements on: April 07, 2014, 12:39:17 pm
How is the renderer (the program that draws the characters) supposed to know how many bytes are in each character representation?

Good question. You can't see it because I hacked out pieces of the table to constrain the size for the example, but each data set ends with 0xFF, 0xFF, 0x00 (which means to the renderer, X=-1, Y=-1, Pen=Up).
11  Using Arduino / Project Guidance / Re: create audio file from arduino sensor data on: April 07, 2014, 08:36:20 am
Hello,
Does anyone know an approach to create an audio file from the signal my arduino is reading off of the analog pin? I am currently reading the sensor and sampling it and sending the digital signal to the computer over the serial port. is there any way to use processing to create an audio file from the data from the serial port?

You can use a serial terminal and "download" the data to a file. Have your Arduino send the data as ascii hex values, download the data as text, then externally convert the text file to a binary file and add a WAV header to it.

Attached is a utility I wrote a long time ago called "wavefix". It can edit existing or create new WAV headers for files. I wrote it specifically for converting data files into sound files (actually, to listen to the sound of a combustion chamber pressure transducer in a small rocket engine by adding a WAV header to the transducer data).

The attached ZIP file has a Win32 console EXE file precompiled and the C source code. It will compile in Linux and will probably compile in MacOS (haven't tried it on a Mac).

Hope this helps.
12  Using Arduino / Programming Questions / Re: Need help - Array with different size elements on: April 07, 2014, 07:24:59 am
A series of Iliffe vectors, pointing into a second linear array.

Sorry, I have no clue what you mean.
13  Using Arduino / Programming Questions / Re: Why == works in an if statement? on: April 07, 2014, 07:22:52 am
This is a pretty basic question.   I believe that I have seen online examples of if statements with just a simple < or > operator, but never with just a simple = operator.  Is the == operator always needed within an an expression found in the if statement? Hoping someone with more experience would be willing to share the reason.

"==" means "does it equal?"

"=" means "set this to that".

Example:
    X = 3;
    if (X == 4) {
        print ("It's not the same!"); <-- this gets printed because 3 is not equal to 4
    } else {
        print ("It matches!");
    }


Now watch what happens here:
    X = 3;
    if (X = 4) { <-- this SETS X to a value of 4
        print ("It's not the same!");
    } else {
        print ("It matches!"); <-- this gets printed because setting X to anything returns boolean "true"
    }


Make sense?
14  Using Arduino / Programming Questions / Need help - Array with different size elements on: April 07, 2014, 07:14:53 am
Hi all,

I am trying to figure out how to create an array that has elements of different lengths. Each element will contain X/Y coordinates to draw vector characters, and I need to point to any element at random... like this:

Code:
static const uint8_t c30[] PROGMEM = { // char 0x30 (0)
    0x14,0x00,0x00,
    0x09,0x1c,0x01,
    0x04,0x18,0x01,
};

static const uint8_t c31[] PROGMEM = { // char 0x31 (1)
    0x14,0x00,0x00,
    0x06,0x18,0x01,
    0x08,0x19,0x01,
    0x0b,0x1c,0x01,
    0x0b,0x07,0x01,
};

static const uint8_t c32[] PROGMEM = { // char 0x32 (2)
    0x14,0x00,0x00,
    0x04,0x17,0x01,
    0x04,0x18,0x01,
    0x05,0x1a,0x01,
    0x06,0x1b,0x01,
    0x08,0x1c,0x01,
    0x03,0x07,0x01,
    0x11,0x07,0x01,
};
//............. etc............

static const uint16_t pointers[] PROGMEM = {
    c30, c31, c32, etc........
};

Note that each set of coordinates (c30, c31, c32, etc...) contain a different number of bytes. The last lines in the code example (pointers) is what I'm trying to do... for example if I do a pgm_read_word (pointers + 0) I want it to point to the first byte in c30, pointers + 1 would point to the first byte in c31, etc... (that is, I want the address of each character set).

I hope I described this correctly. Any ideas how to do this will be appreciated. Thanks!

-- Roger
15  Using Arduino / Programming Questions / Re: Arduino UNO R3 16u2 Firmware Restore on: April 06, 2014, 03:09:51 pm
Thanks Krupski for the quick and detailed reply. Although I would classify myself as an experienced C programmer,  I haven't quite figured out everything with the Arduino or AVR tools yet. I'll have to go find an AVR tool to use for the programmer - I use a Win7 platform. I was hoping there was a function built into the Arduino IDE that I was missing but guess not. Thanks again.

The command line I posted was generated by my script. That command line (an AVRDUDE command) will work equally well in Windows. The script, however, will not.

All you have to do is click Start, then Run, then type "cmd". A black screen with white letters will open. That's a command line interface.

Then just copy and paste the command I posted into the window and press enter.

Of course as I said, edit the command line accordingly to match your hardware (for example, your COM port will be something like "COM3" rather than "usb").

That command line should run AVRDUDE, read the 16u2 chip and record all the stuff in the filenames I mentioned previously.

If you get a "Command or path not found" error message, that's because AVRDUDE.EXE isn't in your path. You'll have to find where it is and then type in the whole path.

For example, instead of just "avrdude" you may need something like "C:\Program Files\Arduino_105\hardware\tools\avrdude.exe" (wherever your AVRDUDE is - you'll have to find it).

When you're done, type "exit" and hit enter to close the command window.

Hope this helps.
Pages: [1] 2 3 ... 45