Mechanical 7 Segment Display Clock Using An Arduino & 28 Servos

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys in this project I'm going to be showing you how you can build a mechanical 7-segment display clock which is driven by 28 servers and controlled by an Arduino Tommy's kept using a tsts unity real time clock module and each servers independently controlled using two 16-channel server drivers to expand Arjuna's PWM eye over the RTC interface [Music] I started off by designing an individual 7-segment display numeral which could be actuated using a macro server for each segment the macro servers move each segment vertically went on a 90 degrees to the side when off segments that is on took you straight on to the standard server on so that no additional hardware is required our 3d printer the segment's using a translucent green PLA with a 15% info [Music] to control the service are used to PC a non 685 16 channel pita and in drivers which lied to controller to 16 servers on each board and chain up to 62 votes together of an RTC interface this means that you could theoretically independently controller to 992 servers with just two I opens I'm going to be using one for the two our digits and one for the two minute digits on our clock to chain the three together I need to first add a pin header to the other side of the first board and then change their address on the second board so that it's uniquely identified this is done by bridging these small terminals on the top right of the board there were clock dip switches allowing you to set a different address for each board [Music] now that without at the header strip and change the dress on the second board let's make up the cable to chain the two together [Music] we'll also need another cable to connect these two boards to the Arduino along with the clock module [Music] now let's get back to the display segments I sprayed the back and sides of the segment's black to match the background so if they list visible when they're turned away if you leave them green and you're still going to end up with a thin visible line when the segments are turned 90 degrees I've include the segment's onto the server arms and added a small 3d printed spacer block to the bottom of each server to glue onto the backboard [Music] a nun that each segment to keep track of them in the code I started with the top segments in the unit's digit being one and then worked around to the tens digit for 14 segments they're all connected to each driver board in this order as well although the travel board numbering starts from 0 I duplicated this numbering for each of the hour and minute boards before clearing the digits onto the back board I laid the math on a flat surface to test them this allowed them to move without the fear of them moving the wrong direction multi foreign bumping into each other which may damage the segments will strip the gears on the servers once I was happy at the movements of the digits I got to work on the board I needed a backboard which was at least 600 millimeters long and 240 millimeters ha the last grade larger boxes are the areas in which the segment's move when they move out of the way these needed to be 210 millimeters by 135 millimeters so if there's Jason segments don't touch when they're both moved outwards the inner darker rectangles are the same Salons for the six servers which make up the outside of each digit lastly I left 30 millimeters between the inner digits for the dots I then measured and cut the backboard from a piece of three millimeter in DF which had spread black as well I marked the segment positions on the backboard and then started gluing them in place [Music] [Music] [Applause] [Applause] now that the digits are done we just need to hide the wiring I drilled holes through the back of the board near each server to feed the server wives three I put a small drop of clear on each of them to keep them in place I stack the boards onto the back of the clock using double-sided tape [Music] I remove the arms from the servers before loading the final version of the software so that I could make small adjustments to the upright positions without worrying about them hitting each other I then finished up the code you can download the code through the link in the video description we start by importing two libraries one for the clock module and one for the server drivers we then create an object for each of the server drivers one for the two our digits and one for the two minute digits we then have four arrays to store the owner North positions for each server this allows you to fine-tune the travel limits that the digits all straight up and don't live all under travel when I move to the off position we also have an array to store the segment positions for each digit from 0 to 9 we then assign the clock pins and create variables for each digit our tens and units and minute tens and units we also need to know what the previously displayed digit was so we know whether the middle segment is going to be moving and if so we need to move the two adjacent segments out of the way a little so two can pass by without hitting then the variable mid offset defines the homilies adjacent segments should move out of the way we then start with a setup function here we start each of the pwm server ports set the oscillator frequency and our server frequency we then have a lance update the clock time which is only needed once to set the time on your clock and can then be removed or commented are finally we run through a loop which sets each service at one position so that 888 is displayed on the clock this ensures that we have an own starting position for each server and where possible you should try and start the clock with your segments as close to these positions as possible we didn't move on to the main loop where we get to update the town from the real-time clock module then split the hour and minutes into the tens and units we then check to see if the time has changed since the last circle and only if the time has changed we need to update the display once the display is updated we then update the previously displayed variables to record the changes we then have a short delay so the time is only checked twice every second now let's have a look at the update display function we start by updating the middle segment we do this that we're able to move the adjacent segments out of the way if the middle segments need to move we then move all of the middle segments and then move the remaining segments that they moved back into place if the previous tip moved them out of the way there is an if statement for each digit which essentially looks up the required segment positions from the array and then moves them on or off accordingly the delays just aid with the stability in the code the update mode function is probably most complex portion of the code although there's a lot of repetition here for each of the four digits this function looks at whether the middle segments of each digit needs to move if it does that then looks at where the either the chastened digits are going to be in the way if the section moves that then moves it out of the way before moving the middle segment the delays in this section also allow the adjacent segments to move out of the way perform using a middle segment that's the code now let's upload it to the Arduino and see what it looks like segments Jets are slightly when initialized and then moved to display the current time it takes a bit of patience in the beginning to get each segments traveled omit set up correctly so if the segment is upright went on and moved far enough went off so the top is no longer visible most of my segments required adjustment and there are quite a few cases of server arms popping off and servers over traveling before the setup process was complete but once you're done you're left with a great looking clock with a unique twist on a seven segment display [Music] [Music] thanks for watching please like this video if you enjoyed it and subscribe to my channel for more tech and electronics projects tutorials and reviews [Music]
Info
Channel: Michael Klements
Views: 96,211
Rating: undefined out of 5
Keywords: DS1302, arduino, Arduino Uno, clock, etc, mechanical 7 segment display, servos, PWM driver, I2C
Id: SKNxyh06X1c
Channel Id: undefined
Length: 10min 50sec (650 seconds)
Published: Tue Apr 14 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.