Loading...
  Show Posts
Pages: [1] 2
1  Community / Exhibition / Gallery / Re: Arduino and MLX90620 16X4 pixel IR thermal array on: April 07, 2013, 08:00:52 am
Hi,

thanks a lot for the answer. I am still thinking about buying the MLX90620 or the Grideye?

Cu kami
2  Community / Exhibition / Gallery / Re: Arduino and MLX90620 16X4 pixel IR thermal array on: February 21, 2013, 06:42:37 am
Hi,

just got the chance to order a Panasonic GRID-Eye AMG8851 (5 Volt) or AMG8831 (3.3 Volt).

What did you think which one is better the MLX or the GRID-Eye?

Thanks a lot.

Cu kami83
3  Community / Exhibition / Gallery / Re: Arduino and MLX90620 16X4 pixel IR thermal array on: January 10, 2013, 02:33:55 pm
Hi,

i would like to make good picture for a distance like 1-2 meters. What is with a Lens? Do i need one?

Thx a lot.

Cu kami
4  Community / Exhibition / Gallery / Re: Arduino and MLX90620 16X4 pixel IR thermal array on: January 10, 2013, 09:47:53 am
Hi,

anyone who can tell me if i should use the 60° or 40° FOV??
And should i need a Lens?


Thanks a lot.

Cu kami
5  Community / Exhibition / Gallery / Re: Arduino and MLX90620 16X4 pixel IR thermal array on: January 10, 2013, 03:20:23 am
HI,

i have found an distributor for Germany. Which type of sensor of the MLX 90620 should i use the 60° or 40°?

Thanks a lot.

Cu kami
6  International / Deutsch / Arduino: Button drücken wird nicht erkennt. Nur der Interrupt wird ausgelöst on: December 21, 2012, 09:06:43 am
Hi,

ich habe hier einen ATtiny84 mit einem simplen Taster dran:

http://www.mikrocontroller.net/wikifiles/8/8a/Taster.gif

Ich habe folgenden simplen Code zum Testen geschrieben und lasse mir das alles per Serial ausgeben:

Code:
#include <JeeLib.h>
#include <avr/sleep.h>
#include <avr/interrupt.h> 

#define DIO1 10  // d10

static void setPrescaler (uint8_t mode) {
    cli();
    CLKPR = bit(CLKPCE);
    CLKPR = mode;
    sei();
}
int buttonState = 0;     
ISR(WDT_vect) { Sleepy::watchdogEvent(); }

ISR (PCINT0_vect) {

Serial.println("Ubt");
     
}


void setup()   {
setPrescaler(0); // div 1, i.e. speed up to 8 MHz
         Serial.begin(38400);
      Serial.print("ack13 \n");
   
      pinMode(DIO1, INPUT);       //set the pin to input
PCMSK0 |= (1<<PCINT2); //  tell pin change mask to listen to (DIO1)
digitalWrite(DIO1, LOW);
GIMSK  |= (1<<PCIE0); // enable PCINT interrupt in the general interrupt mask
 
      //sei();
 
}
 
void loop() {
  buttonState = digitalRead(DIO1);

  // check if the pushbutton is pressed.
  // if it is, the buttonState is HIGH:
  if (buttonState == HIGH) {     
    // turn LED on:   
     Serial.print("1 \n"); 
  }
  else {
    // turn LED off:
     Serial.print("2 \n");
  }
  //Serial.println(inttime);
  delay (500);
 
 

 
}

Mein Output in hterm sieht nun so aus:

Code:
ack13
2
2
2
2
2
2
UUbt
bt
2
2
2
2
UUUUUbtUUbUUUUUUaUUbUUUbt
bt
bt
t
bt
2
2

Was mich nun stört ist das egal ob der Schalter betätigt ist oder nicht er immer nur LOW ist und nie HIGH ist. Aber ich jeden Interrupt auf dem Pin angezeigt bekomme. Was mache ich falsch?

Gruß kami83
7  International / Deutsch / Re: Entprellen von Schalter mit Interrupt und PinChange on: December 18, 2012, 02:57:03 am
Hi,

