Show Posts
Pages: 1 [2] 3 4 ... 10
16  Using Arduino / LEDs and Multiplexing / Re: So many possibilities to troubleshoot... Where do I begin? on: February 04, 2014, 10:06:16 pm
Here is my idea.  I'm building a hexacopter.  I'd like my LED controller to take telemetry data from the flight controller and change the colors based on information from the flight controller.

Or do you want to control 8 led strips ?

Actually 7  (one strip per leg. to help me see the orientation easier and a "heartbeat" LED)  All of them RGB

For my application size and weight will matter a little.  I'll look around a bit to see if I can get a mosfet small enough to fit on my 55mm square board.

Also based on the attached drawing (that I revised) did I take care of Crossroads suggestions?

I can't thank you all enough for the tremendous help!

Loren
17  Using Arduino / LEDs and Multiplexing / Re: So many possibilities to troubleshoot... Where do I begin? on: February 04, 2014, 05:39:02 pm
Sorry about that...

Here is the link:  http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=17407
18  Using Arduino / LEDs and Multiplexing / Re: So many possibilities to troubleshoot... Where do I begin? on: February 04, 2014, 05:08:29 pm
CrossRoads,

Wow thanks for all of the pointers.   I've made all of the appropriate adjustments to the schematic, but I do have one additional question:


ULN2004
http://www.ti.com/lit/ds/symlink/ulq2004a.pdf
can only drive its outputs low, so:
+5 to anode, cathode to resistor, resistor to  ULN2004 output.

I'm going to be using LED strips.  I thought I saw current limiting resistors on the strip.  If they have them on the strip would it be necessary to include them on this board?

Thanks again guys,

Loren
19  Using Arduino / LEDs and Multiplexing / Re: So many possibilities to troubleshoot... Where do I begin? on: February 04, 2014, 12:24:33 pm
I'll try and give that a shot. 



20  Using Arduino / LEDs and Multiplexing / Re: So many possibilities to troubleshoot... Where do I begin? on: February 04, 2014, 08:22:40 am
You made about 5 steps at once. Do this step by step. You need for example a few test sketches, before trying to run the final project.

Is the Arduino board running, can you upload a sketch to it ?
This is your board:
http://arduino.cc/en/Main/ArduinoBoardProMini
Can you make the led of the Arduino board blink when it is attached to your board ?

I'm certain that I'm able to get a sketch to work on the board.  I've been able to communicate both ways to a processing sketch that I'm running on my laptop.

Check the wiring of the shift registers. Either the schematic is wrong, or you have connected them wrong.
This is explanation and shows cascading for 2 shift registers:
http://bildr.org/2011/02/74hc595/
You have enough pins, so you don't need cascading.

This is the schematic that I based my board off of.  It appears that I missed a couple of things which are probably contributing to my problems. 


I missed the capacitor which isn't shown in the link you provided.  I'll try and look up the specific data sheet for the 595s I ordered and look into the master reclear pin.  After looking at the diagram again with "fresh eyes" I missed the fact that the data needs to loop through each 595. 


If the shift registers are working, you have to check how the ULN2004 are wired. The connectors to the leds have no power pin but a GND pin. The ULN2004 is like an open-collector output, you need a power pin for the leds.
What do the leds look like ? Do they have a series resistor build in. I don't think so. You can't connect the leds like that.



I'll do a little more digging on the darlington.

Thanks for your help
21  Using Arduino / LEDs and Multiplexing / So many possibilities to troubleshoot... Where do I begin? on: February 03, 2014, 09:50:03 pm
I have managed to dive into the "deep end of the pool" when it comes to a project I'm working on.   I've designed and build a board to control some LEDs for a helicopter I'm building.  The basic idea is a shift register feeding a darlington array and then output the darlington array  to the LEDs.  Attached are the pictures of the schematic, the board without the pro mini attached and a pic with the mini attached.

Also here is the code that I'm running to try and get the LED going:

Code:

#include <EEPROM.h>

//Pin connected to ST_CP of 74HC595
int latchPin = 4;
//Pin connected to SH_CP of 74HC595
int clockPin = 3;
////Pin connected to DS of 74HC595
int dataPin = 2;
int seq[14] = {1,2,4,8,16,32,64,128,64,32,16,8,4,2};
void setup()
{
  // start serial port at 9600 bps and wait for port to open:
  Serial.begin(57600);
      pinMode(dataPin, OUTPUT);       //Configure each IO Pin
    pinMode(latchPin, OUTPUT);
    pinMode(clockPin, OUTPUT);

}

int inByte;

