Gazz292 Posted March 13 Author Posted March 13 (edited) I think i might have made all the 'controllers' i need to drive the EU07 / EP08 style trains at my laptop desk now, it's only taken me 2 years : Gone is the radmor style 3D printed USB microphone that sat in it's holder on the side of the lighting switch panel (and the tacky 6 key plus rotary encoder mini keyboard i used to change radio channel and press the ZEW buttons) 😊 I now have a 3D printed Radmore style radio 😊 As with all the items on my laptop driving desk, the radio is sized to fit the space i have, i reckon it's about 3/4 of real size, i also deliberately reduced the height of the radio's main case as i needed the radio to pass over my legs when i move the overbed table out of the way, yet still hang off the front of table dovetail mounts so the top is below the main switch panel. The radio is made up of individual panels that screw together to make the main case, the case is then screwed to the switch panel from below, with the push button mounting piece screwed through the top of the switch panel, a 1mm thick 'text plate' fits over the buttons and hides the screws (which is handy as it took 2 hours to print the text plate alone, and i printed about 10 of them before i got one as good as i could get it, thank bod the 3D printer does the work and not me) A dovetail mount screws to the rear of the radio, allowing the radio to slide onto the mounts on my table like any of my other controllers. A base panel that houses the microphone board screws to the bottom of the main case, the microphone is a seperate item that's a little smaller than my self contained USB mic (to match the scale of this radio) this mic only houses a mic element and a switch, a coiled 4 pin headset cable connects the mic element and PTT switch to the microphone board (the switch goes to the STM button board) The microphone board is the circuit board out of a cheap desktop 'streamers echo mic' ... shown as i bought it to the left. This 'streamers mic' has a soundcard built in, so it can play audio from the computer via a set of headphones plugged in the 3.5mm socket, This could be handy if it ever becomes possible to route the radio's audio to a seperate speaker in SimRail (like some games can route the VOIP chat audio to a headset whilst playing the main game sounds via the main computer speakers) This mic also has a 'monitor' function where it can play the audio from the mic over a headset, so my radio's speaker is plugged into the mic board for this reason, allowing me to check i have not set the echo control too high or i'm getting feedback.... Feedback was an issue i had when using the monitor function when the mic was sat in it's holder, as this places the mic very close to the speaker, so to get around this i routed one of the mic element wires through the (double pole) PTT switch so the mic is only live when the PTT switch is pressed, this is how it's done in a lot of 2 way radio mics... it also means my mic is always muted when i am not deliberately pressing the PTT button, so google is not able to listen for advertising keywords either. The mic board plugs into a USB port, as does the STM microcontroller board used for the buttons and switches, so i used a USB C bulkhead fitting (gives you a USB C female socket on either side of a panel) into which a 3 port USB hub plugs inside the radio, then the mic and STM boards plug into that hub using short cables, leaving me one USB port for another board in the future to run the LED's properly. I used 3 x 12 position single pole, 30 degree per position rotary switches, one with the lock out washer / position restrictor set at 10 positions for the channel change switch, one at 6 positions for the volume switch, and 3 positions for the 'Nazłuch' switch, Only the channel change switch has keybinds to do anything in the sim, you can move the other 2 knobs with the mouse, the volume one adjusts the radio speaker's volume.... i've never actually tried doing this when someone is talking in MP. And the Nasłuch switch i think selects which ZEW tone the radio will respond to when you have the radio in 'Do Not Disturb' mode (where you put the microphone in the holder backwards, so the ring around the mouthpiece presses on 2 metal pins, the radio will then be silent except for one transmision after someone presses a ZEW button on their radio, something that is not simulated in SimRail as the ZEW tones do not play over other peoples radios) The push button switches are 'piano switches' that are commonly used in real radio's. Usually these come as multiple switches in a row fixed on a long metal mounting piece, with an 'interlock' function, so only one button locks down at once and pressing another button releases the last one... as found in 1980's era hifi equipment for source selectors etc. I don't need the interlock function for the radio's switches, and you can remove the interlock bar and make the switches independent, but i also needed to set each switches spacing differently to how the ones i got are on the single piece mount, you can get different switch spacings, but i found it easier to just get individual piano switches, rotate them 90 degrees and make a 3D printed mount for them... but that does increase the distance needed between the piano switches and rotary switches. I also need some latching versions of these piano switches, as that's what is used for the power, squelch / noise block and radiostop buttons, for the ZEW buttons i need momentary switches, but thankfully these are old skool switches that allow modding, and you can pull the little wire piece out that provides the latching function to turn them onto momentary switches... some of these switches need the end under the spring in place to stop the switch springing all the way out, so cut the latch wire in half and place just the top (dog leg) part back under the spring. The the brain of the radio is a STM32F microcontroller board running FreeJoy that i've used a few times before in other switch panels, the hope is one day we will get joystick support for SimRail and then the sim can read the joystick buttons directly (and hopefully also joystick axes for the levers) But for now i use JoyToKey running on my laptop when SimRail is running to change the joystick buttons to keyboard key presses. I used 29 of the 30 pins on the STM board for rotary switch and push button inputs, the final 'spare pin' i connected to the red 'SFN' led which lights up when i press the push to talk button on the microphone as shown below: That red SFN led should also light up when the ZEW and radiostop buttons are pressed i believe .... to show it's transmitting, i hoped to do that with FreeJoy, but it turns out i can only set it to turn the led on from one input (the piano switches are multi pole ones, so i could re-wire things to get the SFN led lighting up when the ZEW and radiostop buttons are pressed too, not that they do anything in multiplayer mode in the sim, i imagine the ZEW tones are not played to everyone's radio in range because of trolls who would press them all the time to annoy people, same as why the radiostop only works in your own train if you press it) I connected the green power led to the power switch, so it simply turns on and off as i use that switch, In the future when we get the I/O API in the sim, i will add a second microcontroller board to run the led's, then i can have the power led turn off if the loco's battery is off, or the radmor power supply / cab selector is off or set to the wrong cab, and maybe even have the SFN light only work (or illuminate dimly) if there's someone in range... kinda how the mic icon next to the text chat box will only go green when someone is in range to hear you .. so i know not to bother hyping myself up to talk on the radio when there's no point (i have issues talking on phones, the radio is easier as i'm in control with the PTT button, but i still don't use it much because of my 'issues') : Finally... a view of the top of the radio, the tamper seal on the radiostop button is a 3D printed distressed 'seal tag' and a few strands of thin electrical wire for the break wire, i heated the ends of the wire to melt it into the seal tag. The radiostop buttons surround screw posts are 2.8mm diameter with a 1mm hole in the sides of them for the tamper wire to pass through, i was struggling to fit that stuff together even using tweezers and a magnifier. And really finally this time (i've spent 3+ hours typing this wall of text!) The radio from the front with the mic sat in its cradle, as it spends 99% of it's time when i'm driving a train. i used flash for these photo's so it shows up every little imperfection of the 3D printed parts that you don't usually notice with your eyes in normal light. Edited March 14 by Gazz292 7 1
Conrad Posted March 14 Posted March 14 Great, you've managed to make it all happen! It looks amazing ! As for the radio, I am designing a 1:1 scale version in a similar idea, sound card, 3W 10x10cm speaker, similar idea of buttons, but on an arduino to be able to control the diodes better. 3d print, folded just like the original. 3
Gazz292 Posted March 15 Author Posted March 15 (edited) This one is an immersion enhancement of sorts... real lights that mimic the cab lights (to an extent) EU07 Cab Light Switches Operating Real Lights .mp4 The video is showing: At 1 second i turn on the 'Oświetlenie Kabin' (Cab Light) switch. The drivers side cab light in the train illuminates, and the the spot lamp to my right turns on at 35% brightness and 3000K colour temp. At 2 seconds i turn on the 'Oświetlenie Ogólne' (Overall Lighting) switch. The left hand cab light in the train illuminates up and the bedside lamp to my left is turned on as well (again at 3000K and 35%) At the 3 second mark i turn on the 'Przyciemnienie Kabiny' (Cab Light Dimmer) switch. This does not have a keybind to dim the cab lights in SimRail unfortunately, but it does dim my room lamps to 1% brightness. At 5 seconds i turn the dimmer switch off, and the room lamps go back to 35% brightness. At 7 seconds i turn the cab light switch off. The right side cab light in the train turns off and the bedside lamp takes a second to fade to off. And at 8 seconds i turn the overall lighting switch off. The left side cab light turns off in the train and the spot lamp to my left fades to off over a second. Why and how i did it: I drive the trains in SimRail mostly at night, so i often have the room lights off to add to the immersion that i am actually driving a train in the dark, but just like a real train driver at night i often want to see my controls for a brief moment, usually to find the correct button to press or switch to move. So like in a real train at night where you would turn on the cab lights to see the controls, i wanted to do similar by switching on and off lamps in my room via the switches on my controllers, at the same time sending the commands to SimRail to operate the cab lights in the train. The process: Fit smart bulbs to the lamps. Put an ESP8266 board in my lighting switch controller with the cab light switches connected to it, that board is running ESPHome. ESPHome sends the switch states via wifi to a Home Assistant server that i have running on an old raspberry Pi (i already had that and use it mostly to view camera feeds from my 3D printer). Home Assistant sends the smart bulb control signals via wifi to the lamps in response to the cab light switches on my controller being operated. The STM32f bluepill board that was already in my controller still sends joystick button signals to the computer, which Joy2Key changes to keyboard presses that SimRail can read (if i was any good at coding i would probably do all this on one board, but these microcontrollers are very cheap and i find it easier to keep input and output stuff separate) Then i had to set up the switch logic and smart bulb settings in Home Assistant. The above took me over a week to figure out and get working, using point and click GUI based programming tools which wrote the code in the background, then programmed the PI and ESP boards wirelessly (that's how ESPHome and Home Assistant works thankfully, as trying to write code fries my brain) As the lamps in the room are also used for general illumination, when i turn the lamps on via their wall switches they illuminate at 4000K colour temperature and 100% brightness. When i turn a cab light in the sim on with a switch on with my controller, the relevant room lamp also turns on at 3000K and either 35% or 1% brightness depending on the position of the cab light dimmer switch.... (i really appreciate the dim position in the dark for preserving night vision) If a lamp is already on at 4000k 100%, it will change to 3000k at the brightness matching the dimmer switch position. Then when a cab light switch is turned off, the cab light in the sim turns off and the relevant room lamp fades out, this is to try and copy how bulbs turn off in SimRail (and i presume real EU07's) ... As they run on DC in the train they take longer to extinguish than AC powered bulbs typically do. The colour temperature thing is to try and mimic the tungsten filament bulbs in the train, so i sort of have a general room illumination mode, and an EU07 cab light mode. Edited March 20 by Gazz292
Recommended Posts