Show Posts
Pages: 1 ... 32 33 [34] 35 36 ... 342
496  Using Arduino / Programming Questions / Re: A PID example question on: September 04, 2014, 09:49:54 am
So what you have is better explained by my schematic below, where as PaulS says, there needs to be some sensor or other providing a voltage between 0 and 5 on a A1. I've just shown that as a pot, and as Paul says it certainly can't be the LED as in your earlier schematic.
497  Using Arduino / Programming Questions / Re: Help to get a MQ-2 Programming Code on: September 04, 2014, 09:17:02 am
There's stuff in the playground. From what I read before, it's just an analog signal. It seems to be easier if you have it on a pre-made breakout board.

BUT..... it also seems that it's up to the user to choose the resistor in the other side of the divider, bit of a trade off between accuracy and sensitivity.
498  Using Arduino / Sensors / Re: ir emitter not working on: September 04, 2014, 09:13:38 am
If you have this Keyes module, then it's already 38k capable, you don't need the code to do that fancy timing. So stick 5V in the signal and it should transmit a modulated burst.
499  Using Arduino / Sensors / Re: ir emitter not working on: September 04, 2014, 06:20:04 am
I'm just wondering if..... maybe that module you have has electronics on board for 38kHz already, why else would it have three leads? So maybe the 5V / GND drives the electronics which gives 38kHz modulated output when the signal is high. If that's the case, then the adafruit code which provides modulation is redundant and all you need to do is provide the message.

Pure speculation on my part, mind.
500  Using Arduino / Programming Questions / Re: Setting an Alarm with RTC on: September 04, 2014, 05:49:34 am
here code in zip file to set alaram


AMPS I'll bet that's the code the OP's using, but it has nothing to do with RTC. See my post above, which syncs the system time with the RTC.
501  Using Arduino / Programming Questions / Re: Setting an Alarm with RTC on: September 04, 2014, 05:43:59 am
Hi-

You need to sync with the RTC.

This code uses the alarm library AND an RTC.

Jim

Code:
/*
 * TimeAlarmExample.pde
 *
 * This example calls alarm functions at 8:30 am and at 5:45 pm (17:45)
 * and simulates turning lights on at night and off in the morning
 * A weekly timer is set for Saturdays at 8:30:30
 *
 * A timer is called every 15 seconds
 * Another timer is called once only after 10 seconds
 *
 * System time now set from RTC, jim august 2014
 * remember to set the rtc first...
 * added wire and ds1307rtc libraries
 */

#include <Time.h>
#include <TimeAlarms.h>
#include <Wire.h> //added jim ************************
#include <DS1307RTC.h> //added jim ***************************

void setup()
{
  Serial.begin(9600);
  Serial.println("In setup...."); //added jim *****************
  /*
  using rtc, sync system time to rtc
   setTime(8,29,0,1,1,11); // set time to Saturday 8:29:00am Jan 1 2011 //old way *****************
   */

  // following lines added to set time from rtc, took from timeRtcSet example, added jim *****************
  setSyncProvider(RTC.get);   // the function to get the time from the RTC
  if (timeStatus() != timeSet)
    Serial.println("Unable to sync with the RTC");
  else
    Serial.println("RTC has set the system time");
  // end of setting the time ******************************



  // create the alarms
   Alarm.alarmRepeat(11, 30, 30,led13OFF);
  Alarm.alarmRepeat(11, 30, 00,led13ON);
 
  //Alarm.alarmRepeat(11,16,0, MorningAlarm);
 /*
  Alarm.alarmRepeat(10, 35,45, MorningAlarm); 
  Alarm.alarmRepeat(10,36,0, MorningAlarm);
 
  Alarm.alarmRepeat(10, 36,30, MorningAlarm);
 
  Alarm.alarmRepeat(10,37,0, MorningAlarm); 
 
  Alarm.alarmRepeat(10, 15,30, MorningAlarm);
  Alarm.alarmRepeat(10,16,0, MorningAlarm); 
  Alarm.alarmRepeat(10,16,30, MorningAlarm); 
  Alarm.alarmRepeat(10,17,0, MorningAlarm); 
  Alarm.alarmRepeat(10, 17,30, MorningAlarm);
  Alarm.alarmRepeat(17,45,0,EveningAlarm);  // 5:45pm every day
  Alarm.alarmRepeat(dowSaturday,8,30,30,WeeklyAlarm);  // 8:30:30 every Saturday
  */


  //Alarm.timerRepeat(15, Repeats);            // timer for every 15 seconds   
  //Alarm.timerOnce(10, OnceOnly);             // called once after 10 seconds


  pinMode(13, OUTPUT);
  digitalWrite(13, LOW);
  Serial.print("Turning pin 13 LED off at ");
  digitalClockDisplay();
  Serial.println("Ending setup...."); //added jim *****************
}

void  loop(){ 
  digitalClockDisplay();
  Alarm.delay(1000);
}

