Microcontrollers for All: The Shrimp at Wuthering Bytes and So Make It

Jeremy Bennett
shrimp-blink-uart

There is something of a race to make the cheapest possible computer and if the Internet of Things is to succeed, then we need such products. The good thing about many of these boards is that they are readily available to the consumer, and very accessible for the embedded non-specialist, whether a product designer, a teacher or a hobbyist. Raspberry Pi is arguably the best known, but devices such as Arduino, BeagleBone, mbed and the ST Discovery are also very popular.

But these boards have two drawbacks. The first is that, while they can be had for $10 or less, the more user-friendly boards are typically in the$30-50 bracket, and even the humble Arduino is $20+. Fine for a one-off project, but too much if you want to use lots — for example, with a whole class of children —  or on riskier projects where you stand a chance of destroying the board (something I’ll admit to having done myself by confusing the Vcc and Vss pins when wiring up an H-bridge.)

Secondly these boards are often very packaged, which in an educational context matters. You really want students to understand how the bits fit together — only then will they truly understand how these things work.

This is important to Embecosm, since there are not enough good engineers for us to hire, and we need all the tools we can get to excite and inspire young people, so that they will consider careers in engineering. This needs to be done through hands-on workshops using raw materials, and at a price where mass adoption is achievable.

The Shrimp

Which brings me to the Shrimp. This is an Arduino Uno stripped to its bare bones and built on a breadboard. It comprises an ATmega328 with just an oscillator and a reset circuit.

minimal-shrimp-no-uart-circuit

The ATMega128 must be pre-programmed with a simple bootloader, so that programs can be downloaded over a simple UART connection.  This is something that can be done in advance, using either a commercial programmer, or another Shrimp or Arduino configured as an ISP. There are plenty of tutorials online which explain how to do this.

Users sometimes wonder why the UART DTR pin is needed. This is used to drive RESET low, after which for a short period of time the bootloader will look for activity on the Tx line. If activity is found, it will attempt to download a new program and save this to flash, and otherwise it just runs the program it already has stored. The Arduino IDE takes care of forcing reset via DTR prior to uploading a compiled program.

Once a program is downloaded the UART connections are not needed, it is sufficient to simply supply 3-5 volts to Vcc, and the UART adapter can be reused for other projects.

The workshops

shrimp-blink-batteryEmbecosm ran a workshop at Wuthering Bytes in Hebden Bridge last weekend to introduce beginners to the Shrimp. There were a range of workshops available, with 24 people taking up the Shrimp workshop. We had them first build a Shrimp, use it to flash a LED by driving pin D13, then extend it to drive 8 LEDs so it could be used as a persistence of vision system. All the materials for this workshop— presentation, Fritzing diagrams, images— can be found on GitHub. We had a range of participants, including a number of children (youngest nine) and two teachers, nearly all of whom got through the project, even though many had never built a circuit before.

I then was able to be a student myself attending the Shrimp workshop at So Make It in Southampton last week, which was a much smaller group and most with some electronics or computing experience. This gave me time to explore my own ideas, and I was very pleased to be able to wire up a simple H-bridge and use it to drive a model car motor under control of the Shrimp. I’ll be posting more about this in the future.

So what have we learned

It is quite clear that most beginners, particularly younger children, do not really understand how the Shrimp works; they build by looking at pictures and copying. But there is immense satisfaction in getting something to work, and then using the Arduino IDE to change the period or frequency of a blinking LED is something they can understand and it allows them to take ownership of the design.

However, there is a consequence, which is that the tutorial material must exactly match what the student is expecting. While the experienced user knows the color of the wire doesn’t matter, the beginner can be easily thrown if a diagram shows a blue wire, and his or her kit comes with a green wire instead.

We also found that using the minimal Shrimp design is essential. There is a more complicated “protected” version of the shrimp, which puts capacitors across the power supply and uses a diode to protect the reset pin against sudden surges (which can put the ATmega into a completely different programming state). But these require more components, and the only way to fit them on a mini-breadboard is to force multiple wires into a single hole, which is difficult. The protections are valid, but are not really needed for a simple design operated from USB or batteries — the ATmega168 is a pretty robust part. Far better to use the minimal design and risk losing the odd chip.

Finally, while the Shrimp fully achieves the goal of exposing the detail of computer design, it only partially achieves the low cost goal as this requires volume purchase.

The resistors, capacitors, microcontroller and xtal come to $3 or so. The USB UART used for programming can be shared among projects, and one that uses cheaper silicon can be had for as little as $2.50. However, the breadboard, battery pack, batteries and jumper wires all add to the cost, with cheap breadboards in particular being harder to find unless you source them in large quantities from China. So to equip someone with everything they need to get started can cost $15-20. Even subsequent projects will probably cost over $10, because they need another breadboard, battery pack and jumper wires.

The future

Shrimping on a breadboard is a great way to get started with building your own computer. But once you have made your first, making lots for future projects can get a bit tedious. The interesting part quickly becomes using the Shrimp as the basis for other projects.  So Embecosm is working on a PCB version of the core Shrimp design — essentially a bare bones Arduino compatible.

This board will use a separate UART programmer (since that component can be reused), allow all the components for a minimal or protected shrimp to be soldered on, and export the I/O pins to solder points. You’ll be able to solder up the very simplest designs using a few spare pads we’ll provide, or for more complex projects either solder in pins or use wires to connect to a separate breadboard. More news here, when that board is ready!

signature-jeremy-blog

2 Responses to “Microcontrollers for All: The Shrimp at Wuthering Bytes and So Make It”

  1. Philipp

    Is there a way not to use dtr pin for uploading a program?
    (I bought this converter http://www.conrad.de/ce/de/product/197326/Conrad-Mini-USB-zu-UART-Konverter?ref=searchDetail and it has no dtr connector… It just has TTL Driver input…
    No clue what that is.)

    Could it be dtr?

    Reply
    • Jeremy Bennett

      Hi Philipp,

      My German is not too good, so I found the user guide hard to read. The DTR pin is driven low by the Arduino IDE to trigger a reset on the ATMega328. On reset, the bootloader program installed on the ATMega328 monitors pins 2 & 3 (the UART RX/TX), and if there is activity it starts downloading a new program from them. Otherwise it jumps to the start of whatever program it already had downloaded. So you need some way to trigger a reset in order to be able to download programs.

      For this converter, you would need to modify the Arduino IDE to drive the TTL Driver pin low instead. I don’t know how to do this, but it is open source, so you could look at the code and see. I would imagine if you asked on one of the Arduino user groups someone would be able to point you in the right direction.

      HTH,

      Jeremy

      Reply

Leave a Reply