Show Posts
Pages: 1 2 3 [4] 5 6 ... 14
46  Using Arduino / General Electronics / Re: Mosfet gate voltage on: February 23, 2013, 08:20:02 am
thanks majenko,

I do have a 100 ohm series resistor between the I/O pin and the mosfet gate, but I'll try a 220 ohm resistor.

You are right about the breadboard. I am planning to solder the entire circuit into a perf board, but I just wanted to use a breadboard first to test my circuit wiring because I don't have many spare parts.

If I insert the ATmega chip back into the arduino board, power the board from the same batteries and regulator and wire the I/O pin to the mosfet gate the motor runs as it should and I measure 5V between the I/O pin and mosfet gate. Any idea why that works but the standalone arduino doesn't?  Could it be the values of the decoupling capacitors that the arduino uses? That's one more thing I would like to check before I solder the circuit into the perf board. 

47  Using Arduino / General Electronics / Re: Mosfet gate voltage on: February 23, 2013, 06:18:17 am
I edited my first paragraph. I should have clarified that the voltage to the mosfet gate from the output pin is 2v and the rest of the circuit measures 5v where it should measure 5v. I'm having a hard time understanding why when I use the same ATmega chip, same mosfet motor circuit, and same power supply works as expected when the chip is in the arduino board but doesn't work when I have the Atmega chip on the breadboard as a standalone. When I say "works" I mean that I measure 5v between output pin and mosfet gate and the motor is running.
Thanks for the replies.
48  Using Arduino / General Electronics / Mosfet gate voltage on: February 22, 2013, 08:46:07 pm
When I apply power to my breadboarded ATmega 328 with a small DC motor driven through a logic level mosfet, the voltage measures about 5v then drops to around 2v after 4 or 5 seconds. EDIT: I'm referring to the voltage between the output pin and mosfet gate. The rest of the circuit measures 5v where it should measure 5v.

I'm using 6 AA rechargeable NiMH batteries through a 7805 regulator decoupled with .1uF and 22uF on the input and .1uF and 10uF on the output. Edit: 1.5A regulator
Mosfet wiring and datasheet:
see attached photo. I also put a 100 Ohm resistor in series from output pin to mosfet gate per Crossroads and others in other posts.
ATmega 328 wiring:


int StartSpeed=0; // you have to experiement to find the magic number.
int StopSpeed=255;//Again experiment ok
const int MotorPin=3;
int i=StartSpeed;
unsigned long TimeNow;
unsigned long PreviousMillis=0;
long Delay=10; // experiment with the value ok, the lower the value the steeper the gradiend of speed

void setup()

void loop()
  if (i<StopSpeed)
    unsigned long CurrentMillis=millis();
    if (CurrentMillis-PreviousMillis>=Delay)
      i ++;

Things I have tried to fix:

1. 0.1uF capacitor in series with the flyback diode
no change

2. switching regulator
no change

3. changing output pins
no change

4. changing ATmega 328
no change

5. changing code to non-PWM using just digital write high
digitalWrite(motorPin, HIGH);
no change

6. Swapping out motor
no change

7. swapping LED and current limiting resistor for motor
works fine

8. using same code, same power, and same ATmega 328 plugged into the Arduino
works fine!
This is what puzzles me most because I assumed that I had damaged the two ATmega 328's that I am using, but this tells me that they aren't damaged.

Any suggestions are greatly appreciated. Thanks in advance.
49  Using Arduino / Programming Questions / Re: what does this mean 'val is not declared in this scope'? on: February 10, 2013, 08:56:44 am
val1 = analogRead(potpin1);            // reads the value of the potentiometer (value between 0 and 1023)
(it comes here)

Delete that second line or make it a comment. Also you have imported the servo library twice.

50  Using Arduino / Motors, Mechanics, and Power / Re: Logic Level Mosfet on: February 05, 2013, 06:58:42 pm
Some surface mount packages like DPAK aren't
particularly small and can be soldered onto strip board fairly easily, note.
Good tip. I was wondering about that. thanks
51  Using Arduino / Motors, Mechanics, and Power / Re: Logic Level Mosfet on: February 05, 2013, 02:16:53 pm
Thanks Lefty.

When I search a company like Mouser or Digi Key for a logic level mosfet, what filter am I looking for?
52  Using Arduino / Motors, Mechanics, and Power / Logic Level Mosfet on: February 05, 2013, 01:49:27 pm
Is the FQP30N06L a logic level mosfet? This is from a post that is about a year old referring to the the FQP30N06L:,102455.0.html

Both those MOSFET types require 10V of gate drive, they won't work properly with 5V - they might turn on a little bit, but they won't do so reliably.

When looking for MOSFETs for direct drive from logic level (5V) signals, you must get logic-level MOSFETs.  The key spec on the datasheet is the value of Vgs at which the Rds(on) is specified.  "Rds(on) at Vgs=4.5V" is typically the specification to look for.  4.5V is used to allow for below-spec 5V supplies.  If the only Rds(on) values are given for Vgs=10V, or if Vth is specified as "2--4V" then is NOT logic level.

Vth (threshold voltage) confuses a lot of newcomers - its the voltage at which the device switches OFF.  For logic level devices it will typically be 0.5 to 1.0V or so.

I bought that mosfet from Sparkfun without looking at the data sheet because they claim that it is logic level.

Here are some screenshots of the data sheet that I don't understand.

The first screenshot leads me to believe that is is logic level because of the R
characteristics, but the second screenshot leads me to believe that it isn't logic level. Can somebody please enlighten me?
53  Using Arduino / Motors, Mechanics, and Power / Re: Wishing my Tamiya Motors Had More Drive on: February 03, 2013, 08:02:29 pm
It would be a huge help to get rid of the weight of that lantern battery and to have front wheels that can actually turn instead of dragging on a high friction surface.
54  Using Arduino / Sensors / Re: MaxSonar Noise Problem? on: February 01, 2013, 04:22:45 pm
This wiring diagram is from Maxbotix to help suppress noise.
55  Using Arduino / Sensors / Re: MaxSonar Noise Problem? on: February 01, 2013, 05:55:41 am
Can you post your code and schematic? That would be a huge help for diagnostics.
56  Using Arduino / Project Guidance / Re: FTDI Debugger on: January 30, 2013, 11:24:08 pm
or because my custom Arduino based boards have a +5v voltage regulator.. which needs more than +5 to power it).. so I power externally.. but I still want my FTDI cable connected (RX/TX/GND) so I can see whats going on in my serial monitor.. or do serial communications..etc..
Yea that's the only reason I would like the FTDI cable connected as well, and I'll also be using a 5V regulator.  Good to know it isn't letting the smoke out. Thanks
57  Using Arduino / Project Guidance / Re: FTDI Debugger on: January 30, 2013, 07:28:13 pm
I disconnected the 5v from the FTDI cable and put the 1k ohm resistors in series with the rx-tx and tx-rx, but am still getting 1.9 V to the 5V rail. Any other ways to get rid of that? Or will it not damage my chip or components with a separate battery supply to the circuit?
58  Using Arduino / Sensors / Re: Help with the SparkFun PIR sensor on: January 30, 2013, 06:35:58 pm
double check your connections from your arduino to the breadboard. looks like you might have 5v connected to the GND rail on the breadboard. And I don't see where you have anything connected to ground on the arduino. hard to tell from that angle though
59  Using Arduino / Project Guidance / Re: FTDI Debugger on: January 29, 2013, 10:10:29 pm
What you can do to help with conflict like when your standalone 328p and external circuitry is being powered up with a battery or other independent voltage source but the FTDI module is not plugged into the PC, is to use two series 1K ohm resistors in each of the Rx and Tx signals going to your standalone. That will prevent any 'back door' current flow in that situation.

Thanks Lefty. I previously just tried unplugging the 5v from the FTDI, but my "test power" led was still dimly lit. You say that a 1K resistor will work from RX of FTDI to TX of uC and another series 1K resistor from TX of FTDI to RX of uC while the FTDI is connected to the PC and the rest of the board is under external power? I just want to make sure I understand you.
60  Using Arduino / Project Guidance / FTDI Debugger on: January 29, 2013, 09:37:14 pm
I have set up a breadboard arduino  (ATmega 328 with Arduino Uno Optiboot) much like the picture below according to this tutorial:

In order to program, I wired up the FTDI Basic Breakout like this:

ftdi                     arduino
5v         -------->      5v
GND      -------->     GND
TX         -------->     RX
RX         -------->     TX
DTR (RST)   ----->    Reset     must connect through a .1uF ceramic cap

I uploaded this code and it works fine.

int led = 9;

// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second

For future use, I would like to use a power supply for the chip and inputs/outputs other than the USB power supplied by the FTDI breakout board, but I would like to use the FTDI breakout board connected to my computer for debugging. How can I connect the FTDI board without the conflicting power issues?
Pages: 1 2 3 [4] 5 6 ... 14