Pages: [1]   Go Down
Author Topic: Circuitry.  (Read 565 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset 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
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset 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 Offline
Edison Member
*
Karma: 9
Posts: 1016
View Profile
 Bigger Bigger  Smaller Smaller  Reset 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 Offline
Faraday Member
**
Karma: 47
Posts: 2925
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset 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

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

Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset 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/

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

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 634
Posts: 34527
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset 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 Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How would you recommend making the circuit?

The link should allow you to rework the circuit.
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 634
Posts: 34527
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset 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 Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset 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)
Online Online
Brattain Member
*****
Karma: 634
Posts: 34527
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset 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
Jump to: