Go Down

Topic: Circuitry. (Read 1 time)previous topic - next topic

agrinshtein

Feb 04, 2013, 07:03 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: [Select]
`IF time = 10:AMTHAN LED 1 = high;ELSEIF time = 11AMTHAN LED 2 = high;ELSEIF time = 12: PMTHAN LED 3 = high;  etc...Thereafter,IF pushbutton 1 (which is attached to LED 1 -- the 10AM LED) is pressedTHAN println"the 10AM pusbutton was pressed at 10:12";IF pushbutton 2 (which is attached to LED 2 -- the 11AM LED) is pressedTHAN 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.

Osgeld

#1
Feb 04, 2013, 08:03 am
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

Krodal

#2
Feb 04, 2013, 08:13 am
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.

Docedison

#3
Feb 04, 2013, 09:17 am
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.
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

agrinshtein

#4
Feb 04, 2013, 11: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/

Code: [Select]
`if time.now == 8:00 than close switch to LED 1 etc..`

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

Does that make sense or am I still missing something?

Grumpy_Mike

#5
Feb 04, 2013, 03:09 pm
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.

agrinshtein

#6
Feb 04, 2013, 03:31 pm
How would you recommend making the circuit?

The link should allow you to rework the circuit.

Grumpy_Mike

#7
Feb 04, 2013, 03:36 pm
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.

agrinshtein

#8
Feb 04, 2013, 09:28 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.

Grumpy_Mike

#9
Feb 04, 2013, 10:22 pm
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.

Go Up