Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 11
61  Using Arduino / Motors, Mechanics, and Power / Re: MOSFET for DC motors on: January 09, 2013, 07:26:50 am
Thanks for the reply but I'm not sure on your values.

150 ohm to limit below 40mA, so 5 / 0.150 = 33mA - OK!

What happens with R1 - in the linked circuit it's a pull up resistor right? So a high value is intended to keep current low so that the transistor grounding wins - or have I got how that works exactly wrong?  smiley-confuse
62  Using Arduino / Motors, Mechanics, and Power / MOSFET for DC motors on: January 09, 2013, 05:33:18 am
I've got two automotive fans I'm wanting to drive from an arduino.

The fuse that supplies both of them is 50Amp.

So if I take that as the maximum both will draw, I plan to split the fans into two using MOSFETs.

I'm looking at the datasheet for the IRF1405 - and I think this will do, but I'm just tossing up whether I need to add a transistor and drive it using battery voltage or direct from the pins.
The datasheet is here:

I think I need a current limiting resistor between the arduino pin and the transistor - but how do I size that resistor?

See image for the circuit I'm planning to use - any problems / thoughts?

The MOSFET is different in the schematic linked, so I wonder if the resistor values change compared to the jaycar one I linked to? (it can handle higher current so should be ideal with a transistor).

Also, the datasheet shows the gate threshold min max as 2 and 4 volts. Is 2 the off value and 4 the 'barely on' value - and 12 the 'it's full on' value?
Using the transistor (2n3904) - I'll want to get 4 - 12V modulating...
63  Using Arduino / General Electronics / Re: Stall Current on: January 08, 2013, 01:21:16 am
They still seem very low and this is where I'm struggling - I want to pick a MOSFET to drive them.
The fuse is 50A. If the stall current is supposed to be '3 - 8x' the operating current, then 8Amps is very low.

My DMM is fused only for 10A - a 50A fuse suggests I shouldn't measure the current..
64  Using Arduino / General Electronics / Re: Stall Current on: January 08, 2013, 01:07:07 am
What sort of fans are they? If they use brushed DC motors, you can work out the stall current by measuring their resistance and dividing it into the supply voltage. Measure the resistance several times, rotating the shaft a little between readings, and take the lowest resistance.

I think they are brushed DC - typical radiator fan motors.

The resistance differs between them - the measurement I took was 1.8ohms and 2.6ohms

So, taking your calculation, 12 (lowest supply voltage) / 1.8 ohms = 0.15A ?
12 / 2.6 = 0.21A

That seems stupidly low.
They have a 50A supply fuse on them.
65  Using Arduino / General Electronics / Stall Current / MOSFET / Transistor selection on: January 06, 2013, 05:05:44 am
I'm looking to use an arduino to control fans.

I'd like to do better than a simple relay, but there's also the issue of stall current. I haven't tackled anything to do with stall current before, but reading this thread:,5325.0.html

Made me think that those car relays are typically rated for around 30A. It's already got a controller in it that appears to operate them at a medium.

What do typical designs do for start up / stall current? The relays that are in there appear to not have failed in the many years it's been running. Perhaps it's the case the fans combined do not draw > 30 A at start up ?

66  Using Arduino / Programming Questions / Re: PROGMEM in the Arduino 1.0.1 IDE on: January 05, 2013, 06:21:28 pm
That fixed the bulk of the errors, there's still some errors hanging around.
'error: cannot convert 'const char*[15]' to 'const char **' for argument to 'byte menu_selection(const char**, byte)'

The function is used to display a menu produced from an array:
Line 3322: byte menu_selection(char ** menu, byte arraySize)

I'm using it as below:
byte menu_selection(const char ** menu, byte arraySize)
  byte selection = 1; // Menu title takes up the first string in the list so skip it
  byte screenChars = 0;  // Characters currently sent to screen
  byte menuItem = 0;     // Menu items past current selection
  boolean exitMenu = false;
  boolean forceExit = false;

  // Note: values are changed with left/right and set with middle
  // Default selection is always the first selection, which should be 'Exit'

  lcd.print((char *)pgm_read_word(&(menu[0])));
  forceExit = delay_reset_button();  // make sure to clear button

The array being passed in is as below:
const char displayMenu[6][13] PROGMEM = {"Display menu", "Exit", "Contrast", "Metric", "Fuel/Hour", "Font"};
const char adjustMenu[11][12] PROGMEM = {"Adjust menu", "Exit", "Tank Size", "Fuel Cost", "Fuel %", "Speed %", "Out Wait", "Trip Wait", "Tank Used", "Tank Dist", "Eng Disp"};

They were defined as:
prog_char *adjustMenu[] PROGMEM = {"Adjust menu", "Exit", "Tank Size", "Fuel Cost", "Fuel %", "Speed %", "Out Wait", "Trip Wait", "Tank Used", "Tank Dist", "Eng Disp", };
67  Using Arduino / Programming Questions / Re: Need help on SoftwareSerial (+SIND:0) on: January 05, 2013, 06:11:56 pm
You should add this to the code to get an idea of what is being seen:

Get rid of that, it's just giving you needless numbers (telling you it's looping).

      incoming_char =;
Add Serial.println(incoming_char)

That'll give you a new line with the received character in Serial monitor.

The \0 at the end of at_buffer is a string null termination character.

68  Using Arduino / Programming Questions / Re: Need help on SoftwareSerial (+SIND:0) on: January 05, 2013, 08:07:35 am
Is it no array in sketch?

