Logic Gate Learning Kit - designed with code! - Page 1
Forum section: electronics / general

author: Timot
author_rank: Newbie
timestamp: January 28, 2024, 05:19:40 pm
content: Hey Everyone,I've been working on a learning kit so the younger generation can learn about logic gates. But there is a catch..! Instead of using schematics, the project is written with the atopile compiler, which lets you describe electronics with code. That means it's super easy to version control your project using git! The repository for the project is here:https://github.com/Timot05/logic-card/You can find the code at elec/src/logic-card.atoI've also made a video about the update I'm planning to make here:The first version of the project is working decently well, but it's slightly hard to assemble the cards on the device, which is especially an issue with kids. So instead of using pin headers and datums, the next revision will use pogo pins and a sliding mechanism to keep the cards in place.I'll continue updating this thread as I make progress on it.Let me know what you think!Tim

author: Zero999
author_rank: Super Contributor
timestamp: January 28, 2024, 05:31:59 pm
content: Do you really need an electrical connection between the MCU board and the card?There are several other ways to do this.RFIDCapacitive sensorsMagnetsOpticallyI'm not interested in the compiler. One of the reasons why I chose electronics was because I did programming as part of computing A-level and found it boring. I still accept I occasionally need to do it now, but fortunately not very often.

author: Timot
author_rank: Newbie
timestamp: January 28, 2024, 05:39:14 pm
content: Yeah, I did think of using capacitive sensing. Some stm32 micros seem to support it:https://wiki.st.com/stm32mcu/wiki/Introduction_to_touch_sensing_with_STM32I might switch to optical sensing but it was also convenient to have the pogo pins push the card upwards and lock it in place. Though I could have the spring to keep the card in place in the enclosure itself.For the compiler, it's definitely a big switch from schematics. But fundamentally, it still works roughly the same (making connections between functional blocks) except that it gives you more options if you want to reuse or add parameters to your design.

author: Zero999
author_rank: Super Contributor
timestamp: January 29, 2024, 04:57:45 pm
content: If you're going to use connectors, then all you need are two DPDT momentary switches, the LED and a resistor. The switches can be configured as NOT, AND, NAND, OR NOR, EXOR etc. just by changing the links to the connector on the plug-in board. No MCU or programming to worry about.

author: Timot
author_rank: Newbie
timestamp: January 29, 2024, 05:10:56 pm
content: How would I get XOR?The benefits I could see with the MCU:- If someone is interested, they can change the firmware and learn about it while they do- Reduce the number of pogo pin (or optical sensors) to a minimum. For example with 3pin + vcc I could get 2^3 possibilities, so 8 potential cardsVery curious about your implementation though. I think I could see how it works if I add one pogo pin per card and some ICs for each logic that we would want to achieve.

author: Zero999
author_rank: Super Contributor
timestamp: January 29, 2024, 08:20:13 pm
content: Here's how to make an XOR gate using just two SPDT push-button switches.

author: Timot
author_rank: Newbie
timestamp: January 29, 2024, 10:33:34 pm
content: Oh good one thanks! Definitely a good option for a cheap version of the kit.I'd have to miss out on the RGB led which is unfortunate. I was also hoping to add different flavors of latches.

author: Zero999
author_rank: Super Contributor
timestamp: January 29, 2024, 11:17:01 pm
content: Why do you need an RGB LED? All a logic gate does it turn it on and off, right?The '4007 can also be used to implement many different logic functions, including some latches.https://assets.nexperia.com/documents/data-sheet/HEF4007UB.pdfhttps://www.ti.com/lit/ds/symlink/cd4007ub.pdfhttps://wiki.analog.com/university/courses/electronics/electronics-lab-28Another option is to use a quad NAND, such as the 74HC00 and NAND logic.https://en.wikipedia.org/wiki/NAND_logic

author: Timot
author_rank: Newbie
timestamp: January 31, 2024, 01:57:46 am
content: Thanks for pulling up the datasheets! Those could definitely make for a good cheap version of the project.The RGB LED is mostly there for esthetics. The goal is to match the color of the coverlay depending on which card is installed. Makes it a tad more entertaining I think

author: tggzzz
author_rank: Super Contributor
timestamp: January 31, 2024, 12:42:33 pm
content: Quote from: Zero999 on January 29, 2024, 08:20:13 pmCommonly seen in most two-floor houses with a stairway: one switch at the top of the stairs, one at the bottom.Next task: how to do the same with a three-floor house?

author: tggzzz
author_rank: Super Contributor
timestamp: January 31, 2024, 12:47:00 pm
content: Quote from: Timot on January 31, 2024, 01:57:46 amEngineers have to be able to distinguish the essential/necessary parts of a question/task/problem from the unimportant parts - and then to ignore the unimportant parts.Different coloured LEDs will be a good pedagogical technique for instilling those concepts.In a similar vein, Professor Eric Laithwaite at Imperial College used to set exams where one question was easy and sufficient get you a pass mark, one was more challenging and couuld get you a good degree, and one could not be answered adequately in the time available.He expected his undergraduate engineers to be able to determine which questions to avoid. If they couldn't, they wouldn't make good engineers anyway. I doubt he would be allowed to do that now, more's the pity. Arguably that applies to the whole concept of the project: the computer is an unnecessary complication. Zero999's point about using switches and LEDs is very valid, IMHO. I'll change my mind if I can understand how a computer enhances learning the logic comcepts.

author: Zero999
author_rank: Super Contributor
timestamp: January 31, 2024, 02:18:08 pm
content: I don't see why you can't use an RGB LED with switches, or a simple logic gate.The connector on the card could connect the LEDs in different combinations to give 7 different colours. More can be achieved by adding a resistor to the card, to reduce the brightness of one or more of the LEDs, if necessary.

author: tggzzz
author_rank: Super Contributor
timestamp: January 31, 2024, 04:22:41 pm
content: Quote from: Zero999 on January 31, 2024, 02:18:08 pmYou can, of course.Hell, I designed and implemented my first computer (6800, TTL, 128B RAM (not kB) using LEDs, switches, resistors and a multimeter.