Toastie Posted March 27 Author Posted March 27 33 minutes ago, amine said: The vintage technic lights blinks in reverse polarity. Ha! I did not recall that - but you are right! Best Thorsten Quote
Toastie Posted March 27 Author Posted March 27 (edited) @amine I just found an 8-pin ILD74 (double) opto coupler flying around here ... and quickly made this: It is rather small and works quite nicely (no power supply required). The part on the right of the diagram (+/- and 10kOhm) is just illustrating the pull-up resistor inside Interface B. No harm is caused when the 9V terminal is attached the wrong way around on an Interface B input; it just doesn't work ;) On my Interface B, the left contacts of the 9V terminals are + and the right are GND. The short 9V wire goes to any Control Center output (polarity does not matter), the long goes to an input of Interface B (yellow or blue), GND goes to both emitters of the two internal transistors of the ILD74 . This is absolutely straight forward, and there is nothing special - it is simply your idea, @amine, made with rather old resurrected electronics ;) The two internal LEDs of the ILD74 only light up, when the polarity is right - and they "protect themselves", as one is always conductive, so that the voltage drop across the non-conductive LED is such that it can easily deal with that. The resistor on the right in the photograph (and center in the diagram) determines the reading for forward (or reverse, depending on how the 9V LEGO wire is attached to the CCII output terminal). The other coupler output goes directly to the (+) input terminal of Interface B. As only either one can be on, or both are off, the reading for the Interface B input is unequivocally determined. Here is what I recorded in raw mode of any input: off: 1023 - forward: 10 - reverse: 108. As said, you can use other resistor values of course. There is one advantage: There is no latency. The moment you press a button on the CCII, the reading changes on Interface B. The ILD74 costs less than 1€, there are also quad couplers < €2. Virtually all the low power electronic opto couplers will work though. Three ILD74, six 1 kOhm resistors, and three 9V cables cut in half or made from scratch and you are good to go. You can simultaneously press buttons on CCII and the timing is pretty accurate. Just an idea! All the best Thorsten Edited March 27 by Toastie Quote
amine Posted March 27 Posted March 27 47 minutes ago, Toastie said: @amine I just found an 8-pin ILD74 (double) opto coupler flying around here ... and quickly made this: It is rather small and works quite nicely (no power supply required). The part on the right of the diagram (+/- and 10kOhm) is just illustrating the pull-up resistor inside Interface B. No harm is taken when the 9V terminal is attached the wrong way around on an Interface B input; it then just doesn't wok ;) On my Interface B, the left contacts of the 9V terminals are + and the right are GND. The short wire goes to on Control Center output (polarity does not matter), the long goes to an input of Interface B (yellow or blue), GND goes to both emitters of the two internal transistors of the ILD74 . This is absolutely straight forward, and there is nothing special - it is simply your idea, @amine, made with rather old resurrected electronics ;) The two internal LEDs of the ILD74 only light up, when the polarity is right - and they "protect themselves", as one is always conductive, so that the voltage drop across the non-conductive LED is such that it can easily deal with that. The resistor on the right in the photograph (and center in the diagram) determines the reading for forward (or reverse, depending on how the 9V LEGO wire is attached to the CCII output terminal). The other coupler output goes directly to the (+) input terminal of Interface B. As only either one can be on, or both are off, the reading for the Interface B input is unequivocally determined. Here is what I recorded in raw mode of any input: off: 1023 - forward: 10 - reverse: 108. As said, you can use other resistor values of course. There is one advantage: There is no latency. The moment you press a button on the CCII, the reading changes on Interface B. The ILD74 costs less than 1€, there are also quad couplers < €2. Virtually all the low power electronic opto couplers will work though. Three ILD74, six 1 kOhm resistors, and three 9V cables cut in half or made from scratch and you are good to go. You can simultaneously press buttons on CCII and the timing is pretty accurate. Just an idea! All the best Thorsten WOW THATS AMAZING 😁 Quote
Toastie Posted March 27 Author Posted March 27 56 minutes ago, amine said: WOW THATS AMAZING Thank you, but it was >your< brilliant idea! I just assembled a couple of old/used pieces of electronics and cables lying around. Your version is 100% pure LEGO! Best Thorsten Quote
amine Posted April 4 Posted April 4 (edited) On 3/27/2026 at 8:24 PM, Toastie said: Thank you, but it was >your< brilliant idea! I just assembled a couple of old/used pieces of electronics and cables lying around. Your version is 100% pure LEGO! Best Thorsten Another Idea is that I would like to make programs out of the to sequences. Instead of pushing program 1 and program 2 by hand I want something that could tell the control center for example repeat 3 times program 1 and program 2.... Edited April 4 by amine Quote
Toastie Posted April 4 Author Posted April 4 3 hours ago, amine said: that could tell the control center for example repeat 3 times program 1 and program 2.... In that case you'd need to do some soldering as show at the beginning of this thread. All the keys of CC have traces that go to the microcontroller, along with test points - here soldering is possible. I don't see any other means of talking to the CC ... Best Thorsten Quote
Toastie Posted June 12 Author Posted June 12 (edited) Dear All, this is just an update for @amine's proposal to use Control Center (I/)II (CC, #8485) as “input pad” for Interface B (#9751), which in turn records the 6 A/B N/S W/E keys of CC for further use, e.g., storing and replaying a sequence. Yes, CC can do that on its own, but it can only store two programs with limited storage capacity. And when power is gone, so are the sequences … Well, my CC is already pimped to the effect that its inputs (= buttons) can be controlled from the outside, this is what this thread is about. Even more so, I made that additional interface such that it is compatible with the Interface A (#9750) logic. Which in turn means that I can control CC with @Bliss LEGO Blockly programming environment. But there is more, there always is :D As also shown in this thread, the outputs of the CC are readily monitored with opto-couplers, as proposed by @amine. I expanded the quick and dirty 2 opto-coupler/1 channel output version shown above to a little less dirty 2x4 opto-coupler (LTV 845) version, which simply “plugs into” the back of CC. Well not exactly: The board plugs into 3 slightly manipulated 2x4 electric plates (#4757) connected to the 3 outputs of CC; one additional input may be used for, e.g., an analog 9V power input such as monitoring the output of a 9V train speed controller (#4548). These are the manipulated 2x4 electric plates; they feature an additional 2 pin female connector (center/right) and one 3 pin connector (left, turned upside down) – this is just for symmetry reasons, only 2 pins are used: (@Jack Sassy: I used a carpet knife ;) They are attached to the CC and extend the 9V output terminals such that they can be used as per usual for 9V lights/motors and at the same time monitoring is possible. These are the cables, the little opto-coupler board and some decorations/mounting tiles/plates. Optionally some LEGO housing may be added, but I didn’t want to do that: Interface attached – the inputs are the CC terminals and one additional 9V connector (left). The 4 outputs (right 9V connectors) go to Interface B’s inputs: Here is the entire gang, from right to left: CC hooked up to a) an opto-coupler based Interface A compatible board inside the b) 9V train speed controller, and c) Interface B with 4 inputs connected to the outputs of CC, again using the new opto-coupler board. The output of the 9V train speed controller is also monitored. And in full operation. Computer control is via @Bliss LEGO Blockly and the Arduino box in front; see this thread for further information! When a CC output is OFF, the reading on Interface B is “1023”. When a CC output is ON + forward (N, E, upper button), the reading is around 30. When ON + reverse (S, W, lower button), the reading is around 120: This very dirty (@Bliss: forgive me!) LEGO Blockly program above illustrates that behavior; the 9V regulator is turned one notch to the right – all 7 power levels are resolved. Note that this only fully works in one direction, either forward or reverse. Any opto-coupler pair resolves both directions at the +/-9V level - and this is what CC does, but they don’t entirely resolve the full reverse voltage range, as there remains some overlap. Nevertheless, “0” + 7 power levels are resolved for each direction. That’s it – now @amine may use CC as input pad for CL . All the best Thorsten Edited June 12 by Toastie Quote
Toastie Posted June 13 Author Posted June 13 Dear All + @Bliss + @amine this is so >absolutely awesome<. I need to make a video, but time is relative :D Control Center is connected to LEGO Blockly using an Arduino/HC05 Bluetooth (BT) combo, running @Bliss code. Interface B is connected to LEGO Blockly using another HC05 BT channel. It is, as if both were connected via a COM port. The program below (now with variables ^^ my fault!!!) exemplarily uses two tasks and one main loop. The loop repeatedly changes the outputs of the Control Center (via the Interface A/LEGO Blockly compatible Arduino). My little opto board hooked up to Control Center feeds its output status (+9V, -9V, OFF) to the inputs of Interface B. What happens is that the Arduino changes its outputs, Control Center reacts accordingly, Control Lab recognizes that and changes its outputs, here only B/F as a visual response. Happy blinking - and rock solid. No glitches, even after hours of BT connections! Crazy. I know that there is RCX, CM, PF, LWP3, etc. access through LEGO Blockly as well, but I treat these (PBricks/hubs) as independent, programmable devices, and prefer NQC or RobotC for making them - independent. I am so happy about LEGO Blockly. There is so much more to it: The entire non-blocking approach, @Bliss is implementing - it is so crucial, when programming "machines"! I never ever thought this would be possible. >All< my beloved "stationary" LEGO interfaces (9750, 9751, 8485) now "live" ... act and respond - using one totally cool intuitive graphical software: LEGO Blockly! All the best and have a nice weekend Thorsten Quote
amine Posted June 14 Posted June 14 13 hours ago, Toastie said: Dear All + @Bliss + @amine this is so >absolutely awesome<. I need to make a video, but time is relative :D Control Center is connected to LEGO Blockly using an Arduino/HC05 Bluetooth (BT) combo, running @Bliss code. Interface B is connected to LEGO Blockly using another HC05 BT channel. It is, as if both were connected via a COM port. The program below (now with variables ^^ my fault!!!) exemplarily uses two tasks and one main loop. The loop repeatedly changes the outputs of the Control Center (via the Interface A/LEGO Blockly compatible Arduino). My little opto board hooked up to Control Center feeds its output status (+9V, -9V, OFF) to the inputs of Interface B. What happens is that the Arduino changes its outputs, Control Center reacts accordingly, Control Lab recognizes that and changes its outputs, here only B/F as a visual response. Happy blinking - and rock solid. No glitches, even after hours of BT connections! Crazy. I know that there is RCX, CM, PF, LWP3, etc. access through LEGO Blockly as well, but I treat these (PBricks/hubs) as independent, programmable devices, and prefer NQC or RobotC for making them - independent. I am so happy about LEGO Blockly. There is so much more to it: The entire non-blocking approach, @Bliss is implementing - it is so crucial, when programming "machines"! I never ever thought this would be possible. >All< my beloved "stationary" LEGO interfaces (9750, 9751, 8485) now "live" ... act and respond - using one totally cool intuitive graphical software: LEGO Blockly! All the best and have a nice weekend Thorsten I don't understand very what is blockly, is it basically python code running in the background. Can we make it a standalone application with custom interface ? Well done for the set up, now my guess is that even captain James T Kirk is very jaleaous of your command center.... Quote
Toastie Posted June 15 Author Posted June 15 22 hours ago, amine said: I don't understand very what is blockly, is it basically python code running in the background. Can we make it a standalone application with custom interface ? "LEGO Blockly" is @Bliss full graphical programming environment (clicking blocks together) for interaction with legacy LEGO Interfaces (A/B) and PBricks (CM/RCX/WeDo1/2) as well as PF. In addition, it also speaks the LWP3.0 (or LPF2) protocol and has some blocks ready to go. Blockly: Here is what they say about themselves: "Blockly is a library for visual programming that uses drag-and-drop blocks. It's the engine that powers the most popular coding education programs worldwide." LEGO Blockly runs in either in a Chromium browser (I use Chrome for updates ^^) or as a standalone application (This is my preference). You can easily download the latest version on @Bliss website (https://blissca.github.io/lego-blockly/index.html, just click on "open in app" or use the interface directly within the browser without need of any download. It has really cool features - the entire "non-blocking" blocks (i.e., the program continues to run although timers etc. have been started) are so cool. You require an Arduino (Uno/Nano/Mini Pro ...) or compatible as USB interface from your computer to Interface A as well as for PF. All the serial based PBricks/Interface B connect "directly" via Serial2USB adapters. Since I don't want to trap over many cables for my 3 Interface A/1 Interface B plus my pimped Control Center Interface, I use serial to BT or TTL to BT ("HC05") adapters - works like a charm. The software for the Arduino is available here: https://github.com/BlissCA/lego-blockly/tree/main/SketchArduino At least this is my understanding and how I use LEGO Blockly - @Bliss may want to correct me if I am wrong. Best regards Thorsten Quote
Bliss Posted June 16 Posted June 16 (edited) On 6/13/2026 at 4:32 PM, Toastie said: I know that there is RCX, CM, PF, LWP3, etc. access through LEGO Blockly as well, but I treat these (PBricks/hubs) as independent, programmable devices, and prefer NQC or RobotC for making them - independent. This is not 100% accurate. Yes RCX, CM are independant microcontroller and I would call them Smart Brick. But PF, WeDo1, WeDo2, LPF2 (Lego Power Function 2 = Boost, Technic Hub, Lego Hub, Lego Control Hub (Remote controlled car like the porsche with head and tail lights)) are not smart bricks. They are brainless bricks. So the brain, the program, must run on a PC, Phone, Tablet... @Toastie, other than that, your description of Lego Blockly is quite good and complete. The idea behind lego blockly is really to be able to program in one simple interface a mix of older and newer Lego Brainless Electronic Bricks (RCX/CM are exceptions). in addition, I wanted to make an App that does not need any install and would work in many OS (OS X, Linux, Windows). It is a Web App (Chromium) but can run standalone too. In addition to all protocol listed by @Toastie, it also support VLL (Visual Light Link) for Micro Scout and Code Pilot bricks. It is One-Way so it is not to control the Spybotics... Since it is a Web app, the code behind Lego Blockly is in JavaScript. The app is always evolving... Next lego device to be supported will probably be the Lego Dimentions Toy pads and tags somehow... I also have other feateures to add for LPF2 (Technic Hub internal LED, Control Hub lights, etc) Edited June 16 by Bliss Quote
Toastie Posted June 16 Author Posted June 16 8 hours ago, Bliss said: But PF, WeDo1, WeDo2, LPF2 (Lego Power Function 2 = Boost, Technic Hub, Lego Hub, Lego Control Hub (Remote controlled car like the porsche with head and tail lights)) are not smart bricks. They are brainless bricks. Thank you for clarifying (again ^^ - I am slow) PF, WeDo1/2, and Boost are for sure brain-dead, but didn't the PyBricks people give the other LPF2 hubs a brain? Once a PyBricks generated program was running on the hub (City, Technic, etc.) the computer can be disconnected and the hub runs the program independently? I never tried PyBricks, but this is how I understand their website information. May be wrong as well! Thank you again and all the best Thorsten Quote
Bliss Posted June 16 Posted June 16 (edited) 7 hours ago, Toastie said: but didn't the PyBricks people give the other LPF2 hubs a brain? Well, I just learned something today again... It appears indeed that the default firmware can be changed and PyBricks can make these hubs autonomous which is really great. But, out of the box, these hubs are not autonomous and the LPF2 protocol is available and we can use them in Lego Blockly as is. Thanks again for pointing this out. Edited June 16 by Bliss Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.