I do not really understanf the readATString function, how the caracter are "compiled" in at_buffer.

I am very block at this point.

Many thankf for your help

You aren't using an array with this line of code:
if (at_buffer == "+SIND:0") Serial.print("SIM card remove");

You were given a valid answer earlier:
You need to look at "strcmp"

What did you find when you looked into strcmp?
69  Using Arduino / Programming Questions / Re: Problems with Serial Bus on: January 05, 2013, 08:03:44 am
The chip isn't receiving \n from you, so doesn't exit the while loop..
70  Using Arduino / Programming Questions / Re: Problems with Serial Bus on: January 05, 2013, 07:32:47 am
Hmm. How much SRAM does your Arduino have?
71  Using Arduino / Programming Questions / Re: Need help on SoftwareSerial (+SIND:0) on: January 05, 2013, 07:29:32 am
But now I have big difficulties ti understand how to store and work specialy with those value
Your post definitely needs some clarity added to it (more of the code), and perhaps some of what you have tried?

The first thing you need to test is the result of 'incoming_char'- so Serial.print it. I bet it's not the string you are testing for, I'd suggest it's just one of the characters of the string you are expecting.
72  Using Arduino / Programming Questions / PROGMEM in the Arduino 1.0.1 IDE on: January 05, 2013, 07:11:56 am
I'm utilising the ODBuino project here,
To rewrite to use it for a similar but different protocol purpose.

I know the code for that compiles fine on Arduino 0022 as I did have it working there previously.

The compiler in 1.0.1 is throwing a heap of errors mainly due to the PROGMEM prog_char deprecation that's occurred.

I've gone through and modified the lines such as line 759:
prog_char pctd[] PROGMEM="- %d + "; // used in a couple of place

const char pctd[] PROGMEM = "- %d + "; // used in a couple of place

I get problems like this:
prog_char select_no[]  PROGMEM="(NO) YES "; // for config menu
prog_char select_yes[] PROGMEM=" NO (YES)"; // for config menu

Changed to:
const char select_no[]  PROGMEM = "(NO) YES "; // for config menu
const char select_yes[] PROGMEM = " NO (YES)"; // for config menu

Gives an error from function menu_select_yes_no, which is programmed as:
byte menu_select_yes_no(byte p)
  boolean exitMenu = false;

  // set value with left/right and set with middle
  exitMenu = delay_reset_button();  // make sure to clear button

      exitMenu = true;


    exitMenu |= delay_reset_button();
  while(!MIDDLE_BUTTON_PRESSED && !exitMenu);

  return p;

The error given is 'invalid conversion from const char* to char*' - this would relate to the lcd_print_P line, which takes the const char "select_yes" and prints to LCD.
void lcd_print_P(char *string)
  char c;
  while( (c = pgm_read_byte(string++)) )

I think the problem is actually the code - lcd_print_P gets a ? pointer? to a string and needs to read it?
73  Using Arduino / General Electronics / Re: Serial Comms on: December 31, 2012, 06:39:47 pm
I found an issue in how I connected to the optocoupler that was holding it on when it should not have.

Now I have it switching on / off as it should on TX.
RX I'm not so confident is working (I'm still not receiving a response as desired).

When I hold the K line low (direct short to ground) RX reads 1.10V. When I release it, RX reads 3.69V.

I've swapped the 330ohm resistor for a 510 ohm resistor, but that's giving me 2.59V and 0.5V.

I need that short to ground to read closer to 0 I think for the serial library to read it correctly (as a logical 1) - so why can't I get it to show 0V exactly using a 330ohm as the pull up to VCC?
74  Using Arduino / General Electronics / Serial Comms on: December 31, 2012, 01:41:52 am
I'm taking a stab at the attached PDF trying to go to arduino.
I'm not planning on using the line labelled L, and I've replaced the FT232BM with an arduino.

I'm using SoftwareSerial as it's a non standard baud rate at 15625 baud, and I've added rough timing for that to the library.

I've tried connecting but I don't get any data back - so I've taken the circuit connected the K line to a multimeter intending to see the line dip below 1V for 200ms x 7, however during that bit of the code, the line is around 8.35V.
When idle the line sits at 8.95V.

My thought is the RX line is holding it high how I have wired it - so I'll describe it.

I have replaced SD601 with BC337, I've got the K line coming into the circuit and it's held high with a 1K resistor. On that same line of the breadboard, I've got two jumpers one takes the signal to the transistor to be grounded, the other goes to the RX optocoupler.
I believe somewhere amongst this is what is holding it high (I can't see what I'd call a logic 0 in my testing).

Any thoughts based on the schematic what might be a problem? I assume the schematic to be correct though I did look at the 1k to ground at the base of the transistor as well - changing it to be inline did nothing.
75  Using Arduino / Programming Questions / define constant with two hex values, and naming arrays? on: May 19, 2012, 10:28:29 pm
Can I define a constant variable with two hex values?

#define PARAM_1 0x01 0x09
#define PARAM_2 0x09 0x05


And then

will that print 0x01 0x09 to the target ?

Then I want to name them for display on LCD - but for that I want an array:
names[PARAM_1] = 'My Disp Text';
names[PARAM_2] = 'My Next Text';
(I'd like to look at the array with the hex constant to find the name) - as names[0x01 0x09] - I know that's not going to work..) -

Any thoughts on the array?
Pages: 1 ... 3 4 [5] 6 7 ... 11