element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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
Making Time
  • Challenges & Projects
  • Project14
  • Making Time
  • More
  • Cancel
Making Time
Blog The Current Time : Hours and Deciminutes
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Making Time to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: dubbie
  • Date Created: 12 Jan 2021 3:26 PM Date Created
  • Views 2240 views
  • Likes 11 likes
  • Comments 10 comments
  • nano
  • current
  • deciminutes
  • makingtimech
  • time
Related
Recommended

The Current Time : Hours and Deciminutes

dubbie
dubbie
12 Jan 2021
image

Making Time

Enter Your Electronics & Design Project for a chance to win a $200 shopping cart!

Submit an EntrySubmit an Entry  Back to homepage image
Project14 Home
Monthly Themes
Monthly Theme Poll

 

After a long think about what I might do for the Making Time Project14 challenge and thinking I might not be able to come up with anything suitable I had the idea of creating a current flow that would represent the time, hence the name current time. I thought it would be fun to create a circuit that would create a current between 0 and 11 microamps to represent the hours 0.00 to 11.00 o'clock - I had trouble thinking about whether 12.00 o'clock should be 12.00 or 00.00 and in the end decided on using 00.00. So all I needed was to create 12 different current steps, 0.0 microamps to 11.00 microamps. My initial idea was to use a stabilised voltage source such as a Zener combined with high precision resistors, controlled using analogue switches. Sadly, at this point my thinking went awry and for some reason I decided that I could use analogue multiplexers for the analogue switches with just one value of resistor. As I had some analogue multiplexers and had just purchased some resistors I thought I would be OK. I also wanted to use moving coil meters to display the time, one for hours and one for minutes. At this point I stopped thinking and went to do something else assuming that I could get the meters later.

 

Unfortunately it seems that low cost moving coil meters can only be obtained from China and the delivery time was after this competition ended. I was then about to give up when I just thought 'well, I could use digital multi-meters to display the two currents', as a sort of proof of concept. I was just about to start construction when I also realised that analogue multiplexers would not provide an incrementing current value if the same resistor value is used. So, I was about to give up for a second time when I thought 'maybe I could use the 4.7V digital voltage outputs from a Nano, with a 4.7 MOhm resistor on the output to create the increments of 1 microamp. Unfortunately, Nano outputs do not work properly unless more than 100 microamps is drawn. Was I discouraged? Yes! But decided that perhaps I could use 1 milliampere increments rather than 1 microamperes and happily, this is the case. So I needed 11 digital outputs from the Nano for the hours - it has 12 so that was OK.

 

I decided to make a neat little stripboard construction, with turned pin sockets as I had a Nano with turned pin connectors already soldered in. Everything went fine, everything was soldered together, I made preliminary tests and it seemed to work quite well, although getting exactly 1.00 mA increments was difficult but I managed 1.0 mA +/- 0.05 mA which I thought would be satisfactory. After all, the original design called for moving coil meters and these small discrepancies would not have been visible. At that point the Nano decided it didn't want to be programmed anymore so I had to change to a Nano with the square 1 mm pins, which of course, do not fit into turned pin sockets. Nor could I get any turned pin connectors in time to solder to a different Nano. So at that point I gave up on being next and went into just getting it connected together somehow mode. I used a protoboard for the Nano and used single core wire to make connections to my already assembled stripboard - as I didn't have enough 4K7 resistors to start again!. Success, it all worked well.

 

Then I turned my mind to how to create the minutes. A bit more tricky. To get minute increments I would need 59 different digital outs and 59 resistors, - none of which I had. So I thought, why not use 5 minute increments and then I would need only 11 more digital outputs. Unfortunately there were not enough on the Nano to do this so it would have meant using two Nanos synchronised together. Time was running out and I didn't think I would get that going in time, so just went for 10 minute increments (deciminutes) - why not! This required 5 digital outputs so I used five of the Nano analogue I/O pins, hoping that their digital output voltage would also be 4.8V .Fortunately, they were. And it worked. Houray.

 

I had hoped to be able to show the 10 minutes increments on the second meter, but this could not be achieved. It needed more than 100 uA to get the analogue outputs to work (programmed to be digital outputs), 1 mA worked but didn't increment in steps of 10 and using 10 mA from each output would have needed 50 mA for the Nano and something was bound to change if I started to drawn that much current, so I settled on just incrementing in deciminutes. I would have worked on a moving coil meter. The circuit diagram is shown below.

 