char inData[20]; // Allocate some space for the string
char inChar; // Where to store the character read
byte index = 0; // Index into array; where to store the character
int address = 0;
byte value;

void loop()
{
  // if we get a valid byte, read analog ins:
  if (Serial.available() > 0) {
    // get incoming byte:
    //inByte = Serial.read();
    //Serial.println("One way"); 


    while(Serial.available() > 0) // Don't read unless
      // there you know there is data
    {
      if(index < 19) // One less than the size of the array
      {
        inChar = Serial.read(); // Read a character
        inData[index] = inChar; // Store it
        index++; // Increment where to write next
        inData[index] = '\0'; // Null terminate the string
      }
    }
    // Now do something with the string (but not using ==)
    if (strcmp(inData, "Read")  == 0){
      Serial.println("SndEprom");
      sendProm();
     
    }

  }
 
      for (int n = 0; n < 14; n++)
    {
        digitalWrite(latchPin, LOW);             //Pull latch LOW to start sending data
        shiftOut(dataPin, clockPin, MSBFIRST, seq[n]);          //Send the data
        digitalWrite(latchPin, HIGH);            //Pull latch HIGH to stop sending data
        delay(75);
    }
}

void sendProm(){
  for (int i=0; i <= 100; i++){
       // read a byte from the current address of the EEPROM
  value = EEPROM.read(address);
 
  Serial.print(address);
  Serial.print(",");
  Serial.print(value, DEC);
  Serial.println();
 
  // advance to the next address of the EEPROM
  address = address + 1;
 
  // there are only 512 bytes of EEPROM, from 0 to 511, so if we're
  // on address 512, wrap around to address 0
 
   
  delay(15);
   }
   address = 0;
}





My first step will be to make sure that there is indeed 5v present at the LED SUP input.  Any thoughts after that would be greatly appreciated.

Loren
22  Using Arduino / Interfacing w/ Software on the Computer / Re: Inconsistent results transferring EEprom from Arduino to Processing on: February 03, 2014, 08:40:52 pm
I don't know if makes a difference but
Quote
Serial.begin(57000);
probably should be 57200 in both the Arduino and Processing code.

57200 threw an error in processing but 57600 seems to be working better.  Thanks groundfungus.  The only little sticky wicket left is how to clear the inData variable once the full message has been received?

Loren
23  Using Arduino / Interfacing w/ Software on the Computer / Inconsistent results transferring EEprom from Arduino to Processing on: February 03, 2014, 07:50:09 pm
I'm trying to setup a processing program to read the eeprom on a pro mini into a gui.   My problem is that I'm not able to get the computer and the mini to communicate consistently.  Here are the two sketches:

On the Pro Mini:

Code:

#include <EEPROM.h>

void setup()
{
  // start serial port at 9600 bps and wait for port to open:
  Serial.begin(57000);

}

int inByte;

char inData[20]; // Allocate some space for the string
char inChar; // Where to store the character read
byte index = 0; // Index into array; where to store the character
int address = 0;
byte value;

void loop()
{
  // if we get a valid byte, read analog ins:
  if (Serial.available() > 0) {
    // get incoming byte:
    //inByte = Serial.read();
    //Serial.println("One way"); 


    while(Serial.available() > 0) // Don't read unless
      // there you know there is data
    {
      if(index < 19) // One less than the size of the array
      {
        inChar = Serial.read(); // Read a character
        inData[index] = inChar; // Store it
        index++; // Increment where to write next
        inData[index] = '\0'; // Null terminate the string
      }
    }
    // Now do something with the string (but not using ==)
    if (strcmp(inData, "Read")  == 0){
      Serial.println("SndEprom");
      sendProm();
     
    }

  }
}

void sendProm(){
  for (int i=0; i <= 512; i++){
       // read a byte from the current address of the EEPROM
  value = EEPROM.read(address);
 
  Serial.print(address);
  Serial.print(",");
  Serial.print(value, DEC);
  Serial.println();
 
  // advance to the next address of the EEPROM
  address = address + 1;
 
  // there are only 512 bytes of EEPROM, from 0 to 511, so if we're
  // on address 512, wrap around to address 0
  if (address == 512)
    address = 0;
   
  delay(15);
   }
   address = 0;
}


Processing Sketch:

Code:
// Need G4P library
import g4p_controls.*;
import processing.serial.*;

Serial port;
int val = 0;
int linefeed = 10;


public void setup() {
  size(480, 320, JAVA2D);
  createGUI();
  customGUI();
  // Place your setup code here
  println(Serial.list());
  port = new Serial(this, Serial.list()[4], 57000);
 
}

