Pages: [1]   Go Down
 Author Topic: Circuitry.  (Read 359 times) 0 Members and 1 Guest are viewing this topic.
Offline
Newbie
Karma: 0
Posts: 33
 « on: February 04, 2013, 01:03:55 am » Bigger Smaller Reset

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.
 Logged

SE USA
Online
Karma: 35
Posts: 3649
@ssh0le
 « Reply #1 on: February 04, 2013, 02:03:48 am » Bigger Smaller Reset

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
 Logged

Offline
Edison Member
Karma: 9
Posts: 1003
 « Reply #2 on: February 04, 2013, 02:13:16 am » Bigger Smaller Reset

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.
 Logged

Anaheim CA.
Offline
Edison Member
Karma: 34
Posts: 2402
Experienced old Whitebeard with a Full head of Hair...
 « Reply #3 on: February 04, 2013, 03:17:50 am » Bigger Smaller Reset

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.
 Logged

“The solution of every problem is another problem.” -Johann Wolfgang von Goethe

Offline
Newbie
Karma: 0
Posts: 33
 « Reply #4 on: February 04, 2013, 05:18:18 am » Bigger Smaller Reset

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/

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?
 Logged

Manchester (England England)
Offline
Brattain Member
Karma: 298
Posts: 26024
Solder is electric glue
 « Reply #5 on: February 04, 2013, 09:09:38 am » Bigger Smaller Reset

Quote
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.
 Logged

Offline
Newbie
Karma: 0
Posts: 33
 « Reply #6 on: February 04, 2013, 09:31:11 am » Bigger Smaller Reset

How would you recommend making the circuit?

The link should allow you to rework the circuit.
 Logged

Manchester (England England)
Offline
Brattain Member
Karma: 298
Posts: 26024
Solder is electric glue
 « Reply #7 on: February 04, 2013, 09:36:45 am » Bigger Smaller Reset

Quote
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.
 Logged

Offline
Newbie
Karma: 0
Posts: 33
 « Reply #8 on: February 04, 2013, 03:28:19 pm » Bigger Smaller Reset

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.

 Logged

Manchester (England England)
Offline
Brattain Member
Karma: 298
Posts: 26024
Solder is electric glue
 « Reply #9 on: February 04, 2013, 04:22:18 pm » Bigger Smaller Reset

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.
 Logged

 Pages: [1]   Go Up