ESP32 3D Printed Aviator Clock
by oliverb in Circuits > Clocks
11147 Views, 122 Favorites, 0 Comments
ESP32 3D Printed Aviator Clock


An ESP32 Clock Based On Aviation Style 3D Printed Instrument Panel Gauges
Housed on a reclaimed lump of Oak, three off 3D printed instrument gauges show time in hours minutes and seconds.
A secondary display on the seconds gauge also shows seconds on a 7 segment display.
Chimes sound out the hours and quarters and can be set to day, 24/7 or off as required.
The analogue gauges are each driven by a NEMA17 stepper motor while time is automatically fetched from an NTP time server.
A PIR is fitted to shut down the clock when no movement is detected. The clock wakes up and resets the time and display when movement is detected again.
A selector with spoken prompts allows setting of the seconds update frequency, chime times, summer winter setting, chime volume and clock reset.
Details on my site here https://www.brettoliver.org.uk/Aviator_Clock/Aviator_Clock.htm
Supplies

Main microprocessor ESP32 38pin WROOM 32
This is the 38 pin version and I used the Arduino IDE to program it.
Details of the pin functions etc can be found here.
Secondary Microprocessor
This is a ATMEGA328 built onto a PCP supplied in kit form and is used to drive the 7 segment display in the seconds gauge,
It's an Arduino UNO/NANO in kit form. You can use a NANO in it's place just modify the Vero board to suit.
Nema 17 Stepper Motor 42x23mm 17HS4023 Pancake Motor 1.5A-3.8V
These are set to run in 32 microsteps.
TMC2209 Stepper Motor Driver 3 off
Connects via serial to the ESP32 & has 2M of built in memory to provide sounds for the chimes and spoken prompts.
DS3231 RTC 1 off
Connects to the Arduino NANO /ATMEGA328 to keep time.
MP1584EN ultra Small DC-DC 3A Step Down Converter 1 off
Provides 5v stepped down from 12v for the various modules.
If a 5v 2 Amp PSU is used this is not required.
TM1637 7 Segment Display 1 off
Used in the seconds gauge and connected to the ATMEGA328/NANO show the seconds in digital form.
Small Electronic Parts
Note choose LED colours and resistor values as required.
See pic 1
Harware
You will need a selection of M2 and M3 hex bolts, M1.4 and M2 self tappers and threaded inserts for 3D printing.
These are cheapest to buy in bulk assorted packs from Amazon.
3D printed parts are described on my site here.
and can be downloaded from my Cults3D page here https://cults3d.com/:2834225
Bezel glass is 100mm x 2mm round Perspex sheet.
Videos






I have made a few short videos shwing clock setup and operation.
Video 1 showing the Aviator clock starting up.
Video 2 shows the displays zeroing at 1 o'clock as well as the hour chimes.
Video 3 demonstartion of PIR shutdown and reactivation.
Video 4 shows they available analogue seconds refresh rates.
Video 5 winter and summer clock corrections
Video 6 shows what happens if the hall effect module fails.
Design








Pic 1 I built a similar clock many years ago using analogue voltmeters with 90° displays.
Pic 4 & 5 The clock worked well but with the tiny 90° displays was very hard to read accurately.
For this clock I wanted 120mm diameter gauges with 95mm wide angle dials very similar to gauges used on aircraft or power stations.
Pic 2 Dungeness B power station style dials.
Pic 3 Aircraft Style Dials
Pic 6 Large 270° panel meters are very expensive and if you want a built in digital display cost around £500.
Pics 7 & 8I designed a gauge for my 3D printer that would work with an aircraft or power station type clock.
The gauges are 120mm across with 95mm dials.
Power Consumption


I have attempted to keep the power usage as low as possible in this clock.
The max current draw is around 500mA when any hand is moving. When hands are not moving the current draw is around 65mA. In sleep mode the draw is around 80mA.
Note the steppers run in blocking mode so only one motor can run at any one time. This keeps the max power consumption down from 1.5Amps.
I easured the power consumption at the mains socket using a power meter and the clock uses 1W peeking at aound 3W when the motors are stepping.
This clock has PIR motion controlled shutdown and will sit at 1W after 15 mins of no activity near the clock.
Controls



Pics 1 & 2 The control panel is mounted on the wooden plinth with recesses cut into the wood to take the controls and indicators.
Holes are drilled from the rear of the plinth in to the recesses to take to wires from the controls and indicators into the circuit board at the rear of the clock.
The panel is fixed to the plinth with 8 off 2mm countersunk brass wood screws fixed through countersunk washers.
The panel holds the select switch which selects options from the selector potentiometer mounted in the middle of the panel.
It also starts the clock on startup and after a function change.
The potentiometer selects the following options.
SEL - Select position which is the normal position when the clock is running.
SEC- Seconds update time with 2, 3 or 5 seconds analogue display updates.
BELL- This is the chime control option with Chime off, Chime on Timer 6am to 11pm & chime on 24/7.
WIN- sets the clock to wintertime.
SUM- sets the clock to summertime.
VOL+ - increases the chime volume.
VOL- decreases the chime volume.
RST- resets the clock.
The PIR sensor/diffuser is also fixed to the control panel.
There are 2 LED indicators which depending on the clock mode indicate different things.
Control Panel Indicators






Pic 1 PIR has sent clock into sleep mode
Pic 2 In startup the red LED indicates the time has not been fetched from the NTP server. While the purple LED flashes to show the clock is attempting to get time from the server.
Pic 3 Once time has been fetched and the clock is running normally the Purple LED flashes every other second.
Pic 4 If too many steps are detected (hall effect sensor fail ) the clocks stops and the red LED flashes
Pic 5 The red LED will light steady if time cannot be fetched at any time from the NTP server.
Pic 6 The Purple LED will be On steady while the clock resets after sleep mode.
3D Parts Assembly




Assembly is quite straight forward but I have included some pics with parts labled in order or in position.
Code Setup
Code Setup for local NTP server
The clock gets it's time from your local NTP server so the NTP and your router details will need to be changed in the code before use.
Search for "NTP settings"
You will need to set your timezone eg UK use 0.
Add in your NTP server address of your local time server. Just Google "local NTP time servers.
Enter your router SSID and password.
// NTP settings
int TIMEZONE = 0; // timezone (GMT = 0, Japan = 9 1 = gmt summertime)
#define NTP_SERVER "uk.pool.ntp.org" //using local internet time server
#define WIFI_SMARTCONFIG false
#if !WIFI_SMARTCONFIG
// if you do not use smartConfifg, please specify SSID and password here
#define WIFI_SSID "VirginMedia" // your WiFi's SSID
#define WIFI_PASS "Fg66L8gtdccc" // your WiFi's password
Setting Hands to Zero


The clock synchronizes to zero on every rotation eg hours at 01:00hrs and 13:00 hrs, minutes on every hour and seconds on every minute.
The stepper motor drives the hands to zero and stops when the magnet attached to the rotor is sensed by the hall effect switch.
To set the hands to zero power up the clock and let all the gauges zero then power off the clock.
The hands are fixed to the "nemaspindleconnter" by a single M2 self tapping screw.
If the screw is loosened the hands are free to rotate without turning the spindle/steppermotor.
The gauge pic1 has stopped near zero. To zero the hand loosen the screw and move the hand to zero.
Tighten the screw while holding the spindle in place. I have designed the spindle slightly larger in diameter than the hand so it can be gripped with thin pliers to stop it moving.
Pic 2 Power up the clock again, let the gauges zero and double check all gauges point to zero.
If you find the hands get out of alignment as they rotate try adjusting the steps for that motor.
Although my gauges are identical I found I had to decrease the step rate by 1 on just one of the dials.
Clock Operation


There are only 2 controls for this clock both located on the control panel.
The "Select" switch is a momentary push switch and the rotary selector is a 20K Ω potentiometer.
In normal operation the rotary selector is set to the "SEL" or Select position.
As soon as the selector moves off the "SEL" position the clocks analogue displays stop.
The rotary selector has 7 different position used to set and control the clock.
Each position has at least one function. To set the function the move the rotary control to that item you want and then press the "Select" button.
The clock will speak the current function that has been set. Pressing the "Select" button again will select the next function if available and speak it.
Rotary Control Functions when "SELECT" is pressed
SEL - If a function has been changed using the rotary control the clock is restarted and time updated
SEC- Changes the analogue seconds display update frequency
Option are 2, 3 or 5 seconds
BELL - Changes the when the clock chimes
Options are Chimes on timer (set in code off ater 23:00hrs on after 06:00hrs) , Chimes 24/7 and Chimes off
WIN - sets the clock to wintertime
No other options on this function
SUM - Sets the clock to summertime
No other options on this function
Vol+ - Turns up the chime and voice sounds volume
No other options on this function
Vol- - Turns down the chime and voice sounds volume
No other options on this function
RST- Resets the clock loading default values
No other options on this function
As an example of using the rotary controller and "Select" here is how to change the chimes to off.
Rotate the rotary control to the "BELL" position.
Press the "Select" button once.
The clock will speak the function selected in this case "chimes 24/7".
Press the "Select" button again and the clock will speak "chimes off"
Turn the rotary control back to "SEL" and press it once and to make the analogue display reset/tell the time again.
The chimes are now off.
Waterslide Decals







Waterslide Decals
Pics 1 to 3 The dials are printed onto white waterslide decal paper do not use clear.
I print direct from TurboCAD but test print the enclosed dial images until the 85mm marks line up if your printing from the enclosed images.
Follow the manufacturers instruction as they do vary by brand.
Download the full size images here
Pics 4 & 5 Control Panel Decal Print to match the dimensions between the holes.
Trim printed decal to the black inner line. Paint and prime panel matt black before applying the decal.
Pic 6 To make the decal easier to line up cut/punch out the cutouts before wetting/varnishing.
Pic 7 The "Aviator Clock" label if required is printed on clear inkjet transfer paper if printing on clear 3D material.
Make the label design as you wish.
Vero Board Layouts



Veroboard layout show a board with modules, no modules and the rear of the board.
Full size boards designs can be found on my site here .
Schematic

Full size schematic here.
JQ6500