okay wie sollte ich das denn am besten aufbauen? Also per Software geht das echt nicht?

Wie muss ich RC auslegen?

Gruß kami
8  International / Deutsch / Entprellen von Schalter mit Interrupt und PinChange on: December 18, 2012, 02:34:20 am
Hi Leute,

ich habe hier folgendes Problem ich habe unter Arduino einen Attiny84 so programmiert, das er über einen simplen Schalter einen Interrupt auslöst.

Der Schalter wird nun geschlossen und geöffnet. Ich frage nur auf PinChange ab. Also beim Betätigen des Schalter wird der Interrupt gestartet.

Nun möchte ich gerne jeweils eine Ausgabe durch den Controller bekommen für folgende 2 Tätigkeiten:

1. Der Schalter wird geöffnet und wieder geschlossen.
2. Der Schalter wird nur geöffnet und bleibt offen stehen.

Problem dabei ist nun das der Schalter auch klappern kann, als relativ schnell auf und zu springen kann. Das soll durch den Controller nicht ausgewertet werden.

Ich habe dafür bisher folgenden Code unter  Arduino geschrieben:

ISR (PCINT0_vect) {
volatile unsigned long now;
  now = millis();
  if (now < inttime) { return;}
 
  inttime = now + 2000;
  flag=1;
   
     
}

void setup()   {
      setPrescaler(0); // div 1, i.e. speed up to 8 MHz
     

      delay(500);
       
      ADCSRA &= ~ bit(ADEN); // disable the ADC
      bitSet(PRR, PRADC); // power down the ADC
      PRR = bit(PRTIM1) | bit(PRUSI) | bit(PRADC); // only keep timer 0 going
       
      pinMode(DIO1, INPUT);       //set the pin to input
      digitalWrite(DIO1, HIGH); //use the internal pullup resistor
      PCMSK0 |= (1<<PCINT2); //  tell pin change mask to listen to (DIO1)
      GIMSK  |= (1<<PCIE0); // enable PCINT interrupt in the general interrupt mask

      sei();


 
}


Der Rest des Codes ist unerheblich.

Wer hat da eine gute Idee wie man das Entprellen vernünftig wegbekommt?

Vielen Dank.

Gruß kami
9  Community / Exhibition / Gallery / Re: Arduino and MLX90620 16X4 pixel IR thermal array on: December 13, 2012, 11:36:32 am
Hi guys,

i am also really interested in building my own cheap camera, but i cannot get any sensor here in Germany.
Is there any chance to get some? Any tips?

Thanks a lot.

Cu kami83
10  International / Deutsch / Re: Warum funktionieren meine Interrupts nicht? on: March 03, 2011, 04:09:30 pm
Hi,

also ich würde da Variante 1 bevorzugen. Zur Zeit habe ich das andere SKetch angepasst und fülle damit ein Struct alle paar Sekunden. Nun möchte ich aber immer in der Zeit in den Sleep-Mode gehen, wo kein Interrupt kommt und alle 3 min wieder aufwachen um im Struct eine Zelle weiterzuspringen. Vielleicht hat ja jemand einen Tipp? Wäre dankbar für ein Timer Interrupt Sketch. Gruß kami smiley
11  International / Deutsch / Re: Warum funktionieren meine Interrupts nicht? on: March 02, 2011, 04:25:42 pm
Hi,

so ich habe nun ein erweiterungsproblem. Mit dem Interrupt kriege ich es ja hin, das er mir beim Tastendruck wechselt. Nun möchte ich aber gerne dadurch einen Timer für 15min starten, den Controller bis zum nächsten Interrupt in den Schlaf schicken und nach 15min soll er aufwachen und einen Serielle Ausgabe machen. Geht das? Wenn ja wie?

Gruß kami
12  International / Deutsch / Re: Warum funktionieren meine Interrupts nicht? on: March 01, 2011, 06:43:24 am
Hi,

ich habe nochmal etwas am den Code rumgespielt.

Sieht jetz so aus:

Code:
#include <Ports.h>
#include <RF12.h>
#include <avr/sleep.h>

