element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
John Wiltrout's Blog Process Duration Timer  Blog 1 (The Timer)
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: jw0752
  • Date Created: 24 Jul 2017 4:20 AM Date Created
  • Views 3905 views
  • Likes 12 likes
  • Comments 23 comments
  • diytestequipch
  • clock modification
  • process duration timer
Related
Recommended

Process Duration Timer  Blog 1 (The Timer)

jw0752
jw0752
24 Jul 2017

This is going to be an update and expansion of range for a test device I built and posted on the forum two years ago.

 

Battle of the Batteries - E*** vs D*** vs Bargain

 

The device that I built for that blog was designed to monitor a battery voltage that was under constant current load from a non-programmable electronic load and compare it to a target voltage that was selected by me. It was my purpose to time how long it took for the battery voltage to decay below the set target voltage. Since this process could take many hours I wanted an automated device that would let me walk away and return the next day to see the final results. For this first device I designed it using a comparator and support components which supplied power to an analog electric clock as long as the battery voltage was above the target voltage and then stopped the clock when the battery voltage finally dropped below the target. While this test adapter worked as planned it had several limitations and inconveniences.

 

I have been thinking for some time to revisit this project and to make the following improvements:

 

1. Use a digital clock timer that can be reset to 00:00:00 without having to manually move the clock hands.

 

2. Improve the accuracy of the timing to +/- 5 seconds.

 

3. Have an integral internal power supply to power the unit and produce the Target Voltage selection. ( The original required the use of an external bench supply to power the unit.)

 

4. Expand the range of Monitored (previously called Battery) Voltage that can be tested from 12 volts to 30 volts.

 

5. Expand the concept of the unit to include super capacitors and other processes where an initial energy source is consumed by a load over time.

 

This has been an idea knocking around in my head for some time but the recent posting of the DIY test equipment on the forum has made me put the idea back on the real bench.

 

This first blog will explain the progress I have made on finding an appropriate digital clock and some of the unusual modifications that I had to make to it. Please look with a critical eye at my solution as I am hoping those of you with more experience will warn me if I am making a mistake with this approach.

 

Here is my present best candidate for digital clock timer for the Process Duration Timer:

 

image

 

This is a $3.63 Chinese clock kit. The first thing that I liked about it was that it starts at 00:00:00 when power is first applied and then it begins to time immediately. As I built the kit I intentionally modified it with a mind to building it into the final enclosure. I left the LED display raised and made sure all the other components sat below the level of the faces of the digits. I left the memory battery off, as the fact that it will reset to 00:00:00 each time it is powered down if a asset for this application.

 

* First real problem is how to conserve the time on the clock when the transition of the monitored voltage from above to below the target voltage occurs. Keep in mind that the experiments that this unit will be timing may take many hours and I will not likely be there to look at the clock when the voltage transitions. It may be many more hours before I actually return and want to check the time. The clock system is built around an Atmel AT89C2051 Micro Processor and I have no access to its program nor do I have the skill to modify it if I did. My solution will have to be external and involve stopping the clock without loosing its current time register. I tried using the input switch on the unit to do this but all that it was programmed to do was reset the hours and minutes.

 

After some experimentation I discovered that if I disabled the oscillator clock to the AT89C2051 it stopped timing. I did this by pulling one side of the crystal to ground. (Question  - Is there any reason why this is not appropriate). When the microprocessor has its clock stopped a side effect of the stop is that I am also left with the current output to the LEDs which is usually a single bright digit on the display. I experimented with leaving the system in this state of suspended animation for 40 minutes and when I opened the grounded leg of the crystal the clock resumed at the exact time that it had when it was suspended.

 

The next step was to add a small 5 volt DPDT relay to the underside of the board. One of my concerns was that the additional capacitance of the relay structure that I was adding, to be able to pull the crystal lead to ground, might cause problems. I placed the relay close to the crystal and ground to minimize any capacitance. By now a good survey of the almost unreadable schematic supplied with the clock kit had given me a way to suppress the display of any digits while the clock is in suspended animation. There are six transistors on the unit that control whether a digit displays or not. These transistors all have a common emitter connect to the power supply. I used the second section of the DPDT relay to switch this power feed off to the transistors. In this way the energizing of the 5 volt relay puts the clock into suspended animation and blanks all the digits at the same time. I also used the other touch contact of this pole to light a red LED that I mounted in the place of the memory battery. After cutting some traces and adding a 470 ohm resistor for the LED the back of the circuit board looked like this.

 

image

 