// functions to be called when an alarm triggers:

void led13ON(){
 //Serial.print("Turning pin 13 LED on at ");
 //digitalClockDisplay();
 digitalWrite(13, HIGH);   
 }
 
 void led13OFF(){
 //Serial.print("Turning pin 13 LED off at ");
 //digitalClockDisplay();
 digitalWrite(13, LOW);   
 }
 

void MorningAlarm(){
  digitalClockDisplay();
  Serial.println("Alarm: - turn lights off Jimbo");   
}

void EveningAlarm(){
  Serial.println("Alarm: - turn lights on");           
}

void WeeklyAlarm(){
  Serial.println("Alarm: - its Monday Morning");     
}

void ExplicitAlarm(){
  Serial.println("Alarm: - this triggers only at the given date and time");       
}

void Repeats(){
  Serial.println("15 second timer");         
}

void OnceOnly(){
  Serial.println("This timer only triggers once"); 
}

void digitalClockDisplay()
{
  // digital clock display of the time
  Serial.print(hour());
  printDigits(minute());
  printDigits(second());
  Serial.println();
}

void printDigits(int digits)
{
  Serial.print(":");
  if(digits < 10)
    Serial.print('0');
  Serial.print(digits);
}
502  Using Arduino / Sensors / IR modulation tolerance? on: September 04, 2014, 05:22:12 am
Hi all,

Was helping on an other thread and it got me wondering what tolerance there is on IR modulation?

38kHz seems a common standard (de facto, if not de jure), but presumably there's some tolerance and one could maybe get away with (say) 37.9 to 38.1 or something?

TIA,

Jim

(... who by the way is bored shitless waiting for paperwork for my new contract which starts soon.)

503  Using Arduino / Sensors / Re: ir emitter not working on: September 04, 2014, 04:38:45 am
I can't picture what that module does. Just bypass it, take croc clips to the IR led where it sticks out of the board; treat it like any other led, two wires with a resistor on one side for current limiting.
504  Using Arduino / Project Guidance / Re: ABC - Arduino Basic Connections on: September 04, 2014, 04:35:14 am
Looks like we'll need to brush up on our Latin though  smiley-cool

But seriously, that's excellent. I just tested "infra" and got info on IR emitter and sensor.

505  Using Arduino / Sensors / Re: ir emitter not working on: September 04, 2014, 04:29:30 am
And check pin 13's working to the outside world by sticking a normal led and series resistor across 13 and ground.

And or move the whole thing to another pin.... (change the code  smiley-razz )

And check the 5V pin has 5V
506  Using Arduino / Sensors / Re: ir emitter not working on: September 04, 2014, 04:22:51 am
thanks for all your help
i'm now guessing it is the emitter i'll go o a trip today and buy a new one
You sure you had it wired the right way round? And what value of resistor were you using with it?

Mike it looks to me from that huuuuuuuuge photo, that he has a module which has a resistor built in. I'm wondering what the module does, why 3 wires?- simple enough just to put the IR led across an i/o pin and ground with a series resistor.  edit.. red and black look the right way round on the Uno.

Might be an idea to take pin 13 direct to the anode and ground the cathode, series resistor on side of choice; bypass the pcb.

Note to OP... please use much smaller pix, hundred or so k, not megabyte order, which requires lots of scrolling.
507  Using Arduino / Sensors / Re: ir emitter not working on: September 04, 2014, 04:07:19 am
I did a quick further test: I pointed the emitter at a 38k TSOP receiver, and it pulsed high on its output during each pulse. So not only is the code pulsing, it's also modulating at 38k correctly.

Glad to help....

508  Using Arduino / Sensors / Re: ir emitter not working on: September 04, 2014, 03:53:50 am
Well if L13 is flashing and the IR led isn't, clearly the emitter isn't working, since it will flash in time with L13 and the pulse is long enough to see.
509  Using Arduino / Project Guidance / Re: Help. I'm new on: September 04, 2014, 03:44:03 am
Nope, just thought perhaps I was imagining things, or whatever the opposite of imagining things is when you don't see things that are there.
510  Using Arduino / Sensors / Re: ir emitter not working on: September 04, 2014, 03:31:41 am
Ok I loaded that code in my Uno and I see the pin 13 LED pulsing. So diagnostically that tells me the code is working. I have an IR led, I'm going to hook it up and I should see it through a camera.

So, if you see the pin 13 LED pulse, the code's ok I guess.

EDIT.... I hooked an IR led on pin 13 and yep it's visible as a pulse through a camera, in time with the pin 13 led. So the code's good at least in the sense that it's pulsing. Whether or not it's accurately modulated at 38k when it's on I can't say yet, but I do have a TSOP so I'll check.

Note that I don't have an IR module like yours with 5v, gnd and signal; just used an IR led with series resistor.
Pages: 1 ... 32 33 [34] 35 36 ... 342