Show Posts
Pages: 1 ... 426 427 [428] 429 430 ... 582
6406  Using Arduino / Sensors / Re: ADS1252: Tutorial on High precision (24-bit) ADC on: May 19, 2011, 10:15:48 am
Any more news on using this chip?

______
Rob
6407  Community / Exhibition / Gallery / Re: Modular Stackable Microcontroller System (lots of pics) on: May 19, 2011, 06:43:27 am
Quote
thats it so far.
Is that all?

Wow, like I said when saw the 3d mockup, I get vertigo just looking at it.

The other day you said you got the 1284 bootloader working , was that at 18.432Mhz?

Quote
4 bit DIP's for addresses on the boards with processors,
If the pins used for this go to ADCs you can use trinary encoding (albeit not with normal DIP switches) to get 64 addresses from 4 inputs or 27 from 3 inputs.

The photographer in me says you should have more depth of field in the shots smiley

Good job, it will take you another year to write all the software now.

PS: For industrial use I think you should ad RS-485 capability

______
Rob

6408  Using Arduino / Project Guidance / Re: Coin Counter on: May 19, 2011, 05:39:14 am
No matter how hard I try I just can't get that Aussie twang out of my variable names smiley

______
Rob
6409  Using Arduino / Project Guidance / Re: Arduino controlled tube bending controller on: May 19, 2011, 03:47:15 am
That's all quite doable.

1) A relay or IO board like Terry suggested.
2) You need to see if you can get access to the outputs of this encoder.
3) All simple.
4) Yep, an LCD.

Two things to think about.

Getting inputs from sensors/switches on the machine, that's a longish cable run in a noisy environment, I would not run Arduino inputs directly. Maybe isolate with opto couplers or at least harden them with a series resistor and clamping diodes.

The two safety mechanisms (SICK and palm buttons), try not to implement that functionality with the Arduino but rather leave them as is. I'm not sure how OH&S will view an non-certified program handling these functions. I'd hate the thing to fire up at the wrong time because your code has & instead of &&.

As for doing a PCB, there are many free PCB design packages, Eagle is probably the most common but you can only do boards up to (I think)  60x100mm with the free version.

______
Rob
6410  Using Arduino / Programming Questions / Re: How does serial handle data. on: May 19, 2011, 03:21:24 am
That's one hell of an if/else rats nest Mike, the variable you're testing against seems to have contiguous values which probably means an array or two can remove all the crap.

Actually, don't all those blocks do the same thing?

Can you spell out exactly what is supposed to happen?

Serial characters can't be received "at the same time" they appear one after the other.

Quote
Its part of a musical instrument and I need to make sure the solenoids are in time.
By directly manipulating the ports, but you shouldn't have to, two digitalWrites() in a row will appear to be simultaneous to a human. Even if there's a serial character in between.
______
Rob
 
6411  Community / Exhibition / Gallery / Re: Greenhouse automation on: May 19, 2011, 03:08:13 am
I think I've trimmed some more fat
Code:
  byte stats;
  byte previousstats;
  
   #define TEMP_RED_BIT B00000001
   #define TEMP_GREEN_BIT B00000010
   #define HUMID_RED_BIT B00000100
   #define HUMID_GREEN_BIT B00001000
   #define MOIST_RED_BIT B00010000
   #define MOIST_GREEN_BIT B00100000
  
  
  stats = 0;
  if((temperature < 22) || (temperature > 28)) {
    stats |= TEMP_GREEN_BIT   // green on
  } else {
    stats |= TEMP_RED_BIT;    // red on
  }
  //Humidity
  if((humidity < 60) || (humidity > 80)) {
    stats |= HUMID_GREEN_BIT   // green on
  } else {
    stats |= HUMID_RED_BIT;    // red on
  }
  //Soil
  if((moisture_val < 850) || (moisture_val > 1000)) {
    stats |= MOIST_GREEN_BIT   // green on
  } else {
    stats |= MOIST_RED_BIT;    // red on
  }
 
  ////Checks if update to control panel is needed
  if(stats != previousstats) {
digitalWrite(latch, LOW);
shiftOut(data, clock, MSBFIRST, stats);  // don't need the led() function any more
digitalWrite(latch, HIGH);
        previousstats = stats;
  }
  

You could also use the same arrangement but change the #defines to bit numbers and have bitWrites() instead of the &= and |= with bit patterns.


______
Rob
6412  Using Arduino / Project Guidance / Re: Designed an Attiny "BBB" type board, need input on: May 19, 2011, 02:45:52 am
It's starting to look good.

The 10k pull up resistor is a tad close to the DIP socket.

The holes for the DC barrel jack, they either have to be slots or WAY bigger than that.

2k2 is too large for the LED, although that doesn't affect the PCB layout.

______
Rob
6413  Using Arduino / Programming Questions / Re: storing int in byte-variable on: May 19, 2011, 02:06:42 am
Well cut of me legs and call me shorty, thanks AWOL, I learn something new every day, I was sure it would clobber a byte.

