Sputnix

Arduino + KSP_Serial_IO : "Odysseus"

Recommended Posts

Current Progress Shot

Label-Full.png

 

List of posted updates and developments

- Mid-May (2015) update - Annunciator Panel mount, Shift-register board, and dual-coloured LED panel mounting

- Mid-June (2015) update - Completed 3D printing upper panels with black spool

- Late June / Early July (2015) update - completed testing of LCD + 7 Segment displays, finished wiring, began writing the code / testing [lots of internals stuff, SPI issues]

- Mid July (2015) update - Labeling the panel + Annunciator

- Mid July (2015) update #2 - Master Alarm system

 

Arduino Code / sketch samples

Here you will find some sample code that will hopefully help others out with problems they're having, or implementing certain features without getting to the point of wanting to put your head through a wall :P

 

Previous Development Photos

 

 

console_black_printed.png

console_current_may.jpg

Lower_panel.png

 

 

 

Credit

I have to give much credit to

zitronen- For the work he's put into creating the plugin that many of us are using to create these controllers, and the support given not just to the plugin, but also with general arduino problems / queries! Thank you!

T.A.P.O.R, who personally helped me to get my head around the 7-segment LED screens, along with some additional insights shared. Thanks heaps!

Freshmeat, & stibbons, who often (and regularly) have something incredibly useful to add - or assist when the going gets tough, and nothing on google makes sense -- Thank you! :)

Also, credit to AmeliaEatyaHeart for creating the LedControlFunctions 'function', and for various insights shared in a variety of threads; thank you.

Mulbin & Marzubus - whose own hardware projects inspired me to start my own.

Outside of these two, every other hardware project has provided guidance / inspiration / ideas of some kind. So thank you to everyone in this community sharing their own ideas, interpretations, and struggles. We all benefit from them! :)

Specific Feature Credit

Whilst reading different forum threads, various members have commented or made suggestions of elements / features that they want to include in their own projects; some of these I quite like, and wish to incorporate too. I shall provide credit here - with a link to the post - in acknowledgement.

Mulbin - dual-coloured LEDs to display more information about the state of the craft.

AmeliaEatyaHeart - Flickering panel lights when low power

*************************************************************

Background & Long-term project

I would love to eventually create a fully immersive simulator, which would have two components: A mission Control, with projector and a few consoles, and a 'shuttle' / cockpit.

The two would be separated by a wall, of some kind - and then there would be communication with headsets, which would increase delay to simulate real-life distance delay.

layout.png

No idea if I'll ever get there, but a guy can dream :D

So in the mean time, I will work on a smaller-scale personal physical console for use whilst playing KSP.

I'm still debating creating joysticks - as my Logitech proves to be ridiculously useful for that stuff; so why re-invent the wheel?

Build, Parts, Plans & Ideas

 

 

I originally wanted to go down the route of Marzubus - with the pre-formed console; and I picked up a couple boxes from an electronic surplus supplier (Anyone in Melbourne, Australia - hit me up if you want their details, they have heaps of awesome stuff :) )

And I was going to put a few of these boxes 'together' --

original_case.jpg

But then I found the same Retex box that Marzubus used, and I figured this would be neater. I also plan on having a secondary 'panel' with various displays of data / information that doesn't fit on this panel.

I also looked into a few switch-guard options.

handle.jpg

The two 'NASA style' switch guards are from a USA-based seller, not the cheapest, but I have plans to try create something similar using a 3D printer.

Next is a 2RU rack handle from some servers I acquired via ebay. The last is chrome handles for a kitchen. I'll probably use that for the full-sized console.

One of the things I really wanted to have is a 'Master Alarm' button / light / tone.

Master_alarm.jpgabort.jpg

I already have the arduino code worked out for the right 'tone' of the alarm (going from Apollo 13 film); though if you change speakers from the little piezo speakers you get in most arduino kit, the tone changes.

The 'abort' button has a flip-up cover on it.

One of the other things I really wanted was an 'Annunciator Panel' - which was used in the Apollo Command Module -

apollo13_annunciator_panel.png

[image from Apollo 13, ©1995 Universal Pictures]

I found these little lights in the electronics surplus store, and you can also find them on ebay [see link below for parts link]

They allow the front to come off, so you can place some label between.

annunciator_lights.jpg

And lit up --

annunciator_lights_on.jpg

I will create decals and label them accordingly - once I've worked out what I want them to be triggered by :D

I plan on placing them on the top panel, to the right, (similar to where it is sitting in the shot below) :

front_on.jpg

As for the handles, I will probably follow a layout similar to this initial plan:

handle_placement.jpg

 

eBay Parts list

 

 

Most of the parts I got from ebay - so here's a link to the different parts in case people want any:

I tend to find the cheapest version of any particular part; but sellers fluctuate their price, so be sure to 'shop around' on ebay :)

Flat-splayed toggle switch - Link

LED Panel-mount / bezel - Link

Annunciator LED lights - Link

Toggle-switch Guards - Type 1 (1/4" bushing) Link | Type 2 (15/32" / 12mm bushing) Link

SainSmart Slider - Link

Momentary round push-button switch - Link

Dual-colour LED's (Red / Green) - Link

8-Digit, 7 segment display - Link

Yellow/Blue oLED displays (0.96 inch, 128x64) - Link

TFT LCD displays (1.8 inch, 128x160) - Link

Annunciator Panel LEDs (Yellow) - Link

 

Edited by Sputnix

Share this post


Link to post
Share on other sites
Looks great, can't wait to see more.

Thanks! :D

I've just received some more of the parts from ebay (dual LEDs and the 7-segment displays) - just waiting on the two oLED displays;

I've got to try work out how I'm going to put all these into this enclosure - along with how I want to use them.

It's a constant thought / evaluation process. Because I'm limited with the fact that I can only 'cut once', I really have to consider what I want to do.

[Although, I could probably replace the aluminium with a 3mm piece of ply or mdf, but it wouldn't look quite as nice - even if I painted it.

That was the original plans with the console boxes I got that didn't have a cover-plate]

Share this post


Link to post
Share on other sites
Because I'm limited with the fact that I can only 'cut once', I really have to consider what I want to do.

[Although, I could probably replace the aluminium with a 3mm piece of ply or mdf, but it wouldn't look quite as nice - even if I painted it.

That was the original plans with the console boxes I got that didn't have a cover-plate]

Why not use ply or MDF as a placeholder. That way you can experiment with placement and such before committing to the aluminum.

Share this post


Link to post
Share on other sites
Why not use ply or MDF as a placeholder. That way you can experiment with placement and such before committing to the aluminum.

Primarily because I think and over-think.

This way I make a decision, run with it, and it's done! :)

I'll most likely have to change the top panel to mdf / ply - because the little rotating blade tool I have barely worked for the slider cut-out.

It will be easier to use more traditional wood-work tools for the annunciator panel and the 8-digit 7 segment displays.

Share this post


Link to post
Share on other sites

That is a sweet console you have there. Very well thought out aesthetically. I look forward to see how you progress.

Share this post


Link to post
Share on other sites
That is a sweet console you have there. Very well thought out aesthetically. I look forward to see how you progress.

Thank you :)

I was very mindful of adding a 'design' element to it - both to keep it neat and organised, as well as making it look nicer.

Placing everything within the predefined grid helped that.

Share this post


Link to post
Share on other sites
Oh yay, a new controller! :) Looking great so far.

Thanks :)

I'm waiting on an ebay purchase of a few shift-registers which I'll use to control the lights, and also working out how to create a support for the annunciator panel.

I have access to a 3D printer, so I'm thinking replacing the top Aluminium panel, and doing similar to what Marzubus did with his joystick / simpit.

Would make it a lot quicker, easier, and cleaner. Would still need to paint it - but that's still better than dealing with cutting out a whole heap of small rectangular cut-outs.

Share this post


Link to post
Share on other sites

More pics!

Nice use of door handles, wish I'd thought of that.

That supplier of yours wouldn't be out in Clayton by any chance?

Edited by T.A.P.O.R.

Share this post


Link to post
Share on other sites
More pics!

Nice use of door handles, wish I'd thought of that.

That supplier of yours wouldn't be out in Clayton by any chance?

I'm actually using the 2RU server handles on the project itself :) - But thank you!

Door handles are for a future 'console' project - much like they used here, on the sides of the consoles (mostly the CRT tubes, no doubt to easily place and remove as necessary).

I spent probably about a month researching and looking into how I can use alternate gear to replicate / mimic period-stylings.

As for the supplier - yes, out in Clayton ; Rockby Electronics. They have a 'surplus' type store, and a proper electronic front too - so they usually have what you need.

They had the Retex boxes in the main show-room, in a corner. Almost missed it completely.

Hard to find places like them these days. Still got one out in Bayswater - Truscotts Electronic World; but I find Rockby is better laid out, and has better stuff.

However, you will find more older / vintage stuff you can strip for parts (or even just boxes of old stuff) at Truscotts. It just depends what you're after :)

You know of any other places for parts?

Edited by Sputnix

Share this post


Link to post
Share on other sites
I'm actually using the 2RU server handles on the project itself :) - But thank you!

Door handles are for a future 'console' project - much like they used here, on the sides of the consoles (mostly the CRT tubes, no doubt to easily place and remove as necessary).

I spent probably about a month researching and looking into how I can use alternate gear to replicate / mimic period-stylings.

As for the supplier - yes, out in Clayton ; Rockby Electronics. They have a 'surplus' type store, and a proper electronic front too - so they usually have what you need.

They had the Retex boxes in the main show-room, in a corner. Almost missed it completely.

Hard to find places like them these days. Still got one out in Bayswater - Truscotts Electronic World; but I find Rockby is better laid out, and has better stuff.

However, you will find more older / vintage stuff you can strip for parts (or even just boxes of old stuff) at Truscotts. It just depends what you're after :)

You know of any other places for parts?

Cool, I'd thought that it was Rockby, just because you had so many consoles and at other places I've seen them, they're about 3 x as expensive minimum.

I've never been out there though. I really should make the trip some time!

Thanks for the tip on Truscotts too :)

All the other stores that I know of suffer the Australia tax pretty severely.

Share this post


Link to post
Share on other sites

Tapor demanded an update - so here you are! :P

There have been two main updates to the project --

1. Annunciator Panel

So I'd been dreading the idea of cutting out 9x rectangles for the annunciator light panel.

Which is perfect that I recently had access to a 3D printer! [i seriously gotta buy me one of these things!!]

It took 2x single-cell tests to confirm cut-out and mount size, and then a final print [which worked perfectly first go!].

Left - cutout was too small; Right - perfect; just had to move the cavity that holds the lamps over a bit to make it more central.

trial_and_error.jpgAnunnciator-3dprint_underside.jpgAnunnciator-top.jpgAnunnciator-place.jpg

Rough placement (with lights being held in place by tape). It will be held there by a prototype / vero board, which will be attached via metal stand-offs to the back of the 3D printed panel.

This means I will be following Marzubus' example of 3D printing panel-mounts (only for the top part, however).

2. Shift Register Board

While I wait for my shift-register chips to make their way from sunny China to me, I started working on the board that will be controlling it all.

This will be used to control *all* the LED lights. Each panel-mounted LED has two 'inputs' (a red and a green, owing to the fact that they're dual-coloured LEDs).

Then there are 9 Annunciator lights. A master alarm, and an Abort light. Needless to say, I've pretty much used all there is from this array of shift-registers :P

shift_register_board.jpg

3. Dual-coloured LED housing / panel mount

Mulbin made a mention of using dual-coloured LEDs for enhanced lighting / information. I really liked this idea (as well as his suggested use-case) so I'm following it :)

However, these LEDs have 3x legs (1x cathode, 2x anodes) [i think I got that in the right order].

Basically a common 'ground' / 'negative' that sits in the middle, and then each colours respective 'positive' leg.

Most panel-mounts for LEDs only have 2x holes, so I had to modify the ones I got on ebay to suit.

LED-3.jpgLED-1.jpgLED-2.jpgLED-4.jpg

And the underside (which I'm still working out how to wire up neatly)

LED-Underside.jpg

Hopefully I'll be able to share some more soon! :)

Edited by Sputnix

Share this post


Link to post
Share on other sites

Just a small update.

I had some extended time with the 3D printer, and some black spool -- so I thought I'd make the most of it, and print out all the top panel in black.

The ultimate goal is to prime it (so as to fill up the little spool-grooves) and then spray it a grey-blue colour, similar to what they had in the Apollo ....-pits. I believe it was an insulation coating on the metal surface to prevent shorting. Either case, that's one of those 'nice to have' features (when / if I get around to it).

I've just got to finish running wires to the different parts of the panels, and then start working on the coding; once I've worked the code out, working with KSP_serial_IO, I will post the results here so that anybody else can basically use it for their own endeavours.

console_black_printed.png

Share this post


Link to post
Share on other sites

Finished the Lower Panel today.

I sanded out some of the damage I inflicted around the slider -- and in the process gave the whole panel a 'brushed aluminium' look.

I'm pretty happy with the look :) Also means it should be better to adhere decal labels to.

Lower_panel.png

The 8 buttons are for - you guessed it - action groups. This is why the Abort is in the same 'locality' - since it's technically a dedicated 'action'.

Flight control switches to the right (SAS / RCS / Stage)

With miscellaneous switches underneath (Lights / Gear / Brakes)

Throttle slider far right.

Edited by Sputnix

Share this post


Link to post
Share on other sites
Wow, looking very nice!
Hey, nice progress!

Wish I had time to play :'(

Thanks guys :)

I'm in the (un)fortunate position where I've currently more free time than I'd like.

So I'm trying to burn through and get it done while I do have the time / opportunity.

Also, I'd like to finish it so I can start programming it - and actually using it to *play* KSP! :D

Share this post


Link to post
Share on other sites

Man. I love your setup. Very cleanly done. I love the handles. I guess I need to make a trip to the hardware store to look at handles and see if I can find something that will work for my setup.

Share this post


Link to post
Share on other sites
Man. I love your setup. Very cleanly done. I love the handles. I guess I need to make a trip to the hardware store to look at handles and see if I can find something that will work for my setup.

Thank you :)

You might be able to salvage around parts from wreckers, junk dealers, or surplus electronics stores.

I found that buying new can be expensive (as it is, I didn't use my first set of handles - but it did give me some ideas).

Share this post


Link to post
Share on other sites

It's been a bit of time since my last update - but it's been a lot of little, fiddly work.

One of the main things I was conscious of was trying to keep everything 'modular' - allowing for the whole thing to be taken apart either to do repairs, or 'finishing touches' (such as labels on the lower panel aluminium). So I tried to use header pins, and connectors where possible to allow for this.

I've wired it all up, and the next thing to do is confirm that everything has been wired up properly and communicating with the Arduino as needed.

I also solved some SPI problems with 7-segment displays I was having.

So, if you're having SPI issues - try twisting (like they do with twisted pair cable - Cat5e, or telephone cable) the clock and data lines together to eliminate interference / cross talk.

Although I had started planning and thinking about how to wire up various parts of the board (and in fact, had already mounted most of the switches) I had to mount the Arduino board properly so I could start measuring wire accurately. The side was the easiest - in that the side of the box is straight. Originally I was looking to mount it at the back - but the angle would have been annoying, and wouldn't have given as nice a finish as I'd like.

I also ensured the DC Jack could be accessed, and allow for a variety of sized plugs (different plugs have different sized moulding):

board_mount.png

And for reference - the lower aluminium panel, reverse side, with the switches and LEDs mounted --

rear_board.png

Due to the desire to wire things 'modularly', many of the switches / buttons would work best with spade-plugs. So I got to soldering and crimping (and man is that a tedious task!).

I linked all grounds with all sections, so as to try minimise the number of cables running around (more on that later) --

Ground_link.png

I got pretty close to hitting the base of the box (due to its slope) -- but I still had a few millimetres of clearance (phew!)

AG_Btn_clearance.png

Though this was only really an issue with the Action Group buttons...

To try minimise the crazy wires running to the board, I got some 'test equipment' wiring lugs. These would carry the 3.3v rail, 5volt rail, and the ground.

They sit at the back of everything - with a single wire going to a pin to connect to the arduino board.

power_stands.png

Sorry for crappy photo. This should give an idea of how the wiring for power works. As well some insight to the rats nest that this is :P

To try things consistent and easily identifiable, I kept all powered cables the same colour - Green for 3.3v, Yellow for 5v, and Black for Ground.

In order to try minimise the 'craziness' going to the Arduino, I employed the wonders of Flex cable. I'm hoping it will be ok - in terms of thickness for sending power to the LEDs. I didn't do the maths - I just prayed to the gods of electronics: Ohm, Coulomb, and Tesla - that all will be well :P. I re-purposed one (of my many) floppy-cables, since they are 40 pin, and I had 38 GPIO connectors usable [Pins 22 - 53, with 50 - 53 being used for hardware SPI which I used on the LCD]. I attached a double-strip of header pins to my Arduino 'prototyping shield' that came with my clone-duino kit. Pins PWM 2 - 11 are used to control the lower panel green/red LEDs.

Because of the dual-nature of the lower panel LEDs, I put the resistor on the ground [which apparently is the correct way of wiring them].

Arduino_board_flex_cable.png

Further to the modular design, I wanted to minimise the cables cluttering up the internal space (haha. I crack myself up! :rolleyes:)

So I put a small very board in the middle of the lower aluminium panel to wire all things from the aforementioned panel to it, and then have the various flex-cable wires connected to that -

sub-board.png

You can see it in the midst of the mini rat-nest!

As the saying goes, "the best laid plans of mice and men often go awry" - my attempts to keep this thing as neat as possible has basically failed. How apt that the quote involves rodents!

[i saw a post today of someone who did similar - using ribbon cable, and of course, I can't find it now -- anyway, their implementation was much cleaner / neater].

Anyway -- here's the rats nest from various angles --

rats_nest.png

Upper panel lifted up

side_view.png

Lower aluminium panel separated to see 'cable squish'

The 7-segment displays I have had header-pins to daisy-chain 'easily'. However, because of how I created the mount / brackets, I couldn't use them the conventional way. I soldered wires to the back of the header-pins solder points.

7-seg_daisy.png

I also created a right-angle type connector the first 7-segment display; This would allow me to connector a cable easier - as the depth of the top of the case would be coming too close, and I didn't want to put stress on the cables by having them being jammed / crinked against the metal:

7-seg_connector_1.png

7-seg_connector.png

7-seg_on.png

Each of these panel lights has 2x LEDs inside - and each one requires its own resistor. I used a resistor calculator and the datasheet for these lights to determine the value of the resistor to use on each LED.

Each pair of LEDs were wired to a single cable, which terminated at a point on the header strip I had placed on the vero board. 9 lights = 9 wires = 9 header pins :)

Anunn_back.png

You'll see my table marking out the Arduino Pins and their respective connections in the background.

FYI, SS and SCK are around the wrong way :P

I used super-glue to attach some little stand-offs to the back of the 3D printed bezel, and then some fiber-washers to hold the board in place. There's a slight gap - so it's not a perfect 'snug' fit - but then, I haven't replaced the covers on the panel lights yet (Because I still have to create the labels that sit between the lights and the covers)

Anunn_side.png

I checked to make sure all the lights were working as needed - which they were (hooray! :D )

Anunn_Not_Bezel.png

Without the front bezel attached

Anunn_Front_Bezel.png

With the front bezel attached

I attached all the upper bezels using a 'permanent double-sided tape' from Aldi. We'll see how permanent it is - but I figured it will be strong enough for the job:

double_tape.png

The last bit of information that might be of use to someone is the problems I was having with the SPI communication during testing.

I wired up my 7-segment displays, and tested them - and they were working fine with the direct connection to the board I had.

I then wired up my LCD screen, but had to extend the 7-segment wires to reach the arduino (since things were still very much in test mode, the cable couldn't reach).

I was then noticing that half my 7-segment displays weren't working:

spi_issues.png

You can see the extension lead (partially cropped) going from the bottom left, to the middle - up to the Arduino board.

I was freaking out. Did a wire short? Was I trying to push my Arduino too far?

I even started writing a query to the forums to see if others had seen this.

I then had a random thought (which I was annoyed that I hadn't considered early): I had made a change, by putting an extension lead in.

I removed the extension lead, and sure enough - everything was working. This was fine for testing - but I needed to make sure everything would work, as expected, in the final. I wasn't sure if I would have a 'short enough' lead to the 7-segment displays.

Doing a bit more research, I stumbled upon a blog-post.

There was discussions about SPI and data lengths. These people were trying to run SPI lengths of like 30 feet, or something silly.

Anyway - one commenter mentioned that they twisted the clock and data lines together to eliminate interference.

I figured I'd do a test-try to see if this would work. I twisted the cables of both the lines from the 7-segment, and the respective lines from the flex cable - and it works!

Keep this in mind if you're having any issues with GPIO assigned SPI devices!

Hope you guys have enjoyed this update! Let me know if there's anything specific I missed, or you would like to know about. :)

Thanks for reading!

- - - Updated - - -

This looks great! Excellent job.

Thank you! :)

Edited by Sputnix

Share this post


Link to post
Share on other sites

Your rats nest looks strangely familiar. Looks good, nice tip about the twisting the cable. I might need that later on. Good luck on programming it.

Share this post


Link to post
Share on other sites

Ah, rats nest, my old friend...

I am studying wire lacing... As in old school cord lacing...

I hope it is a skill I can master, so I can bid adieu to my old nemesis "rat's nest"! :sticktongue:

Share this post


Link to post
Share on other sites
Ah, rats nest, my old friend...

I am studying wire lacing... As in old school cord lacing...

I hope it is a skill I can master, so I can bid adieu to my old nemesis "rat's nest"! :sticktongue:

There's some really neat stuff out there (I really like looking at the Apollo CM and seeing how nicely they ran the cables behind all the panels).

I look forward to seeing your final results, richfiles ;)

I think if I was to re-do mine, I'd pay more attention to the cable routing.

But I would also probably change the way I interconnected different parts of the system. Probably even look into PCB.

One reason I didn't was because I wanted to get onto programming the arduino, and using the darn thing :P

Further, I wanted to allow it to be 'taken apart' for upgrades / repairs, and finishing touches (which will come later on).

Share this post


Link to post
Share on other sites
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.