Show Posts
Pages: 1 [2] 3
16  Using Arduino / General Electronics / Re: Program Not running from alternate power supply on: December 23, 2012, 01:19:52 pm
The voltage regulator installed on the RedBack is different than the one that is installed on the YellowJacket. The datasheet for the RedBacks voltage regulator says max is 12v, the YellowJacket was upgraded so they could use a beefier voltage regulator.

I am using the WiShield libraries from async labs UDPApp libraries to connect to the quad copters WiFi network. I am able to send formatted strings to the quad copter which are parsed by the quad copters on board software into flight commands.

The 5v and 3v pins near the USB header are output pins, the voltage regulator is on the RAW input pin. When the board is being powered from the 11.1v battery, it is only connected to the three range finders. When I have it going straight from USB it doesn't have the 11.1v power supply connected. So for testing and programming I am running straight from the USB and only the USB cable. When I plug it into the battery on the drone it is only getting power from the RAW pin and it isn't executing the WiFi software. Could I be throwing too much power at it? I would think that being within the ~7 to 12v range that it should be fine.

It is confusing me because it runs fine, sensors and program, through the USB only connection. But when I throw it onto the quad copter giving power through the regulated power input pin the board gets power, displayed by the red led, however never actually finishes initializing and running the program I've uploaded to it, displayed by flashing green led and no action from quad copter.

So I think my question is; should I drop the power down from the 11.1v battery to maximum current for USB, I'm guessing it's 5v but I admit I lack a whole mess of knowledge on the electrical side since I'm a software guy, and power the RedBack board through the Vcc and ground pins on the USB jumper pins? Would spending that money, the whole $4 maybe and time, solve my problem? My first attempt to fix the problem was commenting out all of the Serial statements in the program thinking that since the RX, TX, and DTR pins on the USB header weren't connected maybe it couldn't initialize because of a serial comm error, didn't work.

The YellowJacket is out of stock and there won't be anymore for quite some time, I originally had one but burned it out plugging the 11.1v into the 5v pin, which is the output pin. I knew it at the time, I just got confused and broke it. So I'm using the RedBack now.

I know this is a bit long winded, sorry about that, but I wanted to make sure I'm giving all the necessary data.

Why would it work through the USB and not through an alternate power that is in acceptable ranges?

Numbers from the battery:
"1000mAh 11.V
10C Continuous Discharge
Charge at 1A max"

Thank you guys for the help.
17  Using Arduino / General Electronics / Program Not running from alternate power supply on: December 22, 2012, 07:33:29 pm


I have ran and powered my whole project from the USB programming port. It connects to my wifi quad copter and sends the take off and land instructions properly, while reading the range finders.

The board has a voltage regulator attached to the RAW pin that can take up to 12 volts. The battery on the quad copter that I've spliced into is 11.1v. The board when I connect it to the battery draws power and the red power led lights up. But the LED for a WiFi connection just blinks and flashes instead of firing up and connecting to the WiFi network.. I'm curious, should I get a 5v or 7v and use the vcc pin on the USB serial headers instead of the raw power pin.

My understanding of the information from AsyncLabs and linksprite information says that the RAW pin for input power is sufficient to run the project. Is this something I am misunderstanding?

The board:
http://www.linkspritedirect.com/product_info.php?products_id=26
which is a clone of:
http://asynclabs.com/wiki/index.php?title=YellowJacket_1.0#Pin_Usage

The sensors (3):
http://www.maxbotix.com/documents/MB1010_Datasheet.pdf

The quad copter:
http://ardrone2.parrot.com/

I've been stuck for about a week trying various ideas and short of ordering/waiting for new parts I've tried them all, including days of time spent searching the net.

Thanks for any help and I hope this is the right place,
Postholes
18  Using Arduino / Networking, Protocols, and Devices / WiFi Project on FastTrack... Crashed could use a hand on: December 04, 2012, 03:53:23 pm
So after I dorked out and blew up my rugged circuits yellow jacket I've spent the last day and a half trying to find another solution since that particular board is not going to be available anytime soon.