public void draw() {
  background(230);
}

// Use this method to add additional statements
// to customise the GUI controls
public void customGUI() {
}

// Called whenever there is something available to read
void serialEvent(Serial port) {
  String myString = port.readStringUntil(linefeed);

  if (myString != null) {
    print(myString);
  }
}

public void button1_click1(GButton source, GEvent event) { //_CODE_:button1:696807:
  println("button1 - GButton event occured " + System.currentTimeMillis()%10000000 );
  port.write("Read");
}

The pro mini will only send the eeprom data about one third of the time.  I can see through my ftdi setup that the command is being sent out to the mini.  What can I do to get the functions to work reliably on both ends?

Thanks,

Loren
24  Using Arduino / Networking, Protocols, and Devices / Re: Trying to get RSSI Value... How do I troubleshoot this on: January 24, 2014, 12:06:21 pm
Glad the device is working as I was running out of ideas smiley-lol
Does this mean your happy the device is working as expected and you maybe need a better/different way to cope with needle bending and no RSSI signals?

I'd like to create a bar graph on a tft based on the RSSI level, but I'll do some searching and see what I can find.  For now I think I'm ok.  Again many, many, thanks for your help!

Loren
25  Using Arduino / Networking, Protocols, and Devices / Re: Trying to get RSSI Value... How do I troubleshoot this on: January 23, 2014, 08:52:46 pm
Quote
It actually works when you separate the two a bit.
"It"? As in you now get changing RSSI values? Or, as in the LED gets brighter/dimmer?
Sorry,  Both.
26  Using Arduino / Networking, Protocols, and Devices / Re: Trying to get RSSI Value... How do I troubleshoot this on: January 23, 2014, 08:17:56 pm
It actually works when you separate the two a bit.   Let me take a stab at what I think was going on and see if I'm right.  If the signal strength is so strong the pulse doesn't look like a pulse anymore but just 5v.  This would create a problem with the arduino because there is no leading or falling edge right?

Thanks,

Loren
27  Using Arduino / Networking, Protocols, and Devices / Re: Trying to get RSSI Value... How do I troubleshoot this on: January 22, 2014, 07:53:16 am
Quote
If the led gets dim with some obstructions, we know that the RSSI is working at the adapter, right?
We know that the LED is actually reflecting the RSSI level. That's not exactly the same thing. RSSI may be being measured without the LED actually reflecting anything more than "connected".

Ok
28  Using Arduino / Networking, Protocols, and Devices / Re: Trying to get RSSI Value... How do I troubleshoot this on: January 22, 2014, 07:49:23 am
Got closets? Anything to increase the number of walls between the two XBees...
Got it.

 If the led gets dim with some obstructions, we know that the RSSI is working at the adapter, right?
29  Using Arduino / Networking, Protocols, and Devices / Re: Trying to get RSSI Value... How do I troubleshoot this on: January 22, 2014, 07:12:15 am
Quote
Inside how far apart do they need to be for me to notice a change?
That was the point I was trying to make earlier. Distance and RSSI are related, but there are so many factors other than distance that have a far greater impact. Put one XBee inside, and put the other outside, or upstairs. Just having a wall between them will have a bigger impact than moving them 20 feet farther apart.
That's I guess what I was trying to get to.  I live in a 2 bedroom apartment, so one at one end of the apartment and the other in the other corner might tell me more with some obstructions between the two.
30  Using Arduino / Networking, Protocols, and Devices / Re: Trying to get RSSI Value... How do I troubleshoot this on: January 21, 2014, 01:31:35 pm
Have you tried connecting direct to the Mega without your shield or at least tried a different pin for the RSSI just in case the shield is not passing pin 8 through as expected.
Does the RSSI LED on the Sparkfun breakout board adjust in intensity depending on signal strength?

Yes I have connected directly to the mega on several different pins and with the same results.  I've also tried running through a spark fun logic level converter too, thinking that maybe 3v wasn't enough to identify the edge of the pulse.  Check http://forum.arduino.cc/index.php?topic=205403.msg1511651#msg1511651 for the findings of that question.   Glad to know that my antics aren't just crazy ideas, that I am working good troubleshooting practices.  Ive also checked continuity from the pin on the header of XBEE socket to the wire leaving the adapter, that's good too.  The glowing led would lead me to believe that  the RSSI is working on the XBEE adapter.  The one thing that I hadn't checked is the dimness of the RSSI LED.  Inside how far apart do they need to be for me to notice a change?

Thanks for all of the help in troubleshooting this!

Loren
Pages: 1 [2] 3 4 ... 10