Show Posts
Pages: [1] 2 3 ... 17
1  Using Arduino / Project Guidance / Re: Looking for Greenhouse Project input (Electronics and code optimization) on: March 24, 2014, 01:32:36 am
Eagle just takes time. Lots of time spent digging through the parts libraries. a lot of commonly used parts are there, but sometimes they are buried 3 or  4 folders deep. if you just want a schematic to use as reference, you don't have to have the exact parts, they don't even have to be close as long as they function the same way and have roughly the same pin layout. But even if you are making a PCB you can get by with using an alternate as long as it matches the pin out and footprint.
for your schematic, i would recommend using the atmega 8 as your microcontroller since it is closer to what is on the nano you can find it  in: add a part-> atmel-> atmega 8. also dig through the "relay" and "optocouplers" to try to find suitable placeholders for whats on your board.  I haven't really looked at the accuracy of your connections because they are hard to trace out and everything crisscrosses.
2  Using Arduino / Project Guidance / Re: Looking for Greenhouse Project input (Electronics and code optimization) on: March 17, 2014, 10:45:26 pm
1) No voltage sag is good!
2) "watertight" > "suitable for wet locations" >>> in-wall indoors box enclosure.  You might also consider distancing the arduino and LCD from the relays and outlets by not installing it inside the electrical boxes but instead putting it in its own enclosure (improves isolation and reduces the effects of ac noise on the arduino.)
3) Fuses: there is more than one way to do it, but if you are pulling power from a pre-existing structure I would venture to say that you probably have a 15-20 amp breaker for your mains protection. However, that stills leaves plenty of current available to wreak havoc on sensitive electronics. If it were me, I would connect a 2-3 amp fast-acting inline fuse to the AC hot coming into the greenhouse (obviously connections are done inside the electrical box) then split that off to the two relays and power outlet for the arduino supply.  Ultimately the fuse rating is determined by the load; what currents do the pump and fan draw? you might also consider a fuse for the 12v power rail.
I assume this for a permanent project. in which case: if its worth doing- its worth doing right.
4) Drawing schematics is a learned skill. practice practice practice.  Google simple circuits and practice copying them. Fritzing works ok for quick sketches, but Eagle is a better tool if you can learn it.
3  Using Arduino / Project Guidance / Re: Looking for Greenhouse Project input (Electronics and code optimization) on: March 17, 2014, 09:14:59 am
Quote
You cannot feed the relay from the arduino.   it needs it's own 5v power supply.....If the relay board is designed to be powered by 5 volts, then the relay board lives off 5v.
This is true. Disregard the part in my previous reply where I talk about powering the relays off 12 volts. Somehow, a picture of 12v songle relay got thrown into this discussion which confused me.
4  Using Arduino / Project Guidance / Re: Looking for Greenhouse Project input (Electronics and code optimization) on: March 16, 2014, 11:58:21 pm
  I would strongly suggest using a different power supply for the relays since you are already experiencing mild power issues. this would provide better isolation (from voltage spiking caused by the relays, fan and pump) and a more stable supply for your arduino. So after rereading some of the posts it looks like the LCD dims when the setup is powered from the computer's USB, but runs fine when powered externally with a 12v 2a wall wart? This is to be expected. USB protocol is limited to 500ma, but the computer host is only required to put out 100ma without the client device "negotiating" for more. You will probably be fine without an external voltage regulator as long as you run your relays off the external 12volt source.
Have you measured the 5volt and 12 volt rails to see if it sags when the relays energize?
When you bring mains voltage into the mix, safety should be the utmost consideration . From personal experience, I would strongly recommend a GFCI outlet. My greenhouse controller malfunctioned when water got into the relay box and power shorted on (fans=on, window vent motors=on, water valves=on) .  I was electrocuted (moderately) from touching the aluminum greenhouse frame and the standing water on the ground. Better safe than sorry.
Secondly, circuit protection can save you from having to replace everything should a fault occur- Fuses are a must.
Another consideration would be eliminating transients on the power line and whatever noise is caused by switching the pump and fan. Fans and pumps are highly inductive. Transients on the power rails can cause erratic behavior and resetting of the microcontroller as well as LCD scrambling. Snubbers, movs, tvs, and varistors are used for filtering on the AC powerline. Usually a snubber close to the load is sufficient.
5  Using Arduino / Project Guidance / Re: Troubles with dehumidifier hack on: March 16, 2014, 07:58:36 pm
The best solution is to try to pin-point what is causing the noise and either stop it at the source or identify how it is getting to the arduino setup and filter it out. however, I wouldn't recommend attempting the following solutions for the AC mains side unless you have some experience, but at least you should learn about it:

Triacs; http://en.wikipedia.org/wiki/TRIAC greatly reduce voltage spikes when used with a zero crossing driver.
snubbers : http://en.wikipedia.org/wiki/Snubber a very basic AC snubber is a capacitor and resistor in series connected across the load. Make absolutely sure to use appropriately rated components (500+ volts) so that they  can handle mains voltages.

Options for the low voltage side:
Decoupling: http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html
Isolating your arduino outputs with optocouplers.
Use a different outlet or mains circuit to power the arduino then what your ac load is connected to, if possible
Shielding the wires that run from the arduino to lcd display with a braid or foil helps too.
Pictures would help  us  help you as well as a schematic.
Just to be clear, in #3) it sounds like you are using the dehumidifier to power the arduino? Have you verified that Vcc is 5 volts with out the arduino connected (unloaded)? if it the voltage is sagging that much, the dehumidifier isn't a reliable enough source.
6  Using Arduino / Project Guidance / Re: Troubles with dehumidifier hack on: March 13, 2014, 10:06:45 pm
Every time I have ran into a scrambled 1602 lcd, it is usually transients caused from switching an inductive load. Don't forget snubbers and decoupling capacitors.  you might have to use a triac with zero crossing optocoupler which, in my case, worked the best.
7  Using Arduino / Programming Questions / Re: using an Array to change 6 led States on: March 01, 2014, 12:02:55 pm
Thanks to both of you!
Knut_Ny would you mind explaining the " void setlights (byte j)  " section. I have never used mask or bit masking so I get  confused at that point.  But I think your example is a simpler and more elegant way of what I want to do. Thanks!
8  Using Arduino / Programming Questions / Re: using an Array to change 6 led States on: February 28, 2014, 07:10:37 pm
Yes that is the general approach...I think-your English is a little hard to understand. My question is how do I set up an array to hold the six different states, then read from the array and change the LED's all within a for loop. I could program them all individually but there has to be a better way.
9  Using Arduino / Programming Questions / using an Array to change 6 led States on: February 28, 2014, 05:18:55 pm
I am working on a Traffic light project and i want to use an array to hold the on-off states for six LEDs (North-South: Red, yellow green; East-west: red, yellow,Green) I Figure it would be easier to change the values in one array than each LED individually when the time comes to change the lights. My Programming skills aren't the best so I wanted to get some advice on how to properly execute it. I want to do something like this but i am not sure if it is correct or the best way:
Code:
int ledPins[] = {
  2, 3, 4, 5, 6, 7 };
  int pinCount = 6;
