Ioannis Tamvakis
Published © MIT

DNA-Dave, the Transcription Translation Robot Educator

DNA-Dave is striving to be the best tool to teach kids molecular biology concepts. The key word is "striving."

IntermediateWork in progressOver 4 days270
DNA-Dave, the Transcription Translation Robot Educator

Things used in this project

Hardware components

BBC micro:bit board
BBC micro:bit board
×1
ElecFreaks octopus:bit
×1
Adafruit neopixel LED dot strand
×1
Alligator Clips
Alligator Clips
×1
Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1

Software apps and online services

MakeCode
Microsoft MakeCode

Story

Read more

Schematics

DNA-Dave_Arduino

fritzing schematic file

DNA-Dave_Arduino_png

schematic png file

Code

miniDave_microbit_DNA_translator

JavaScript
this is Javascript MakeCode code for a microbit connected to a strip of individually addressable LEDs, where you can input and visualise a DNA sequence, then translate it into an amino-acid sequence! Just paste it into the Javascript Window of MakeCode online editor. The AminoAcid color scheme is similar to RasMol amino color scheme, itself similar to Shapely scheme.
function transcribe_and_translate_the_DNA_string () {
    RNA_string = []
    AminoAcid_string = []
    for (let index = 0; index <= DNA_string.length; index++) {
        if (DNA_string[index] == "t") {
            RNA_string.insertAt(index, "u")
        } else {
            RNA_string.insertAt(index, DNA_string[index])
        }
    }
    number_of_triplets = RNA_string.length / 3
    for (let index2 = 0; index2 <= number_of_triplets; index2++) {
        RNA_triplet_position_1 = RNA_string.shift()
        RNA_triplet_position_2 = RNA_string.shift()
        RNA_triplet_position_3 = RNA_string.shift()
        RNA_triplet = "" + RNA_triplet_position_1 + RNA_triplet_position_2 + RNA_triplet_position_3
        AminoAcid = Universal_Genetic_Code_squashed[Universal_Genetic_Code_squashed.indexOf(RNA_triplet) + 1]
        AminoAcid_string.push(AminoAcid)
    }
}
input.onButtonPressed(Button.B, function () {
    if (tilt_state == 1) {
        DNA_string.push("g")
        basic.showLeds(`
            . # # # .
            # . . . .
            # . # # .
            # . . # .
            . # # # .
            `)
    } else {
        DNA_string.push("a")
        basic.showLeds(`
            . # # . .
            # . . # .
            # . . # .
            # # # # .
            # . . # .
            `)
    }
})
input.onButtonPressed(Button.A, function () {
    if (tilt_state == 0) {
        DNA_string.push("t")
        basic.showLeds(`
            # # # # #
            . . # . .
            . . # . .
            . . # . .
            . . # . .
            `)
    } else {
        DNA_string.push("c")
        basic.showLeds(`
            . # # # .
            # . . . .
            # . . . .
            # . . . .
            . # # # .
            `)
    }
})
input.onGesture(Gesture.Shake, function () {
    if (translate_state == 0) {
        translate_state = 1
        strip.clear()
        strip.show()
        basic.showString("Protein")
    } else {
        translate_state = 0
        basic.showString("DNA")
        strip.clear()
        strip.show()
    }
})
input.onGesture(Gesture.TiltRight, function () {
    tilt_state = 1
    basic.showLeds(`
        # # . . .
        # . # # #
        # # # . .
        . . # . #
        . . # # #
        `)
})
input.onButtonPressed(Button.AB, function () {
    DNA_string = []
    basic.showLeds(`
        # . . . #
        . # . # .
        . . # . .
        . # . # .
        # . . . #
        `)
    strip.clear()
})
input.onGesture(Gesture.TiltLeft, function () {
    tilt_state = 0
    basic.showLeds(`
        # # # . .
        . # . # .
        . # # . #
        . . # # #
        . . # . #
        `)
})
let position = 0
let AminoAcid = ""
let RNA_triplet = ""
let RNA_triplet_position_3 = ""
let RNA_triplet_position_2 = ""
let RNA_triplet_position_1 = ""
let number_of_triplets = 0
let RNA_string: string[] = []
let Universal_Genetic_Code_squashed: string[] = []
let AminoAcid_string: string[] = []
let DNA_string: string[] = []
let translate_state = 0
let tilt_state = 0
let strip: neopixel.Strip = null
strip = neopixel.create(DigitalPin.P0, 40, NeoPixelMode.RGB)
tilt_state = 0
translate_state = 0
DNA_string = []
AminoAcid_string = []
basic.showString("DNA!")
Universal_Genetic_Code_squashed = ["uuu", "phe", "uuc", "phe", "uua", "leu", "uug", "leu", "ucu", "ser", "ucc", "ser", "uca", "ser", "ucg", "ser", "uau", "tyr", "uac", "tyr", "uaa", "stop", "uag", "stop", "ugu", "cys", "ugc", "cys", "uga", "stop", "ugg", "trp", "cuu", "leu", "cuc", "leu", "cua", "leu", "cug", "leu", "ccu", "pro", "ccc", "pro", "cca", "pro", "ccg", "pro", "cau", "his", "cac", "his", "caa", "gln", "cag", "gln", "cgu", "arg", "cgc", "arg", "cga", "arg", "cgg", "arg", "auu", "ile", "auc", "ile", "aua", "ile", "aug", "met", "acu", "thr", "acc", "thr", "aca", "thr", "acg", "thr", "aau", "asn", "aac", "asn", "aaa", "lys", "aag", "lys", "agu", "ser", "agc", "ser", "aga", "arg", "agg", "arg", "guu", "val", "guc", "val", "gua", "val", "gug", "val", "gcu", "ala", "gcc", "ala", "gca", "ala", "gcg", "ala", "gau", "asp", "gac", "asp", "gaa", "glu", "gag", "glu", "ggu", "gly", "ggc", "gly", "gga", "gly", "ggg", "gly"]
basic.forever(function () {
    position = -1
    if (translate_state == 0) {
        for (let deoxyribonucleotide of DNA_string) {
            position += 1
            if (deoxyribonucleotide == "a") {
                strip.setPixelColor(position, neopixel.colors(NeoPixelColors.Blue))
            } else if (deoxyribonucleotide == "t") {
                strip.setPixelColor(position, neopixel.colors(NeoPixelColors.Green))
            } else if (deoxyribonucleotide == "c") {
                strip.setPixelColor(position, neopixel.colors(NeoPixelColors.Orange))
            } else if (deoxyribonucleotide == "g") {
                strip.setPixelColor(position, neopixel.colors(NeoPixelColors.Red))
            }
        }
    } else {
        transcribe_and_translate_the_DNA_string()
        for (let AminoAcid2 of AminoAcid_string) {
            position += 1
            if (AminoAcid2 == "ala") {
                strip.setPixelColor(position, neopixel.rgb(10, 10, 10))
            } else if (AminoAcid2 == "arg") {
                strip.setPixelColor(position, neopixel.rgb(40, 10, 235))
            } else if (AminoAcid2 == "asn") {
                strip.setPixelColor(position, neopixel.rgb(0, 150, 255))
            } else if (AminoAcid2 == "asp") {
                strip.setPixelColor(position, neopixel.rgb(255, 0, 0))
            } else if (AminoAcid2 == "cys") {
                strip.setPixelColor(position, neopixel.rgb(255, 200, 0))
            } else if (AminoAcid2 == "glu") {
                strip.setPixelColor(position, neopixel.rgb(230, 10, 10))
            } else if (AminoAcid2 == "gln") {
                strip.setPixelColor(position, neopixel.rgb(0, 255, 150))
            } else if (AminoAcid2 == "gly") {
                strip.setPixelColor(position, neopixel.rgb(235, 235, 235))
            } else if (AminoAcid2 == "his") {
                strip.setPixelColor(position, neopixel.rgb(255, 0, 255))
            } else if (AminoAcid2 == "ile") {
                strip.setPixelColor(position, neopixel.rgb(15, 90, 15))
            } else if (AminoAcid2 == "leu") {
                strip.setPixelColor(position, neopixel.rgb(0, 255, 0))
            } else if (AminoAcid2 == "lys") {
                strip.setPixelColor(position, neopixel.rgb(0, 0, 255))
            } else if (AminoAcid2 == "met") {
                strip.setPixelColor(position, neopixel.rgb(200, 255, 5))
            } else if (AminoAcid2 == "phe") {
                strip.setPixelColor(position, neopixel.rgb(0, 0, 50))
            } else if (AminoAcid2 == "pro") {
                strip.setPixelColor(position, neopixel.rgb(200, 100, 40))
            } else if (AminoAcid2 == "ser") {
                strip.setPixelColor(position, neopixel.rgb(255, 100, 0))
            } else if (AminoAcid2 == "thr") {
                strip.setPixelColor(position, neopixel.rgb(255, 50, 0))
            } else if (AminoAcid2 == "trp") {
                strip.setPixelColor(position, neopixel.rgb(180, 40, 60))
            } else if (AminoAcid2 == "tyr") {
                strip.setPixelColor(position, neopixel.rgb(10, 0, 40))
            } else if (AminoAcid2 == "val") {
                strip.setPixelColor(position, neopixel.rgb(10, 200, 10))
            } else if (AminoAcid2 == "stop") {
                strip.setPixelColor(position, neopixel.colors(NeoPixelColors.Black))
            }
        }
    }
    strip.show()
})

miniDave_microbit_DNA_only_visualiser_simple

JavaScript
This is MakeCode JavaScript code to use with a microbit that is connected to a strip/string of individually addressable LEDs. The user can input a DNA sequence using the microbit and see it in the strip of LEDs! It uses the neopixel extension.
input.onButtonPressed(Button.A, function () {
    if (tilt_state == 0) {
        DNA_string.push("t")
        basic.showLeds(`
            # # # # #
            . . # . .
            . . # . .
            . . # . .
            . . # . .
            `)
    } else {
        DNA_string.push("c")
        basic.showLeds(`
            . # # # .
            # . . . .
            # . . . .
            # . . . .
            . # # # .
            `)
    }
})
input.onButtonPressed(Button.B, function () {
    if (tilt_state == 1) {
        DNA_string.push("g")
        basic.showLeds(`
            . # # # .
            # . . . .
            # . # # .
            # . . # .
            . # # # .
            `)
    } else {
        DNA_string.push("a")
        basic.showLeds(`
            . # # . .
            # . . # .
            # . . # .
            # # # # .
            # . . # .
            `)
    }
})
input.onGesture(Gesture.TiltLeft, function () {
    tilt_state = 0
    basic.showLeds(`
        # # # . .
        . # . # .
        . # # . #
        . . # # #
        . . # . #
        `)
})
input.onGesture(Gesture.TiltRight, function () {
    tilt_state = 1
    basic.showLeds(`
        # # . . .
        # . # # #
        # # # . .
        . . # . #
        . . # # #
        `)
})
input.onButtonPressed(Button.AB, function () {
    DNA_string = []
    basic.showLeds(`
        # . . . #
        . # . # .
        . . # . .
        . # . # .
        # . . . #
        `)
    strip.clear()
})
let position = 0
let DNA_string: string[] = []
let tilt_state = 0
let strip: neopixel.Strip = null
strip = neopixel.create(DigitalPin.P16, 150, NeoPixelMode.RGB)
tilt_state = 0
DNA_string = []
basic.showString("DNA!")
basic.forever(function () {
    position = -1
    for (let deoxyribonucleotide of DNA_string) {
        position += 1
        if (deoxyribonucleotide == "a") {
            strip.setPixelColor(position, neopixel.colors(NeoPixelColors.Red))
        } else if (deoxyribonucleotide == "t") {
            strip.setPixelColor(position, neopixel.colors(NeoPixelColors.Orange))
        } else if (deoxyribonucleotide == "c") {
            strip.setPixelColor(position, neopixel.colors(NeoPixelColors.Blue))
        } else if (deoxyribonucleotide == "g") {
            strip.setPixelColor(position, neopixel.colors(NeoPixelColors.Indigo))
        }
    }
    strip.show()
})

DNA-Dave_Arduino

This is the code that runs on the arduino version of DNA-Dave

Credits

Ioannis Tamvakis

Ioannis Tamvakis

2 projects • 0 followers

Comments

Add projectSign up / LoginAbout BBC micro:bit