Show Posts
Pages: [1] 2
1  Using Arduino / Displays / Re: LCD messes up whenever my relay turns on on: April 21, 2011, 09:59:34 pm
I think I got it! A friend suggested to put diodes on every connection going back to the arduino and it worked haha. I used the same diodes that were used in the relay box.
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.
4  Using Arduino / Displays / Re: LCD messes up whenever my relay turns on on: April 19, 2011, 01:21:20 pm
smiley ok guys, I'll get those pics up ASAP. I also drew a ghetto circuit diagram on paper  smiley-grin
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.
6  Using Arduino / Displays / Re: LCD messes up whenever my relay turns on on: April 18, 2011, 08:57:39 pm
I used this exact tutorial when making my relay box.

The LCD/temp sensor is hooked up exactly like this

All the devices receive power from the +5V on the arduino and go to the same GND from the arduino. The relay box has 3 leads, one going to the +5V (white wire) on the arduino, GND (green wire) on the arduino, and a digital output pin (black wire) to know when it turns on and off.

All work flawlessly (I can hear the relay clicking on and off)..but when it gets plugged into wall outlet (via 3 prong gray cord), it goes crazy like I said. LCD starts spitting out garbage and eventually turns off.
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:

#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:

DeviceAddress insideThermometer = { 0x28, 0x58, 0xBC, 0xE3, 0x02, 0x00, 0x00, 0x71 };

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
// 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) {
} else {


void loop(void)
lcd.print("Temp (F): ");

//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)
      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, 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 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 smiley
9  Using Arduino / Programming Questions / Re: Timer using millis() on: April 17, 2011, 08:59:41 pm
Still doesn't make sense to me  smiley-cry

Anyone else help 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?
12  Using Arduino / Project Guidance / Re: Arduino to control HID grow light? on: March 31, 2011, 10:07:17 am
Would I need to use a RTC to have the lights run on a 16 hour on/8 hour off cycle? The timing doesn't need to be super accurate.
13  Using Arduino / Project Guidance / SEn118A2b Temperature Sensor help? on: March 30, 2011, 02:48:30 pm

I bought this sensor because it looks like the head can be submerged in water and get a reading. The big question I have is that it only has 2 I'm guessing one for PWR and one for GND. The only temperature sensors I've seen had 3 the LM35.

I'm confused as to how I can read temperature with this thing..any ideas?
14  Using Arduino / Project Guidance / Water temperature sensor? on: March 21, 2011, 03:23:00 pm
Is there a nice, cheap way to sense water temperature w/ the Arduino? All of the waterproof thermistors are so expensive.
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  smiley-razz. 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.
Pages: [1] 2