I just tried this

Code:
  byte x;
 int y = 1234;
 x = y; 

with -Wall, not even a warning. However

Code:
  byte x;
 int y = 1234;
 x = 1234; 

Gives "large integer implicitly truncated to unsigned type"


______
Rob
6414  Using Arduino / Programming Questions / Re: storing int in byte-variable on: May 19, 2011, 01:38:29 am
Firstly the compiler should throw an error.

If you force the issue you will clobber a byte on one side of the variable.

Is there a reason to do this?

______
Rob
6415  Community / Exhibition / Gallery / Re: Greenhouse automation on: May 19, 2011, 01:33:41 am
Code:
/////Light trigger
  if((0 <= hour(t)) && (18 > hour(t))) { ///Between which hours on
    lightstatus = 1;
  }
  if((18 <= hour(t)) && (24 >= hour(t))) { ///Between which hours off
    lightstatus = 0;
  }

could be

Code:
/////Light trigger
  lightstatus = hour(t) < 18 ? 1 : 0;


Code:
if(stats != previousstats) {
This compares the addresses of the two arrays, they will never be ==

As they are arrays of binary numbers you have to use memcmp() to compare them.

Then you can use memcpy() to move one into the other.

______
Rob
6416  Using Arduino / Project Guidance / Re: Coin Counter on: May 19, 2011, 01:16:08 am
No guarantees but I'm happy to help.

As there are much better coders than me here I take some comfort from the fact that no one has pinged me on the code yet, or maybe they just haven't noticed the thread smiley

______
Rob
6417  Using Arduino / Project Guidance / Re: 12 Volt Trigger on: May 19, 2011, 12:29:48 am
Quote
How and where in the sketch does this command need to be?
Normally in the loop() function.

Code:
void loop () {
   if (digitalRead(triggerPin) == LOW) { // assumes the opto is wired to pull pin low
       // sequence code here
   }
}

However if you only want this to run once you can put it in the setup() function.

Quote
Then output to the next pin (cue 2) at a user defined timing delay with a 1 second pulse so forth
I'll get into trouble for using delay() here but for this simple application I would suggest something like this.

Code:
void loop () {
   if (digitalRead(triggerPin) == LOW) { 
       digitalWrite (seq1Pin, HIGH)
       delay (1000);
       digitalWrite (seq1Pin, LOW)

       digitalWrite (seq2Pin, HIGH)
       delay (1000);
       digitalWrite (seq2Pin, LOW)

       digitalWrite (seq3Pin, HIGH)
       delay (1000);
       digitalWrite (seq4Pin, LOW)
   }
   while(1);  // if you don't want this to run a second time, OR put this in setup()
}

If you have a LOT of sequences (did you say 12?) then an array would be better.

Code:
byte pins [] = {2, 3, 4, 6, 8, 9, 10, 11, 18, 23, 44, 51};  // whatever pins you are using
const int N_PINS = sizeof (pins) / sizeof (pins[0]);
 
void loop () {
   if (digitalRead(triggerPin) == LOW) {
       for (int i = 0; i < N_PINS; i++) {
          digitalWrite (pins[i], HIGH)
          delay (1000);
          digitalWrite (pins[i], LOW)
      }
}

Quote
how would the optoisolator be connected to the input pin on the arduino for it to read the input?
Emitter to GND, collector through a resistor to VCC (the resistor can be omitted if you use the Arduino's inbuilt pull up resistor). Collector to Arduino pin.

Quote
Will my 12 volt source need a resistor of some sort so that the current doesn't destroy the optoisolator?
Yes, value depends on the opto's LED but about 1k should be OK.

______
Rob
6418  Using Arduino / LEDs and Multiplexing / Re: programing and wiring 2 Multiplexer / demultiplexer with arduino on: May 18, 2011, 09:17:07 pm
You do realize that you can't use 4067s for outputs unless you only need one output on at a time, it's been stated a couple of times but I'm not sure you've pick up on it.

BTW, your picture links to your C drive, that ain't gonna work smiley
______
Rob
6419  Community / Products and Services / Re: Schematice of all the bricks on: May 18, 2011, 09:08:41 pm
Have a look at Terry King's site

http://yourduino.com/

Or get in touch with him. Last I heard he was trying to document all the bricks.

______
Rob

6420  Using Arduino / Project Guidance / Re: Designed an Attiny "BBB" type board, need input on: May 18, 2011, 08:11:34 pm
Quote
Any thoughts on trace width for signals and for the VCC/GND lines?
For such a small board with only one active component I would say 20-30mil would be more than enough.

Google "pcb trace width calculator"

Quote
I think I'm going to change it to a single 7 or 8 pin connector if I can make it route nicely though.
I can't see why you're having trouble realigning the headers, there's only 5 traces on the whole board smiley If they are in a row the board will plug in directly to a BB. As they are I don't see how it can plug in at all (I'll have to drag out a BB and have a look).

______
Rob
Pages: 1 ... 426 427 [428] 429 430 ... 582