[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
REEEE
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /diy/ - Do It yourself

Thread replies: 55
Thread images: 9
File: REEEE.jpg (12 KB, 363x405) Image search: [Google]
REEEE.jpg
12 KB, 363x405
I'm at my wits end. I've been struggling for over 2 weeks trying to make an accurate timer/oscillator using basic electronics and IC's but I'm out of luck and ideas.

I've tried 555 timers, inaccurate as shit.
I've tried 4060 timers, better, but still not good enough.
I've added one of the f*ckers in the pic to the 4060, but STILL the frequencies jump all over the place.

I've tested and exchanged all my parts, no luck there.

My goal is to turn this thing into an 8 hour timer so I can water my plants while I'm out. I've got the pumps, relays, everything. It's just this timer that's failing me hard. I'm at the verge of buying an arduino (which is too OP and too expensive for this purpose) but it'd waste all my time and money (on electronics) thus far.

Please 4chan, you're my only hope.
>>
>I've tried 555 timers, inaccurate as shit.
>I've tried 4060 timers, better, but still not good enough.
The main limiting factor with those are the passive components and 4060 is also influenced by supply voltage variations.
>I've added one of the f*ckers in the pic to the 4060, but STILL the frequencies jump all over the place.
You either did it wrong or you have rather ridiculous requirements for the accuracy of your plant watering timer. If it's the latter, then the uncalibrated accuracy of Arduino isn't probably going to satisfy you.
You can add a trimmer capacitor to adjust the crystal frequency. You should also use as correct as possible load capacitance; wrong load capacitance is the typical reason why RTCs with external crystals suck. That way you'll get normal run of the mill quartz clock accuracy. If it's not enough, there are temperature compensated canned crystal oscillators.
>>
>>1006226

I don't really care for the actual frequency all that much. I can get the 8 hours from almost any frequency smaller than a second basically. I wrote a tool that automatically calculates the pin connections based on the measured frequency.

Stability is the big factor though. From all the tutorials/blogs/websites, it seemed like the crystal oscillator thing would have a highly accurate 2 Hz output on the 4060, but I've been extremely let down.

About the voltage variation, my hookup is as follows:
1 oscillator, the 4060 + crystal
Is connected through the highest pin (2 Hz) to a binary up down counter.
There are 4 of those up-down counters in series.
Those 16 output bits can be combined in a combination of and-gates to accurately set the 8 hour interval.
The and gates trigger an edge detector that immediately resets the counters so the next 8 hours start. The timer is not reset.

The edge detector will (eventually) also trigger the watering mechanism through transistors activating relays activating the pumps.

Mind, I've learnt all of this from scratch in about 3 weeks, so I'm bound to overlook a few things.
>>
>>1006230

Oh and all of it is running on 5 V drawn from a 5 V regulator that's powered by a 12 V adjustable adapter. (I need the 12 V for the relays).
>>
File: 1442014998824.png (112 KB, 297x282) Image search: [Google]
1442014998824.png
112 KB, 297x282
>>1006220
why not use an alarm clock ?
>>
>>1006252
I actually have one I want to take apart, but because I don't have any background in electrical engineering or electronics other than the last two-three weeks, I'm not sure I've got what it takes to take it apart such that I can keep the timer component intact. It's an alarm with a radio in it too, so a bit more complex.

The deadline for the plant watering thing is next week too so, RIP plants, if I don't get it done at least. It's a vegetable garden too from which I regularly harvest (mostly peppers).
>>
>>1006220
>555 timers too inaccurate.
Man this guy must be building a robot or some other tech requiring milisecond precision.
>To water my plants.

Man, if your plants cant handle 8 hours and 15 minutes without water you have some shitty plants.
>>
>>1006260
It's probably just my OCD though. Plus the time difference accumulates.

Also at the moment I can't get the accuracy even within that 15 minutes. Not even inside an hour of 8 hours. It's not just "inaccurate", it's terribly far off the mark.
>>
>>1006230
> it seemed like the crystal oscillator thing would have a highly accurate 2 Hz output on the 4060
It will. Accuracy is typically 20ppm, i.e. less than 2 seconds/day drift.

> but I've been extremely let down.
In what way? (i.e. what have *you* fucked up to make it not work?)

Note that 8 hours = 8*60*60 seconds = 8*4*15*4*15 = 8*16*225 = 128*225. So following your 2 Hz output with a simple 8-bit counter then an 8-bit down counter preloaded to 225 will give the desired interval.
>>
File: 1352531640932.jpg (154 KB, 1000x1310) Image search: [Google]
1352531640932.jpg
154 KB, 1000x1310
>>1006220
I've never had a problem with the accuracy of a 555 chip myself. The keys for me are to use a *well* regulated power supply, meaning use plenty of filter caps with an lm7805 or whatever, and also to add something like an inverter from a hex inverter chip to sharpen the edge of the output pulse.

Honestly though, if you're having trouble with every type of timer that you are using, you probably have some other problem. Perhaps you're accumulating error because you are using a zillion tics to count one toc. Why don't you try configuring the 555 timer for an 8 hour cycle? That is one thing they are pretty good at. Just use a large value tantalum cap (470 uf or so?) And pick the resistor to set the timing at 8 hours. You may need to fine tune the resistor value with a trimmer, but it would be easier than fine tuning the capacitor value. I've configured long time intervals on a 555 chip like that with great success before, and the amount of error that you accumulate would be much lower.

KISS

Keep
It
Simple
Stoopid
>>
>>1006265

> It will. Accuracy is typically 20ppm, i.e. less than 2 seconds/day drift.
Unfortunately, the frequency swings heavily in the current configuration. It doesn't seem to stabilise at all, though it will exhibit fairly long stable periods that then change up every now and again. So like, a minute of 1.3 hz, then 43 seconds of 2.8 hz, then 52 seconds of 1 hz, etc. It's really weird.

> In what way? (i.e. what have *you* fucked up to make it not work?)
I've set myself a goal and it looks like I won't make it. I'm unable to do something fairly basic that others seem to get done well/quick enough (all the blogs I've read for example).

> 128 × 225
Yeah this was one of my earlier concepts as well. I made it more general and just do prime factorisation based on whatever stable frequency I can get. So if the frequency is higher than 1 Hz I'll just use higher factors to get to the number that equals 8 hours. This is definitely something that will simplify the current model I've got tho, despite it being my first idea.

>>1006268
555's get more inaccurate with higher intervals though. Like, really inaccurate. Fine tuning 8 hours would not be easy either if you gotta wait that long. In that case I'll consider making a high frequency but STABLE 555 oscillator and just plug that into counters.

Like I said I don't care much for the frequency as much as I care about stability. The frequency is irrelevant as I can solve that using math, though higher frequencies do give higher accuracy (and hopefully higher stability as well).
>>
>>1006271
> Unfortunately, the frequency swings heavily in the current configuration.

Things to check:
- series resistance and load capacitance are correct
- the drive voltage is correct.
- the power rails are adequately decoupled close to the chip
- your logic is correct (specifically, you don't have race conditions)

The logic should be trivial: preload the down counter with the correct value whenever it hits zero. You should be ignoring the data-out (Qn) lines, only using the carry.
>>
>>1006280

>- series resistance and load capacitance are correct
I'm using a 10M resistor and a 220k resistor with the 32768 Hz crystal. The two capacitors are 22 pF since that's the smallest I've got.

> the drive voltage is correct.
It's 5V. Everything is 5V since I know basically all IC's will work with that and I don't need to care much about mixing CMOS with TTL (or was it TLL?) too much if I mess those up.

> the power rails are adequately decoupled close to the chip
You mean on the master reset? That's the only place I figure I should put one. It's currently grounded with a wire since it used to be hooked up to a reset circuit (grounded through a resistor/capacitor couple).

> your logic is correct (specifically, you don't have race conditions)
I'd need to use at least two counters since each only has 4 bits = 15 max value.

All my logic is correct. I'm a programmer and mathematician so all of that is trivial. At some point I had made some basic logic gates out of transistors and resistors and diodes because some logic chips didn't behave as expected.

As a mathematician, I must say I'm growing a profound dislike of physics atm, despite it being my favourite subject in high school years ago.
>>
File: fc1.jpg (355 KB, 1344x1143) Image search: [Google]
fc1.jpg
355 KB, 1344x1143
>>1006220
Use the grid as a timer, set up a circuit that takes the peaks of the sine wave and divide them accordingly into 8 hour intervals with counters and whatnot.
Many power companies keep a precise timing on the number of oscillations produced per day, there are many clocks that still depend on that method for keeping time.

Anyway, your plants won't give a shit if you're watering 5 minutes late at the end of the month.
>>
>>1006288
That's actually a great idea, though I have no idea how to go about it (yet). Will look into it though.

Also that clock is glorious. Reminds me of a binary clock.
>>
>>1006271
>555s get more inaccurate with longer intervals. Like really inaccurate.

How do you know? Weren't you just saying that you've only been doing this a couple of weeks. Fellow math degree holder here who has been working with electronics for almost 20 years. I don't understand why you want to make this convoluted system of counters and crystals when you could have a simple one chip solution.

I specified using a tantalum cap specifically because of the 'inaccuracies with long time intervals' that you referred to. Even using an aluminum cap you would still have a better solution than what you currently have.

Since it sounds like you aren't familiar with decoupling capacitors, and you insist on using counters because of reasons, you would probably be best off with the solution provided by >>1006288
>>
>>1006285
>- series resistance and load capacitance are correct
Note that the load capacitance depends upon the crystal; you need to check the data sheet. The resistance depends upon the crystal and the desired drive voltage.

> It's 5V. Everything is 5V
The drive voltage will be determined by both the logic voltage and the series resistance. The crystal effectively forms a voltage divider with the resistance.

> the power rails are adequately decoupled close to the chip
> You mean on the master reset?
No, the power rails (Vdd and Vss). ICs which run off a clock signal tend to draw current in short spikes on the edges of the clock. You may need a decoupling capacitor across the power rails close to the IC to provide that current (the inductance of the PCB traces will tend to inhibit them from delivering short pulses of current).
>>
>>1006294

> How do you know?
I read it in various places, including technical data so I relied on other people's expertise and thus believed it to be true.

I'd love a one chip solution so I'm considering going back to the 555 timer if that works best.

What about tantalum and aluminium capacitors makes for a more stable frequency?

The counters make it easier (for me) to set a more accurate interval. I just looked up decoupling capacitors and I think they're all included in the circuits I've looked up/built.

>>1006297
Will the resistance/capacitance/drive voltage values effect the stability? Or only the frequency itself? I presume passive components like resistors and capacitors have fixed values (neglecting counting temperature as a variable) so they should be pretty stable. I realise electrolytic capacitors may leak so I strive to not use those to hopefully get higher stability.
>>
there's a super simple way to achieve very accurate timing using an alarm watch. you can either use the alarm function, or the beep-on-the-hour function. hook up a level inverter to the 2 buzzer connections to convert the signal into digital, and use that signal to count or time whatever you want. if you need more complex functions, just add more watches. you can get 'em at the dollar store for next to nothing.
>>
Thanks for all the responses you guys, I can work a bit with this. I'm too tired to really get into it but I'll try again tomorrow. I may come back to ask further questions, especially if I'm gonna use the 555 timer.

Thanks again.
>>
>>1006302
> Will the resistance/capacitance/drive voltage values effect the stability? Or only the frequency itself?
Not matching the capacitors to the crystal's load capacitance affects the frequency slightly (<0.1%).

But the values of the resistor and capacitors will also affect the drive voltage, which can affect stability (if it's too low, the signal may be too weak; if it's too high, you can get overtones).

The ideal way to find out whether the issue is with the oscillator or elsewhere would be to scope it. You could even just put a piezo speaker on one of the outputs from the 4060; it would be fairly obvious if the frequency was changing.
>>
>>1006268
lel, reverse image search give me bob jones university textbook, a christian homesschool book publisher

https://en.wikipedia.org/wiki/BJU_Press
>>
File: relay.gif (11 KB, 583x338) Image search: [Google]
relay.gif
11 KB, 583x338
>>1006288
what am i looking at ?
>>1006260
lel
>>1006254
m8 just use the alarm system.
the clock must have some speaker to ring, just plug that shit to a relay.
>>
>>1006335

that's just TTL logic, discrete transistors
>>
>>1006342
looks more like some sort of art thing.
it doesn't work, i don't see any ground line or clock generator.
>>
>>1006347

all it would need is one capacitor

also the ground line might just not be obvious
>>
>>1006350
nah, jut checked, i'm 90% sure this thing doesn't work
>>
>>1006353
http://techno-logic-art.com/clock.htm
>>
>>1006306
This. So easy even a Muslim terrorist can do it.
>>
File: eureka.jpg (50 KB, 829x641) Image search: [Google]
eureka.jpg
50 KB, 829x641
Hey all, it's the OP again. Didn't expect the thread to still be alive.

I've added a decoupling capacitor (0.01uF) to the power supply to the timer chip and it's completely stable now.

Pic related, it's the output of my improvised oscilloscope (speaker on breadboard + microphone on PC + audacity + custom script but hey it works)
>>
>>1006626
surprisingly quite capable OP, i congratulate you.
previously used a pc sound card to verify a band-pass filter (audible range)
>>
>>1006220
What kind of power supply are you using?
>>
wouldn't it be easier just to buy a pre set up automatic timer system designed for indoor cannabis grows, for your "mostly peppers"
>>
>>1007516
this is /diy/, not /buy/
>>
>>1007331

12V 600mA for the circuit, 12V 2A for the pumps.

>>1007516

I've found those but they were only available in garden variety. I don't have that many plants or require that kind of water. The timing was also awkward to set since it's in discrete units of like, 10 seconds, 1 minute, 5 minutes, 15 minutes etc.
>>
Just buy an arduino nano and RTC module from ebay or aliexpress, they will cost like $3 in total.
>>
Or, if you suddenly want to go full overkill mode, buy an ESP8266 module and get 100% accurate time from NTP server.
>>
>>1007738

>Current year, going "extremely overkill" costs a whapping $2.12

http://www.ebay.com/itm/201548924579

Deflation really is the natural way, as technology progresses more can be produced with less human effort. Fucking kikes give out billions in the fractional reserve system and quantitative easing to there cronies enriching them at our expense telling us that the inflation is good for us.
>>
>>1006220
$2 for chink arduino pro mini, $2 for ft232 serial programmer.
>>
>>1006288
I can't find a video of that clock. It's truly a work of art.
>>
>>1007724
>>1007738
>>1007926
>>1007968

OP here.

I'll be checking that out, though not for the plants. I'm really interested in Arduino since I really love the Raspberry Pi. Arduino seems a bit more basic and more suitable for electronics and gizmos.

I didn't want an arduino for my plants since it was too OP in my opinion. Plus I had some chips lying around anyway. It's all timed proper now and my plant system is set up. I'm currently measuring the water output so I can time the pump accordingly.

If the thread is still alive in a while I may post pics.
>>
I know this is necro-bumping, but for a 555, any period over like 20 minutes is actually bad, because the discharge of the chip itself becomes significant and unpredictable.

http://www.google.com/patents/US4919140

There is a patent which could set someone else off in a better direction. The circuit provide is tuned for 30-minute polarity reversals, but could be arranged for longer I assume.
>>
>>1009454
>>because the discharge of the chip itself becomes significant and unpredictable

Reference? I've personally configured 555 timers to run for hours or 10's of hours with no problem over the course of months. The chip doesn't discharge. It looks at a capacitor that is charging and discharging and flips an internal flip flop accordingly. The stability of the circuit is based on your power supply and the quality of an external capacitor. Maybe you're thinking heat makes it unstable? But I'm telling you, 555s are stable if you design them right. Don't beleive the hype.
>>
>>1009463
They don't have the source, but http://www.edaboard.com/thread37791.html

They mention a TLC555 which goes from 476ns to "hours"

http://www.electroschematics.com/9082/long-duration-timer/

That circuit uses the sub-timers to divide the output.

http://www.555-timer-circuits.com/common-mistakes.html

"6. Don't use high value electrolytics and high resistances to produce long delays. The 555 is very unreliable with timing values above 5-10 minutes. The reason is simple. The charging current for the electrolytic is between 1 - 3 microamp in the following diagram (when the electro is beginning to charge) and drops to less than 1 microamp when the electro is nearly charged.
If the leakage of the electro is 1 microamp, it will never fully charge and allow the 555 to "time-out." "
>>
>>1009463
Original 555 is Bipolar. Thus the comparator inputs are BJT bases with corresponding bias leakage.

>>1009467
TLC555 is CMOS which has much smaller gate leakage.
>>
>>1009467
That source is referring to electrolytic capacitors. That's basically what I was saying to begin with; don't use shitty capacitors and you will achieve long and stable timing no problem.

I know that there are a million neckbeards on the internet telling you how crappy the 555 circuit is, but that's just because *they* weren't able to design it right, not that it can't be designed right.
>>
Just buy more weed plants when you get back. "Pepper plants" are cheap
>>
>>1006220
>I wonder if I should google for a simple and cheap existing solution for this problem before I spend a year of my life trying to reinvent the wheel

>nah fuck it I'm on /diy/

http://www.princessauto.com/en/detail/basic-24-hour-indoor-timer/A-p8661415e
>>
>>1009789
There's a reason /diy/ is not called /biy/
>>
>>1009792
It's a component, you buy components.

OP didn't first make a fab to make the 555 timer, he bought it.
>>
>>1006271
>Unfortunately, the frequency swings heavily in the current configuration. It doesn't seem to stabilise at all, though it will exhibit fairly long stable periods that then change up every now and again.
>So like, a minute of 1.3 hz, then 43 seconds of 2.8 hz, then 52 seconds of 1 hz, etc. It's really weird.

then your current configuration is wrong, or something is going on with your connections.

there is one other thing that could be wrong which Istrongly suspect, but you need to post a damn scehmatic before we can give you any feedback. if you're gonna treat us like stack excahnge then you need to come to us like stack exchange.
>>
>>1010240
It appears that the issue was the lack of decoupling and it's now fixed:
>>1006626

>>1009626
The frequency of an R-C oscillator is (at best) only as stable as the values of R and C. Good luck finding resistors and capacitors which are anywhere near to 20ppm (which is what you get from a crystal).

That's /why/ crystals are used in preference to R-C oscillators whenever the frequency needs to be remotely accurate.

As a rough guide, anything better than 1% (for a clock, that means 14.4 minutes/day) requires calibration and either active temperature compensation or a restricted temperature range (you normally assume 10-30°C for "indoor" operation). At which point, it's easier to just use a crystal or resonator instead.
>>
>>1006220
>I've added one of the f*ckers in the pic to the 4060, but STILL the frequencies jump all over the place.

You must have done something incredibly stupid then.
>>
>>1006220
I'm not going to read the entire thread because I'm a lazy nigger but this link might help.
http://www.hackersbench.com/Projects/1Hz/
>>
ordinarily i wouldn't suggest buying on diy
but op sounds helpless and i'd hate to see his marijuana plants suffer from drought
Thread replies: 55
Thread images: 9

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.