Jump to content

Banner.jpg.b83b14cd4142fe10848741bb2a14c66b.jpg

DIY Moon Phase Dial


Gina

Recommended Posts

  • Replies 1.1k
  • Created
  • Last Reply

I think I have now finished the new circuit board for the moon phase clock except for the N channel power MOSFETs to drive the RGB LED strip which haven't arrived yet.  This is a new piece of stripboard with all new components with RTC module, arduino Nano and stepper motor driver module having sockets for plugging in.  The plug in components are also new ones.

I shall have to set the RTC to real time first by using the USB and Serial Monitor to set the RTC to PC time.  Then I can try running the clock.  Of course, I can't test the LED strip variable coloured lighting until I get the MOSFETs.  They should have arrived today but hopefully tomorrow now.

Here are photos of the circuit board followed by the latest layout diagram.

Circuit Board New 01.jpgCircuit Board New 02.jpgCircuit Layout 09.JPG

Link to comment
Share on other sites

Testing Time.

RTC and Nano plugged in, not motor driver module, and RTC read test performed (not set to real time yet) with Nano connected to PC via USB (no 12v power).  This worked giving the following display.

RTC Test 01.JPG

Link to comment
Share on other sites

Square wave test.  The following code snippet was used to check that the RTC square wave was working (a 1Hz period).

    int val = analogRead(sqwPin);  // read voltage level of 1Hz square wave
    digitalWrite(ledPin, (val > 500));

Result :-  Test successful :)

This concludes testing of the RTC module connected to the Nano for all functions required by the moon phase clock.

Link to comment
Share on other sites

Well...  I connected 12v PSU and checked that I had correct polarity again before plugging in Nano and RTC module.  BUT I made two errors.  I had the +5v track from the Nano next to the +12v power line.  That was dreadfully silly!!! I should have known better... :o  The other error was to have the RTC module plugged in as well.  Result - two dead items instead of one due to a short between 12v and 5v tracks :(

I have now removed the two wires connecting to the bottom strip and replaced them with one wire that goes straight from the +5v pin on the Nano to the +5v logic power on the motor driver.  At least I didn't have the motor driver plugged in.  The wire from Nano +5v pin to RTC is nowhere near the +12v bus.

A new Nano and a new RTC module now tested without 12v supply plugged in and RTC set to current time successfully.  RTC square wave function also tested successfully. 

I won't have an RTC module plugged in next time I connect 12v...

Link to comment
Share on other sites

Connected 12v PSU and checked that there were no volts where they shouldn't be.  Unplugged 12v PSU, plugged in Nano and plugged 12v PSU back in again.  Nano working OK.  12v off, RTC module plugged in and 12v back on - Nano LED flashed at half secong on and off correctly :)  Next tried with motor driver plugged in and board connected to stepper motor and applied 12v.  I set the sketch to output pulses to the motor normally for running the clock.  Motor ran with half second spurts as designed :)

In between working on the control circuit I had replaced the ABS motor gear with a TPE printed one and now the clock runs with just a quiet tick every half second - RESULT! :)

Link to comment
Share on other sites

Yes, unlike ABS you can't file it off - it has to be cut.  A nice sharp pair of side cutters work quite well.  Fortunately, being soft and flexibly, a fit bits sticking out don't matter, they just bend out of the way.  Makes nice gears :)

Link to comment
Share on other sites

That didn't last long - the Nano died! :(  I don't know why or how.  The RTC draws just 300μA and the motor driver just 8mA max.  The Nano draws 20mA or so.  I know it's been suggested that 12v is perhaps too much for Vin.  28mA and 7v means 196mW - the internal voltage regulator chip is rated at 1.5W.  Even chips without any heat sink can dissipate 200mW easily enough or even 300mw.  RTC and logic power for the motor driver should not affect the Nano when run off 12v.

I guess I can try running the Nano off 7v derived from an LM317T.  I could set a current limit of say 100mA - that should stop the destruction in event of a short or something.

Link to comment
Share on other sites

If my variable voltage and current bench PSU hadn't died on me I could have run the clock circuit off that and set a current limit.  Maybe I should wait until I get a replacement bench PSU or repair my current one (which I don't think I shall be able to do) or rig something up in the meantime.

Link to comment
Share on other sites

Here is a circuit diagram for the LM317T to supply +7v for the Nano with current limiting at around 60mA though I might reduce that as the load is not expected to exceed 30mA.  eg. if the series resistor were increased to 15Ω the current limit would be about 40mA.  In the latter case the maximum load dissipation would be 280mW which shouldn't cause damage.

&v Supply with Current Limiting 01.JPG

Link to comment
Share on other sites

Here's a slightly amended diagram for 40mA current limiting with a red LED to indicate when current limiting is occurring.  This would be for testing.

7v Supply with Current Limiting 02.JPG

Link to comment
Share on other sites

I agree - that's why I added "This would be for testing."  I won't be using the current limiting in the "production" units but a fuse in the circuit is a good idea.  Once I have all this properly sorted out I plan to use (maybe slightly amended versions of) this for several clocks I have in mind.  Even the pendulum clock will use this circuit to drive the winder motor and possibly an electromagnetic pendulum syncronous drive.  I might replace the A4988 driver with the higher power version but time will tell :D

Coming back to the testing rig, I think I might make up a proper supply unit.  I could add this to an ATX PSU or maybe make up an analogue supply with transformer, rectifier block and reservoir/smoothing capacitor.  It could have variable voltage and current limiting with voltage and current displays.  I have made numerous PSUs in the past.  With a floating power input I could use the simpler current limiter circuit shown in the LM317T datasheet.

Link to comment
Share on other sites

Thanks Neil :)  Shame about the long delivery time...  Could be useful for future projects though :)

Had an idea for a simpler very crude current limiting - just use a resistor in series with the LM317T input to drop the input voltage to a point where the Vin-Vout causes it to drop out.  eg. an 82Ω resistor would give a current limit of about 44mA.  Not for the "production" version though.

Link to comment
Share on other sites

Here is the latest layout diagram using the LM317T to reduce the 12v to 7v to supply the Nano.  Shown with current limiting resistor but this will be replaced with a fuse in the final version.

Circuit Layout 10.JPG

Link to comment
Share on other sites

I've had a thought :icon_idea:  I wonder if there might be a problem with the stepper motor driver if the motor supply (12v) is off with supplying 5v to the logic supply input.  I had no problem with the driver not plugged in and it was alright at first with it plugged in and 12v applied but then I unplugged the 12v PSU leaving the logic supply fed from the Nano 5v pin.

Link to comment
Share on other sites

The ones in my CNC box (A4988) are Ok without the 12V supply when the Uno is powered up via usb - no magic smoke has appeared :)  The 12V is just to supply the motor coils via the MOSFETS - it doesn't effect the switching.  The thing that does effect/damage them is if you disconnect the steppers whilst power is on

Link to comment
Share on other sites

Plugged in new Nano and powered up.  Working :)  Vpsu = 12.24v, Vin = 6.96v, LM317T input = 10.38v series resistor = 68Ω (couldn't find any 82Ω).  Calculated Nano supply current = 27mA.

Link to comment
Share on other sites

RTC module plugged in and power applied.  Test sketch showing Nano LED blinking at 1Hz correctly from RTS square wave.  Vpsu = 12.24v, Vin = 6.90v, LM317T input = 10.04v/9.94v (depending on LED state).  Calculated Nano supply current = 32/34mA.  So far so good :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.