element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
CodeBug
  • Learn
  • Learning Center
  • STEM Academy
  • CodeBug
  • More
  • Cancel
CodeBug
Blog QuizBug, a CodeBug IoT educational project making-of
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join CodeBug to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: balearicdynamics
  • Date Created: 4 Oct 2015 12:38 PM Date Created
  • Views 3755 views
  • Likes 11 likes
  • Comments 25 comments
  • educational
  • codebug_sound
  • codebug
  • drobott_com
  • sound_effect
  • buzzer
  • codebug_advanced
  • drobott
  • quizbug
  • hardware_kit
  • iot
  • making_of
  • tindie
  • codebug_software
Related
Recommended

QuizBug, a CodeBug IoT educational project making-of

balearicdynamics
balearicdynamics
4 Oct 2015

A CodeBug Interactive Things project

 

Introduction

The first thoughts when the CodeBug board arrived on the market - and few time before reading the first reviews and technical tweets - was about how to create educational things (or, better, IoT) primarily targeted to newbies, joung enthusiasts, childs and students. The surrounding idea was to develop things moved by the CodeBug board. I mean objects for interaction, empowered by electronics involving making, programming, learning, hacking and customisation. This is how the idea of the CodeBug interactive things project was born.

image

The making-of shown below, the creation project to be clear, is the first one following in my opinion most of these line guides. I am almost against closed projects, especially if remaining open these can be source of inspiration to others.

