Show Posts
|
|
Pages: 1 [2] 3 4 ... 9
|
|
19
|
Using Arduino / Project Guidance / Re: Control PWM fan speed depending on tempature
|
on: March 19, 2013, 10:39:13 am
|
I gather that the PWM would be in the range of 0-255 when writing out to it from the ardunio? int pwmPin = 9; // fan PWM -> connected to digital pin 9 int pwmVal = 0; int DEBUG = 1; // DEBUG counter; if set to 1, will write values back via serial
void setup() { pinMode(pwmPin, OUTPUT); // sets the pin as output
if (DEBUG) { Serial.begin(9600); } }
// Main program void loop() analogWrite(pwmPin, pwmVal);
if (DEBUG) { // If we want to read the output if (pwmVal != 255) { pwmVal += 10; Serial.print(pwmVal); // Print red value Serial.print("\t"); // Print a tab } else { Serial.print('at max high'); // Print red value Serial.print("\t"); // Print a tab } } delay(wait); // Pause for 'wait' milliseconds before resuming the loop }
|
|
|
|
|
21
|
Using Arduino / Project Guidance / Control PWM fan speed depending on tempature
|
on: March 18, 2013, 08:09:48 pm
|
I am looking at getting 2 80x10mm PWM fans. However, i am looking at controlling the fan speed with the arduino via the PWM pins. I found the following diagram that seems to be what i am looking for in order to hook the fan up to the Arduino:  Does that seem correct? I will be using the DS18B20 Thermometer Temperature Sensor in order to see how fast i need to spin the fan. Any helpful feedback would be great!  David
|
|
|
|
|
22
|
Using Arduino / Networking, Protocols, and Devices / Arduino Ethernet sending over sketch via FTDI friend
|
on: March 13, 2013, 07:19:13 pm
|
Hey all i am trying to send over my code to my Arduino Ethernet board via the Adafruit FTDI friend. I am using the 1.0.4 version of the IDE and have the following settings: Tools -> Board -> Arduino Ethernet Tools -> Serial Port -> COM 3 The sketch is sent over to the board without problems or errors... however i am unable to see the IP of the board when i check my "attached devices" in my routers settings menu. Here is a snip of the code i used: byte ip[] = { 192, 168, 9, 199 }; //Manual setup only byte gateway[] = { 192, 168, 9, 1 }; //Manual setup only byte subnet[] = { 255, 255, 255, 0 }; //Manual setup only
// if need to change the MAC address (Very Rare) byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
EthernetServer server = EthernetServer(199); //port 199
void setup(){ Serial.begin(9600);
//Pins 10,11,12 & 13 are used by the ethernet shield
pinMode(2, OUTPUT); pinMode(3, OUTPUT); pinMode(4, OUTPUT); pinMode(5, OUTPUT); pinMode(6, OUTPUT); pinMode(7, OUTPUT); pinMode(8, OUTPUT); pinMode(9, OUTPUT);
//Ethernet.begin(mac); Ethernet.begin(mac, ip, gateway, subnet); //for manual setup
server.begin(); Serial.println(Ethernet.localIP());
}
Here is a screen shot of the router settings:  And this is my arduino ethernet hookup:  What could i be missing?
|
|
|
|
|
24
|
Using Arduino / Project Guidance / Control Car A/C unit contols
|
on: January 21, 2013, 01:54:50 pm
|
Hey all i am looking to do a modification to my current A/C and heat control unit. I would like to control it via the Arduino. Here are some images of what my a/c and heat control unit knobs look like:     All i am looking to do is be able to control them via my PC using the arduino. However, i am unsure of what i can use to either: (1) Turn the individual 3 knobs like i would with my hand using some type of solenoid? (2) plug into the output? and see how i can mimic the turning via the back of the control unit pin wires. Would need help in this category with what i need in order to "listen" to what its doing every time i turn a knob. I will be customizing a dash to house my tablet and therefore it will overlap the air control knobs so i am just looking for a better way in using them since it will be hard to get to them after i install the tablet. Thanks for your time! David
|
|
|
|
|
26
|
Using Arduino / Microcontrollers / Re: Bootloader without turning pins on/off when booting up
|
on: November 07, 2012, 03:58:16 pm
|
If your relays are "active-low", you can avoid momentary ON glitches by setting the output state BEFORE you set the pin to an output: digitalWrite(pin, HIGH); pinMode(pin, OUTPUT); Should that not be: digitalWrite(pin, LOW); pinMode(pin, OUTPUT);
Notice the "low" part instead of "high"? High would turn it on?
|
|
|
|
|
27
|
Using Arduino / Microcontrollers / Re: Bootloader without turning pins on/off when booting up
|
on: November 05, 2012, 06:44:15 pm
|
The relay board is powered by an external power supply. However, i DID have to attached the ground to the arduino also because when i did not, they relays did not come on after 5v was sent from the pins. After hooking up the arduinos' ground also, it worked.
There should be two separate "ground" connections on the relay board: one for the negative side of the power a supply that you use to power the relay board, and one for the negative side of the opto isolator inputs - only this one needs to be connected to Arduino ground. 2 separate grounds yes. One from the 5v/ground of the USB to the arduino nano and then ground from the arduino pin to the ground of the power supply. The power supply 5v/ground to the relay board.
|
|
|
|
|
28
|
Using Arduino / Microcontrollers / Re: Bootloader without turning pins on/off when booting up
|
on: November 05, 2012, 06:10:28 pm
|
Unless they are pulled to a safe level those pins are floating for a while after the board is powered up, they could then do anything and you relay board will follow suite. If the board uses any form of latched logic you are in trouble.
Do you have a schematic of the relay board?
Not true about the possibility of floating input condition. Most of those asian relay boards use a 'current loop' input through the optoisolators input led and are an active low input to turn on the relay (arduino output pin needs to be set to LOW to turn on a relay), so only a +5vdc wire (from the arduino) and a wire(s) from the arduino output pin(s) need to be wired to the relay board to operate the channels, no pull-up or pull-downs required and no arduino ground wire is needed to just operate the optoisolator channels. However the relay board itself does require +5vdc and ground to power the relay coils so if one is going to power the relay coils with the arduino's +5vdc voltage source then a ground is also required from the relay board to a arduino board. However that defeats the advantage of having optoisolators in the first place, so that is rather strange. However most of these relay boards I've seen have a jumper clip so that if the jumper is removed The arduino's +5vdc is not wired to the relay coil circuit but just to the optoisolators input led pins, so you are then free to use an external source of +5vdc voltage to provide power for the relay coil circuits and take full advantage of the isolation properties of the optoisolators.
Also if your going to be using the android's +5vdc to power the relay board then you must also connect the androids ground to the arduino ground for the opto input circuits to work properly, that is probably the source of your problems.
Here is a a typical asian relay board (a single channel version) which has a schematic drawing that should show better what I was trying to explain above. http://www.ebay.com/itm/251061549983?ssPageName=STRK:MEWAX:IT&_trksid=p3984.m1423.l2649
Lefty
_____ Rob
The relay board is powered by an external power supply. However, i DID have to attached the ground to the arduino also because when i did not, they relays did not come on after 5v was sent from the pins. After hooking up the arduinos' ground also, it worked.
|
|
|
|
|
29
|
Using Arduino / Microcontrollers / Re: Bootloader without turning pins on/off when booting up
|
on: November 05, 2012, 06:05:52 pm
|
Here is my code: int relay_1 = 14; //analog pin A0 -> digital to relay 1 [for door unlock] int relay_2 = 15; //analog pin A1 -> digital to relay 2 [for door lock] int relay_3 = 16; //analog pin A2 -> digital to relay 3 [My garage door UP/DOWN] int relay_4 = 17; //analog pin A3 -> digital to relay 4 [Wifes garage door UP/DOWN] int relay_5 = 18; //analog pin A4 -> digital to relay 5 [n/a] int relay_6 = 19; //analog pin A5 -> digital to relay 6 [n/a] int relay_7 = 13; //Digital pin D13 to relay 7 [n/a] int relay_8 = 12; //Digital pin D12 to relay 8 [n/a] String readString;
void setup() { pinMode(relay_1, OUTPUT); // sets the analog pin A0 to digital as output [for door unlock] pinMode(relay_2, OUTPUT); // sets the analog pin A1 to digital as output [for door lock] pinMode(relay_3, OUTPUT); // sets the analog pin A2 to digital as output [My garage door up/down] pinMode(relay_4, OUTPUT); // sets the analog pin A3 to digital as output [Wifes garage door up/down] pinMode(relay_5, OUTPUT); // sets the analog pin A4 to digital as output [n/a] pinMode(relay_6, OUTPUT); // sets the analog pin A5 to digital as output [n/a] pinMode(relay_7, OUTPUT); // sets the digital D13 as output [n/a] pinMode(relay_8, OUTPUT); // sets the digital D12 as output [n/a] Serial.begin(115200); }
void loop() { while (Serial.available()) { delay(1); if (Serial.available() >0) { char c = Serial.read(); readString += c; } } if (readString == "frontDoorUNLOCK") { digitalWrite(relay_1, HIGH); delay(1000); digitalWrite(relay_1, LOW); Serial.println("unlocked"); } else if (readString == "frontDoorLOCK") { digitalWrite(relay_2, HIGH); delay(1000); digitalWrite(relay_2, LOW); Serial.println("locked"); } if (readString == "myGarage") { digitalWrite(relay_3, HIGH); delay(500); digitalWrite(relay_3, LOW); Serial.println("done"); } else if (readString == "wifesGarage") { digitalWrite(relay_4, HIGH); delay(10000); //Needed to bypass damaged sensors on the garage door digitalWrite(relay_4, LOW); Serial.println("done"); } if (readString == "testRelay") { digitalWrite(relay_1, HIGH); delay(500); digitalWrite(relay_1, LOW); digitalWrite(relay_2, HIGH); delay(500); digitalWrite(relay_2, LOW); digitalWrite(relay_3, HIGH); delay(500); digitalWrite(relay_3, LOW); digitalWrite(relay_4, HIGH); delay(500); digitalWrite(relay_4, LOW); digitalWrite(relay_5, HIGH); delay(500); digitalWrite(relay_5, LOW); digitalWrite(relay_6, HIGH); delay(500); digitalWrite(relay_6, LOW); digitalWrite(relay_7, HIGH); delay(500); digitalWrite(relay_7, LOW); digitalWrite(relay_8, HIGH); delay(500); digitalWrite(relay_8, LOW); } readString = ""; delay(100); }
|
|
|
|
|
30
|
Using Arduino / Microcontrollers / Re: Bootloader without turning pins on/off when booting up
|
on: November 05, 2012, 11:10:36 am
|
"would it still allow me to program and send it over to the arduino through the IDE?"
"File:Upload Using Programmer" is part of the IDE. It is just a different path for getting programs into the uC - instead of the Serial Rx/Tx pins, it uses the SPI pins. You connect a AVR ISP to the board instead of using the onboard USB/Serial adapter.
After uploading the bootloader then can i switch back to the USB since my program sends commands/listens to the Arduino serial?
|
|
|
|
|