#define LOGGERNUM   56
#define TESTSEC 5
 
volatile int flag=0;
static byte radioIsOn,testval = 1;
volatile long cnt = 0;
volatile long cnt_old = cnt;
volatile int old_millis = millis();


typedef struct {
    unsigned int device;
    unsigned int error;
    unsigned int lobat;
    unsigned int status1;
} msgstruct;


void count(){
   sleep_disable();
   flag=1;

}
 
void setup()   {

      Serial.begin(57600);
      Serial.println("Logger");
      rf12_initialize(8, RF12_868MHZ, 5);
      rf12_easyInit(0);
     
      rf12_sleep(0); // turn the radio off
      radioIsOn = 0;

      attachInterrupt(1, count, FALLING);
      sleepNow();
}
 
void loop() {
   
    if (flag==1)
    {
     flag=2;
    Serial.println("Sending starts");

    domessage();
   
    }
    if (radioIsOn && rf12_easyPoll() == 0 && flag==0) {
        Serial.println("Sending done");
       
        rf12_sleep(0); // turn the radio off
        radioIsOn = 0;
       
        Serial.println("Sleep");
       
        sleepNow();
    }
 
}
 
void sleepNow()       
{
    set_sleep_mode(SLEEP_MODE_PWR_DOWN);   
    sleep_enable();         
    sleep_mode();           
}


void domessage()
{   
  Serial.println("Msg starts");
 
  int m_delta = millis() - old_millis;
 
  if(m_delta > 200 ){
 
    if (testval==1) testval=0; else testval=1;
   
    msgstruct msgfile;
    msgfile.device = LOGGERNUM;
    msgfile.error = 123;
    msgfile.lobat = rf12_lowbat();
    msgfile.status1 = testval;
    wakeupToSend(&msgfile, sizeof msgfile);
   
    old_millis = millis();

  }
   
}

static void wakeupToSend (const void* ptr, byte len) {
    char sending = rf12_easySend(ptr, len);
    if (sending) {
            // make sure the radio is on again
            if (!radioIsOn)
                rf12_sleep(-1); // turn the radio back on
            radioIsOn = 1;
            flag=0;
        }   
}

Vielen Dank.

Gruß kami
13  International / Deutsch / Re: Warum funktionieren meine Interrupts nicht? on: February 28, 2011, 04:42:41 pm
Hi,

okay mit dem Code kann man besser machen. Aber ich habe das Problem das ich nur mit dem externen Interrupt den Controller aufwecken will. Kannst du mir nicht den Quellcode anpassen?

Vielen dAnk.

Cu kami
14  International / Deutsch / Warum funktionieren meine Interrupts nicht? on: February 28, 2011, 04:16:06 pm
Hi,

ich möchte gerne einfach meinen Controller nach dem Setup in den Powerdown schicken und bei jedem Pinchange am Pin3 Interrupt Pin 1 wieder aufwecken und die Nachricht ("SEND") ausgeben lassen. Das klappt aber gar nicht und er meldet immer nur beim ersten Tastendruck SEND und mehr nicht.

Vielleicht hat ja einer einen Tipp woran es liegen kann. Vielen Dank.

Gruß kami83

Code:
#include <avr/sleep.h>
 
volatile int old_millis = millis();

void count(){
   int m_delta = millis() - old_millis;
  if(m_delta > 200 ){
   Serial.println("Send");
    old_millis = millis();

  }
 sleepNow();

 }
 
void setup()   {
Serial.begin(57600);
Serial.println("Logger");

attachInterrupt(1, count, FALLING);
sleepNow();
  }
  void loop() {
  }
 
void sleepNow()       
{
    set_sleep_mode(SLEEP_MODE_PWR_DOWN);   
    sleep_enable();         
    sleep_mode();           
    sleep_disable();       
   
}

15  International / Deutsch / Arduino in den Schalf schicken und mit Interrupt Pin aufwecken?? on: February 28, 2011, 02:00:24 am
Hi,

