Show Posts
Pages: [1]
1  Using Arduino / Project Guidance / Advice on audio decoder shield on: June 22, 2013, 10:25:56 am
So, I am in the early stages of thinking about a project involving streaming audio over a network.

Of course this would require compression for the sake of efficiency, and I noticed there are a few different shields with FLAC decoding capability.

The thing I am unsure about is the feasibility of using these shields to decode a real-time stream, as I've only seen decoding of files from an SD card mentioned. Ideally it would be possible to simply feed a stream to the decoders over SPI... Does anybody know whether this is the case?

I know I would probably require at the very least a Mega 2560 or, if not, a Due to pull this off. I am sure it's possible with the capabilities of the arduino boards on offer, at least. Seems like a look of work but I have been surprised by the capabilities of microcontrollers in similar projects before.
2  Using Arduino / Sensors / Re: Adequate temperature sensor for logging on: March 12, 2013, 05:38:17 am
There are really only two things to go wrong - the software, and the hardware. The latter includes the wiring.
If you are using established software, i.e. the standard libraries and a sketch known to be kosher from Hacktronics or the like, the problem has to be hardware. If the wiring is OK (?) the sensor may well be a dud - because it has suffered from recent user abuse. Trust me, the DS18B20 can take a lot of abuse, but your options for a working solution are limited.

So, what is the code? and do you have a virginal DS18B20 to hand?

Here is my full code... some of the stuff is from the thermistor code, so I have commented it out. A lot of the code is for driving my 7-seg display. My sensor code is all in the setup and loop functions at the bottom.

The sensor I am currently using is virginal.

Code:
#include <OneWire.h>
#include <DallasTemperature.h>

#define A 16
#define B 8
#define C 4
#define D 2
#define E 1
#define FP 32
#define G 64

#define ZERO (A|FP|B|E|C|D)
#define ONE (B|C)
#define TWO (A|B|G|E|D)
#define THREE (ONE|A|G|D)
#define FOUR (FP|B|G|C)
#define FIVE (A|FP|G|C|D)
#define SIX (A|FP|G|C|D|E)
#define SEVEN (ONE|A)
#define EIGHT (ZERO|G)
#define NINE (A|B|C|D|FP|G)


//#define RANGE 56

int analogPin = 0;
int tempRead = 0;
int leftOn = 10;
int rightOn = 11;
int index;
int count = -1;
int sample = 0;

/*int temps[RANGE] = {715,707,698,689,680,670,661,651,641,631,621,611,600,590,579,568,557,546,535,523,512,500,489,477,466,454,442,431,419,407,395,384,372,361,349,338,327,316,305,294,283,273,263,253,243,233,224,214,205,196,188,179,171,163,156,148};*/
int pins[8] = {3,4,5,6,7,8,9,12};
byte encoded[10] = {ZERO, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE};

byte addr[8];
OneWire ts(2);
DallasTemperature temp(&ts);


byte convertInt(int num)
{
   return encoded[(int)num];
}

void draw(byte digit)
{
   for (int i = 0; i <  7; i++)
    {
        
        if (((digit >> i) & 1) == 1)
        {
          digitalWrite(pins[i], LOW);
        }
        else
        {
           digitalWrite(pins[i], HIGH);
        }
    }
}

void writeNumber(int num){
    byte right;
    byte left;
    
    if (num > 10)
    {
      left = convertInt(num/10);
    }
    else
    {
      left = 0;
    }
    right = convertInt(num%10);
    
    if(num < 0)
    {
       digitalWrite(pins[7], HIGH);
    }
    else
    {
       digitalWrite(pins[7], LOW);
    }
    
    digitalWrite(rightOn, LOW);
    digitalWrite(leftOn, HIGH);
    
    draw(left);
    
    delay(10);
    
    digitalWrite(leftOn, LOW);
    digitalWrite(rightOn, HIGH);
    
    draw(right);
    
    delay(10);
}
void setup() {
  int i;
  for(i = 3; i < 13; i++) {
     pinMode(i, OUTPUT);
   }
  
   Serial.begin(115200);
   temp.begin();
  
  // Grab a count of devices on the wire

  int numberOfDevices = temp.getDeviceCount();

  // locate devices on the bus

  Serial.print("Locating devices...");

  Serial.print("Found ");

  Serial.print(numberOfDevices, DEC);

  Serial.println(" devices.");
  
    // report parasite power requirements

  Serial.print("Parasite power is: ");

  if (temp.isParasitePowerMode()) Serial.println("ON");

  else Serial.println("OFF");

}

void loop() {

   if(count == -1 || count++ == 500)
   {
     Serial.print("Requesting temperatures...");
     temp.requestTemperatures();
     Serial.println("DONE");
     tempRead = temp.getTempCByIndex(0);
     /*if (tempRead == -127)
     {
        sample = 0;
     }
     else
     {
        sample = tempRead;
     }*/
     Serial.print("Temperature is: ");
     Serial.println(tempRead, DEC);
     count = 0;
   }
  
    writeNumber(sample);
}
3  Using Arduino / Sensors / Re: Adequate temperature sensor for logging on: March 11, 2013, 12:54:30 pm
Okay, so I have it connected normally... but the temperature it returns is 0, which is definitely wrong... and when I ask for the number of devices found I get 0 too. I am currently using the DallasTemperature Library.

Before, when I had it wrongly connected, I was getting a 'temperature' read out of -127, which I know indicates "DEVICE_DISCONNECTED"... but what this 0 means I have no idea, especially when there are apparently no devices found.
4  Using Arduino / Sensors / Re: Adequate temperature sensor for logging on: March 11, 2013, 10:23:18 am
Oh, I see. I guess the diagram I found that showed how to connect in parasitic mode was wrong...

I really should have started with the datasheet. Nevermind. I'll connect it up normally.
5  Using Arduino / Sensors / Re: Adequate temperature sensor for logging on: March 11, 2013, 09:29:48 am
So, I got some of the DS18B20s, and I hooked one up using the parasitic power configuration (pin 1 to ground, pin 2 to arduino with 4.7k pull-up and pin 3 unconnected)... but my arduino seems unable to detect it. The OneWire search function fails everytime.
6  Using Arduino / Sensors / Re: Adequate temperature sensor for logging on: March 05, 2013, 12:52:00 pm
Looks nice and simple, thanks.

Got a couple ordered already.
7  Using Arduino / Sensors / Adequate temperature sensor for logging on: March 05, 2013, 12:11:25 pm
So, I want to log the temperature in a room every minute for a day, to see how it fluctuates.

I have an Arduino Uno, so my plan was to connect a thermistor up to it to measure the temperature and then send this data through serial communication to software on a host PC which then logs it in a file.

My problem is that I have no experience of designing sensing circuits, and so I fear that what I plan to do with the thermistor will be woefully inadequate for its purpose.

Here is a crude diagram:



I know that it is kind of pathetically simple, I just wanted to know if it will perform with a reasonable accuracy. I can probably handle a reading that is 1*C out...

If it really is as bad as I suspect, are there any simple suggestions you could make to improve it?
8  Using Arduino / Project Guidance / Re: RGB Leds blinking in sequence first project. Am I on the right track? on: January 15, 2012, 06:53:03 pm
Yeah, all the LEDs were on because you had them connected to 3.3V... meaning that no matter whether you have a HIGH or LOW on the pins, because a HIGH is 5V and a LOW is 0V, you are always going to get a potential drop across the LED, and thus a flow of current.

1k won't break the LEDs, since 5-3.3V/1k = 1.7mA... though given that this is spread across so many LEDs, I'm surprised it was bright enough to see.

Drop the Resistor value to something like 100ohm, and connect the orange lead to ground. Or you could do what KirAsh said... use a resistor on each LED Anode connected to ground. Probably something like 100ohm each should be okay.

EDIT: Actually, disregard my advice... after giving it thought, I think may have oversimplified the problem in trying to do it in my head.
9  Using Arduino / Project Guidance / Re: Camera interface to PC through Arduino on: January 15, 2012, 11:05:38 am
Thanks, I didn't realize there was a Software Serial implementation. I should be fine now.
10  Using Arduino / Project Guidance / Camera interface to PC through Arduino on: January 14, 2012, 07:22:59 pm
Hi,

I have one of these cameras:

http://www.4dsystems.com.au/prod.php?id=75

I also have an Arduino Duemilanove.

I would like to pictures with the camera by connecting it to the Duemilanove using the UART, and then retrieving the image and sending it straight onto my PC. The Camera has EEPROM onboard, so I don't need to worry about storing the image before I send it on to my PC, and I don't care about framerate.

What I would like to know is whether it is possible to send and receive data over USB as well as over the Arduino's UART, as in the Documentation on the site it says that they are connected somehow... so I am unsure whether this is feasible or not.

When I use the UART, since the FTDI chip is connected, can I listen into the UART communications with my PC? If I could then I could still probably do this...

Any help would be very much appreciated.
11  Forum 2005-2010 (read only) / Troubleshooting / Re: Trying to learn on: November 06, 2010, 08:21:21 am
Well, I've got to go buy a few things before I start then.

Thanks for the help!
12  Forum 2005-2010 (read only) / Troubleshooting / Trying to learn on: November 06, 2010, 08:03:54 am
Hi,

I've just got around to trying some stuff out on the Duemilanove I bought a few days ago, and I've hit a problem.

I don't have any electronic components at the moment, so I am trying to learn using the stuff that the board already has. I'm writing a program that blinks the LED at a regular interval, and upon pressing the onboard pushbutton, the interval becomes smaller, the LED flashes more frequently and gradually gets slower and returns to normal again. The only problem is, I can't get the switch to work.. I don't know whether it's just that I have the wrong pin or whether it's that I haven't debounced the input or something like that... Anyway, here is my code:

Code:
const int ledPin = 13;
const int buttonPin = 2;
int ledState = LOW;
int buttonState = 0;
unsigned long prevMillis = 0;
long interval = 2000;

void setup() {
   pinMode(ledPin, OUTPUT);
   pinMode(buttonPin, INPUT);
}

void loop() {
     unsigned long currMillis = millis();
     buttonState = digitalRead(buttonPin);
     if((currMillis - prevMillis) > interval) {
         prevMillis = currMillis;
        
         if(ledState == LOW) {
            ledState = HIGH;
         } else {
            ledState = LOW;
         }
         digitalWrite(ledPin, ledState);
     }
     if (buttonState == HIGH) {
            interval = 500;
         } else if (interval < 2000) {
            interval = interval * 1.5;
         } else {
            interval = 2000;
         }
}

Any help would be appreciated, I really want to learn how to use this thing.
Pages: [1]