Show Posts
Pages: [1] 2 3
1  Using Arduino / General Electronics / Re: Circuitry. on: February 04, 2013, 03:28:19 pm
I wish I had a clear understanding of what you are saying.
Quote
I would wire up the push buttons between an input and ground, and enable the internal pull up resistors in software.
I have changed it slightly to have the switches connected to pin 11. Is that what you meant? https://www.circuitlab.com/circuit/9tgp8z/led-switch-case-buttons-to-capture-time/

Quote
I don't know what you want to do with the time switches but one way would be to wire them up just like push buttons and wire the LEDs to three outputs.
With the time switches I want them to complete the circuit when a specific time is reached, let's say 10:00, and thereby lighting up the LED.  So I understand that I need:
  • The power in order to power the LED
  • The switch in order for it to complete the circuit provided the correct criteria are met
  • Ground - to complete the circuit

What am I not understanding? Because I feel that I am not understanding something very basic.

2  Using Arduino / General Electronics / Re: Circuitry. on: February 04, 2013, 09:31:11 am
How would you recommend making the circuit?

The link should allow you to rework the circuit.
3  Using Arduino / General Electronics / Re: Circuitry. on: February 04, 2013, 05:18:18 am
Thanks all.

I have changed the voltage on the battery - thanks for pointing that out.

I have reworked on the circuit in where I have three time switches and three pushbutton switches.

See here: https://www.circuitlab.com/circuit/9tgp8z/led-switch-case-buttons-to-capture-time/

The three time switches should be powered by the logic of
Code:
if time.now == 8:00 than close switch to LED 1 etc..

The three pushbuttons should work by the logic of
Code:
if button pushed than send time to serial monitor

Does that make sense or am I still missing something?
4  Using Arduino / General Electronics / Circuitry. on: February 04, 2013, 01:03:55 am
I have drawn this circuit for this little project I am working on.

However, I am not sure where to put the pushbutton in the circuit.

Basically, what I am looking to do is to have the following code work:

Code:
IF time = 10:AM

THAN LED 1 = high;

ELSEIF time = 11AM

THAN LED 2 = high;

ELSEIF time = 12: PM

THAN LED 3 = high;  etc...

Thereafter,

IF pushbutton 1 (which is attached to LED 1 -- the 10AM LED) is pressed

THAN println"the 10AM pusbutton was pressed at 10:12";

IF pushbutton 2 (which is attached to LED 2 -- the 11AM LED) is pressed

THAN println"the 11AM pushbutton was pressed at 11:24";

etc...

See attached link for circuitry I have drawn and how would one attach the pushbuttons? https://www.circuitlab.com/circuit/mhxwff/led-switch-case-buttons-to-capture-time/

Thanks.
5  Using Arduino / Programming Questions / Re: Button to tell time on: January 17, 2013, 02:51:57 pm
Code:
Someone else made a code that does the following:
if(now.hour() ==13 || now.hour() == 14 ) // add minutes and/or seconds to get more accurate time
{
   /* Do code 1*/
}

else {
  /* Do code 2*/
}
That looks cool.  Ill try it out.
6  Using Arduino / Programming Questions / Re: Button to tell time on: January 17, 2013, 01:47:52 pm
@Pauls -- thanks so much for your help.  I appreciate your chiding and giving me direction at the same time.  I finally got it.

The next thing I am working on is figuring out how to make

IF statements based on the time I get out of the RTC.

So something like

IF time is 12:00-13:00
THAN have LED connected to PIN 3 light up.
IF time is 13:00-14:00
THAN have LED connected to PIN 4 light up.
ETC..

Buckling down.
7  Using Arduino / Programming Questions / Re: Button to tell time on: January 15, 2013, 01:03:57 am
1. Ye. I had changed it and the program went crazy on me so I had to shut down the program before I could save it.

It's changed now.
Code:
Serial.println("press the button and we will tell you the time.");}

2. I am not sure what you mean when you say that the pinMode() is in the 'if' statement.  It looks like it is in the void setup () curly bracket.

