Show Posts
Pages: [1] 2
1  Using Arduino / Motors, Mechanics, and Power / Re: Controlling Two 12v Fans off Arduino using one Power Adapter on: April 13, 2014, 03:13:53 pm
Great, Thanks!!!!
2  Using Arduino / Motors, Mechanics, and Power / Re: Controlling Two 12v Fans off Arduino using one Power Adapter on: April 13, 2014, 02:41:40 pm
Hey,
thanks for feedback.
The only transistors I have lying around are:
STP16NF06 or the P2N2222A
anything I can do with that? It's the usual near deadline (tomorrow morning) and trying to make it happen by then...
smiley

3  Using Arduino / Motors, Mechanics, and Power / Re: Controlling Two 12v Fans off Arduino using one Power Adapter on: April 13, 2014, 02:01:23 pm
Sure.
Here is a quick Fritzing diagram that shows what I am doing.
The Fans are represented as DCmotors and those FET Transistors in reality are the IRF530s.
Many thanks for your help
E
4  Using Arduino / Motors, Mechanics, and Power / Re: Controlling Two 12v Fans off Arduino using one Power Adapter on: April 13, 2014, 01:35:17 pm
Thank you dearly Grumpy Mike, do you think I should put that 100R resistor in the bunch just in case?
The fans will be working on and off for 10hours a day.
Best wishes

E
5  Using Arduino / Motors, Mechanics, and Power / Controlling Two 12v Fans off Arduino using one Power Adapter on: April 13, 2014, 01:22:25 pm
Hey everyone,
I know this topic comes out every so often.
Just wanted to ask if I am doing the right thing, in order to avoid overheating the board and the transistors.

I am running two Fans off my Arduino Mega, they are DC12v 0.14A each.
I am using two IRF 530 transistors to drive them, I have put a diode between each transistor's drain and the positive to the Vin of the board.
The board is powered through a 12V adapter, I am not trying to control the speed, just simple on and off.
At some point I thought about using a resistor between the transistor's source and the ground of the board, but I have noticed that the fans would stop working. I tried 10k Ohm and 1k ohm, they just wouldn't work.
Can I run them without using any resistors or would I risk overheating the circuit?
The whole thing will be housed in a carton box, that's why I am trying not to overheat anything.
Also, the fans go on every 7 seconds for 3 seconds then off.

Many thanks for your help

Best

Elso
6  Using Arduino / Motors, Mechanics, and Power / Controlling Reversible motor controller 24Vdc 15A with an Arduino and Maxuino on: March 03, 2014, 06:30:49 am
Hi there,
I am trying to control 4 DC motors (14.4 volt, about 10amp at peak) through 4 Reversible motor controller 24Vdc 15A like this one http://uk.rs-online.com/web/p/dc-motor-controllers/3639601/.

The Arduino will be controlled through Max/MSP's Maxuino, there I will be able to control every digital pin and set them on High or Low etc.

The way I was going to do this is by wiring Arduino to the Ffwd Rev and H, S, L to control the speed.
So far I have had experience in wiring normal small DC motors controlled via Arduino or Hbridge and I haven't seen the Ffwd and Rev controls, I was thinking about supplying PWM values through Max and in so control the speed, I am guessing the HSL is confusing me a bit.

Could anyone recommend how should I wire the Arduino to a single controller?
This would surely put me in the right direction in order to learn how to control the others.
Please let me know if you need more details or info, I am attaching one image of the controller, obviously I don't want to blow anything up and will keep the power of the Arduino separated from that of the the Motor and external Power Supplier.
Should I ground the Arduino too?
Many thanks in advance.

Best wishes

Elso
7  Using Arduino / Programming Questions / Re: Working with array of strings, PROGMEM question on: February 02, 2013, 01:15:03 pm
Thanks Krodal!
8  Using Arduino / Programming Questions / Re: Working with array of strings, PROGMEM question on: February 02, 2013, 12:29:13 pm
Thank you very much indeed guys for sharing your knowledge and opinion.
I can see I am simply scratching the surface of the Progmem and strings, I will solder together an new mini OLED tonight and will see if everything works correctly.

