Circuitry.

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:

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.

http://arduino.cc/en/tutorial/button

and using a 9 volt backup battery on the 1307 will just smoke it, use a 3.3 volt coin cell

Connect the button to an unused pin of the Arduino and to ground.
You can set an internal pull-up resistor in the Arduino, or use a pull-up resistor of 10k from the Arduino pin to 5V.

Don't try to make your whole code work, but make little steps.
Try to make the leds blink first.
Next try to make the buttons work, write the result to the serial monitor.
After that try to make the DS1307 work, and have the result written to the serial monitor.
If everything is okay, start with the project, and do it step by step.

You should also read the datasheet for the DS1307. As Osgeld wrote, the 9V will smoke it. The battery voltage input for the DS1307 should be 3.5V maximum.

Don't forget the limited 2.7 to 3.8 Volt Vcc range as well. The battery can be also be a 100F super cap if you have room on your BOM, just consult the spec sheet before powering it down, you might have issues.

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: LED SWITCH CASE + BUTTONS TO CAPTURE TIME - CircuitLab

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

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

Does that make sense or am I still missing something?

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

You might have reworked it but the push buttons are not going anywhere and you have no pull down resistors. The time switches just seem to light up some LEDs, very nice but you can't use them in your code because they are not connected to the arduino.

How would you recommend making the circuit?

The link should allow you to rework the circuit.

How would you recommend making the circuit?

I would wire up the push buttons between an input and ground, and enable the internal pull up resistors in software.
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.

I wish I had a clear understanding of what you are saying.

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? LED SWITCH CASE + BUTTONS TO CAPTURE TIME - CircuitLab

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.

Each button must be wired to a diffrent input pin. The other end of the button should be connected to ground.
The time switches are not needed, you just connect the LED and resistor to an arduino output each.

As you seem to know so little I suggest you do some tutorials first before proceeding with this project.