For my project I need to connect to an ad hoc network with a static IP and send formatted strings from my arduino uno r3 through a UDP port.

I've been staring at:
https://www.sparkfun.com/products/9954

But I can't find anything that says UDP libraries are working for that shield.

I do like the idea of using this guy, but I have no idea how I would interface my arduino uno to it:
https://www.sparkfun.com/products/11048
      Does this solution require this guy too?
      https://www.sparkfun.com/products/10854

I would love to just use the arduino wifi shield however everywhere I've looked seems that isn't UDP ready and I have about 2 weeks to catch up on almost 6 months of lost work..

Any suggestions or advice would be greatly appreciated.

BTW this is the guy I'm trying to repalce:
http://ruggedcircuits.com/html/yellowjacket.html

Thank you,
Postholes

19  Using Arduino / Interfacing w/ Software on the Computer / Re: I may have fried it, advice please on: December 04, 2012, 03:24:22 am
Well I am looking at the Arduino Wifi shield. It is much heavier (weight) than I want to use, also about $30 more expensive, than the board I just blew up.... (cuss words)

I am looking through some of the data sheets and information on the wifi libraries and the wifi shield and I am not finding anything that says I can connect to an ad-hoc wifi network. I am guessing that I can simply by providing an existing adhoc network SSID/credentials. Does anybody know if this is possible before I spend the cash on this guy? I tried Google and searching the Arduino forums and haven't found an actual definitive answer to this question. It would seem that connecting to an existing network should work, the Client class connect() function seems to allow me to assign an ip/port to connect to.

Thanks,
Postholes
20  Using Arduino / Interfacing w/ Software on the Computer / Re: I may have fried it, advice please on: December 03, 2012, 06:17:31 pm
Thanks PaulS,

I went to do the order and they are out of stock, now looking for other possible options unless I hear they will have one sooner than a week or 2.

Any suggestions?
21  Using Arduino / Interfacing w/ Software on the Computer / I may have fried it, advice please on: December 03, 2012, 05:41:08 pm
I am using a http://ruggedcircuits.com/html/yellowjacket.html and went to test my program. I dorked out and plugged the 11v batter into the 5v pin and not the RAW input pin. The board never started, I waited a full minute at least for it to fire up its WiFi connection. It didn't happen and by the time I unplugged everything  I realized my mistake. The microcontroller was hot when I pulled it out to make sure I have the proper program installed to it. However when I try to upload I get this error:

avrdude: stk500_recv(): programmer is not responding

When I hit the reset button the RX/TX lights don't blink.

I haven't tried this yet, but if I click the "Burn Bootloader" button in the tools drop down menu would that help or just increase my problems. The real issue is this is for my senior project and I have to present tomorrow evening. I don't think I could get replacement here soon enough if I wanted to. But I will try next day air anyway, but I can't afford to make the order unless I get input from somebody else.

Thanks,
Postholes
22  Using Arduino / Programming Questions / WiFi Program not starting on: November 20, 2012, 06:46:15 pm
I am trying to get a rugged circuits yellowjacket to host a WiServer that will allow me to control a robot through a web interface with a wireless connection. However it is getting stuck and I am not even getting the print lines in the:

boolean sendPage()
function.

I've been playing with this and some example code and I can't quite figure out what is wrong with this. Any help would be appreciated.

I have all of the appropriate libraries that are being referenced, well servo and string are both arduino. With other demo programs I've used using #include <WiServer.h> works fine.

Thanks,
Postholes

Code:
#include <WiServer.h>
#include <string.h>
#include <Servo.h>

#define WIRELESS_MODE_ADHOC   2

// Variable Declaration ======================================================
#define lasers 8
#define solenoid 12
#define range 9 // Just in case we need to use Analog then use pin A5
#define elevation 10

// pins for motor speed and direction
int speed1 = 5, speed2 = 6, direction1 = 4, direction2 = 7;

// starting speed and rotation offest
int startSpeed = 70, rotate = 30;

// initial speeds of left and right motors
int left = startSpeed, right = startSpeed;

// Elevation Variable
int eleValue;

// Servo Declaration and initialization
Servo eleServo;

// Range finder variables
unsigned int timeNow;
long pwmRange, inch;
boolean firingRange = false;
int fullSteamAhead = 7;

// Wireless configuration parameters ----------------------------------------
unsigned char local_ip[] = { 10,1,1,5};   // IP address of WiShield
unsigned char gateway_ip[] = { 192,168,1,1};   // router or gateway IP address
unsigned char subnet_mask[] = { 255,0,0,0};   // subnet mask for the local network
const prog_char ssid[] PROGMEM = { "PingTheBot"};      // max 32 bytes
unsigned char security_type = 0;   // 0 - open; 1 - WEP; 2 - WPA; 3 - WPA2

// WPA/WPA2 passphrase
const prog_char security_passphrase[] PROGMEM = { "12345678"};   // max 64 characters

// WEP 128-bit keys
// sample HEX keys
prog_uchar wep_keys[] PROGMEM = {
  0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d,   // Key 0
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // Key 1
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // Key 2
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00   // Key 3
};

// setup the wireless mode
// infrastructure - connect to AP
// adhoc - connect to another WiFi device
unsigned char wireless_mode = WIRELESS_MODE_ADHOC;

unsigned char ssid_len;
unsigned char security_passphrase_len;
// End of wireless configuration parameters ----------------------------------------

/* boolean states[3]; //holds led states */
boolean states[7]; // holds states for left, forward, right, laser, fire, stop, elevation up, elevation down
int stateCounter; //used as a temporary variable

char tmpStrCat[512];
char numAsCharBuff[2];
char ledChange;

// Range finding function
boolean findRange()
{
boolean goStopValue = false;

pwmRange = pulseIn(range, HIGH);

// 147uS per inch according to datasheet
inch = pwmRange / 147;

if ((inch <= fullSteamAhead) && (millis() - timeNow) > 250)
{ // If sensor reads something at or closer than 7 inches, send all stop
timeNow = millis();
goStopValue = false;
firingRange = false;
return goStopValue;
}
else
{
goStopValue = true;
if (goStopValue && (inch < 60))
{
firingRange = true;
}
return goStopValue;
}

return goStopValue;
}

// Turn left function
void turnLeft()
{
left = rotate;
right = 0;
analogWrite(speed2, right);
analogWrite(speed1, left);
}

// Turn Right function
void turnRight()
{
right = rotate;
left = 0;
analogWrite(speed2, right);
analogWrite(speed1, left);
}

// Forward Function
void forward()
{
if (findRange())
{
left = startSpeed;
right = startSpeed;
analogWrite(speed1, left);
analogWrite(speed2, right);
}
else
{
left = 0;
right = 0;
analogWrite(speed1, left);
analogWrite(speed2, right);
}
}

// laser function
void laser()
{
digitalWrite(lasers, HIGH);
}

// fire weapon function
void fireWeapon()
{
if (firingRange)
{
digitalWrite(solenoid, HIGH);
delay(250);
digitalWrite(solenoid, LOW);
}
}

// stop funtion, instead of just stopping this puts robot in near reset state
void stopRobot()
{
eleValue = 20;
analogWrite(speed1, 0);
analogWrite(speed2, 0);
digitalWrite(lasers, LOW);
eleServo.write(eleValue);
}

// Elevation up function
void elevationUp()
{
int eleValueMax = 80;
if (eleValue < eleValueMax)
{
eleValue = eleValue + 10;
}
else
{
eleValue = 80;
}
eleServo.write(eleValue);
}

// elevation down function
void elevationDown()
{
int eleValueMin = 20;
if (eleValue > eleValueMin)
{
eleValue = eleValue - 10;
}
else
{
eleValue = 20;
}
eleServo.write(eleValue);
}

// reads states and calls proper function. Takes integer ledChange
// sets all states != ledChange to false.
void writeStates(int pinChange)
{
// turn off all states but the one user updated
int i;
for (i = 0; i < 7; i++)
{
if (i != pinChange)
{
states[i] = false;
}
}


//  set States or call functions to run to handle robot control
switch (pinChange)
{
case 0:
turnLeft();
break;
case 1:
forward();
break;
case 2:
turnRight();
break;
case 3:
laser();
break;
case 4:
fireWeapon();
break;
case 5:
stopRobot();
break;
case 6:
elevationUp();
break;
case 7:
elevationDown();
break;
}
}

// This is our page serving function that generates web pages
boolean sendPage(char* URL)
{
// Test print begin =======================================
Serial.println("boolean sendPage Being page printing");
// test print end =======================================

Serial.println("Page printing begun");

//printStates();
writeStates(ledChange);

if (URL[1] == '?' && URL[2] == 'R') // R0 = left, R1 = forward, R2 = right, R3 = laser, R4 = fire, R5 = stop, R6 = elevation up, R7 = elevation down
{
ledChange = (int)(URL[3] - 48);

// Write the states to the board
writeStates(ledChange);

//after having change state, return the user to the index page.
WiServer.print("<HTML><HEAD><meta http-equiv='REFRESH' content='0;url=/'></HEAD></HTML>");
return true;
}
 
if (strcmp(URL, "/") == false)
{
WiServer.print("<html><head><title>Predator Bot</title></head>");

WiServer.print("<body><center>Select the control state to change:<center>\n<center>");
// R0 = left, R1 = forward, R2 = right, R3 = laser, R4 = fire, R5 = stop, R6 = elevation up, R7 = elevation down
tmpStrCat[0] = '\0';
strcat(tmpStrCat, "<a href=?R0>Left</a>");
strcat(tmpStrCat, "<a href=?R1>Forward</a>");
strcat(tmpStrCat, "<a href=?R2>Right</a>");
strcat(tmpStrCat, "<a href=?R3>Lasers</a>");
strcat(tmpStrCat, "<a href=?R6>Elevation Up</a>");
strcat(tmpStrCat, "<a href=?R7>Elevation Down</a>");
strcat(tmpStrCat, "<a href=?R4>Fire Weapon</a>");
strcat(tmpStrCat, "<p></p><p><h1><a href=?R5>Stop</a></h1></p>");
WiServer.print(tmpStrCat);

WiServer.print("</body></html> ");
return true;
}
}

void setup()
{
// Set pins to proper values
pinMode(speed1, OUTPUT);
pinMode(speed2, OUTPUT);
pinMode(direction1, OUTPUT);
pinMode(direction2, OUTPUT);
pinMode(lasers, OUTPUT);
pinMode(solenoid, OUTPUT);
pinMode(elevation, OUTPUT);
pinMode(range, INPUT);

// set default elevation for servo
eleValue = 20;

// set up servo for elevation control
eleServo.attach(elevation);
eleServo.write(eleValue);

// set motor direction to forward
digitalWrite(direction1, HIGH);
digitalWrite(direction2, HIGH);

// set speed of both motors
analogWrite(speed1, left);
analogWrite(speed2, right);

// begin serial output
Serial.begin(9600);

// Test printing ===============================================
Serial.println("Setup running, WiServer.Init next command");
// End test printing ===============================================

// WiServer Initialization
WiServer.init(sendPage);

// Test printing =======================================
        Serial.println("WiServer.init(sendPage) happened");
// end test printing =======================================

// Set all states to false during initial setup
int i;

for (i = 0; i < 7; i++)
{
states[i] = false;
}

// Initially set time values
timeNow = millis();
}

void loop()
{
// Run WiServer
WiServer.server_task();

delay(10);
}
23  Using Arduino / General Electronics / Re: Wiring Connections on: November 06, 2012, 10:11:29 pm
Thank you guys!!!

oric_dan, your links are exactly what I was looking for. I used original link that justjed offered and was poking around on jameco but couldn't find that connector pin that you have pasted.

Thanks again everybody I really appreciate your input!


Postholes
24  Using Arduino / General Electronics / Re: Wiring Connections on: November 06, 2012, 09:15:37 pm
Justjed,

I would like that idea, but I want to put the ends onto the wires. I would need a crimping tool to attach the connections to the wires, the plastic boxes aren't all that important to me. I would like to keep it to single wires for the most part. This is being used for my senior project to turn a Parrot AR.Drone into a self flying drone. I need to keep things light and tight so I can't have slack wire to roll up and tie once it's put together.


cr0sh,

This is just to hold together long enough to finish my 1 year project then I don't want to have to desolder anything from my board, just personal preference, since the YellowJacket is a $55 piece of hardware.
25  Using Arduino / General Electronics / Wiring Connections on: November 06, 2012, 07:37:42 pm
I am doing a project with the Rugged Circuits YellowJacket http://ruggedcircuits.com/html/yellowjacket.html

The problem I have is that I have three Sonic Range Finders (The maxbotix lv-ez1 from sparkfun). I have a little spool of wire which should be plenty to handle my project. However I have male header pins on all the boards and sensors with the square pins sticking out. I need to find a solution to attach or crimp some ends to the wires so that I can connect the sensors to the microcontroller. I've been searching the Internet, stopped at Fry's electronics, a hobby shop, and a Radio Shack and nobody seems to have anything, or I don't know what I really need. Either way I was wondering if somebody could help me out. I would be happy to attach a picture to clarify what I'm trying to describe if it's necessary.

I have a few wires with some square connections on them that work great but the source that I received those from isn't unlimited and I need to purchase and make these wires on my own.

Any suggestions would be much appreciated,
Postholes
26  Using Arduino / Project Guidance / Re: Senior project Questions/Advice seeking on: May 08, 2012, 06:45:10 pm
I didn't want to do just one sensor in the front because the drone is 18-24 inches wide. If I had a sensor in the middle of the drone it may not see the edge of the door frame it's about to fly through and smack it. The drone has a downward sonar sensor that I may be able to get data from, in that case I could do a rangefinder pointed up, and two looking forward, possibly angled in to detect a lamp or narrow post at a distance. This way I should be able prevent running into ceilings, and figure out how to handle a narrow post near a wall instead of just not seeing it.

I do like the idea of fly until so close, turn 30 degrees, fly, repeat.

Thanks,

Postholes
27  Using Arduino / Project Guidance / Re: Senior project Questions/Advice seeking on: May 07, 2012, 09:43:55 pm
Thank you all.

I will most likely be back when I have problems after starting this project!!!


Postholes
28  Using Arduino / Project Guidance / Re: Senior project Questions/Advice seeking on: May 07, 2012, 07:26:04 pm
I found a video that shows the drone being rotated through the standard command control system (an iPad) so there is an existing command control function to rotate the drone. So my part would involve actually finding the commands in the open source code.


Thanks for the suggestion funkyguy4000!
29  Using Arduino / Project Guidance / Re: Senior project Questions/Advice seeking on: May 07, 2012, 07:13:53 pm
I'm looking at the Rugged Circuits Yellow Jacket http://ruggedcircuits.com/html/yellowjacket.html and I can't find the weight of the actual board anywhere. I can find it's shipping weight, like almost all microcontroller components, but getting the weight of the board seems to be nearly impossible on so much of this type of thing.

I would like to know if I am understanding the description well enough though. The way I am reading this if I use the Yellow Jacket I won't need the arduino pro mini. Just run the sensors to the Yellow Jacket and power/program to the Yellow Jacket board and it will handle everything for me.

Thanks again!
Postholes
30  Using Arduino / Project Guidance / Re: Senior project Questions/Advice seeking on: May 07, 2012, 06:58:35 pm
Quote
You're going to need a power source.

My plan was to use the drones battery to power the board and sensors. It uses a standard RC car type plug so I thought I should be able to find a splitter for that at a hobby shop and just run wires to the board.

I am not entirely certain that the drone can rotate, I am hoping (for pocket book reasons) that it does, otherwise the weight of 8 sensors and the arduino board should keep it below the ~150gram limit.

Thank you for the help and I am reading these replies as absolute encouragement!

Postholes
Pages: 1 [2] 3