So far I have been only compiling to check that everything works, strange enough Arduino will always give me the same randomly calculated names and last names, is that normal? I mean it puts together names and last names once, then if I unplug it and plug it back either some minutes later or the day after, it gives me back names and last names with the same order it did before, as if it can only ramdomly calculate names and last names once.

Any ideas about it?

Thanks!

Elso
9  Using Arduino / Programming Questions / Re: Working with array of strings, PROGMEM question on: January 30, 2013, 12:30:59 pm
wow!
your code works like a charm!
 smiley-cool smiley-cool smiley-cool smiley-cool smiley-cool smiley-cool smiley-cool smiley-cool smiley-cool smiley-cool smiley-cool smiley-cool
Thanks!!!!!!!

Elso
10  Using Arduino / Programming Questions / Re: Working with array of strings, PROGMEM question on: January 30, 2013, 04:35:15 am
Okay...
I still seem to have a problem understanding the strings being 8 characters long, sorry, just being thick probably  smiley-lol
At the moment, looking at the tutorial I have created two lists and a buffer into which I copy one string at time that is being concatenated into a char, I have rewritten the previous code like this:
Code:
// include the library code:
#include <Adafruit_CharacterOLED.h>
#include <avr/pgmspace.h>

// initialize the library with the numbers of the interface pins
Adafruit_CharacterOLED lcd(6, 7, 8, 9, 10, 11, 12);

prog_char string_0[] PROGMEM = "MARK";   // "String 0" etc are strings to store - change to suit.
prog_char string_1[] PROGMEM = "FRANCIS";
prog_char string_2[] PROGMEM = "JOHN";
prog_char string_3[] PROGMEM = "ANDREW";
prog_char string_4[] PROGMEM = "ROBERT";
prog_char string_5[] PROGMEM = "SEAN";

prog_char string_6[] PROGMEM = "HAYES";   // "String 0" etc are strings to store - change to suit.
prog_char string_7[] PROGMEM = "LUDWIG";
prog_char string_8[] PROGMEM = "HARRISON";
prog_char string_9[] PROGMEM = "GRAND";
prog_char string_10[] PROGMEM = "SALTER";
prog_char string_11[] PROGMEM = "BOND";

// Then set up a table to refer to your strings.

PROGMEM const char *string_table1[] =    // change "string_table" name to suit
{   
  string_0,
  string_1,
  string_2,
  string_3,
  string_4,
  string_5 };

PROGMEM const char *string_table2[] =    // change "string_table" name to suit
{   
  string_6,
  string_7,
  string_8,
  string_9,
  string_10,
  string_11};
 
char buffer[30];    // make sure this is large enough for the largest string it must hold


long randNames; // random word taken from the group names
long randLastnames; // random last name
char finalWord[40];  // enough room for all strings together
int myLenght; // lenght of the final word
//int myCentre; // coordinates to place the final word in the centre

char* mySpace = " ";

void setup(){
Serial.begin(9600);
}

void loop(){
  randNames = random (320); //picks a synonym
  randLastnames = random (320); //picks an adjective
 
  finalWord[0] = 0;          // start with a null string:
  strcpy_P(buffer, (char*)pgm_read_word(&(string_table1[randNames])));
  strcat (finalWord, buffer); //add third string
  strcat(finalWord, mySpace);   // add second string, the empty space string
  strcpy_P(buffer, (char*)pgm_read_word(&(string_table2[randLastnames])));
  strcat(finalWord, buffer);   // add first string
 
  myLenght = strlen(finalWord);
 
  Serial.println(finalWord);
   
}

This should give me the final word as a result of Names + Lastnames, one at time, I guess.
Instead I cannot see anything printed on the serial monitor, for the moment I am not trying to write to the OLED.

Can you spot if there is anything wrong in it?

Many thanks!

Elso
11  Using Arduino / Programming Questions / Re: Working with array of strings, PROGMEM question on: January 30, 2013, 02:56:41 am
Thanks for the help,
the OLED display doesn't have an SD card unfortunately, it is a Winstar OLED 16x2 like this model:
http://www.rapidonline.com/Electronic-Components/16x2-Oled-Display-Yellow-80x36x10mm-57-2292
pins are grouped differently on my model, but that is a detail.
Do I need to make each string 8 characters long?
I am going through the tutorial you linked, thanks for the resource!
I will let you know how it goes!

Many thanks

Best

Elso
12  Using Arduino / Programming Questions / Working with array of strings, PROGMEM question on: January 29, 2013, 05:02:53 pm
Hi there,
following my previous topic (http://arduino.cc/forum/index.php/topic,145342.msg1091993.html#msg1091993) regarding the maximum number of strings I can place in an array, I am trying to use the PROGMEM to store the string arrays I have in the Flash memory; the main problem is that I don't k ow if this is the right procedure to follow in my case.

What I am trying to achieve is:
to have two arrays containing strings, about 300 strings each, each containing between 3 to 8 letters. Each time the sketch run, two strings are randomly selected from the two arrays (one pulled from each one of them); then they are concatenated and visualised on an OLED display, using the Adafruit library (https://github.com/ladyada/Adafruit_CharacterOLED).
As those are too many strings and I already had some memory issues with my script (I am using an Arduino Mega 2560) I would like to move those strings to the flash memory.
I went to the PROGMEM tutorial page (http://www.arduino.cc/en/Reference/PROGMEM) but it seems to me that I need to copy the string table / array to the RAM buffer.

My questions are:
- do I need to copy the entire array or simply the string randomly selected?
- do I need to clear that buffer once I don't need the string anymore to make space for another one?

Many thanks for your help, I am attaching a shorter version of my code

Code:
// include the library code:
#include <Adafruit_CharacterOLED.h>

// initialize the library with the numbers of the interface pins
Adafruit_CharacterOLED lcd(6, 7, 8, 9, 10, 11, 12);

long randNames; // random word taken from the group male names
long randLastnames; // random last name
char finalWord[40];  // enough room for all strings together
int myLenght; // lenght of the final word

char* maleNames[]={"FRANK", "JOHN", "MARK", "LORIS", "MICHAEL", "....,
 };

char* maleLastnames[]={"STEIN", "OLLIS", "GRAND", "MERLIN", "KRANZ", "...


 };

char* mySpace = " ";

void setup(){
Serial.begin(9600);
}

void loop(){
  randNames = random (320); //picks a random name
  randLastnames = random (320); //picks a random last name
 
  finalWord[0] = 0;          // start with a null string:
  strcat(finalWord, maleLastnames[randLastnames]);   // add first string
  strcat(finalWord, mySpace);   // add second string, the empty space string
  strcat (finalWord, maleNames[randNames]); //add third string
 
  myLenght = strlen(finalWord);

  if (myLenght < 16) {// if the final word doesn't exceed 16 spaces
  lcd.setCursor(0, 0); //positions the cursor on the first row
  lcd.print(finalWord); //prints the word picked from the group

  delay(10000); // wait a bit for ppl to read
  lcd.clear(); // clears the display
  delay(5000); // dark/empty display
  }
   
}
13  Using Arduino / Project Guidance / Re: Max number of Strings in a char array on: January 28, 2013, 09:15:54 am
Thanks!
14  Using Arduino / Project Guidance / Re: Max number of Strings in a char array on: January 27, 2013, 07:23:56 pm
Thanks Paul,
ops, yes, indeed I meant strings, not Strings...
 smiley-red
The length of each string varies from 2 to 10 characters.
Since my arrays of strings won't change after the program runs, I guess I should store them both in the Flash memory through the PROGMEM, am I right?

Best

Elso
15  Using Arduino / Project Guidance / Max number of Strings in a char array on: January 27, 2013, 04:36:46 pm
Hi there,
I am controlling an external LCD display, I have two char arrays with words, I randomly extrapolate words off each one of them, the concatenate them and visualise them on the display.
I was wondering, how many can I store in the Arduino Mega (which will run without laptop) before having to use external RAM?
Also, as I haven't used such RAM before, could you please advice what is the one I should buy?

Many thanks

Best

Elso
Pages: [1] 2