Google+ Followers

Monday, December 9, 2013

40. Second Version of the Yacht Race Timer - YRTb

7000 page views!!
I just made a couple of refinements to the previous design - the main one being the reduction from 3 buttons to 2.  I decided that the as Button 1 wasn't being used until after time zero, T0, and Button 3 (red button) was only used before  T0, that I could remove Button 3 and give its functionality to Button 1.  This involved just a very small adjustment to the code, and a slight re-organisation of the breadboard.  The RTC board now sits more comfortably on the breadboard than it did before.

And then just to confuse everything, I put in a third button (the red button's back!) but this time, it's an Arduino RESET button.  This is effectively a breadboard button in parallel with the Arduino's RESET button, and when pressed, it grounds the Arduino's RESET connection, causing a reset.  I thought this would be necessary if the Arduino was to be buried behind the other hardware if it ever gets boxed.

The project now looks like this:



You can also see that I added a little refinement to the software so that when Button 2 is pressed to scroll through earlier finishing times, instead of displaying the previously used " *", it shows "*Readback" to make it very clear what's being displayed.  Additionally, if the read-back finishing time is more than 30 minutes after the first finishing time, the message is " *!>30min".

The red button on the left can now be used to reset the whole thing (as can the Arduino's button, just to the right of the red LED).  The first (left-hand) brown button is now used to set the number of countdown minutes when the prompt "Set c/d" shows just after reset or powering up for the first time.  The second brown button (on the right) still has the scrollback functionality.

I was thinking about having the unit boxed and even re-produced.  In this case you probably wouldn't want to include a whole Arduino Uno in the box.  Instead you should be able to get away with just the ATMEGA328P-PU chip and some other components, so here is an imaginary breadboard setup:


Please note that I have NOT tried building this circuit!! The first thing you will notice is that the LCD is not a 20 x 4 like the one I am using, but that's the only one I could find on Fritzing.  The connections are the same.  The buttons I referred to are shown as S2, S3 and S4.  There is also an Arduino RESET button on the left called S1.  The circuit includes a voltage regulator, so the recommended 7V to 12V input can be used safely.  It would be possible to just include the components of the RTC, but the pre-fabricated RTC circuit board (in the example above, from Adafruit) is hard to beat!

Just a note on Fritzing - it's brilliant!  This is free and can be downloaded from http://fritzing.org/download/.  As well as "building" a circuit (with or without a breadboard) as above, you can then ask the software to draw the schematic, "autoroute" it, and best of all, draw a double-sided PCB.  More than this - you can create an etchable PCB, and for about 32.20, Fritzing will actually build your PCB!  It can also point you to places on the web for buying your parts.  Amazing!

Here is an example of a schematic for the circuit above:


I'm showing this purely an an illustration of what can be done.  There are actually errors in the above schematic.

And for completeness, here is a PCB version:



Again a warning - this hasn't been shown to work!  I just wanted to show you what Fritzing can do.  The yellow and orange copper traces are on different sides of the board, so that's why they are allowed to cross each other.  There are places above where a yellow trace becomes an orange one, because the connection goes from one side of the board to the other using the black dot surrounded by green, known as a "Via".  The grey rectangle at the bottom represents the  LCD board.  The board shown above would probably be about 10 cm square.

Just a note on the RTC accuracy - after a couple of weeks, the RTC time of day is 3 minutes behind my PC's time.  It might be wise to periodically return the setup to the PC and run the SetTime sketch, or else use the high accuracy temperature compensated DS3231 RTC which I previously referred to.  Don't forget that the finishing times are using the Arduino's millis() function, modified by my fiddle factor, so in theory, the accuracy of this part of the timing can be adjusted to give very high accuracy.


No comments:

Post a Comment