So there is the product (and the assembly hacking kit) on the Drobott shop, and the self-hacking explanation in this article, with many thanks to the CodeBug provided by Element14 (if someone of you decides to buy one of them, don't forget to apply the Element14 discount code W0E49MYQ for a 10% off).

 

How it works

The proof of concept is almost simple: the CodeBug board controls a questions support board inclduing a 7x14 cm paper sheet. The sheet is expected showing a question with 5 possible options; one (or more) correct answers and the other wrong.

 

Thanks to the sensitive features of the CodeBug legs, no further accessory should be used: the user should touch with a finger the top-right conductive corner and one of the five possible answers with another. The answer response is shown on the CodeBug 5x5 LED display (a scrolling text) and the attached buzzer plays a wrong or correct sound effect.

 

Depending on how the back of the questions support board connectors are wired, it is possible configure one or more answers as correct and one or more answers as wrong, accordingly to the question image. The following image shows an example of single correct answer with three different types of questions.

image

Creating the Questions Support Board

The Questions Support Board Is machined with a 5 mm super-compact plastic foam creating the spaces for the question paper sheet and the conductive areas. The conductive areas are obtained by adhesive soldering copper belts 2 cm wide; the front area (visible) of the copper is used to "touch" the answers while the back side of the belt (hidden to the user) are wired together depending on the kind of options that should be correct and wrong.image

 

The images below shows the assembly phase of a question support board with contacts and back soldered wires.

imageimage

imageimage

The resulting board has a size of 10x15 cm with a question image area of 7x14 cm.

image

Connecting to the CodeBug

When the boards are created the first three top-left contacts should be legged to the CodeBug respectively from left to the right with Leg 1, GND and Leg 3, accordingly with the program that responds with a correct answer on Leg 1 and wrong answer on Leg 3.

image

For a more impacting effect when the user touch on of the answers some sound effects has been generated bit-banging a buzzer (or a very small speaker). In this case the 5V leg of the CodeBug should be connected to the positive wire of the buzzer while the negative is connected to the Leg 0.

image

The following video shows the QuizBug at work.

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

The software

The QuizBug software can be remixed on the CodeBug site and modified as well or used as-is. The commented images below analyses in detail the different blocks of code.

image

Most of the variable used in the program are declared on top. This makes a simple job any further change for a different reactivity or behavior of the program without the need to change the instructions. The variable ResponseString is defined initially with a dummy content (it is never used) to optimize the response speed; only the variable content is changed instead of using two different sprites.

Changing the values of low and speed different sound effects can be generated by the buzzer.

 

The program wait until a button (A or B) is pressed then after the variables definition starts an infinite loop. The different activities are controlled by flags that decides what conditions are verified according with the user interaction.

image

Every time the user press the button A the OnOffStatus changes. When it is true, a new answer can be tried else the program waits until the user does not start it.

image

Thanks to set the variables of the program on top, when the leg status (corresponding to the answer) is checked, only some flags and variables should be changed; Accordingly with the leg the ResponseString content is set to correct or wrong (instead of designing two different sprites). The value of Raise (+1 or -1) is set to change the direction of the sound effect, growing for the correct answer and falling for the wrong answer. The flag AnswerStatus is normally set to false when the program is waiting for the user interactions. When a choice is detected, it is set to true for the answer response animation.

image

If AnswerStatus is true, the user has pressed one of the possible answers and two separate events are executed in sequence: the sound effect generation and the scrolling text with the answer response. As the variables has already been set before, only one action should be executed valid for both the conditions of the program.

Attachments:
imageQuestionary-Template A4.pdf
  • Sign in to reply

Top Comments

  • DAB
    DAB over 9 years ago +2
    Nice project. It is amazing what you can do with simple devices and a little imagination. DAB
  • Former Member
    Former Member over 9 years ago in reply to balearicdynamics +2
    I agree, I would definitely like to see the memory/codespace usage! Im away from home for a few days tomorrow but when I get back Im going to look into the python interface. It offers a little more control…
  • mcb1
    mcb1 over 9 years ago +2
    Nice work. When you first suggested it, I was a little puzzled how it would turn out. This is very clever and has some interesting options. Mark
Parents
  • qrv@kd4e.com
    qrv@kd4e.com over 9 years ago

    Will this work with the OrangePi knock-off device?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • qrv@kd4e.com
    qrv@kd4e.com over 9 years ago

    Will this work with the OrangePi knock-off device?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • balearicdynamics
    balearicdynamics over 9 years ago in reply to qrv@kd4e.com

    Hello David,

     

    please can you explain what do you mean? Thanks.

     

    Enrico

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • qrv@kd4e.com
    qrv@kd4e.com over 9 years ago in reply to balearicdynamics

    The OrangePi is similar to the RasPi but $15. vs $35. - making it more affordable for experiments ... I don't know about pin & feature compatibility to match the CodeBug device.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 9 years ago in reply to qrv@kd4e.com

    Possibly this old advert conveys the idea:

    image

    Linux is Linux, and provided that standards-based interfaces are used, and source code is available, then it should work on any computer with those interfaces running Linux - even (say) BeagleBone Black which has a completely different connector.

    Some pin-rewiring with jumper wires between the connectors would solve any interface mismatch since the codebug connector layout has no standard and is matched to plug into the Raspberry Pi.

    However, it really depends on what interfaces are used (I believe SPI and I2C are available on the connector, and SPI and I2C are standards-based interfaces) and if source code is available and if people are willing to take the time to inspect and recompile it if needed (not always needed), or write their own code.

    Often people are not willing to invest time to examine the pinouts and the code, hence often the reason people stick with what is known to work, until someone tries something else and reports their success.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • balearicdynamics
    balearicdynamics over 9 years ago in reply to qrv@kd4e.com

    Ahh ! Thank you. It is the first time I hear of this. Maybe the worth to make a try as the price. But has similar characteristics ? Or slower etc ? Clone or poor cousin ?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Former Member
    Former Member over 9 years ago in reply to shabaz

    I've only had a quick glance at the Codebug Python Library - for the most part it's compatible with anything that has a Python interpreter. It does use a standard Raspberry Pi GPIO library to set up the i2c ports, should be a 5 minute tweak for any device that you are familiar with.

     

    The Codebug Library just sends and recieves data over the i2c bus, I didnt see a compiled pyc file so it's al laid bare in plain old Python script, if anybody was enthusiastic enough they could easily sift out the i2c instructions and use any other language on any other platform (with or without i2c if you bit bang the bug) to send them.

     

    Once this last program is finished in Blockly, Codebug is playing in the snakes nest so expect some Python related posts soon! And yes.. it is likely to be my last program in Blockly; I just don't hate myself enough to prolong using it.image

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube