Show Posts
Pages: 1 ... 85 86 [87] 88 89 ... 111
1291  Forum 2005-2010 (read only) / Interfacing / Re: what is the best ethernet shield? on: January 16, 2009, 03:34:35 pm
The limitations are not necessarily  with the shield or the ENC28j60.  The Arduino is very limited in memory space (from the perspective of what is needed by the TCP/IP STACK)  You would even have trouble if you programmed it in straight AVRGCC with just an AVR168.
1292  Forum 2005-2010 (read only) / Interfacing / Re: Analog output on: November 17, 2008, 10:22:33 pm
LED + resistor = ALWAYS -> to save the life of the LED and the I/O port since the LED resistor is about CURRENT not VOLTAGE.
1293  Forum 2005-2010 (read only) / Interfacing / Re: Slot Cars Hack on: November 17, 2008, 10:54:50 pm
for lack of a better term, the PWM from the Arduino needs to control transistor throttles that are added to the I/O pins.  The Transistors in the throttle circuits carry the current from the "game" power pack. The Arduino just sends low current  PWM to the transistor  throttle.

Untested:
1294  Forum 2005-2010 (read only) / Interfacing / Re: relay missing on: November 18, 2008, 09:46:36 am
How are you powering the relays?

Is there ANY possible way that the RELAY COIL being energized can feed back into the Arduino's power supply as a SPIKE that is not filtered.

Is it possible to supply the power to the coils via common Ground and Separate Supply... like a battery... to test the theory that glitches are causing unreliable changes on the I/O pins.

You could try adding some additional BYPASS CAPACITORS on the Arduino MCU supply to help catch spikes.  Maybe the Sanguino is more sensitive or has fewer caps.

1295  Forum 2005-2010 (read only) / Interfacing / Re: Arduino voltage? on: November 17, 2008, 09:56:17 pm
1st,  What do you mean "advertised"?

The example showed an LM35 that reads Millivolts per Degree C  and your LM34 reads Millivolts per degree F.

It's the chip USED that defines Celcius or Fahrenheit... not the math.

The math does makes sense.  The *100 converts the Millivolts to volts.

The 5 and 1024 are for scaling the MAX A/D voltage against the MAX A/D resolution.

temperature = (5*val*100/1024)

=

TEMP F = 5V MAX * A/D VALUE READ * 100 (Millivolts to Volts) divided by  A/D resolution  (again, this is called SCALING)

If you just read RAW values... it will not make sense... as you have noticed.

The A/D on the Chip reads 0-5V with 1024 Bits of resolution.   Halfway between 0 and 5V (like 2.5v) the A/D value = 512.

Based on my understanding of your circuit and results  160 = 78.2 Degrees F.

Sounds Right to me.



By The Way, if you want a chip that send you REAL temperature values, try the 1-wire DS18S20 or 3-wire serial DS1620.
1296  Forum 2005-2010 (read only) / Interfacing / Re: Arduino and Parallax GPS on: November 13, 2008, 02:09:25 pm
In my case, I really don't want to lose the Diecimila host connection to talk with the Serial stream from the Parallax GPS.  So far, the Arduino Software.Serial library work good for me.  (It was designed to allow RS232 type serial communication on non-uart pins using the Bit-Bang Method)

This does mean you need to write code in such a way that you don't "miss" incoming data...  but it's not that hard.
1297  Forum 2005-2010 (read only) / Interfacing / Re: 2N2222 vs 2N2222A on: November 13, 2008, 02:15:36 pm
Here is a nice tidbit of RETRO ELECTRONCS reading material...   it also somewhat explains why you should just consider  lovely 2N2222 a recommendation and not a requirement.

http://semiconductormuseum.com/Transistors/Motorola/Haenichen/Haenichen_Index.htm
1298  Forum 2005-2010 (read only) / Workshops / Re: Anyone In NC, SC, Or GA on: June 04, 2009, 01:49:48 pm
Georgia
1299  Forum 2005-2010 (read only) / Workshops / Re: Atlanta, GA Area on: May 04, 2009, 11:05:32 am
Great news. Thanks.  I'm in Cumming, myself.
1300  Forum 2005-2010 (read only) / Exhibition / Re: My SunDuino on: January 20, 2011, 12:53:37 pm
Very nice.  I just had to buy one to check this chip out...  
1301  Forum 2005-2010 (read only) / Exhibition / Re: FORTH environment for Arduino on: January 01, 2011, 11:17:24 am
Neat.

Peanut Gallery Comment:  Forth never really caught on... did it.
1302  Forum 2005-2010 (read only) / Exhibition / Re: audiophile 3-way active crossover *volume control* on: January 01, 2011, 08:59:57 pm
As always... Excellent work.
1303  Forum 2005-2010 (read only) / Exhibition / Re: dip swit basic need help led on: December 28, 2010, 08:31:34 pm
FYI: "Exhibition" is about showing off what you have done.

If you are a noob and want to learn more, there are some really good documents and even books available.  Nothing says you can't just "read" for a while before you start experimenting.

Good places to start:

http://www.lulu.com/items/volume_63/1108000/1108699/4/print/ARDUINO_NOTEBOOKv6.pdf


http://dave.lab6.com/acid/dump/2009/ASKManual.pdf
1304  Forum 2005-2010 (read only) / Exhibition / Re: Live For Speed Gear Indicator on: December 23, 2010, 04:24:41 pm
A lot of the real work was done in the UDP-INSIM-PACKET application on the PC.  It listens to the OUTGAUGE values from the network and creates the serial commands that are sent to the arduino.

While this was an attempt to recreate the Gear Indicator project, it could certainly be expanded to control other things... like a real world Speedo and real gauges.  Having all the source code makes it just a simple matter of coding.

Not having to use overly complicated C# or JAVA means I can code something up even if I'm short on time.


While I am  certainly still tweaking the UDP-Serial application, I have made it available in its current state on my website.  

http://www.pwillard.com/files/OGBFINAL.zip
1305  Forum 2005-2010 (read only) / Exhibition / Live For Speed Gear Indicator on: December 22, 2010, 02:32:01 pm
Work IN progress...

What is it?

The Racing Simulator "Live For Speed" has the ability to broadcast live simulation data over UDP packets for much of the in-game data so even remote devices can make use of data available.  This data is defined as the INSIM PACKET data.  Among these is the OUTGAUGE (dashboard) information such as speed, Turbo Boost, RPM, Current Gear, etc.

A while back, a determined hacker named Vladimir Kadlec created a way to display the GEAR INDICATOR data to a seven segment LED attached to the LPT port.

This was all good while we still had LPT ports, but we seem to no longer get LPT ports on our systems.  I started a project that would convert the OUTGAUGE UDP - to- LPT  project into a OUTGAUGE UDP -to- Serial Port project by removing the LPT code and replacing it with the Serial Port using the Windows API.

Vlad's Project was great.  It was written in the very "free" DevC++ Windows C Compiler and all source code was available.  Adding the Windows Serial API was pretty straightforward.  

So, I coded up a USB-FTDI-Serial port µController.

http://www.pwillard.com/files/gearind.pdf



After looking over some available tutorials... I decided to use them as a launching point for an old project I started that originally used the now obsolete Parallax SX28.   I decided to share my progress.

Arduino Code - Complete (below)
INSIM UDP to Serial Relay client - Complete (will be posted on my website)
Enclosure - In Progress

Test Setup:


Code:
//----[ OutGaugeBus ]------------------------------------------------------
//  Name    : OGBUS.PDE
//-------------------------------------------------------------------------
//  Purpose : Receive serial commmands from "Live For Speed" INSIM OUTGAUGE
//          : Client and then display real-time dashboard information
//          : on Arduino based output devices, such as LED's.
//          : Live For Speed References:
//          : LFS/DOCS/INSIM.TXT
//          : http://en.lfsmanual.net/wiki/InSim_Tutorials
//          : http://www.brunsware.de/insim/
//          : See Also: http://www.lfs.net/
//-------------------------------------------------------------------------
//  Date    : 25 Oct, 2007 ( Started as a Parallax SX28 project )
//  Version : 2.11
//  Modified: 12/22/2010 11:30:34 AM
//  Author  : Pete Willard
//          :
//Additional:
//  Credits : * Mike McRoberts - Earthshine Design -
//          :     Arduino Starter Kit PDF
//          :
//          : * Hacktronics - http://www.hacktronics.com/Tutorials
//          :
//          : * Arduino ShiftOut tutorial
//          :
//          : To keep code "recognizable", available references were used
//          : and changed very little from reference sources listed above.
//-------------------------------------------------------------------------
//  Notes   : Includes using a 74HC595 Shift Register for the Bar Graph
//          : and discrete 7-segment display for gear indicator
//          :
//          : Commands come from OGBUS.EXE (DevC++ UDP Client) and convert
//          : INSIM OUTGAUGE data into serial packet data for Arduino
//          : INSIM Client Software will send ALL vaalues every update
//          : but can send as little as Clear Command "C0"
//          :
//          : Expansion:
//          : With a little creative wiring, it would be possible to
//          : daisy chain multiple serial Arduino boards or if USB is
//          : used, multiple OGBUS clients can be run at one time
//          :
//          : Command Examples:
//          : (Comma Separated Values) Any Order up to 24 Characters
//          : Format: <command><argument>,<command><argument>...<cr><lf>
//          : C0    = Clear All Outputs
//          : G0-G8 = Gear Indicator
//          : R0-R8 = RPM Bargraph
//          : S0|S1 = Shift Light Pin On|Off (binary)
//          : P0|P1 = Pit Limiter Pin On|Off (binary)
//          :
//-------------------------------------------------------------------------


//----[ Variables ]--------------------------------------------------------
const int buffsize = 25;     // Buffer Size
char buffer[buffsize];      // Incoming Serial Data Buffer
int  debug    = 0;          // Set to NON-ZERO to test with Serial Monitor
int  ledCount = 8;          // The number of LEDs in the Bar Graph LED
//-------------------------------------------------------------------------
// Seven segment LED layout for the Gear Indicator
// Arduino pins must be sequential
int GIstartpin = 2;
//                    Arduino pin: 2,3,4,5,6,7,8
byte seven_seg_digits[9][7] = {  { 0,0,0,0,1,0,1 },  // = R
                                 { 0,0,1,0,1,0,1 },  // = N
                                 { 0,1,1,0,0,0,0 },  // = 1
                                 { 1,1,0,1,1,0,1 },  // = 2
                                 { 1,1,1,1,0,0,1 },  // = 3
                                 { 0,1,1,0,0,1,1 },  // = 4
                                 { 1,0,1,1,0,1,1 },  // = 5
                                 { 1,0,1,1,1,1,1 },  // = 6
                                 { 0,0,0,0,0,0,0 },  // = 7 (blank)
                                                 };
//                                 a b c d e f g ------>  LED segment
//-------------------------------------------------------------------------
// Bargraph Values for 8 LED Bargraph
// Only 8 values of BYTE are needed to light the 8 bargraph LED's
// sequentially
// NOTE: Most Bargraph LED's are "10 unit" so I have bottom 2 and top 2
// LED's tied together.
// Part Number used:   AVAGO "HDSP-4832"  3-Green 4-Yellow 3-Red
// Mouser Part Number: 630-HDSP-4832
// The Shift Register lowest outputs start with Green Anodes of the
// Bargraph.
//
byte bargraph[9] = {0x00,0x01,0x03,0x07,0x0F,0x1F,0x3F,0x7F,0xFF};
//-------------------------------------------------------------------------
// LED PINS - optional since we are low on pins
int shiftlight = 12;
//int pitlimit   = 13;     // Pick one
//int lowfuel    = 13;
//-------------------------------------------------------------------------
// 74HC595 Pin Setup
int latchPin = 9;   // Pin connected to ST_CP (12) of 74HC595
int clockPin = 10;  // Pin connected to SH_CP (11) of 74HC595
int dataPin  = 11;  // Pin connected to DS    (14) of 74HC595

//----[ SETUP ]-----------------------------------------------------------
void setup() {
  // Speed needs to match INSIM - Outgauge Client Configuration setting
  Serial.begin(19200);
  Serial.flush();

  // Set all pins to Outut Mode
  int a;
  for(a=0;a < 13;a++){
      pinMode(a, OUTPUT);
   }
}

//----[ MAIN LOOP ]------------------------------------------------------
void loop() {

// Mike McRoberts serial input command routines
// from the "Serial Controlled Mood Lamp" example
// in Arduino Starter Kit Manual from Earthshine Design

if (Serial.available() > 0) {
int index=0;
  delay(10); // let the buffer fill up
  int numChar = Serial.available();
   if (numChar>buffsize) {
       numChar=buffsize;
      }
   while (numChar--) {
          buffer[index++] = Serial.read();
         }
 splitString(buffer); // Process Serial Packet
 }
}

//----[ SubRoutines ]----------------------------------------------------

void splitString(char* data) {
// also from "Serial Controlled Mood Lamp" example

if (debug) {
 Serial.print("Data entered: ");
 Serial.println(data);
}

// Sequentially De-Tokenize the Serial Commands received
 char* parameter;
       parameter = strtok (data, " ,");
   while (parameter != NULL) {
          // Pass result to parseCMD for each Command received
          parseCMD(parameter);
          // remove processed commands from the list
          parameter = strtok (NULL, " ,");
   }

   // Clear the text and serial buffers
   for (int x=0; x<buffsize; x++) {
        buffer[x]='\0';
   }
  Serial.flush();
}

//=======================================================================
void parseCMD(char* data) {
// Flexible, easily expanded Command Parser
// based on "Serial Controlled Mood Lamp" example
// *** Marvelous coding by Mike MCRoberts

//--[gear]---------------------------------------
if ((data[0] == 'G') || (data[0] == 'g')) {
 // Have command, now get Argument "value" while removing whitespace
 int ArgVal = strtol(data+1, NULL, 10);
 // then limit the results to what we expect for this command
     ArgVal = constrain(ArgVal,0,8);
     sevenSegWrite(ArgVal);

     if (debug) {
         Serial.print("Gear is set to: ");
         Serial.println(ArgVal);
     }
}

//--[shift light]--------------------------------
if ((data[0] == 'S') || (data[0] == 's')) {
 int ArgVal = strtol(data+1, NULL, 10);
     ArgVal = constrain(ArgVal,0,1);
     digitalWrite(shiftlight,ArgVal);

     if (debug) {
         Serial.print("SHIFT is set to: ");
         Serial.println(ArgVal);
     }
}

//--[reset]--------------------------------------
 if ((data[0] == 'C') || (data[0] == 'c')) {
   int ArgVal = strtol(data+1, NULL, 10);
       ArgVal = constrain(ArgVal,0,1);

       sevenSegWrite(8);
       shiftWrite(0x00);

     if (debug) {
         Serial.print("Clear Outputs");
     }
 }

 //--[rpm bar graph]-----------------------------
 if ((data[0] == 'R') || (data[0] == 'r')) {
   int ArgVal = strtol(data+1, NULL, 10);
       ArgVal = constrain(ArgVal,0,8);

       shiftWrite(bargraph[ArgVal]);

       if (debug) {
           Serial.print("RPM is set to: ");
           Serial.println(ArgVal);
       }
 }

} // End parseCMD Loop


//=======================================================================
void sevenSegWrite(byte digit) {
  byte pin = GIstartpin;
  for (byte segCount = 0; segCount < 7; ++segCount) {
    digitalWrite(pin, seven_seg_digits[digit][segCount]);
    ++pin;
  }
 }
//=======================================================================
void shiftWrite(byte Rdata){
    // prepare the register for data
    digitalWrite(latchPin, LOW);
    // shift out the bits:
    shiftOut(dataPin, clockPin, MSBFIRST, Rdata);
    //Set the latch pin high to enable the outputs
    digitalWrite(latchPin, HIGH);
}

Pages: 1 ... 85 86 [87] 88 89 ... 111