Show Posts
Pages: 1 ... 38 39 [40] 41 42 ... 68
586  Using Arduino / Motors, Mechanics, and Power / Re: Sharing Base Transistor fries H-Bridge! Why? on: August 07, 2012, 02:21:47 pm
Congratulations, it is the classical how-not-to-make-an-H-bridge error.

Look for example at the left side of the bridge.
The base current for Q3 becomes the base current for Q1.
So Q1 and Q3 will turn fully on and cause a shortcut. The current through R3 can't help preventing it, because the base current is almost unlimited.

With the example that didn't fail, the base of Q1 is to ground, so Q1 is never active.
The base of Q4 is to 5V, so that is also never active.
The current flow through Q3 - M1 - Q2, so the motor is on.

If you understand how the current flows, you know how an H-bridge works.

You could connect the emitters to the motor, and make a 'safe' circuit.
Or you could use a driver ic. Like the old L293D, or a MOSFET driver.
587  Using Arduino / Motors, Mechanics, and Power / Re: Varying Voltage to a Pump on: August 07, 2012, 02:10:23 pm

Now you can use a digital output pin instead of the potmeter, and start playing with.
Have fun !

const int pinMotor = 9;   // write your own pin here

void setup()
  pinMode (pinMotor, OUTPUT);

void loop()
  analogWrite (pinMotor, 20); // too slow
  delay (3000);
  analogWrite (pinMotor, 50); // very slow
  delay (3000);
  analogWrite (pinMotor, 80); // slow
  delay (3000);
  analogWrite (pinMotor, 120); // medium speed
  delay (3000);
  analogWrite (pinMotor, 255); // full on
  delay (3000);
588  Using Arduino / Motors, Mechanics, and Power / Re: Varying Voltage to a Pump on: August 07, 2012, 12:30:41 pm
The flyback or snubber diode should be the other way around.
A flyback diode is for an inductive load, and is parallel with the inductive load.
For a motor, the voltage could not only give a high voltage peak (inductive), but also be negative (dynamo).

To be sure, I would place both diodes, like in this picture I found elsewhere in the forum:

589  Using Arduino / Storage / Re: Webduino, getting data from SD card on: August 07, 2012, 11:58:35 am
If the file could not be found on the SD card, you could return an 404 error.
590  Using Arduino / Sensors / Re: Flex Sensor on: August 07, 2012, 08:23:54 am
Please don't cross-post:,117624.msg884961.html,117623.msg884959.html
591  Using Arduino / Motors, Mechanics, and Power / Re: DC Motor Control on: August 07, 2012, 08:23:30 am
Please don't cross-post:,117624.msg884961.html,117623.msg884959.html
592  Using Arduino / Motors, Mechanics, and Power / Re: Varying Voltage to a Pump on: August 07, 2012, 08:20:49 am
You are going in the right direction.

If you use an analog input for the transistor, it might get very hot.
PWM is just on or off, that prevents it from getting hot.
Your circuit will work with the potmeter and 9V.

But an output of the Arduino is HIGH +5V. So the motor will never get 9V.
To control it with an Arduino, you better place the motor at the collector of the transistor. And the emitter at ground. A pull-down is not needed, but you need a resistor from the Arduino to the base of the transistor.
The protection diode can be placed as a flyback diode over the motor.
593  Using Arduino / General Electronics / Re: Relay Switching on: August 07, 2012, 04:09:21 am
My advice to have a single line at the bottom for ground was wrong. Sorry.
You use the ground symbol, that makes it a lot easier.

I still don't understand how you use the incoming signals.
The resistor at the /RESET line was to ground, it should be to Vcc.
You connected Aref to Vcc, but the most standard way is to keep that open, with a capacitor to ground.
The 7805 must have those 100nF capacitors close to it, so I placed them next to it in the drawing.

I tried Fritzing a few times, so I gave it a try.
Now the picture is a lot larger, but the layout is more standard.
You can use my fritzing file if you like it.
594  Using Arduino / Networking, Protocols, and Devices / Re: How to Carrier Sense Multiple Access with Collision Detection on a serial port? on: August 06, 2012, 06:48:26 pm
Here is a diagram with delays in it :
CSMA is mentioned here :

But if you just use RX and TX, there is no carrier. And the CSMA protocol needs a carrier.
What do you need it for ?
Do you want to implement the amateur radio interface ?
I hope not that you are inventing it all over again.
595  Using Arduino / General Electronics / Re: Relay Switching on: August 06, 2012, 05:06:38 pm
Use two 100nF next (close) to the 7805.
And one (better two) 100nF at the ATmega328.
Somewhere should be a larger capacitor. So 100uF at the 12V of the 7805 is good, but also 100uF at the +5V is needed.

Sorry, but the D12 and D13 are not fixed. Normally is switch to ground, and pull-up resistor to +5V.
At D13, both the resistor and the switch go to +5V.
Pin D12, I don't understand what you want there. I have attached a drawing, but I don't know if that is what you need.
Is Pin A0 getting the full +12V ? If so, the ATmega328 will be broken instantly.

If you make your drawing with a bottom line as ground. The picture will become three times as large, but better to understand.
596  Using Arduino / General Electronics / Re: Relay Switching on: August 06, 2012, 02:47:29 pm
I don't know how the sensor is powered. Is that 10k going to ground, or should it go to +5V ?

You forgot the flyback diodes over the load. (search for flyback). (search for diode)

The 7805 needs 100nF on input and output.

The +5V has only 10uF and two 10nF. Can you make it 100uF and two 100nF ?
The 100uF can be shared by the 7805 and the ATmega328.
It might also be 22uF, but 10uF seems to me just a little to small.

I think D13 is not working. If the switch is to ground, the resistor of 10k should be a pull-up to 5V.

D12 has no pull-up? The internal pull-up is 20k. The switch will pull it down with 25k, the result is unpredictable.
597  Using Arduino / Programming Questions / Re: Change Code on the fly - submit commands faster (without loading) on: August 06, 2012, 02:36:45 pm
Oh, I see.

You could make a script, but that's complicated.
What if you make a single sketch that can do it all.....
The variable part can perhaps be stored as variables in EEPROM.
You can use avrdude to program the EEPROM.
598  Using Arduino / General Electronics / Re: can you power ac relay of an arduino on: August 06, 2012, 02:32:29 pm
For a 24V AC relay at DC, you might want to start with 12V.
If you use the AC relay with the same DC voltage, the coil could get too hot.
599  Using Arduino / General Electronics / Re: Question about serial on: August 06, 2012, 12:30:40 pm
Yes, and Yes.
Click "Design Files".
Click "Schematic (PNG)", or use the Eagle files in "".
See what that 6-pin header is about.... It's only RX, TX, and ground.
600  Using Arduino / General Electronics / Re: Question about serial on: August 06, 2012, 12:17:12 pm
MightyOhm geiger counter :
It contains a ATtiny2313, that's also a AVR microcontroller.
It's open source hardware, I like it!

Sure you can connect RX-TX and TX-RX to an Arduino, but there is a voltage problem.
Suppose two NiMH batteries are used. The voltage Vcc will be 2.4V.
The ATtiny2313 will work with 2.7V (normal version) or 1.8V ('V' version).
In the photo, I see a 'V' version.

So you have to adapt the RX TX voltages. With a ic or with transistors.
Pages: 1 ... 38 39 [40] 41 42 ... 68