All teams in the 2017-2018 Biomaker Challenge were provided with a starter kit, based on the Arduino platform for physical computing. We have chose Arduino-based hardware (www.arduino.cc) as our starting point. The Arduino community has established open standards and rich ecosystem of resources for simple microcontrollers, first established to simplify programming and physical computing for designers and artists. Arduino circuit boards can be plugged into the USB port of any laptop, and a simple cross-platform programming environment used to program the board. A program is simply loaded to non-volatile memory on the Arduino board, which will execute this program loop whenever the board is powered on - behaving as a dedicated appliance or instrument. Arduino boards include many input/output ports, and are intended to interface with sensors and actuators. The Arduino system provides a simple environment for learning programming and hardware skills, and developing real-world laboratory tools for biologists. Further, the Biomarker Challenge provides a direct route for other scientists and engineers to get hands-on experience with biological systems.
We have assembled a £250 Starter Kit for each team that will allow even inexperienced individuals to develop skills, and provide a platform for exploring more challenging applications. The kit included:
1. Giant prototyping board for ArduinoThe Gtronics Proto Shield Plus allows you to plug in Arduino boards, and to integrate these with custom shields and components on a large plug board - minimising tangled hook-up wires. On-board push buttons and a LCD are provided to facilitate debugging of program flow and to interrogate hardware during testing.
The Protoshield Plus has a number of attractive features:
- The Gtronics Protoshield Plus works with a wide variety of ARDUINO / GENUINO boards: UNO, LEONARDO, YÚN, NANO, MICRO and MINI.
- It has a LCD 1602 display module with I2C PCF8574 I/O expander provided on-board (drive LCD with just 2 pins);
- 5 pushbuttons and a reset button are provided on-board;
- 2 solderless bread-boarding areas 740 contact points each (total 1480 points);More than 400 soldering pads for additional prototyping parts;IN / OUT / POWER pins duplicated near the bread-boarding area for easy connection;
- 2 Output LEDs and 1 potentiometer with knob provided on-boardWired sockets for a servo connection, an external 7-9VDC power supply, and additional ICSP connector to use NANO and MICRO with standard shields, and additional holes let you to create shields with standard 2.54mm breadboards.
A comprehensive manual for the board can be found on the Gtronics website.(http://www.gtronics.net/images/downloads/APSP/APSP_User_Manual_eng_3.pdf).
We are adopting XOD as a simple platform for programming Arduino-based hardware. XOD is an open source platform that allows the graphical layout and assembly of software through connection of a series of nodes. XOD allows a hierarchical and dataflow driven approach, avoids the complexities of text management and syntax, and can be used to directly programme Arduino boards. We use XOD for our training programmes.
The software can be downloaded from:(https://xod.io)
The ARDX Kit for Arduino is a great learning resource with components to build 13 different projects. The kit includes an Arduino UNO boards, and provides a manual with instructions arranged as a series of lessons. These provide a simple way of learning how to wire electronic circuits and programming the Arduino microcontroller. For example, the kit comes complete with a set of paper circuit templates that you lay over the breadboard and push the components through - to remove the worry of wiring the project incorrectly. No experience necessary!
The ARDX manual can be downloaded from here.(http://www.seeedstudio.com/document/pdf/ARDX-02-WO-EG-SEEE-WEB.pdf)Further technical information about the kit can be found here.(https://www.seeedstudio.com/ARDX-The-starter-kit-for-Arduino-p-1153.html)
Grove is a modular electronics platform for Arduino-based quick prototyping that does not involve soldering. Simply plug the Grove modules into the Grove shield and leverage the example code provided for each Grove module. Grove is a modular, ready-to-use tool set. Much like Lego, it takes a building block approach to assembling electronics. The Grove Starter Kit contains 10 of the most popular Grove modules and an Arduino shield with Grove connectors.
Technical information, including code, can be found here.(http://wiki.seeed.cc/Grove_Starter_Kit_v3/)
This contains basic components to build 7 different projects, and include an additional small circuit breadboard and more hook-up wire.
The kit is provided by SeeedStudios, and technical information can be found here.(http://wiki.seeed.cc/Sidekick_Basic_Kit_for_Arduino_V2/).
The Biomaker Starter Kit will contain a 4D Systems 3.2" gen4 touch-responsive programmable display from 4D Systems (with memory card, Arduino interface and programmer), with information about programming environments. An Arduino library for direct serial communication with the display is available - along with more sophisticated Workshop4 development tools, including ViSi-Genie, a graphical programming tool that allows simple access to a wide range of display widgets like gauges, switches, sliders, readouts, etc., for creating customised interfaces for Arduino-based instruments. The programmable displays can be easily adapted for Raspberry Pi board computers.
Product page for 3.2" gen4 touch-responsive programmable display can be found here.(http://www.4dsystems.com.au/product/gen4_uLCD_32D/)Information, including downloads for the 4D Systems Workshop4 development software for programming the displays can found here. Includes sophisticated widget-based design of custom interfaces.(http://www.4dsystems.com.au/product/4D_Workshop_4_IDE)
In order to develop 2018 tutorial sessions for the use of the XOD graphical programming environment, and control of Arduino-driven hardware - we explored the use of multifunction shields to simplify the training session - to minimise fiddly and error-prone wiring during the sessions. The use of these shields can introduce clashes between their devices and elements on the Protoshield Plus. Details of the ports used by the Protoshield Plus and various multifunction shields are shown below.
The Gtronics Protoshield Plus board provides a very flexible platform for prototyping new circuits. It includes a number of components that connect to digital and analogue ports on any Arduino board that is plugged into the Protoshield Plus. In order to use the Protoshield Plus with third party shields loaded with additional components, it can be necessary to unplug or rewire components to avoid post clashes. The table below shows the ports used on the Protoshield Plus - along with a comparison of ports used by a number of multifunction shields.
Each shield bears a range of components accessing a variety of Arduino ports (listed above). Some of these clash with ports already used on the Protoshield Plus. Happily, it is simple to rewire the ports. We suggest making the following changes to the default settings of the board.
The Protoshield Plus manual is excellent, and provides the instructions for cutting traces to allow rewiring of port connections.
We suggest disconnecting the push button array from port A0, disconnecting the green and red LEDs from ports D11 and D12, and disconnecting the potentiometer (variable resistor) from port A1. PCB pins can be soldered to pads next to the cut traces. This allows the components to be connected to new ports using leads with female-male connectors - to avoid clashes with operation of ports on attached shields.
The default settings for the Protoshield Plus allow the use of the LCD display with an Arduino UNO compatible board as an I2C device on port 0x20 (decimal 32). The LCD display works well with the XOD/common-hardware node "text-lcd-16x2-i2c"
Components:Protoshield Plus: http://www.gtronics.net/en/products/arduino-proto-shield-plusAvailable directly from Gtronics or via their Amazon storefrontGtronics Facebook site with useful technical guides: https://www.facebook.com/ProtoShieldPlus/
UNO-compatible Arduino board: https://www.orangepipboards.comAvailable from: https://www.rapidonline.com/orangepip-kona328-arduino-uno-compatible-development-board-75-0550
Keyestudio Multipurpose Shield V1: http://www.keyestudio.com/shop/shield/keyestudio-multi-purpose-shield-v1.htmlMore technical details at: http://wiki.keyestudio.com/index.php/Ks0183_keyestudio_Multi-purpose_Shield_V1
Keyestudio Multi-Function shield V2: http://www.keyestudio.com/shop/shield/keyestudio-multi-purpose-shield-v2.htmlMore technical details at: http://wiki.keyestudio.com/index.php/Ks0184_keyestudio_Multi-purpose_Shield_V2
HAILANGNIAO Multi-Function shield V2: https://www.aliexpress.com/item/Multifunctional-expansion-board-kit-based-learning-for-UNO-r3-LENARDO-mega-2560-Shield/32845170467.html
Open-Smart RTC shield: https://www.aliexpress.com/item/For-Arduino-Expansion-Board-Clock-Shield-Wire-Digital-Module-SCM-Experiment-Original-Product-Blue-Black/1771823374.html
A series of video tutorials for Arduino programming can be found here.(https://www.youtube.com/playlist?list=PLA567CE235D39FA84)
Download code for 2018 tutorials1:Introduction to Arduino and XOD: Click left to download a libary of patches that support the first tutorial session with the Biomaker hardware package.Ver 0.2 Available 23rd June 2018 (with modifications by Marco Aita)
Download tutorial one software
2:Interfacing devices: Click left to download a library of patches and nodes that support the second tutorial session with the Biomaker hardware package.
Download tutorial two software
3:Advanced sensors and timing: Click left to download a set of XOD (.xodball) files that contain demos for Marco Aita's traffic light, buzzer, real-time clock and 7-segment LED display exercises.
Download tutorial three software
Marco Aita has also produced a library of useful code for Session Three that can be downloaded directly into the XOD desktop IDE environment, and used to extend the tutorial code and use of hardware. XOD libraries can be found at: https://xod.io/libs/, and Marco's library is labelled: "marcoaita/malibrary - A library of code used for training on XOD at www.biomaker.org"
4: Integrating sensors and actuators: robotics: Click left to download a library of XOD code for experimenting with the mBot robot, including motor control and PID regulated sensor responses.
Download tutorial four software
Training Session 1:Introduction to hardware
In this first session teams will be introduced to Arduino microcontroller boards. The boards contain a microprocessor with embedded interface circuits, including non-volatile memory. The devices can be powered directly from a USB port, which also allows software running on a laptop to be compiled and then dumped as a single programme (or "sketch") into the microcontroller memory. This is a very simple form of computer, with only one programme and no operating system. For biologists, the process of dumping code into the microcontroller is not so far from the process of constructing a DNA circuit and dumping this into a cell.
Participants in the Biomaker Challenge will be given an UNO Arduino board, and a Gtronics Proto Shield Plus chassis as part of their Starter Kit. The latter allows mounting of the Arduino board and shield (see below), and provides a 2x16 character LCD display, control switches and a plug board for prototyping new circuits. We wish to keep the training sessions open for all interested - and we can loan hardware to folk who are not already Biomakers. In addition, the hardware is relatively inexpensive and is readily available for purchase online.
Background information about Arduino boards can be found online at https://www.arduino.cc
Introduction to XOD
XOD is open source software that can be used to programme the Arduino micro controller board. It uses a graphical interface that represents hardware and computing elements as nodes that can be wired together to allow data flow between the objects. We think that this provides a simple way for non-programmers (i.e. biologists) to develop useful skills and understanding - without needing to deal with the complications of programming languages and syntax.
There are variety of introductory lessons for XOD, available at: https://xod.io/docs/tutorial/- an example is shown right.
Simply install the cross-platform XOD software, assemble and plug in the hardware, and you can get started directly. In addition to these introductory exercises with minimal hardware, we will be running sessions with extended componentry, that we will build on during the training course.
- Installing and running XOD
- Required hardware
- Hello
- Upload to Arduino
- Pins, data, and the Inspector
- Fractional numbers and PWM
- Wiring configuration
- Adding nodes
- Node labels
- Constant nodes
- Input from a potentiometer
- Doing math
- Controlling servos
- Accessing help
- Mapping values
- Adjusting map range
- Buttons
- Logic nodes
- Reading lightness
- Comparing numbers
- If-else branching
- Smoother changes
- Pulses
- Clock
- Pulse counting
- Flip-flop
- Using multiple timelines
- Showing text on LCD
- Displaying sensor values on LCD
- String concatenation
These tutorial exercises can be run outside of the Biomaker training sessions - to give a fuller range of experience with the programming interface and nodes. The required hardware can be found in the Starter Kit.
UNO compatible Arduino board
Gtronics Proto Shield Plus for Arduino prototyping, shield expansion and LCD display
Find more information about XOD at https://xod.io/docs/
Keyestudio Multipurpose shield for Arduino
Building with software
We will provide a software library that provides XOD nodes for components present on the Keyestudio Multipurpose Shield V1 (right) and the LCD display and switches on the ProtoShield Plus (above). The use of these devices means that there is no need to struggle with error-prone wiring of circuits at this introductory stage. We will demonstrate:
(i) How to set up your laptop with the XOD software and connect the hardware. This will also be used as a platform for subsequent training sessions.
(ii) How to use simple devices like switches, variable resistors and LEDs to provide inputs and outputs for software programmes.
(iii) How to write information to the LCD screen for display, and how to toggle between display modes using the embedded array of switches.
(iv) How to read values from a sensor, and display these in real time.
(v) We will finish the session with a small scale programming challenge.
Reference materials
Download the Protoshield Plus manual (PDF, 3.2MB)
Download circuit diagram for Protoshield Plus (PDF, 0.29MB)
Download Arduino UNO and Multipurpose Shield pinouts (PDF, 1 MB)
Training Session 2The piezo buzzer
We will be using the same shield as the first training session (Keyestudio Easy Module Shield V1: see right). This shield contains a passive piezo buzzer that is connected to port D5. Marco Aita has encapsulated the Arduino tone library in a XOD node that can be used to switch on and control the pitch of the buzzer.
The Training Session TWO software will be available as a xodball file that can be downloaded from this site.
Identify the buzzer node, copy into a patch and experiment with the use of inputs from other devices on the shield, such as the variable resistor and photoresistor. The buzzer provides a useful device for audible alarms. Next, we'll wire up a digital sensor.
Keyestudio Multipurpose shield for Arduino
Demo code for control of the passive buzzer c/o Marco Aita.
Digital thermometer
The DS18B20 chip is a digital thermometer that provides 9-bit to 12-bit Celsius temperature measurements (and has an alarm function with nonvolatile user-programmable upper and lower trigger points). You will be provided with a waterproof sealed unit with a 1M lead. The DS18B20 chip is contained in the stainless steel tip, and communicates over a 1-Wire bus that requires only one data line (and ground) for communication with the Arduino. In addition, the DS18B20 can derive power directly from the data line (“parasite power”), eliminating the need for an external power supply. Each DS18B20 has a unique 64-bit serial code, which allows multiple sensors to be placed on the same 1-Wire bus. XOD provides a node in the "common hardware" library that can read single 18DSB20 devices in a circuit.
Download Arduino UNO and Multipurpose Shield pinouts (PDF. 1. MB)
The sensor measures temperatures from -55°C to +125°C with better than ±0.5°C Accuracy from -10°C to +85°C (see graph) - the chip is internally calibrated and returns a digital measurement that can be displayed directly. (For more information, see: https://create.arduino.cc/projecthub/TheGadgetBoy/ds18b20-digital-temperature-sensor-and-arduino-9cc806)
Your challenge is to devise and implement in XOD a temperature alarm system using the Arduino prototyping system, DS18B20 sensor, LCD panel readout and buzzer.
How to wire the DS18B20 sensor to an Arduino. (You will be using a waterproof, encapsulated version with connecting wires: red = 5V. black = GND, yellow = DATA)
Sonar device
XOD contains a node that supports use of an ultrasonic sonar distance sensor, the HC-SR04. For more information about the device, see: (https://components101.com/ultrasonic-sensor-working-pinout-datasheet).
The ultrasonic transmitter emits an sound waves at 40 000 Hz which travel through the air and if there is an object or obstacle on its path It will bounce back to the module. The module also has a receiver that allows measurement of the travel time. Knowing the speed of the sound allows calculation of the distance. The HC-SR04 Ultrasonic Module has 4 pins, Ground, VCC, Trig and Echo. The GND and the VCC pins of the module need to be connected to ground and the 5 volts pins on the Arduino board and the trig and echo pins to any Digital I/O pin on the Arduino Board.
There are two XOD nodes that allow calculation of (i) the travel time of for an acoustic pulse (hc-sr04-ultrasonic-time) and (ii) the range of an object in metres (hc-sr04-ultrasonic-range).
Can you use this code to create a theremin-like device, using different forms of input to control the (potentially) tuneful passive buzzer output device?
Timing in XOD: a traffic light
A traffic light is a good example of a device which does its job sequentially. In its simplest form a traffic light has three states:
- Green — go
- Yellow — stop if you can
- Red — stop!
Each state is active for some time interval and when done everything starts from the beginning and repeats again and again. Doing things sequentially in XOD can appear hard at first sight. It’s a bit harder than in traditional imperative languages, but not so complicated if you would remember the pattern:
- Understand your sequence states
- For each state make a patch node
- On each state patch, use pulse inputs and outputs to enter and exit the state
- Make a joining patch which wires all states together
- Define an entry pulse for the first state
The XOD tutorial at: https://xod.io/docs/guide/simple-traffic-light/demonstrates the creation of a node from an existing patch, and then use of the new node and management of timing in XOD. (Code has been customised by Marco Aita for our hardware).
Multi-function shield II
The next part of the tutorial tutorial will focus on the availability and use of low cost, high precision sensors that can be easily used for scientific purposes. We will also introduce the use of a second multi-function shield that will provide some useful features for the use of sensors. The shield contains:
- 4 digit 7-segment LED display module (3641BH) driven by two serial 74HC595’s (Pin Latch 4, Clock 7, Data 8)
- 4 Red LEDs (Pin 10, 11, 12, 13) [D1-13, D2-12, D3-11, D4-10]
- 10K potentiometer (Pin A0) [Vr-A0]
- 3 x push buttons (Pin A1, A2, A3) [S1-A1, S2-A2, S3-A3]
- Piezo buzzer (Pin 3 digital ON/OFF) [LS1-3]
- DS18B20 temperature sensor interface (not included) (Pin A4) [U5-18b20-LM35-A4]
- Infrared receiver interface (Pin 2) [U4-IR-2] Compatible to a 1838B Infrared IR receiver
- Bluetooth interface (GND, +5v, 0 = tx, 1 = rx) [APC220]
- Free pins pwm (5, 6, 9, A5) with GND, +5V
- Serial interface header for connection to (optional) serial modules (Bluetooth, wireless interface, voice module, a voice recognition module)
The Hackatronics section of the Cohesive Computing site (http://www.cohesivecomputing.co.uk/hackatronics/) provides an excellent source of information about this shield, along with Arduino IDE code to drive features of the board. Support for XOD, a relatively new platform, is less well developed, but growing rapidly. Our tireless Biomaker support crew have produced custom nodes and patches to help exploit the shield.
Triggering the buzzer
We have compiled a XOD library that contains nodes and patches that you can use to provide audible output. The buzzer on the shield can be triggered to produce timed output of defined frequency (tone). A transistor is used to control the piezo speaker (LS1) - which is activated when the output port D3 is set to zero (Unlike the buzzer on the Multi Purpose shield used in Training Session 1 & 2, there is no need to drive a oscillating signal through LS1, it is set automatically).
LED 7-segment display
The tutorial library for training session TWO also contains support for other components on the shield, including switches 1 (port A1), 2 (port A2) and 3 (port A3); the variable resistor (port A0) and bank of 4 red LEDS (ports D1-D4).
In addition, the shield has a 4 digit 7-segment LED display. The digits are made up of seven individual LED segments, which must be controlled to form particular numbers.
Controlling individual LED segments to display numerical values.
The shield is wired with two 74HC595 shift register chips that each take an 8-bit serial input and decodes this to provide 8 parallel outputs. Suitable serial codes are sent to the circuit to control the display of numbers on the display. Marco Aita has wrangled code that allows the circuit to be used inside the XOD environment (with thanks to Arduino Learning).
Real time clock
I2C Tiny RTC DS1307 Real Time Clock Module AT24C32 Board for Arduino (Battery included)
- Two wire I2C interface
- Hour : Minutes : Seconds AM/PM
- Day Month, Date - Year
- Size: 28x25x10mm
- Leap year compensation
- Accurate calendar up to year 2100
- 1Hz output pin
- 56 Bytes of Non-volatile memory available to user
DS1307 is a low-power real-time clock chip with 56 bytes of non-volatile RAM, full BCD code clock and calendar. The address and data will be transmitted via a two-wire bidirectional serial bus, and the chip can provide information such as seconds, minutes, hours, etc., and the number of days in each month can be automatically adjusted. Besides, there is a compensation function for leap year. AM / PM flag is to determine whether the clock operates in 24-hour or 12-hour mode, and there is a built-in power-sense circuit in the chip with powering down detecting and battery switching functions.
DS18B20 temperature sensor
The new shield provides support for the DS18B20 digital thermometer chip. Note that Jumper one (J1) must be added to allow the sensor to work.
DS18B20 digital temperature sensor adopts single-bus technology, which can effectively reduce external interference and improve the measurement accuracy. Meanwhile, it can convert the measured temperature directly into a serial digital signal for computer to process. With simple interface, it makes data transmission and processing much easier.
Additional I2C sensors
1-Wire and I2C are true shared-bus protocols - you can have 100+ components all talking at once using the same 2 wires (for I2C) or a single for 1-Wire. I2C (Inter-Integrated Circuit) is a faster and more open standard, and many sophisticated (and often cheap) digital devices are available for connection.
List of I2C devices and addressescompiled by Adafruit
XOD provides a series of I2C primitives that can be combined to create custom patches and nodes.
Download software library
The starter code for Tutorial Session Three can be downloaded. Marco Aita has compiled a series of patches and nodes for this training session, which can be obtained from the download page
Connecting the GND (black), A4 data (yellow) and VCC 5V (red) wires of the DS18B20 device to the multi function shield.
Reference materials
Circuit diagram for the Multi-function shield II board (1 page PDF, 24KB)
Data sheet for DS18B20 1-wire digital thermometer (22 page PDF, 262 KB)
Link to Hackatronics descriptionof the multi-function shield with the Arduino IDE and libraries (30 page PDF, 383 KB)
Comments