Show Posts
Pages: 1 ... 427 428 [429] 430 431 ... 582
6421  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
6422  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
6423  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

6424  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
6425  Community / Exhibition / Gallery / Re: Greenhouse automation on: May 18, 2011, 12:47:35 am
Hi SpencerH,

Do you really have 3 phase power or are the three "mains" wired the same active.

6A @ 240V means huge motors, are they really that big?

I gather they are DPDT relays and the "to CP" contacts are just to show they are working with the other pole doing the pump/whatever control.

______
Rob
6426  Using Arduino / Project Guidance / Re: Designed an Attiny "BBB" type board, need input on: May 18, 2011, 12:24:32 am
Why not put the two breadboard power pins in line with the IO pins? That way the whole thing plugs straight onto a breadboard. As it is you'll have to run flying wires from one or the other.

______
Rob
6427  Community / Bar Sport / Re: My electric blanket doesn't work ... on: May 17, 2011, 10:24:28 pm
Yes, in Aus you can pick your climate of choice.

Tassie, mostly cool/cold, green babbling brooks, much like England.
Lower states, pretty cold in winter to very hot (40+) in summer.
High country, more snow than Switzerland in winter, mild to cold in summer (still snow in summer on occasion).
The outback, varies between really cold and boiling hot -10 nights to 45+ (even 50+ in places) days.
Upper states (tropics) same temp all year round (approx 30-35 days) but humidity changes from dry to very humid.

_____
Rob
6428  Community / Bar Sport / Re: Employment for Arduinoites on: May 17, 2011, 10:01:54 pm
No sooner have I spoken than we get this post

http://arduino.cc/forum/index.php/topic,61488.0/topicseen.html

______
Rob
6429  Using Arduino / Networking, Protocols, and Devices / Re: Arduino on: May 17, 2011, 09:55:10 pm
I don't know, but what's the heartbeat for?

If you get Xbee to do it then that tells you nothing about the Arduino.

Also a little more descriptive title (you can change that) may get you some more informed responses.

_______
Rob
6430  Using Arduino / Project Guidance / Re: Coin Counter on: May 17, 2011, 09:29:08 pm
It's morning and no other takers so here is a rough start. As I see it you need to read 30 inputs fast and although the signals should be pretty clean from the opto sensors (depends on the sensor) they probably still need debouncing.

The debounce library may do this I haven't looked at it.

Done for 32 coins, will need slight adjustments for 30

Off the top of my head, thoroughly untested, not compiled, probably has bugs and maybe even logic errors. I think the basic idea is sound, but then I'm not the one putting the tender in for the job smiley


Code:
// Wiring must be organised such that the sensors are connected
// in groups of 8 to to procesor ports
// Assumes
//    4-digit coin counters, ie 9999 coins max
//    digital input goes HIGH when coin over sensor

#define DEBOUNCE_TIME 5
#define TRANSITION_TIME 50  // # of mS it takes a coin to pass the sensor
#define N_COINS 32

byte ports [4] = {PORTC, PORTD, PORTF, PORTG};
byte debounce_counters [N_COINS];
boolean coin_passing [N_COINS];
int coin_counters[N_COINS];
int display_timer;

void setup () {
// do some stuff here
SPI.begin(...); // etc
for (int i = 0; i < N_COINS; i++) {
coin_passing[i] = false;  // shouldn't really need this
}
}

void loop () {
static display_counter = 0;
byte group = 0;

for (int port = 0, port < 4; port++) {
byte portval = ports[port];  // get 8 sensor bits
// now test each sensor bit
// increment the sensor's counter if the bit is 1
//      and we didn't just do so,
//      ie the coin is still passing from the last count
// clear the sensor's counter if 0
for (int sens = 0; sens < 8 sens++) {
if (portval & B00000001 == 1) {
if (coin_passing[i]) {
coin_passing[i]--;  // coin is still passing from last count, dec counter
} else {
debounce_counters[port + sens]++;  // one more closer to being a valid coin
}
} else {
debounce_counters[port + sens] = 0; // any 0 value and we start again
}
portval >>= 1; // move next bit into position 0
}
}

/////////////////////////////////////////
// now we have an updated array of 32 counters
// test to see if any have reached the debounce value
for (int i = 0; i < N_COINS; i++) {
if (debounce_counters[i] > DEBOUNCE_TIME) {
// we have a new coin
coin_counters[i]++;
debounce_counters[i] = 0;
coin_passing[i] = TRANSITION_TIME;
}
}

//////////////////////////////////////////
// every 100mS send the counters out to the displays,
// assumes a string of N_COINS AS1108 shift regs or similar and 4-digit counters
// for 32 displays we need to shift 32*4*7 bits
// at 8mMHz this will take 112uS plus some overhead
static temp_array[4];

display_timer++;
if (display_timer >= 100) {
display_timer = 0;
for (int i = 0; i < N_COINS; i++) {
func_to_convert_bin_to_BCD (temp_array, coin_counters[i]); // there may be a library func for this
SPI.transfer (temp_array[0]);
SPI.transfer (temp_array[1]);
SPI.transfer (temp_array[2]);
SPI.transfer (temp_array[3]);
}
}
delay (1); // 1mS delay added to the time it takes to do the above
}

______
Rob
6431  Community / Bar Sport / Re: My electric blanket doesn't work ... on: May 17, 2011, 09:15:17 pm
Brrrr, I had to go get a jumper just to read your post. smiley

______
Rob
6432  Using Arduino / Networking, Protocols, and Devices / Re: Fast communication to PC with low Arduino footprint on: May 17, 2011, 11:30:11 am
Quote
Sampling + sending raw data through Serial.print (baudrate 115200): 2.2 Hz
That may have been the serial blocking, a non-blocking version might do a lot better although it will never match SPI.

______
Rob
6433  Using Arduino / Project Guidance / Re: Coin Counter on: May 17, 2011, 11:26:28 am
This can be done, it just needs some deep thought.

I'm not sure a method of counting the 30 coins was proposed yet. I was going to suggest PCINTS but there are only 24 of them.

I do have an idea but it's late here, if nobody has come up with something by tomorrow morning I'll post it.


______
Rob
6434  Development / Other Hardware Development / Re: ATMEL Mega1284P evaluation board avalible on: May 17, 2011, 11:05:20 am
Quote
How do I get the battery markings on the bottom of the board?
Don't know, I don't use Eagle for anything but viewing other people's files.

Quote
"Are the mounting holes at good spacing, .1" preferably but at least whole mm."
Not sure what you are asking here.
Just that the distances between mounting shouldn't be something like 57.356mm that's hard to measure with you come to mounting it in a box.

Quote
"SQW signal going to an interrupt pin so you can create a version of millis() that doesn't skip a beat or have the RTC wake the processor at 3AM. "
I think I can do that - does it need to a hardware interrupt like INT2 on pin PB2, or can it be a PCINT like PD7?
Either way, I would probably save the INTs and use a PCI, but INT2 would be a bit easier to use from the software point of view and it's "spare" according to the Arduino or do the 1284 core files handle attachInterrupt(2,xx).

Quote
"3.3V regulator & cap"
The MCP1700T is good, @ 250mA it will handle the power I would think, what power do the SD cards draw? The SOT23 has a tempco of up to 336 C/W and the the SOT89 only 52 C/W. So the SOT23 can only handle about 1/3W at room temp (depending on how much copper it has around it).

Quote
is any one familiar with this Pericom part:  PT7C4311WEX
Not me,it looks similar to the 1307 but I don't see any benefit to using it. The RX-8025 mentioned before looks nice and I do like the built-in TCXO, but if you went that route I'd go with the DS3231 chip. There are libraries for the common chips, probably not for the others, so unless there's a really neat feature not available on the 1307/3231 I'd stick with them.

Quote
One of those chips is extremely fine pitch.
I use a hot air gun to solder these (the FTDI is the finest I've done so far), easy, just run two beads of paste along the pads and hit it with the hot air. Clean any bridges with solder wick.

______
Rob


6435  Using Arduino / Project Guidance / Re: Coin Counter on: May 17, 2011, 10:11:49 am
If you use LED driver chips like the AS1108 (this does 4 7seg displays) you can run as many displays as you like with 3 pins.

MAXIM also make chips (like the MAX7219) that will run these displays, some go up to 8 displays per chip.

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