a timer that goes logic high or low every 15mins (hardware version)

Status
Not open for further replies.

sarahMCML

Joined May 11, 2019
698
Or you could do it with about $5 worth of CMOS IC devices and ZERO invested in programming devices, and if you needed to replace a damaged part in ten years it would still be available and you would not need to program it.
I have this circuit breadboarded, tested and all drawn up ready to go if the TS is interested. Whether it could be constructed on a PCB any smaller than an Arduino Nano though is unlikely, even using SOIC packages and surface mount components.
 

Thread Starter

timtim1234

Joined Nov 30, 2023
246
Because I want to fit in into the same project box that has the other device in it. a couple of DIP IC and a few components would be ok.
 

Thread Starter

timtim1234

Joined Nov 30, 2023
246
You are not getting it you can pull the chip and program a attiny leave the chip in and burn bootloader
the UNO as a programmer. there dirt cheap or get one of these
https://www.amazon.com/dp/B09921SC7...&s=pc&sp_csd=d2lkZ2V0TmFtZT1zcF9kZXRhaWw&th=1

20 dollar programmer
Or the UNO less then 10 dollars

Code:
#define ledPin 13  // Pin connected to the LED

unsigned long previousMillis = 0; // Variable to store the last time LED was updated
const long interval = 1000; // Interval at which to blink (milliseconds)
const long timerInterval = 1 * 60 * 1000; // 15 minutes in milliseconds 1 * 60 *

//bool ledState = LOW; // Initialize LED state

void setup() {
  pinMode(ledPin, OUTPUT); // Initialize the LED pin as an output
}

void loop() {
   digitalWrite(ledPin,LOW );
  unsigned long currentMillis = millis(); // Get the current time

  if (currentMillis - previousMillis >= timerInterval) {
    // It's time to toggle the LED
    previousMillis = currentMillis;
    digitalWrite(ledPin,HIGH);
    delay(interval); // Wait for 1 second
    digitalWrite(ledPin,LOW ); // Toggle the LED
  
  }
}

That code works I just tried it out

Also, I was thinking anyway to add a trigger pin ( logic high) once that is triggered that would start the timer? And has this function to be on a switch? Meaning if this switch is on only work with a trigger. if switch is off then timer every 15 mins? For that matter, have another pin monitor if it's logic high no timer would start ( trigger or standard timer) intill that pin is a logic low.
 
Last edited:

be80be

Joined Jul 5, 2008
2,395
The attiny not going to be a easy part to program the new ide has problems with broken libraries
 
Last edited:

sarahMCML

Joined May 11, 2019
698
Sorry I've not responded sooner, been a little busy with other things. Anyway, here is the circuit I came up with. Nothing revolutionary, flip flop U3A produces the 1 second output pulse, once every 15 minutes, positive or negative going depending on whether Q or /Q is used. Timing was using an electrolytic capacitor, so R5 could need adjusting to get it spot on! U3B produces the 15 minute high/low cycle.
To test, just fitting the diode to Q4 gives a complete cycle every 8 seconds.
The reset switch is High to reset, could be a momentary or toggle, or a fairly high current logic pulse (due to R4 needing to pull up against possibly up to 4 low outputs of the CD4020.

15MinTimer.png

EDIT: Image edited for incorrect wire.
 
Last edited:

BobTPH

Joined Jun 5, 2013
11,543
Also, I was thinking anyway to add a trigger pin ( logic high) once that is triggered that would start the timer? And has this function to be on a switch? Meaning if this switch is on only work with a trigger. if switch is off then timer every 15 mins? For that matter, have another pin monitor if it's logic high no timer would start ( trigger or standard timer) intill that pin is a logic low.
This is the best argument you could make for using a microcontroller. The new functions could be added mostly in software. If you had built a hardware version and wanted to make this change it would be back to drawing board.
 

ericgibbs

Joined Jan 29, 2010
21,452
Hi sarah,
From what TS is posting, free installation space is at premium, I have asked what free volume space dimensions are available, so far no answer.
Perhaps you may have more luck getting this information.
E
 

MisterBill2

Joined Jan 23, 2018
27,607
Consider that ALL of the components used in the circuit of post #149 have been available for at least 20 years, and will continue to be available for quite a while yet. Then consider that no expense for programming would be required and that every aspect of the circuit can be easily understood by those with a bit of electronics knowledge. And if one is wanting to learn, the logic functions can be understood.
 
Hi

I have be playing around with 555 timers and I have on order cd4060. I am trying to make a timer that goes for one second a logic high or low ( selectable with switch) every 15 mins. I notice that 555 is not good for long time cycles. So I think a cd4060 would be better for this.

Sorry I don't want to mess around with MC, PIC, etc I don't want to learn programming.

Thanks
Consider the LTC6991 Slowest time is 29.1uH
 

be80be

Joined Jul 5, 2008
2,395
The attiny 85 you have to add cores to the Arduino ide there libraries that tell the ide about the chip pins how much code you add to it
the ide is now 2.3 .2
so you have to add the right ones to the Ide plus programming using the arduino as isp doesn't work from the load button in the IDE
you have to use ctrl shift u to load the code into the attiny
And there are lots libraries out there you pick the wrong one and the code i posted will never use millis

If you want use the attiny don't install the latest ide use one of the older ones like 1.6 to 1.8
 

swr999

Joined Mar 30, 2011
58
Keep it simple!

The following will do what you want. Download the Arduino IDE, buy a Nano (or any other Arduino-compatible MCU), and spend a couple hours (or less) running the code to see it work. For testing, in the code below you could change the 899 to 59 and see a 1-second pulse every minute on pin 8 (scope or DMM).

Mod: added Code Tags
C-like:
int pin = 8; // pin 8, which is to be set high or low

int n = 0; // declare “n” as an integer

void setup() {

pinMode(pin,OUTPUT); // set “pin” to be an output pin

}

void loop() { // this “loop” section runs repeatedly forever

for (n=0;n<899;n++){ // let 899 seconds elapse

delay(1000); // 1000 milliseconds = 1 second

}

digitalWrite(pin, HIGH); // set “pin” to logic high (5V)

delay(1000); // wait 1000 milliseconds (1 second)

digitalWrite(pin,LOW); // set “pin” to logic low (0V)

} // jump back to void loop() and repeat
  • Click the “Upload” button (the forward arrow in the IDE upper blue taskbar)
  • IDE compiles and uploads the code to the Nano
 
Last edited by a moderator:

panic mode

Joined Oct 10, 2011
5,008
that was suggested many times but TS is not encouraged. if i recall delay() accepts long integer as parameter so it should be possible to make the 15min delay without loop.
 

be80be

Joined Jul 5, 2008
2,395
The ttiny 85 not really a chip for the first time user the nano be the best bet
15min delay without loop. with delay() it said you use long integers
 

Thread Starter

timtim1234

Joined Nov 30, 2023
246
Hi sarah,
From what TS is posting, free installation space is at premium, I have asked what free volume space dimensions are available, so far no answer.
Perhaps you may have more luck getting this information.
E
sorry didn't see that post its bout 2x3 box
 

Thread Starter

timtim1234

Joined Nov 30, 2023
246
sorry sometimes its hard to keep up with the posts they seems to come in faster then i can keep up

i also asked about tweaking the code? i will repost what i asked too

Also, I was thinking anyway to add a trigger pin ( logic high) once that is triggered that would start the timer? And has this function to be on a switch? Meaning if this switch is on only work with a trigger. if switch is off then timer every 15 mins? For that matter, have another pin monitor if it's logic high no timer would start ( trigger or standard timer) intill that pin is a logic low.

the code above for a ttiny85
 
Status
Not open for further replies.
Top