Code:
void setup ()
{
    Serial.begin(57600);
    Wire.begin();
    RTC.begin();
     pinMode(buttonPin, INPUT);
  if (! RTC.isrunning()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    RTC.adjust(DateTime(__DATE__, __TIME__));

   }
 
}

3. With regards to the wiring: I think that might be the problem as well.  See attached picture.  Hope it's clear enough.
8  Using Arduino / Programming Questions / Re: Button to tell time on: January 14, 2013, 06:44:29 am
Gotcha.

Code:
// Date and time functions using a DS1307 RTC connected via I2C and Wire lib
 
#include <Wire.h>
#include "RTClib.h"
 
RTC_DS1307 RTC;
const int buttonPin = 2;
int buttonState = 0;
 
void setup () {
    Serial.begin(57600);
    Wire.begin();
    RTC.begin();
 
  if (! RTC.isrunning()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    RTC.adjust(DateTime(__DATE__, __TIME__));
    pinMode(buttonPin, INPUT);
   
  }
 
}
 
void loop () {

  DateTime now = RTC.now();
 buttonState = digitalRead(buttonPin);
    if (buttonState == HIGH){
    Serial.print(now.year(), DEC);
    Serial.print('/');
    Serial.print(now.month(), DEC);
    Serial.print('/');
    Serial.print(now.day(), DEC);
    Serial.print(' ');
    Serial.print(now.hour(), DEC);
    Serial.print(':');
    Serial.print(now.minute(), DEC);
    Serial.print(':');
    Serial.print(now.second(), DEC);
    Serial.println();
 
    Serial.print(" since 1970 = ");
    Serial.print(now.unixtime());
    Serial.print("s = ");
    Serial.print(now.unixtime() / 86400L);
    Serial.println("d");
    }
    else     {
 
    Serial.println('press the button and we will tell you the time.');}
   
   
}

Does that look better?

However, it doesn't react to the button press and also it prints "25902" which I am not sure how that got there?

P.S. I love the arduino community.  The rapid response allows you to keep some sort of workflow.
9  Using Arduino / Programming Questions / Button to tell time on: January 14, 2013, 06:25:34 am
Have hooked up an RTC to my Arduino and got the time working perfectly.  Where the correct time shows up on the Arduino Serial Monitor.

Now I am trying to get the serial monitor to only display the time when the pushbutton is pressed.

I have attached a picture of my setup and here is the code.  Where am I going wrong?
Code:
// Date and time functions using a DS1307 RTC connected via I2C and Wire lib
 
#include <Wire.h>
#include "RTClib.h"
 
RTC_DS1307 RTC;
const int buttonPin = 2;
int buttonState = 0;
 
void setup () {
    Serial.begin(57600);
    Wire.begin();
    RTC.begin();
 
  if (! RTC.isrunning()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    RTC.adjust(DateTime(__DATE__, __TIME__));
    pinMode(buttonPin, INPUT);
   
  }
 
}
 
void loop () {

  DateTime now = RTC.now();
 
    Serial.print(now.year(), DEC);
    Serial.print('/');
    Serial.print(now.month(), DEC);
    Serial.print('/');
    Serial.print(now.day(), DEC);
    Serial.print(' ');
    Serial.print(now.hour(), DEC);
    Serial.print(':');
    Serial.print(now.minute(), DEC);
    Serial.print(':');
    Serial.print(now.second(), DEC);
    Serial.println();
 
    Serial.print(" since 1970 = ");
    Serial.print(now.unixtime());
    Serial.print("s = ");
    Serial.print(now.unixtime() / 86400L);
    Serial.println("d");
   
        buttonState = digitalRead(buttonPin);
    if (buttonState == HIGH) {
    Serial.println();
    delay(3000);}
    else
    Serial.print('press the button and we will tell you the time.');
   
   
}

Thanks.
10  Using Arduino / Project Guidance / Re: Displaying captured time on serial monitor on: December 27, 2012, 01:43:13 pm
It seems that the wireless option would be fairly cheap still.