byte lightstates [] = {0, 0, 1, 1, 0,0)[

for (int thisPin = 0; thisPin < pinCount; thisPin++) {
    // turn the pin on or off by depending on the ledstates array:
    digitalWrite(ledPins[thisPin], lightstates);
Here is the sketch so far:
Code:
const byte NS_RED = 2;
const byte NS_YELLOW = 3;
const byte NS_GREEN = 4;
const byte EW_RED = 5;
const byte EW_YELLOW = 6;
const byte EW_GREEN = 7;
const byte NS_SENSOR = 8;
const byte EW_SENSOR = 9;
const byte CLOCK = 10;
const byte CLOCKled = 13;
byte NS_state = 0;
byte EW_state = 0;
int CLOCKledState = HIGH;
int CLOCKState;             // the current reading from the input pin
int lastCLOCKState = LOW;
long lastDebounceTime = 0;  // the last time the output pin was toggled
long debounceDelay = 50;
long CycleCounter = 0;

void setup ()
{
  Serial.begin(9600);
  pinMode (2, OUTPUT); 
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode (6, OUTPUT); 
  pinMode(7, OUTPUT);
  pinMode(8, INPUT);
  pinMode(9, INPUT);
  pinMode(10, INPUT);
  pinMode(13, OUTPUT);
  digitalWrite(CLOCKled, CLOCKledState);
 
}

void loop() {
  CheckClock();
  CheckSensors();
 
}

void CheckClock(){
    int reading = digitalRead(CLOCK);

  if (reading != lastCLOCKState) {
 
    lastDebounceTime = millis();
  }

  if ((millis() - lastDebounceTime) > debounceDelay) {
   
    if (reading != CLOCKState) {
      CLOCKState = reading;

     if (CLOCKState == HIGH) {
        CLOCKledState = !CLOCKledState;
      }
      else CycleCounter ++;
    }
  }

 
  digitalWrite(CLOCKled, CLOCKState);

 
  lastCLOCKState = reading;
}
void CheckSensors(){
 
  NS_state = digitalRead(NS_SENSOR);
  EW_state = digitalRead(EW_SENSOR);
}
10  Using Arduino / Project Guidance / Re: Finalizing project on: February 15, 2014, 09:55:03 pm
The arduino line of products (Mega, due, Uno, Nano) are development boards the come with other support components like a voltage regulator, polarity and over current protection, as well as a usb chip on board among many other extras. "Standalone" usually means just that and not much more or precisely only  whatever your specific application calls for. People usually switch a completed project over to a standalone processor because its cheaper than the development board ($4 versus $10-$50) and the development board is more suited to prototyping anyway.  you might consider a digital thermometer like the ds18b20 because multiple sensors share the same data line (onewire device).
11  Using Arduino / Motors, Mechanics, and Power / making a 12v 20 amp power supply using a center tapped transformer on: February 14, 2014, 01:27:22 pm
I found an older unregulated 12 power supply on craiglist and I want to add voltage regulation to dial down the no load voltage(22 volts per leg after being rectified and filtered). Here is the example: http://www.electroschematics.com/6850/12v-scr-battery-charger/
After breadboarding, it doesn't seem to provide any voltage regulation and I can't adjust the voltage using the 10k pot. Have I misinterpreted the purpose of the circuit?  Is there a better way to do this?
12  Using Arduino / General Electronics / Re: Electrical Safety on: February 11, 2014, 12:23:47 am
Quote
It probably wasn't 12V...
most definitely was. The car was off. My arm was slick with perspiration when I rested it across the battery terminals to reach down into the engine compartment to locate a dropped bolt. Stung mildly, (similar to licking a 9 volt).  Much different sensation then getting hit with the high voltage that causes the arcing in the spark plug which I have also experienced.
13  Using Arduino / General Electronics / Re: Electrical Safety on: February 09, 2014, 11:06:36 pm
Depending on who you ask, 30 ma is considered lethal current. Last time I measured my resistance finger to finger it was in the 100k ohm range. So ohms law tells me the lethal voltage is pretty high. But there are a lot of other variables that factor in. The time is relatively short, however long it takes to cause fibrillation. I've felt shocks at twelve volts from a car battery capable of hundreds amps- not very painful. And I have been electrocuted from 240 mains voltage which is quite painful and I consider myself lucky I received no burns or lasting injuries. Static electricity is typically very high voltage and very low current.
14  Using Arduino / Project Guidance / Re: How to activate a relay on a frequency for a certain duration ? on: February 05, 2014, 04:17:37 pm
The uno is the common starting point for most beginner and intermediate project.  Physical  speaking the pro mini is the smallest "arduino product", but it requires an external programmer to communicate with the computer. Looks like you need maybe a dozen I/o pins which is fine for the uno. Memory is rarely problem. Programming - wise you should work through some the examples like blink without delay. You can set interval and run times using a two potentiometers on analog pins. Arduino comes with a built in clock and timers.
15  Using Arduino / General Electronics / Re: Power issues on: January 30, 2014, 04:04:46 pm
A cheap usb cord with high Gauge wire can cause voltage losses . A cheap power supply running @ 20 % load may not be able to  provide the voltage specified. I have seen both cases. But 5% fluctuation isn't completely unrealistic. If it were rated at 30 amps and showed the problem you are describing then I would have concerns.
Pages: [1] 2 3 ... 17