Show Posts
Pages: 1 ... 423 424 [425] 426 427 ... 584
6361  Using Arduino / General Electronics / Re: Current Sensor on: July 08, 2011, 12:03:01 am
The measured voltage on the ACS712 is isolated from the other half of the chip, so it doesn't matter what level it is as long as its < than the isolation rating.

______
Rob
6362  Using Arduino / General Electronics / Re: Current Sensor on: July 07, 2011, 06:42:58 pm
The ACS712 is a common choice. SOIC-8 package but you could solder some wires to the pins to use on a breadboard.

BTW that link to the ZMC10D-ND doesn't seem to work.
______
Rob

EDIT: Same chip retrolefty pointed to, I forgot about the SF breakout board.
6363  Using Arduino / Programming Questions / Re: Need to understand Serial-RS485 master/slave addressing on: July 06, 2011, 11:26:42 am
Here are a couple of reworked versions of your function

Code:
void recieveMSG() {
    // 'clear" the frame in memory by dorking the last byte
    // so we can check the frame after it's been received
    charArray[3] = 0;
    while(Serial.available() == 0);          // wait for character
if (Serial.read() == 0x10) {             // if it's a sync char read the rest of the frame
for (int i = 0; i < 4; i++) {        // assumes 4 bytes in every frame
while (Serial.available() == 0); // wait for next character
charArray[i] = Serial.read();    // load char into array

// test here for valid frame, something like
if (charArray[3] != 0x2b || charArray[3] != 0x2c) {
// bad frame
}
}
}

void recieveMSG() {
    // 'clear" the frame in memory by dorking the last byte
    // so we can check the frame after it's been received
    charArray[3] = 0;
    while(Serial.available() == 0);            // wait for character
if (Serial.read() == 0x10) {           // if it's a sync char read the rest of the frame
while(Serial.available() < 4);    // assumes 4 bytes in every frame, wait for all 4
for (int i = 0; i < 4; i++) {     
charArray[i] = Serial.read();  // load chars into array

// test here for valid frame, something like
if (charArray[3] != 0x2b || charArray[3] != 0x2c) {
// bad frame
}
}
}

It's late here so I hope I got them right, if not my apologies in advance smiley

NOTES:
In a real system you should do more testing for frame validity, for example what happens if you only get 3 bytes?
If the first char received is not 0x10 the func exits, maybe loop inside the func or maybe handle this outside by rapid calling of the func so you don't block on receiving a frame.
Probably should return a value indicating good/bad frame.
Other stuff I can't think of right now.
______
Rob
6364  Using Arduino / Programming Questions / Re: Need to understand Serial-RS485 master/slave addressing on: July 06, 2011, 10:59:35 am
You get the 0x10

Serial.read() == 0x10)

then straight away test for another character

while (Serial.available()) {

}

when you do the "while" test the second character is still on it's way so the test fails and the function exits. That's the base of the problem.

Also (not your problem but should be fixed)

     while(Serial.available() == 0);;
         if (Serial.available())

you can only get to the if when a character is available, no need to test again. And then

     int recieved = Serial.read();
      delay(5);
      charArray[charIndex] = recieved;     
      charIndex++;

No need for a delay, just stick the character in the array.

int charIndex = 1;

charIndex would normally start at 0 not 1.

______
Rob


6365  Using Arduino / Project Guidance / Re: Water Detection Project on: July 06, 2011, 08:31:50 am
I think Jeenodes might be good for this. They have built in wireless and IIRC really low power.

______
Rob
 
6366  Using Arduino / Sensors / Re: Serial Communication on: July 06, 2011, 06:26:57 am
It sounds like you're basically doing the right thing but you shouldn't need any delays. Post your code, there has to be a problem in it somewhere.

Quote
high byte/low byte combination
If the value is > 255 you have to send as two bytes, if <= 255 you can send a one byte

______
Rob
 
6367  Using Arduino / Project Guidance / Re: Detect Disconnection on: July 06, 2011, 04:27:15 am
It depends largely on what's connected to the wire.

What is?

_____
Rob
6368  Topics / Home Automation and Networked Objects / Re: Starting an Home Automation project on: July 06, 2011, 02:55:54 am
You can read an output or just store a copy in memory, either way you can tell what the relay should be. But as you pointed out what if you have a manual switch that can change the relay state?

You can run the switch to the processor and let it make all the decisions. But there can be problems when you have a failure in the system and the processor decides it knows best about the relay's state.

You can have the switch manually control but also run a wire from the switch to the processor, likewise you can read this to see what state the relay should be in.

A relay is just a switch, a relay with one switch is called "single pole", a relay with two switches is called "double pole". You can use this to your advantage.

Get a double pole relay, use one pole to control the light and the other to feed back the relay state to the processor.

Now there is no real chance for confusion because the processor can read the relay state at any time.

You can (in fact should) also organize things so the button will work the light regardless of the processor, this gives you a backup for times when the auto system is not working (there will be many such times smiley)

______
Rob


 
6369  Using Arduino / General Electronics / Re: How to rearrange pins on an Eagle schematic on: July 06, 2011, 01:39:27 am
I don't advocate showing all signals either, that's just as bad in the other direction. It's very difficult to follow a lot of parallel wires and even harder when, as is the case with many Arduino schematics, they are crossed over in weird fashions . I've seen some schematics recently with every GND and VCC wire drawn in then every signal drawn as well and just to top it off all the chips drawn with the pins in the real-world location on the package.

A schematic is a document, and like all documents it should strive to be clear to the reader, although I admit that noobies have a different idea as to what is clear than an experienced person does, the aforementioned drawing of chips with real-world pin locations may be a good example of that.

With most circuits there's a nice balance between a rats nest of wires and having to search the entire page looking for a signal that could easily have been drawn in.

I used Rimu schematic for a while, great package but no pin moving so I spent time drawing new components (actually it's just a copy and edit of an existing component) when necessary so that my schematics would be clearer, and anyway I just like them to look nice smiley

______
Rob
6370  Using Arduino / General Electronics / Re: How to rearrange pins on an Eagle schematic on: July 06, 2011, 12:51:11 am
Quote
You need an alternative symbol in the library
Another reason to hate Eagle. IIRC Protel allowed pins to be moved over 20 years ago.

Quote
Or just give up on showing actual connections, and connect everything via names on a short piece of net from the pins.
Which I guess is what everyone does, and it also explains why most Eagle schematics are impossible to read smiley

______
Rob

6371  Using Arduino / Project Guidance / Re: ArdweeNET - simple and robust networking for monitoring and control on: July 05, 2011, 07:36:23 pm
Thanks CB. It boosts my confidence level knowing someone else has scanned the design and not found any fundamental errors.

I seldom prototypes things, preferring to go straight from paper to PCB, but when you design by yourself with no-one to look over your shoulder  it's easy to get so close you don't see the problems.

______
Rob
6372  Using Arduino / Project Guidance / Re: ArdweeNET - simple and robust networking for monitoring and control on: July 05, 2011, 09:52:57 am
I guess the design is bang on then so I've started PCB layouts.

Here's a quad +-20A sensor node.



Approx lifesize (on my screen anyway), should be 40mm wide.



This one is larger than standard because of the relatively huge connectors needed for 20 amps.

Bear in mind that this is effectively a tiny Duemilanove that is dedicated to reading current and telling the world the results via RS-485.
 
______
Rob

6373  Community / Products and Services / Re: New product: Digit Shield on: July 05, 2011, 09:00:55 am
Hi Michael,

Love your boards.

I'm working on a 4-digit board myself at present (not a shield so no competition), there's something very satisfying about getting LEDs to work, much more so than LCDs smiley

______
Rob
6374  Using Arduino / Networking, Protocols, and Devices / Re: serial com port communication with Mega on: July 05, 2011, 05:53:22 am
Quote
The netbook is using simple serial communication.
Does this means it's NOT using USB?

Quote
But when I connect it to the netbook and change the com port to 4
It won't necessarily be on the same port with a different computer.


______
Rob
6375  Using Arduino / General Electronics / Re: RS232 shield on: July 05, 2011, 05:49:39 am
have a look at shieldlist.org

______
Rob
Pages: 1 ... 423 424 [425] 426 427 ... 584