Welcome to Cockpitbuilders.com. Please login or sign up.

May 09, 2021, 11:18:04 AM

Login with username, password and session length


Fly Elise-ng
16 Guests, 1 User
  • Total Members: 4032
  • Latest: vasekg
  • Total Posts: 57014
  • Total Topics: 7593
  • Online Today: 28
  • Online Ever: 582
  • (January 22, 2020, 08:44:01 AM)
Users Online
Users: 1
Guests: 16
Total: 17



Will Depart in...



Segment displays

Started by Mach7, November 02, 2020, 04:55:31 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Joe Lavery

I agree with you Ame, although some of the clones use different chips and don't always work until you download new drivers.
Recently I've been buying the Elegoo ones from Amazon. They seem to be better quality than the run of the mill Chinese ones.
Incidentally I tried to create a joystick controller recently using Mmjoy2 and I couldn't get the arduino to be recognised. I didn't realise that there were two kinds of mini USB cables. I saw a comment on the arduino forum. I changed the cable for an older one, instead of the nice new shiny one that came with my new phone and hey presto the arduino popped up.
I thought perhaps some of you might have had the same experience.
Life isn't about waiting for the storm to pass, it's about learning to dance in the rain

Journalist - writer for  PC Pilot Magazine


November 24, 2020, 07:47:47 AM #101 Last Edit: November 24, 2020, 07:48:24 AM by Mach7
Hello Andrew,

I am going to have to change one of the switch positions from momentary on/off to latching...

Here was our original plan;

TO is a latching pushbutton.
MCT is a momentary pushbutton.
TEST is a momentary pushbutton.
TGT is a latching pushbutton

I want to change the MCT button from momentary to latching....

The reason is basic hardware availability. I ordered some AML21 series momentary push/on off switches through eBay, and like the last couple of orders, they are refused at Customs...(I find this happens a lot lately).

Anyway, I have more than enough latching switches, and one extra momentary on/off AML series 21, which will be used for the test function.



I think that will still work with the software I have written, but it would be easy to accommodate.

However, a lot of switches that have latching and non-latching models can be modified. The latching ones have a tiny spring and a pin that runs in a small groove to perform the latching operation.

In some, it is possible to remove the pin and convert the switch from latching to non-latching. You might have to partially disassemble the switch.


Incidentally, I tried scaling the photo of the TMS and decided it measures 3.5" wide by 5.5" tall. I also decided that the buttons themselves were 11/16" square in a 13/16" bezel.

These switches have 11/16" (17.4mm) actuators:

They could be inset into a repeated 13/16" grid on a 3D-printed frame.

Might have to get creative with squeezing some LEDs in there, but they are backlit, so a simple mask might work, to let the light through where it's needed.

Momentary only, but latching can be done in software.


Your dimensions are somewhat accurate..the CDU is 130 mm by 84 mm.

The switches look good, but what I have done...(and I will include pics when I get home on sat) is build a backing box that holds all the AML21 switches so that they are recessed by 9 mm from the CDU. I then print buttons (19 x 19mm and 10 mm thick) that insert through the CDU cutouts, which are glued to the (original) switch face.

The buttons themselves are printed with 5.2 mm holes to allow a 5 mm LED insertion, and a 2 mm raised surface inside the button dimensions which makes positive contact with the switch to allow a clean on off switch action when pressed.

I considered running the LED wires through the switch body...but the better option was to keep them outside and run them around the AML switch cluster then out through the top of the cdu for connection.

The wires themselves are light gauge and tuck neatly into the groves printed into the 2mm base that makes contact with the switch.


Sounds cool. I can see from your earlier pictures what you are doing. I'm keen to see the final thing.

I have just received some parts from AliExpress that were ordered a month and a half ago. And some other parts that were ordered a month ago. Occasionally things are faster, but there's no real pattern.

I hope yours arrive soon.


Quote from: Joe Lavery on November 23, 2020, 11:36:25 PMI agree with you Ame, although some of the clones use different chips and don't always work until you download new drivers.
Recently I've been buying the Elegoo ones from Amazon. They seem to be better quality than the run of the mill Chinese ones.
Incidentally I tried to create a joystick controller recently using Mmjoy2 and I couldn't get the arduino to be recognised. I didn't realise that there were two kinds of mini USB cables. I saw a comment on the arduino forum. I changed the cable for an older one, instead of the nice new shiny one that came with my new phone and hey presto the arduino popped up.
I thought perhaps some of you might have had the same experience.

Hello Joe,

I've never had that problem. It's possible that the 'faulty' cable was intended for power only, and did not contain the two USB data wires. Or it could have just been faulty.

For this project it is not necessary to have a data connection. I expect Jim will power the Arduino directly through its 5V and GND pins.



Andrew, some of the parts arrived...the Arduino nano and some 4 digit LED displays attached to the driver, still waiting for the 3 segment displays.

I am also re-doing some of the printed parts, and also found room to include the dimmer pot.

I will take some pic's of the project tomorrow and post under the new (as discussed) thread.



Excellent! You can start playing with the Arduino immediately if you like. Find a tutorial or some examples and follow along. Just getting the Arduino environment installed and getting the 'blink' program running (after you have modified it- generally, stock Arduinos arrive with 'blink' already installed, so change the delays a bit so it's obvious that it's different).

The display will work with my software as-is, but the fourth digit will be blank or garbage. Put some tape over it. :) It would be a good idea to get that working before you replace the 7-segment module anyway, otherwise you won't know if you made an error.

Looking forward to your design and construction thread.


Andrew, some good new and bad news.

Good new is that I might be able to ustilize the 4 digit displays by modifying the CDU face somewhat. Like you said, I would just need to cover the forth digit.

Not sure yet if I can do this, it all a matter of space as it sits right next to the Tref thumbwheels.

The bad news is that they send me the wrong USB connection for the Nano...they sent me the standard not the smaller one.

I might have a USB connection with the same port around here somewhere...would it suffice to say if I find a plug in that successfully plugs into the nano it should work for programming?



Regarding the LEDs, I'd suggest waiting until the 3-digit module arrives before deciding to modify things to accept the 4-digit module. Although functional it might just not look quite right. However, if you do decide it's acceptable then be aware it is possible to modify the software to use the rightmost three digits (so the unused one is on the left) instead of the current configuration where the unused digit is on the right. This might help you with the structural design.

It might be better than trying to desolder the 4-digit module and replacing it with the 3-digit module.

Regarding the Nano, generally they have a mini-USB connector. If you have a cable from elsewhere it should work.


Hello Andrew,

Unfortunately the 4 digit display (plus attached TM1647) will not fit...over budget on space...

As it is I will have to de-solder one of those boards...pry the 4 digit display from its hold, then attach wires from each output to the corresponding connection on the 3 digit display, (when it arrives).

I purchased enough drivers with attached segment displays so if I foul one up, it is not a big deal.

I did find a small USB connection that I have for a scanner...so hopefully it will work OK for the Nano programming...(it fits ok, so it should work).

I am going to start the new thread under BAe146 TMS Construct, will include some pictures tonight.

I am not happy with the TMS cdu base...the one that holds the AML switches, so I am presently re-printing it....already 2 hours into a 20 your print.

I was having some printer issues, PLA was extruding around the nozzle and I would have to pause the work every 4 hours and clean the control head off....only to find the solution was to tighten the nozzle itself...regardless, will most likely reprint the CDU face as well.

Its not a high end 3D printer...so everything has to be just right to get a decent print job..



Hello Andrew,

Received another package from ALIexpress today :)...

just waiting for the three digit LEDs and we are good to go.

I will start to assemble and solder up the parts once the CDU housing is complete as I have had to redue the whole process over again.

As you know, I was having issues with my printer, as I was having to pause the print at 30 percent 'done' intervals...clean the nozzle...then resume...the only problem was that it left weak joints when it was paused to where it was resumed...

I think using hairspray to have the print adhere to the glass on the first layer was part of the issue. however the hairspray works 100 percent of the time and I never have warped or

As they say, for every action there is an equal an opposite reaction...so now my prints stick perfectly to the platform...but the nozzle becomes plugged with excess spray causing it to clog on the first couple of layers of print.

I Found that increasing the nozzle temperature from 200 to 220 seemed to solve most issues...


Very good. You could get the display running on the bench (with four digits) before dismantling and re-soldering it.

My 3D printer is also a cheap one, but it has been quite reliable. I use only PLA, and a temperature of 200 °C. I also heat the bed (about 60 °C) which helps adhesion, and the bed has a layer of blue painter's tape.

Hopefully the rest of the parts will be there soon.


Hello Andrew, wiring up the thumbwheel switches and AML's today. Should have a test bed set up by tonight. Having some computer issues now...trued to download the Arduino IDE from the site and the drivers changed my computer...now the resolution is all screwed up and I cannot fix it. I have run a system restore, but nothing seems to work.


That shouldn't happen. I suspect something else is going on.

Where did you download the Arduino IDE from?


Downloaded it from the official site;


Ran my AVG, no threats found.

It actually occurred when it asked me if I wanted to download the driver software...once I clicked 'yes' the resolution went a bit array.

I uninstalled all the files, and tried to run a system restore but it tells me it is still open in windows explorer...

anyway, i donloaded the same IDE on my other laptop (windows 10) with no issues.


Ok. Well now you can become a hotshot embedded systems programmer!


So..i am at the stage where is all is wired up, (test bench) and I am at the point of arduino download....so...your program is on Github, how do I get it to the Arduino IDE for download....I have tried to copy and paste...but it give me an error..


i think i am on the right track as I can get the file to the IDE..but when i verify it gives me acopy error message....(TM1637h. no such file or directory)


Sorry, no time to chat, but it's a library. Google Arduino libraries and follow your nose.


oK...I am sure i can figure it out.


Well...I figured it out, but I think I might have an issue with my (generic) USB plug in. In my wisdom I also ordered a UNO board, and was able to successfully download the program, (after installing the correct libraries). With respect to the Nano...the port is correct, everything checks out...once plugged in the green light comes on (on the board)...but during download, the red light comes on and the error message appears.

It failed the connection test as well.

I have confirmed that the correct board is selected and went though all the troubleshooting tutorials....so tomorrow I will see if I can't get my hands on a new USB plug in.

Will this program work if I wire it up to the uNO?...or is it nano specific...the reason I ask is that some of the output numbers/letters are not the same when compared board to board.



I selected ATmega328p (old bootloader) and it allowed me to download onto the Nano....now let's wire it up and see what it looks like!


Sorry I didn't have time to give you detailed instructions, but I guess you found the library menu in the Arduino IDE and found the AKJ7 TM1637 library.

Regarding Nano/Uno, fundamentally they are the same, and you can consider the Nano to be a small form-factor Uno. It's the same microcontroller on board, and the pins are numbered the same although some extra ones are broken out on the Nano I think. The problem that may have bitten you is the revision of bootloader on the Nano. The bootloader is factory programmed into the chip at manufacture, and there is generally only one for Uno, but at least two common ones for Nano. When you select Nano in the Arduino IDE there is a further option under Tools, and that is 'Processor'. You can choose ATMega328P and ATMega328P (Old Bootloader). For your Nano, check what had been selected earlier and choose the other one and try again.

Like the Website ?
Support Cockpitbuilders.com and Click Below to Donate