image

 

The programme for the Current Time clock is listed below. I didn't have much time left to test it much so I have no idea how accurate it will be over 24 hours, but I think there would be enough granularity to be able to tweak the timing in order to achieve a suitable accuracy. Alternatively I could just add a real-time clock chip - which I do not have - so I didn't. This did make the programme fairly simple, as can be seen below. I used a while loop for the hours and a for loop for the decimeters (why not!)

 

/*

  Uses current to create a clock display

  Just for Fun

  Dubbie Dubbie 5th Jan'21

*/

 

 

#define oneclock   2

#define twoclock   3

#define threeclock 4

#define fourclock  5

#define fiveclock  6

#define sixclock   7

#define sevenclock 8

#define eightclock 9

#define nineclock 10

#define tenclock  11

#define elevenclock 12

#define tenmin    A0

#define twentymin A1

#define thirtymin A2

#define fortymin  A3

#define fiftymin  A4

#define decimindelay 2500

 

 

void setup()

{

  // initialize digital pins as outputs

  pinMode(LED_BUILTIN, OUTPUT);

  pinMode(oneclock,   OUTPUT);

  pinMode(twoclock,   OUTPUT);

  pinMode(threeclock, OUTPUT);

  pinMode(fourclock,  OUTPUT);

  pinMode(fiveclock,  OUTPUT);

  pinMode(sixclock,   OUTPUT);

  pinMode(sevenclock, OUTPUT);

  pinMode(eightclock, OUTPUT);

  pinMode(nineclock,  OUTPUT);

  pinMode(tenclock,   OUTPUT);

  pinMode(elevenclock, OUTPUT);

  pinMode(tenmin,     OUTPUT);

  pinMode(twentymin,  OUTPUT);

  pinMode(thirtymin,  OUTPUT);

  pinMode(fortymin,   OUTPUT);

  pinMode(fiftymin,   OUTPUT);

} /* setup */

 

 

void loop()

 

 

{

int timecount;

 

 

timecount = 0;

while (1)

  {

    switch (timecount)

      {

        case 0 : alloff(); break;

        case 1 : digitalWrite(oneclock, HIGH); break;

        case 2 : digitalWrite(twoclock, HIGH); break;

        case 3 : digitalWrite(threeclock, HIGH); break;

        case 4 : digitalWrite(fourclock, HIGH); break;

        case 5 : digitalWrite(fiveclock, HIGH); break;

        case 6 : digitalWrite(sixclock, HIGH); break;

        case 7 : digitalWrite(sevenclock, HIGH); break;

        case 8 : digitalWrite(eightclock, HIGH); break;

        case 9 : digitalWrite(nineclock, HIGH); break;

        case 10 : digitalWrite(tenclock, HIGH); break;

        case 11 : digitalWrite(elevenclock, HIGH); break;

        default : alloff();

                  timecount = 0;

                  break;   

      } /* switch */

 

 

    timecount++;

 

    deciminutes(); // This is the 10 minues x 6 = 1 hour delay

    digitalWrite(LED_BUILTIN, HIGH);  

    delay(1000);   // Heart beat to show working. Once every hour.   

    digitalWrite(LED_BUILTIN, LOW);

  } /* while */

} /* loop */

 

void alloff(void)

 

{

digitalWrite(oneclock,   LOW);   

digitalWrite(twoclock,   LOW);   

digitalWrite(threeclock, LOW); 

digitalWrite(fourclock,  LOW);  

digitalWrite(fiveclock,  LOW);  

digitalWrite(sixclock,   LOW);   

digitalWrite(sevenclock, LOW); 

digitalWrite(eightclock, LOW); 

digitalWrite(nineclock,  LOW);  

digitalWrite(tenclock,   LOW);   

digitalWrite(elevenclock, LOW);  

} /* alloff */

 

void minoff(void)

 

{

  digitalWrite(tenmin,    LOW);

  digitalWrite(twentymin, LOW);  

  digitalWrite(thirtymin, LOW);

  digitalWrite(fortymin,  LOW);  

  digitalWrite(fiftymin,  LOW);  

} /* minoff */

 