ich möchte gerne immer wenn ein Pin-Falling an Pin 3 entsteht per RF12 eine Nachricht verschicken und dann wieder in den Schlaf gehen. Dafür habe ich folgenden Quellcode geschrieben. Der aber läuft nur ständig abstürzt. Vielleicht kann jeman den Code ja für mich optimieren.

Vielen Dank.

Gruß kami

Code:
#include <Ports.h>
#include <RF12.h>
#include <avr/sleep.h>
#define LOGGERNUM   56
#define TESTSEC 5
 
typedef struct {
    unsigned int device;
    unsigned int error;
    unsigned int lobat;
    unsigned int status1;
} lowbatterystruct;
 
static byte radioIsOn,testval = 1;
MilliTimer countTimer;
int seccount2 = 0;
 
static void wakeupToSend (const void* ptr, byte len) {
 
  char sending = rf12_easySend(ptr, len);
 
    if (sending) {
        // make sure the radio is on again
        if (!radioIsOn)
            rf12_sleep(-1); // turn the radio back on
        radioIsOn = 1;

 
    }
    Serial.println("Send");
 
   
}
 
void setup()
{
  Serial.begin(57600);
Serial.println("Logger");
  rf12_initialize(8, RF12_868MHZ, 5);
rf12_easyInit(3);

  lowbatterystruct msgfile;
    msgfile.device = LOGGERNUM;
    msgfile.error = 20;
    msgfile.lobat = rf12_lowbat();
    msgfile.status1 = testval;
 
 while(seccount2 < TESTSEC)
{
 if (countTimer.poll(1000)) {
  seccount2+=1;
 
}   
   
  rf12_easyPoll();
    if (testval == 1)
     testval =0;
     else testval=1;
        lowbatterystruct msgfile;
    msgfile.device = LOGGERNUM;
    msgfile.error = 20;
    msgfile.lobat = rf12_lowbat();
    msgfile.status1 = testval;
     // send measurement data, but only when it changes
    rf12_easySend(&msgfile, sizeof msgfile);
 
}
 
 
  rf12_easyInit(0); 
 

rf12_sleep(0); // turn the radio off
radioIsOn = 0;
set_sleep_mode(SLEEP_MODE_PWR_DOWN);   // sleep mode is set here
sleep_enable();          // enables the sleep bit in the mcucr register
attachInterrupt(1,domessage, FALLING); // use interrupt 0 (pin 2) and run function
sleep_mode();
}
 
void loop()
{
if (radioIsOn && rf12_easyPoll() == 0 ) {

        rf12_sleep(0); // turn the radio off
        radioIsOn = 0;
   
   sleepNow();
}
 
}
 
 void sleepNow()         // here we put the arduino to sleep
{
 
    set_sleep_mode(SLEEP_MODE_PWR_DOWN);   // sleep mode is set here
    sleep_enable();          // enables the sleep bit in the mcucr register


    attachInterrupt(1,domessage, FALLING); // use interrupt 0 (pin 2) and run function
                                       // wakeUpNow when pin 2 gets LOW
Serial.println("Sleep");
    sleep_mode();            // here the device is actually put to sleep!!
                             // THE PROGRAM CONTINUES FROM HERE AFTER WAKING UP

    sleep_disable();         // first thing after waking from sleep:
                             // disable sleep...
    detachInterrupt(1);      // disables interrupt 0 on pin 2 so the
                             // wakeUpNow code will not be executed
                             // during normal running time.

}
 
void domessage()
{
 
  static unsigned long last_interrupt_time = 0;
  unsigned long interrupt_time = millis();

  if (interrupt_time - last_interrupt_time > 200)
  {
   
if (rf12_easyPoll() == 0 ) {
  Serial.println("Start");
    if (testval==1) testval=0; else testval=1;
    lowbatterystruct msgfile;
    msgfile.device = LOGGERNUM;
    msgfile.error = 123;
    msgfile.lobat = rf12_lowbat();
    msgfile.status1 = testval;
 
      wakeupToSend(&msgfile, sizeof msgfile);
  }}
  last_interrupt_time = interrupt_time;
 
 
}
Pages: [1] 2