Recent Posts

Pages: [1] 2 3 ... 10
1
Perhaps a dumb question, but do you have the enable pin on the controller HI?
I have already accommodated for this - ta
2
Project Guidance / Re: Next Step, Display
Last post by pntrbl - Today at 03:36 am
I tried to insert a picture of my anemometer but it didn't work. :smiley-confuse:

In any event, from what I've learned hanging around here I have been able to hack some code that counts the pulses from my anemometer and then uses those to calculate the windspeed in MPH to my Serial Monitor.

Code: [Select]
// read MPH

volatile int mphcount = 0;//see http://arduino.cc/en/Reference/Volatile
int mph = 0;
unsigned long lastmillis = 0;

void setup(){
 Serial.begin(9600);
 attachInterrupt(0, mph_anemometer, FALLING);//interrupt zero (0) is on pin two(2).
}

void loop(){
 
 if (millis() - lastmillis == 60000){  /*Uptade every minute, this will be equal to number of pulses.*/
 
 detachInterrupt(0);    //Disable interrupt when calculating
 
 
 mph = mphcount / 104;  /* Convert pulsecount to MPH.*/
 
 Serial.print("MPH =\t"); //print the word "MPH" and tab.
 Serial.print(mph); // print the mph value.
 Serial.print("\t pulsecount=\t"); //print the word "pulses".
 Serial.println(mphcount); /*print pulses per minute. And print new line or enter.*/
 
 mphcount = 0; // Restart the MPH counter
 lastmillis = millis(); // Uptade lasmillis
 attachInterrupt(0, mph_anemometer, FALLING);//enable interrupt
  }
}


void mph_anemometer(){ /* this code will be executed every time the interrupt 0 (pin2) gets low.*/
  mphcount++;
}


Considering I didn't know what a Serial Monitor was a month ago when I showed up here, you guys have helped me to make some serious progress!

But now I need to take the next step and figure out how to get my little UNO friend to output to a display. I'm thinking a pair of 7 segment LED's would do just fine.

Can any body point me in a general direction?
3
Sensors / Re: BNC Sensor Shield (ISE Pro...
Last post by wvmarle - Today at 03:33 am
You're needing a high-impedance input for this, possibly with off-set.
These circuits are not that hard to build yourself (just make sure you use a suitable OpAmp for it - and they normally come only in SSOP or VSSOP type packing), or get a pH amplifier board - they do the exact same thing. Take a high-impedance voltage signal as input, and produce a low-impedance voltage output, which can be read directly by the Arduino.
Just to confirm: you are talking about those glass-bulb type of electrodes, right?
4
Sensors / Re: Oil temperature sensor
Last post by wvmarle - Today at 03:30 am
Connection for the OpAmp is anyway wrong.

The reading should be done in between R5 and the thermistor, and indeed can go directly to the analog in.

Then you need to use the B-coefficient formula to calculate the temperature, not a simple analog mapping as the response is anything but linear (as you can see in the graph you posted). Adafruit has a good write-up on thermistors.
5
It's isolated from the rest of the micro controller Circuity via cutting the traces leaving the 2k pull up intact I have driven it using NPN transistors already. I have a jumper wire going directly to the pins of the D200 modules.

Tom you have a sharp eye to recognise it's an AMC2500 being butchered :)
6
Bar Sport / Force required to pull open do...
Last post by Qdeathstar - Today at 03:29 am
Hi.

I have a door on a spring that automatically closes. I have a dog that has figured out how to push the door open, but much to his surprise it closes behind him. He hasn't figured out how to get out. This makes him sad.

I had some crap laying around so i decided to make a automatic door opener using a nema17 stepper motor that can take 1.3amps max. The stepper driver I got can only output about half that, and even though i am using a geared stepper motor (bondtec extruded i am no longer using) it ain't got enough power. CLICK CLICK CLICK and now i am sad. :(

So, before i buy more things i figured the first step would be to determine how much torque i need.

How can i determine that?

Right now, the stepper turns a lever that rotates a 1ft aluminum bar.  Any ideas?  Not sure where to put this since it's not an arduino problem.
7
Programming Questions / Buffer and PROGMEM
Last post by TGGeko - Today at 03:29 am
Hello, I'm working with an 128x64 LCD screen and am using the Adafruit library Adafruit_SSD1306

In the code, it initialized the screen with the Adafruit splash screen. It's a pretty hefty burden on memory, but I like having this on start up. Below is how the byte array is stored in the library:

Code: [Select]
static uint8_t buffer[SSD1306_LCDHEIGHT * SSD1306_LCDWIDTH / 8] = {
0x00, 0x00, Blah Blah lots of Hex codes,  0x00
};

void Adafruit_SSD1306::display(void) {

    for (uint16_t i=0; i<(SSD1306_LCDWIDTH*SSD1306_LCDHEIGHT/8); i++) {
      fastSPIwrite(buffer[i]);
      //ssd1306_data(buffer[i]);
    }
}


My question is, can the byte array of the buffer, all those bytes, be moved into PROGMEM for better storage? Would this at all save dynamic memory?

I tried using
Code: [Select]

const uint8_t intro[SSD1306_LCDHEIGHT * SSD1306_LCDWIDTH / 8] PROGMEM = { 0x00 etc};
static uint8_t buffer[SSD1306_LCDHEIGHT * SSD1306_LCDWIDTH / 8] = {intro};


but it didn't save any memory at all. It's also giving me an "invalid conversion" warning
8
Project Guidance / Next Step, Display
Last post by pntrbl - Today at 03:21 am
My current mission in life is to develop a display for a homemade anemometer I built out of coffee scoopers, aluminum bar stock, and automobile parts.

9
Programming Questions / Re: Police light question
Last post by Tallen01 - Today at 03:16 am
Thank you for your help! I guess I was having issues with terminology! Thanks again!
10
Project Guidance / Re: Advice for Project
Last post by wvmarle - Today at 03:13 am
Indeed, should be an int. When writing the sketch I first thought had to do a division, due to multiple counts per revolution, but don't know the count so didn't add it.

Now come to think of it again, OP seems to want to set the rpm to a float value, though (using 62.5 as setpoint). That would imply about one revolution per second, or 1/10th per 100 ms. That means my suggested 100 ms time is way too short, 1 second may even be too short unless OPs encoder produces lots of ticks per revolution (I guess this info is buried somewhere it the 100-something posts before). It should, to measure such low rpm rates quickly. At 20 ticks per rotation, one measurement every second would be reasonable, as then the error would be 5-6% (one tick count on about 19 ticks per second).

It may be better to change the measurement and measure the time between a fixed number of ticks (can be every single tick - using micros() for higher accuracy), rather than the ticks per set time.
Pages: [1] 2 3 ... 10