void deciminutes(void)

 

{

int mincount;

 

 

mincount = 0;

 

  for (mincount=0; mincount < 6; mincount++)

  {

    switch (mincount)

      {

        case 0 : minoff(); break;

        case 1 : digitalWrite(tenmin, HIGH);  ; break;

        case 2 : digitalWrite(twentymin, HIGH); break;

        case 3 : digitalWrite(thirtymin, HIGH); break;

        case 4 : digitalWrite(fortymin, HIGH); break;

        case 5 : digitalWrite(fiftymin, HIGH); break;

        default : minoff(); break;   

      } /* switch */   

    delay(decimindelay); /* 10 minute delay */     

  } /* for */

} /* deciminutes */

 

 

The completed Current Time clock is illustrated in the following video. In order to be able to see the hours and deciminutes changing I have not implemented 'real time'. Instead the deciminutes increment every 2.5 seconds rather than every 10 minutes (or 600 seconds).

 

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

 

All-in-all and despite all the problems and setbacks I am happy with what I have created and I am sure (mostly) that if I had two moving coil meters of the correct range, that it would work satisfactorily. Add a real-time clock chip and it would even keep time as well.

 

Well, now it is time for a walk, followed by a cup of tea, maybe even a biscuit.

 

Dubbie

  • Sign in to reply

Top Comments

  • genebren
    genebren over 4 years ago +5
    Dubbie, Interesting concept for a clock. I was wondering if your mind went down the path of using binary weightings for the current sources. As all the currents sum prior to the meter, you could use a…
  • shabaz
    shabaz over 4 years ago +3
    Hi Dubbie, If the Arduino functions expose PWM easily (I think they do, but I've just not done it), that could be another approach (i.e. change the duty cycle, so that the average voltage varies). Anyway…
  • Andrew J
    Andrew J over 4 years ago +2
    Got to give 10 out of 10 for perseverance! It's a great, off the wall idea.
  • dubbie
    dubbie over 4 years ago in reply to navadeepganeshu

    Navadeep,

     

    There always has to be some voltage drop between the supply voltage and the digital output on a digital circuit and for most 5V systems it is usually around 0.1 to 0.3V. It is pretty much a coincidence that the digital output voltage is 4.7V and matches the 4K7 resistor value in order to get a 1 mA current. I did have some control over the voltages if I used a separate power supply so that I could vary the supply voltage between 4.5 and 5.5V which would also vary the digital high output voltage. Fortunately when the Nano is powered from A USB cable it works out pretty much perfectly.

     

    There is a temperature effect so as the Nano warms up the digital output voltage does increase by about 5% but again, fortunately, this moved the current in the right direct from 0.95 mA to 1.00 mA, or thereabouts. I didn't run the system for hours so I have no idea what the long term stability is. Probably not very good. However, if I had been able to get some moving coil meters there small variations would (probably) not have been noticeable.

     

    Dubbie

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • navadeepganeshu
    navadeepganeshu over 4 years ago

    Wow! Loved the idea and build.

     

    Matching matching with 4.7 image . I just realised that Arduino nano gives only 4.7V though its marked as 5V. Couldn't that drop be compensated with diode compensation circuit easily?

    Good that it helped in this project as 5K resistors aren't common to get 10mA for the clock, yet seems so wrong to have marked 5V output onboard though it never supplies it.

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

    Shabaz,

     

    That is an interesting idea, another method I did not think of.

     

    I was interested in the meter. I do not think I have ever seen a moving coil meter with two needles before.

     

    Dubbie

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • dubbie
    dubbie over 4 years ago in reply to Fred27

    Fred,

     

    You're right. I was playing with a new mobile robot while I was making the current clock, it was much more fun than the clock.

     

    Dubbie

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

    Hi Dubbie,

     

    If the Arduino functions expose PWM easily (I think they do, but I've just not done it), that could be another approach (i.e. change the duty cycle, so that the average voltage varies). Anyway, as usual, there's many ways to tackle an idea!

    Just to throw another idea out there for discussion, in the past there also used to be analogue meters with two needles, they used them for ham radio SWR meters.. I wish these meters would make a comeback for representing two pieces of data.

     

    (Image source: aliexpress).

     

    image

    • Cancel
    • Vote Up +3 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