http://za.mouser.com/Search/Refine.aspx?N=4292713435&Keyword=949-NRF24L01P-R
http://za.mouser.com/Search/Refine.aspx?N=4294759686&Keyword=595-SN74LS245N

However, I would like to just test it first with wires.  I just understand it that way.  I also like building the circuits..
11  Using Arduino / Project Guidance / Re: Displaying captured time on serial monitor on: December 27, 2012, 01:21:41 pm
Gotcha.

So basically next action is to get an ethernet shield?
12  Using Arduino / Project Guidance / Re: Displaying captured time on serial monitor on: December 27, 2012, 01:06:52 pm
Thanks for your help.

However, after all of this back and forth the supplies that I currently have in my inventory are basically an Arduino, resistors, LED's, and some other random stuff.

Is there anyway that I can capture the time from the arduino and have the serial monitor read it?

Afterwards I will go buy the rest of the necessary supplies.
13  Using Arduino / Project Guidance / Re: Displaying captured time on serial monitor on: December 27, 2012, 12:34:30 pm
Perhaps even just a bunch of RF keyfobs that all connect to a central Arduino which just forwards the button press and the ID of who sent it to a PC application.

That could be a good idea.  So basically it's a bunch of buttons around the room which communicate to the Arduino wirelessly?

Code:
As far as I'm aware, the twitter library works with Ethernet/WiFI shields, not with a PC. So you could add that to the Arduino and eliminate the PC altogether. In that case, you would need the Arduino to handle the timestamp, but If it has internet access, it may as well just get it from an NTP server.

I was thinking about using the Ethernet/WiFi shield.

Quote
and if you want to send a text or post a tweet or whatever then you can launch an application on the PC to do that. Naturally, the application will have access to the PC's clock and all the other services you might need to do that.
The idea being that the program that translates the Serial comms and communicates with the Twitter API would have some way to access the system date and time through some API.

Do you have a vision for how this could be done? Or somewhere where I could look up how to do this? Or the steps necessary to learn - as in doing other projects that would teach me those steps and than I would know how to do this as well?

Thanks.
14  Using Arduino / Project Guidance / Re: Displaying captured time on serial monitor on: December 27, 2012, 11:59:31 am
Quote
Are you envisaging a wired connection to each desk? If not, I suppose you would need a wireless Arduino per desk which would add quite a lot to the complexity and cost. Otherwise you could wire them back to a central Arduino, where you're presumably multiplex them.

I am envisaging as the first rough model an Arduino at one of the students' desk.  The one who has the worst attendance.  It is to bring awareness to his tardiness and engineer him to coming more punctually.

However, as the future model I envisage that it will be a button connected to a small microcrontroller (Atmega or something of the nature) which has been programmed by an Arduino to transfer the data to the computer.

Quote
Anyway, assuming you have some solution for the students' button presses to be communicated in real time back to an Arduino which is connected to a PC, it just needs to write a message to the serial port to tell the PC that the button has been pressed.

Surely this would be possible without an Arduino as well.  (An Atmel microcontroller that has been programmed by Arduino) 

Quote
An application on the PC would receive these messages and take whatever action you defined.

Would I need to make such an application? It seems like that should be able to be done with the currently exisiting Twitter Library and than from there with Zapier to automatically SMS it to students or perhaps with Twilio.

Quote
Given all the work you've gone to to acquire this information I'd be inclined to log it to a database so that you can do something useful with it such as produce attendance reports,


Good idea.

Quote
and if you want to send a text or post a tweet or whatever then you can launch an application on the PC to do that. Naturally, the application will have access to the PC's clock and all the other services you might need to do that.

Don't get how that would automatically work.  I don't want there to be a person who has to do any data entry.

Quote
(Personally, if my school had given me a button that sent me a text when I pressed it, I'm sure that as soon as the novelty factor wore off it would be abandoned as pointless, distracting and a waste of money. But that's nothing to do with the technology.)

Well, it's always worth a try.  smiley
15  Using Arduino / Project Guidance / Re: Displaying captured time on serial monitor on: December 27, 2012, 11:30:01 am
What are your recommendations?
Pages: [1] 2 3