You can see that I have also added a flyback diode to the relay to minimize a voltage spike when the relay is de-energized. The next step is to test the prototype of the timer to see if it does the things that I want it to do. First of all I want it to start off counting when power is applied at 00:00:00. Secondly I want to be able to put the timer into suspended animation for an indefinite period of time. The suspension will stop the clock pulse of the AT89C2051 and suppress the lighting of the digits in the display. To tell me that the clock is in suspended animation the red LED in the lower right corner should light. Here is a video of the proof of concept test.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

I continue to be concerned about my use of the clock crystal for the AT89C2051 to produce the desired suspended animation. If anyone has any input or experience with this, your insights would be appreciated.

 

My next topics for this series of blogs leading up to building a working Process Duration Timer will concern themselves with a suitable power supply to drive the clock, the Arduino that will provide logic control of the unit, and a source for setting the target voltage. Also the integration of the Arduino and the programming thereof. I will also be including a scaling circuit so that the ADC of the Arduino is allowed to use its resolution to the best advantage regardless whether we are testing a device in the 30 volt area or the 1.5 volt area. We will also have to plan for instrumentation so that we can see the test voltage as well as the target voltage. I am sure that more ideas will come as I begin to build and test the individual components. This is probably the first project that I have decided to blog about as I design it rather than wait for a finished project. You just may get a chance to see me flounder and fail and have to be helped to the finish line.

 

John

 

https://www.element14.com/community/people/jw0752/blog/2017/07/28/process-duration-timer-part-2-power-supply

  • Sign in to reply

Top Comments

  • shabaz
    shabaz over 7 years ago +4
    Hi John, Clever idea, to freeze the clock as you have done : ) There are some other ways to do the freezing (e.g. use an external clock oscillator and gate it with (say) 'AND' logic, but that requires…
  • jw0752
    jw0752 over 7 years ago in reply to jc2048 +4
    Hi Jon, Thank you for your insights. I will make certain the I am using XTAL1 for the grounding. I did look at using the Arduino and a Real Time chip briefly before turning to modifying the existing clock…
  • shabaz
    shabaz over 7 years ago +3
    It is such a cool thing to have a process timer for the bench : ) For some recent testing (I think it was the Capacitance-to-Digital evaluation board from TI) I needed to do some timing, and in the end…
  • mcb1
    mcb1 over 7 years ago in reply to shabaz

    Had that when the script seems to get confused.

    Usually just post it then come back again.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jc2048
    jc2048 over 7 years ago in reply to shabaz

    Works for me. You're now two likes closer to being a level 10 (whoever that's going to be - I suspect it might be a mathematician, famous for his papers on computability, statistical cryptoanalysis, and so on).

     

    I confused myself earlier by liking something and seeing the count go down (took me a couple of moments to realise that I'd previously liked it and was removing the like that was already there).

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 7 years ago in reply to shabaz

    Hm, its working now : ( I cant reproduce it.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 7 years ago in reply to jc2048

    I think I've spotted a bug in Jive : ( Do 'Likes' work when comments are heavily nested? I can't 'Like' your comment that I'm replying to, although marking it 'Helpful' worked fine. However I can 'Like' other comments. Could you try 'Liking' my comment to see if it works?

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jc2048
    jc2048 over 7 years ago in reply to shabaz

    I really don't know, it just seemed to me that shorting the input must be safe, but the output is a bit of an unknown and probably should be treated as any of the outputs would (ie you'd worry about the dissipation if you shorted it for more than a few seconds). Internally, the oscillator is usually represented schematically by an inverter with a resistor from output to input to bias it to the midway point so that it operates as an amplifier. The resistor has quite a high value (a couple of megs). You'd add an external resistor in series if you wanted to limit the drive to the crystal (crystals have a rating for the power they can deal with).

     

    Microcontrollers usually have different settings for high and low frequency crystals. I think that will relate to drive strength. I doubt that they switch a resistor in series with the output, it's more likely that there are a couple of pairs of output MOSFETs in parallel and one pair can be disabled for the lower drive strength. (That's the way that would occur to me to do it.)

     

    It is interesting that it works so well for John. As you say, the problem area is short cycles (or even short half cycles, because they may use both edges at the hardware level) which would mess up the internal timing.

     

    Perhaps it's because holding the input at the rail and then releasing it gives the thing a huge kick that guarantees to get it off to a good start. It would be interesting to see what the input and output looked like at that moment.

     

    I suppose, in a way, it's more remarkable that it survives the relay contact bouncing when it first shorts the input. When the processor is brought to a halt it's done in fits and starts, stopping and starting several times. Perhaps all the clock code is in an interrupt running off a timer and it will pick up and get going again regardless of what you do to it.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube