Author Topic: Logic Gate Learning Kit - designed with code!  (Read 6057 times)

0 Members and 1 Guest are viewing this topic.

Offline TimotTopic starter

  • Newbie
  • Posts: 9
  • Country: ch
Logic Gate Learning Kit - designed with code!
« on: January 28, 2024, 05:19:40 pm »
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.ato

I'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



« Last Edit: January 28, 2024, 05:49:28 pm by Timot »
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19601
  • Country: gb
  • 0999
Re: Logic Gate Learning Kit - designed with code!
« Reply #1 on: January 28, 2024, 05:31:59 pm »
Do you really need an electrical connection between the MCU board and the card?

There are several other ways to do this.

RFID
Capacitive sensors
Magnets
Optically

I'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.
 

Offline TimotTopic starter

  • Newbie
  • Posts: 9
  • Country: ch
Re: Logic Gate Learning Kit - designed with code!
« Reply #2 on: January 28, 2024, 05:39:14 pm »
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_STM32

I 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.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19601
  • Country: gb
  • 0999
Re: Logic Gate Learning Kit - designed with code!
« Reply #3 on: January 29, 2024, 04:57:45 pm »
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.
 

Offline TimotTopic starter

  • Newbie
  • Posts: 9
  • Country: ch
Re: Logic Gate Learning Kit - designed with code!
« Reply #4 on: January 29, 2024, 05:10:56 pm »
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 cards

Very 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.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19601
  • Country: gb
  • 0999
Re: Logic Gate Learning Kit - designed with code!
« Reply #5 on: January 29, 2024, 08:20:13 pm »
Here's how to make an XOR gate using just two SPDT push-button switches.
 

Offline TimotTopic starter

  • Newbie
  • Posts: 9
  • Country: ch
Re: Logic Gate Learning Kit - designed with code!
« Reply #6 on: January 29, 2024, 10:33:34 pm »
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.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19601
  • Country: gb
  • 0999
Re: Logic Gate Learning Kit - designed with code!
« Reply #7 on: January 29, 2024, 11:17:01 pm »
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.pdf
https://www.ti.com/lit/ds/symlink/cd4007ub.pdf
https://wiki.analog.com/university/courses/electronics/electronics-lab-28

Another option is to use a quad NAND, such as the 74HC00 and NAND logic.
https://en.wikipedia.org/wiki/NAND_logic
 

Offline TimotTopic starter

  • Newbie
  • Posts: 9
  • Country: ch
Re: Logic Gate Learning Kit - designed with code!
« Reply #8 on: January 31, 2024, 01:57:46 am »
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 :)
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19724
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Logic Gate Learning Kit - designed with code!
« Reply #9 on: January 31, 2024, 12:42:33 pm »
Here's how to make an XOR gate using just two SPDT push-button switches.
(Attachment Link)

Commonly 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?
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19724
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Logic Gate Learning Kit - designed with code!
« Reply #10 on: January 31, 2024, 12:47:00 pm »
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 :)

Engineers 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[1].

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.

[1] 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.
« Last Edit: January 31, 2024, 12:50:18 pm by tggzzz »
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19601
  • Country: gb
  • 0999
Re: Logic Gate Learning Kit - designed with code!
« Reply #11 on: January 31, 2024, 02:18:08 pm »
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.
« Last Edit: January 31, 2024, 02:54:01 pm by Zero999 »
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19724
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Logic Gate Learning Kit - designed with code!
« Reply #12 on: January 31, 2024, 04:22:41 pm »
I don't see why you can't use an RGB LED with switches, or a simple logic gate.

You can, of course.

Hell, I designed and implemented my first computer (6800, TTL, 128B RAM (not kB :)) using LEDs, switches, resistors and a multimeter.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf