Show Posts
|
|
Pages: [1] 2
|
|
2
|
Using Arduino / Displays / Re: LCD messes up whenever my relay turns on
|
on: April 21, 2011, 08:58:13 pm
|
|
Hey guys, still can't figure it out.
I checked all my connections, the diodes are the right way. Is there anything I can do to help see what is exact source of the problem?
I have no idea what to do at this point. Remember, it only starts bugging out when the relay is activated and completes the load to the wall outlet.
|
|
|
|
|
3
|
Using Arduino / Displays / Re: LCD messes up whenever my relay turns on
|
on: April 19, 2011, 02:44:59 pm
|
  Ok here's a pic of the relay. There is a 1N4148 diode next to the 10k resistor but you can't see it. The 3 leads (green,black,red) go into the arduino. I guess the only thing that I deviated from was that I didn't use a 3 pin screw terminal for those leads, I just soldered the wires right to the PCB. I'll post the circuit diagram once I get to a scanner.
|
|
|
|
|
5
|
Using Arduino / Displays / Re: LCD messes up whenever my relay turns on
|
on: April 18, 2011, 10:35:30 pm
|
|
Sorry. I haven't plugged anything into the outlet that the relay controls yet. The relay is a 30A SPST relay that allows me to plug things into a GFCI outlet, which is powered by that gray cord and plugs into the wall. Eventually, I will plug a 1000W Grow Light into the relay box.
When the relay flips to the ON position and is sourcing from 120V, things get messy. I still haven't tested it when there is a load (the Growlight) plugged into the circuit that the relay is controlling. So for now, I can't even get the GFCI outlet to work either. Sometimes, even the GFCI outlet is tripped and shuts off on itself so I'm guessing that it's a problem with current.
|
|
|
|
|
7
|
Using Arduino / Displays / Re: LCD messes up whenever my relay turns on
|
on: April 18, 2011, 08:25:05 pm
|
// This Arduino sketch reads DS18B20 "1-Wire" digital // temperature sensors. // Tutorial: // http://www.hacktronics.com/Tutorials/arduino-1-wire-tutorial.html
#include <OneWire.h> #include <DallasTemperature.h> #include <LiquidCrystal.h>
// Connections: // rs (LCD pin 4) to Arduino pin 12 // rw (LCD pin 5) to Arduino pin 11 // enable (LCD pin 6) to Arduino pin 10 // LCD pin 15 to Arduino pin 13 // LCD pins d4, d5, d6, d7 to Arduino pins 5, 4, 3, 2 LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);
int backLight = 13; // pin 13 will control the backlight
// Data wire is plugged into pin 8 on the Arduino #define ONE_WIRE_BUS 8
// Setup a oneWire instance to communicate with any OneWire devices OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature. DallasTemperature sensors(&oneWire);
// Assign the addresses of your 1-Wire temp sensors. // See the tutorial on how to obtain these addresses: // http://www.hacktronics.com/Tutorials/arduino-1-wire-address-finder.html
DeviceAddress insideThermometer = { 0x28, 0x58, 0xBC, 0xE3, 0x02, 0x00, 0x00, 0x71 };
//Timer const int relayPin = 7; // the number of the Relay pin
int relayState = LOW; // Relay state when start long previousMillis = 0; // will store last time relay was updated
long interval = 10000; // interval at which to blink (milliseconds)
void setup(void) { // Start up the library sensors.begin(); // set the resolution to 10 bit (good enough?) sensors.setResolution(insideThermometer, 10);
pinMode(relayPin, OUTPUT); pinMode(backLight, OUTPUT); digitalWrite(backLight, HIGH); // turn backlight on. Replace 'HIGH' with 'LOW' to turn it off. lcd.begin(16,2); // columns, rows. use 16,2 for a 16x2 LCD, etc. lcd.clear(); // start with a blank screen }
void printTemperature(DeviceAddress deviceAddress) { float tempC = sensors.getTempC(deviceAddress); if (tempC == -127.00) { lcd.print("Error"); } else {
lcd.print(DallasTemperature::toFahrenheit(tempC)); } }
void loop(void) { delay(2000); sensors.requestTemperatures(); lcd.setCursor(0,0); lcd.print("Temp (F): "); printTemperature(insideThermometer);
//relay timer unsigned long currentMillis = millis();
if(currentMillis - previousMillis > interval) { // save the last time you blinked the relay previousMillis = currentMillis;
// if the relay is off turn it on and vice-versa: if (relayState == LOW) { relayState = HIGH; interval = 10000; // turn on for 5000ms } // end if was low (and is now high) else { relayState = LOW; interval = 5000; // turn off for 8000ms } // end of was high (and is now low)
// set the Relay with the relayState of the variable: digitalWrite(relayPin, relayState); }
|
|
|
|
|
8
|
Using Arduino / Displays / LCD messes up whenever my relay turns on
|
on: April 18, 2011, 03:28:41 pm
|
I'm using a 16x2 LCD http://www.seeedstudio.com/depot/lcd-162-characters-green-yellow-back-light-p-62.html?cPath=163_164, and whenever my relay turns on, the LCD screen either spits out garbage, or turns off completely. My relay turns on and off every 10 minutes. The relay I am using comes from the Sparkfun tutorial http://www.sparkfun.com/tutorials/119. I'm using the Ds18B20 temp sensor to output to the LCD. The LCD works fine when the relay box isn't plugged into a 120V outlet, but as soon as I plug it into the wall, the LCD screen starts messing up. I'm guessing it has something to do with the current/voltage that goes through everything as soon as I plug it into the wall. My knowledge of electronics is kinda on the beginner side so is there anything I can do to remedy this? I don't know if temp sensor/lcd/both are being affected but I know that everything works fine as long as the relay isn't plugged into my 120V power source. Suggestions please 
|
|
|
|
|
10
|
Using Arduino / Programming Questions / Re: Timer using millis()
|
on: April 16, 2011, 05:49:01 pm
|
|
Because I don't know what to write when I want it to stay off for a set interval. From playing around the example, I can only get it to stay on for the desired period, but then it stays off for the same time period. Ex. I can get it to stay on for 10 seconds but it stays off for 10 seconds, then repeats.
I do not have the time to order a RTC, I was thinking about that also but this is due in a week.
|
|
|
|
|
11
|
Using Arduino / Programming Questions / Timer using millis()
|
on: April 16, 2011, 04:54:21 pm
|
|
Hey everyone, I'm kind of in a bind. I'm a huge newb when it comes to programming but I have a issue that can probably be resolved by one of you guys in like 5 minutes.
I was trying to power a device for a set interval on/off and I realized I can't use the delay function because I have a temperature sensor that needs to constantly getting data.
I have been looking at the BlinkWithoutDelay code and I can't figure out how to make it so that I can use millis() to turn on a device for 16 hours, turn it off for 8 hours, and repeat.
Would anyone possible point me in the right direction or write this simple code for me?
|
|
|
|
|
15
|
Using Arduino / Project Guidance / Arduino to control HID grow light?
|
on: March 19, 2011, 12:19:23 pm
|
Hello all, This newbie has some questions relating to the arduino and electronics in general. I was wondering about relays and High Intensity Grow lights. I want the Arduino to switch on a grow light for a set interval. The grow light is 1000W, and all I have seen relating to the Garduino are those thin fluorescent lights. I know I need to use relays, but I have no idea which one to choose. I have a 5V DC relay with the contacts rated at 2A at 125VAC. I'm really uncomfortable b/c I'm unsure of how all the numbers relate to each other. I don't want to kill myself/burn down my school  . Any help is appreciated as to what kind of relays I should be looking for and if it is possible to power a 1000W bulb w/ Arduino.
|
|
|
|
|