HackerBox 0026: BioSense

Published

Introduction: HackerBox 0026: BioSense

BioSense - This month, HackerBox Hackers are exploring operational amplifier circuits for measuring physiological signals of the human heart, brain, and skeletal muscles. This Instructable contains information for working with HackerBox #0026, which you can pick up here while supplies last. Also, if you would like to receive a HackerBox like this right in your mailbox each month, please subscribe at HackerBoxes.com and join the revolution!

Topics and Learning Objectives for HackerBox 0026:

  • Understand theory and applications of op-amp circuits
  • Use instrumentation amplifiers to measure tiny signals
  • Assemble the exclusive HackerBoxes BioSense Board
  • Instrument a human subject for ECG and EEG
  • Record signals associated with human skeletal muscles
  • Design electrically safe human interface circuits
  • Visualize analog signals over USB or via OLED display

HackerBoxes is the monthly subscription box service for DIY electronics and computer technology. We are hobbyists, makers, and experimenters. We are the dreamers of dreams. HACK THE PLANET!

Step 1: HackerBox 0026: Box Contents

  • HackerBoxes #0026 Collectable Reference Card
  • Exclusive HackerBoxes BioSense PCB
  • OpAmp and Component Kit for BioSense PCB
  • Arduino Nano V3: 5V, 16MHz, MicroUSB
  • OLED Module 0.96 inch, 128x64, SSD1306
  • Pulse Sensor Module
  • Snap-Style Leads for Physiological Sensors
  • Adhesive Gel, Snap-Style Electrode Pads
  • OpenEEG Electrode Strap Kit
  • Shrink Tubing - 50 Piece Variety
  • MicroUSB Cable
  • Exclusive WiredMind Decal

Some other things that will be helpful:

  • Soldering iron, solder, and basic soldering tools
  • Computer for running software tools
  • 9V Battery
  • Stranded hook-up wire

Most importantly, you will need a sense of adventure, DIY spirit, and hacker curiosity. Hardcore DIY electronics is not a trivial pursuit, and we are not watering it down for you. The goal is progress, not perfection. When you persist and enjoy the adventure, a great deal of satisfaction can be derived from learning new technology and hopefully getting some projects working. We suggest taking each step slowly, minding the details, and don't be afraid to ask for help.

Note that there is a wealth of information for current, and prospective, members in the HackerBox FAQ.

Step 2: Operational Amplifiers

An operational amplifier (or op-amp) is a high-gain voltage amplifier with a differential input. An op-amp produces an output potential that is typically hundreds of thousands of times larger than the potential difference between its two input terminals. Operational amplifiers had their origins in analog computers, where they were used to perform mathematical operations in many linear, non-linear, and frequency-dependent circuits. Op-amps are among the most widely used electronic devices today, being used in a vast array of consumer, industrial, and scientific devices.

An ideal op-amp is usually considered to have the following characteristics:

  • Infinite open-loop gain G = vout / vin
  • Infinite input impedance Rin (thus, zero input current)
  • Zero input offset voltage
  • Infinite output voltage range
  • Infinite bandwidth with zero phase shift and infinite slew rate
  • Zero output impedance Rout
  • Zero noise
  • Infinite common-mode rejection ratio (CMRR)
  • Infinite power supply rejection ratio.

These ideals can be summarized by the two "golden rules":

  1. In a closed loop the output attempts to do whatever is necessary to make the voltage difference between the inputs zero.
  2. The inputs draw no current.

[Wikipedia]

Additional Op-Amp Resources:

Detailed Video Tutorial from EEVblog

Khan Academy

Electronics Tutorials

Step 3: Instrumentation Amplifiers

An instrumentation amplifier is a type of differential amplifier combined with input buffer amplifiers. This configuration eliminates the need for input impedance matching and thus makes the amplifier particularly suitable for use in measurement and test equipment. Instrumentation amplifiers are used where great accuracy and stability of the circuit are required. Instrumentation amplifiers have very high common-mode rejection ratios making them suitable for measuring small signals in the presence of noise.

Although the instrumentation amplifier is usually shown schematically as being identical to a standard op-amp, the electronic instrumentation amp is almost always internally composed of THREE op-amps. These are arranged so that there is one op-amp to buffer each input (+,−), and one to produce the desired output with adequate impedance matching.

[Wikipedia]

PDF Book: Designer's Guide to Instrumentation Amplifiers

Step 4: HackerBoxes BioSense Board

The HackerBoxes BioSense Board features a collection of operational and instrumentation amplifiers to detect and measure the four physiological signals described below. The tiny electrical signals are processed, amplified and fed to a microcontroller where they can be relayed to a computer via USB, processed, and displayed. For microcontroller operations, the HackerBoxes BioSense Board employs an Arduino Nano module. Note that the next couple of steps focus on readying the Arduino Nano module for use with the BioSense Board.

Pulse Sensor modules feature a light source and a light sensor. When the module is in contact with body tissue, for example a fingertip or earlobe, changes in the reflected light are measured as blood pumps through the tissue.

ECG (Electrocardiography), also called EKG, records electrical activity of the heart over a period of time using electrodes placed on the skin. These electrodes detect the tiny electrical changes on the skin that arise from the heart muscle's electrophysiologic pattern of depolarizing and repolarizing during each heartbeat. ECG is a very commonly performed cardiology test. [Wikipedia]

EEG (Electroencephalography) is an electrophysiological monitoring method to record electrical activity of the brain. Electrodes are placed along the scalp while EEG measures voltage fluctuations resulting from ionic current within the neurons of the brain. [Wikipedia]

EMG (Electromyography) measures electrical activity associated with skeletal muscles. An electromyograph detects the electric potential generated by muscle cells when they are electrically or neurologically activated. [Wikipedia]

Step 5: Arduino Nano Microcontroller Platform

The included Arduino Nano module comes with header pins, but they are not soldered to the module. Leave the pins off for now. Perform these initial tests of the Arduino Nano module separately from the BioSense Board and PRIOR to soldering the header pins the Arduino Nano. All that is needed for the next couple of steps is a microUSB cable and the Nano module just as it comes out of the bag.

The Arduino Nano is a surface-mount, breadboard-friendly, miniaturized Arduino board with integrated USB. It is amazingly full-featured and easy to hack.

Features:

  • Microcontroller: Atmel ATmega328P
  • Voltage: 5V
  • Digital I/O Pins: 14 (6 PWM)
  • Analog Input Pins: 8
  • DC Current per I/O Pin: 40 mA
  • Flash Memory: 32 KB (2KB for bootloader)
  • SRAM: 2 KB
  • EEPROM: 1 KB
  • Clock Speed: 16 MHz
  • Dimensions: 17mm x 43mm

This particular variant of the Arduino Nano is the black Robotdyn design. The interface is by an on-board MicroUSB port that is compatible with the same MicroUSB cables used with many mobile phones and tablets.

Arduino Nanos feature a built-in USB/Serial bridge chip. On this particular variant, the bridge chip is the CH340G. Note that there are various other types of USB/Serial bridge chips used on the various types of Arduino boards. These chips allow you computer's USB port to communicate with the serial interface on the Arduino's processor chip.

A computer's operating system requires a Device Driver to communicate with the USB/Serial chip. The driver allows the IDE to communicate with the Arduino board. The specific device driver that is needed depends upon both the OS version and also the type of USB/Serial chip. For the CH340 USB/Serial chips, there are drivers available for many operating systems (UNIX, Mac OS X, or Windows). The maker of the CH340 supplies those drivers here.

When you first plug the Arduino Nano into a USB port of your computer, the green power light should come on and shortly after the blue LED should start to blink slowly. This happens because the Nano is pre-loaded with the BLINK program, which is running on the brand new Arduino Nano.

Step 6: Arduino Integrated Development Environment (IDE)

If you do not yet have the Arduino IDE installed, you can download it from Arduino.cc

If you would like additional introductory information for working in the Arduino ecosystem, we suggest checking out the instructions for the HackerBoxes Starter Workshop.

Plug the Nano into the MicroUSB cable and the other end of the cable into a USB port on the computer, launch the Arduino IDE software, select the appropriate USB port in the IDE under tools>port (likely a name with "wchusb" in it). Also select "Arduino Nano" in the IDE under tools>board.

Finally, load up a piece of example code:

File->Examples->Basics->Blink

This is actually the code that was preloaded onto the Nano and should be running right now to slowly blink the blue LED. Accordingly, if we load this example code, nothing will change. Instead, let's modify the code a little bit.

Looking closely, you can see that the program turns the LED on, waits 1000 milliseconds (one second), turns the LED off, waits another second, and then does it all again - forever.

Modify the code by changing both of the "delay(1000)" statements to "delay(100)". This modification will cause the LED to blink ten times faster, right?

Let's load the modified code into the Nano by clicking the UPLOAD button (the arrow icon) just above your modified code. Watch below the code for the status info: "compiling" and then "uploading". Eventually, the IDE should indicate "Uploading Complete" and your LED should be blinking faster.

If so, congratulations! You have just hacked your first piece of embedded code.

Once your fast-blink version is loaded and running, why not see if you can you change the code again to cause the LED to blink fast twice and then wait a couple of seconds before repeating? Give it a try! How about some other patterns? Once you succeed at visualizing a desired outcome, coding it, and observing it to work as planned, you have taken an enormous step toward becoming a competent hardware hacker.

Step 7: Arduino Nano Header Pins

Now that your development computer has been configured to load code to the Arduino Nano and the Nano has been tested, disconnect the USB cable from the Nano and get ready to solder.

If you new to soldering, there are a lot of great guides and videos online about soldering. Here is one example. If you feel that you need additional assistance, try to find a local makers group or hacker space in your area. Also, amateur radio clubs are always excellent sources of electronics experience.

Solder the two single row headers (fifteen pins each) to the Arduino Nano module. The six pin ICSP (in-circuit serial programming) connector will not be used in this project, so just leave those pins off.

Once the soldering is complete, check carefully for solder bridges and/or cold solder joints. Finally, hook the Arduino Nano back up to the USB cable and verify that everything still works properly.

Step 8: Components for BioSense PCB Kit

With the microcontroller module ready to go, it is time to assemble the BioSense Board.

Component List:

  • U1:: 7805 Regulator 5V 0.5A TO-252 (datasheet)
  • U2:: MAX1044 Voltage Converter DIP8 (datasheet)
  • U3:: AD623N Instrumentation Amplifier DIP8 (datasheet)
  • U4:: TLC2272344P OpAmp DIP8 DIP8 (datasheet)
  • U5:: INA106 Differential Amplifier DIP8 (datasheet)
  • U6,U7,U8:: TL072 OpAmp DIP8 (datasheet)
  • D1,D2:: 1N4148 Switching Diode Axial Lead
  • S1,S2:: SPDT Slide Switch 2.54mm Pitch
  • S3,S4,S5,S6:: Tactile Momentary Button 6mm X 6mm X 5mm
  • BZ1:: Passive Piezo Buzzer 6.5mm Pitch
  • R1,R2,R6,R12,R16,R17,R18,R19,R20:: 10KOhm Resistor [BRN BLK ORG]
  • R3,R4:: 47KOhm Resistor [YEL VIO ORG]
  • R5:: 33KOhm Resistor [ORG ORG ORG]
  • R7:: 2.2MOhm Resistor [RED RED GRN]
  • R8,R23:: 1KOhm Resistor [BRN BLK RED]
  • R10,R11:: 1MOhm Resistor [BRN BLK GRN]
  • R13,R14,R15:: 150KOhm Resistor [BRN GRN YEL]
  • R21,R22:: 82KOhm Resistor [GRY RED ORG]
  • R9:: 10KOhm Trimmer Potentiometer “103”
  • R24:: 100KOhm Trimmer Potentiometer “104”
  • C1,C6,C11:: 1uF 50V Monolithic Cap 5mm Pitch “105”
  • C2,C3,C4,C5,C7,C8:: 10uF 50V Monolithic Cap 5mm Pitch “106”
  • C9:: 560pF 50V Monolithic Cap 5mm Pitch “561”
  • C10:: 0.01uF 50V Monolithic Cap 5mm Pitch “103”
  • 9V Battery Clips with Wire Leads
  • 1x40pin FEMALE BREAK-AWAY HEADER 2.54mm Pitch
  • Seven DIP8 Sockets
  • Two 3.5mm Audio-Style, PCB-Mount Sockets

Step 9: Assemble the BioSense PCB

RESISTORS: There are eight different values of resistors. They are not interchangeable and must be carefully placed exactly where they belong. Start by identifying the values of each type of resistor using the color codes shown in the component list (and/or an ohmeter). Write the value on the paper tape attached the the resistors. This makes it a lot harder to end up with resistors in the wrong place. Resistors are not polarized and can be inserted in either direction. Once soldered into place, closely trim the leads form the rear of the board.

CAPACITORS: There are four different values of capacitors. They are not interchangeable and must be carefully placed exactly where they belong. Start by identifying the values of each type of capacitor using the number markings shown in the component list. Ceramic capacitors are not polarized and can be inserted in either direction. Once soldered into place, closely trim the leads form the rear of the board.

POWER SUPPLY: The two semiconductor components that make up the power supply are U1 and U2. Solder these next. When soldering U1, note that the flat flange is the device ground pin and heat sink. It must be soldered completely to the PCB. The kit includes DIP8 sockets. However, for the voltage converter U2, we strongly recommend carefully soldering the IC directly to the board without a socket.

Solder on the two slide switches and the 9V battery clip leads. Note that if your battery clip came with a connector plug on the leads, you can just snip the connector off.

At this time, you can plug on a 9V battery, flip the power switch on and use a volt meter to verify that your power supply is creating a -9V rail and a +5V rail from the supplied +9V. We now have three voltage supplies and a ground all from one 9V battery. REMOVE THE BATTERY TO CONTINUE ASSEMBLY.

DIODES: The two diodes D1 and D2 are small, axial-leaded, glassy-orange components. They are polarized and should be oriented so that the black line on the diode package lines up with the thick line on the PCB silkscreen.

HEADER SOCKETS: Separate the 40 pin header into three sections of 3, 15, and 15 positions each. To cut the headers to length, use small wire cutters to snip through the position ONE PAST where you want the socket strip to end. The pin/hole that you cut through is sacrificed. The three pin header is for the pulse sensor at the top of the board with pins labeled "GND 5V SIG". The two fifteen pin headers are for the Arduino Nano. Remember that the six pin ICSP (in-circuit serial programming) connector of the Nano is not used here and does not need a header. We also do not suggest connectorizing the OLED display with a header. Solder the headers into place and leave them empty for now.

DIP SOCKETS: The six amplifier chips U3-U8 are all in DIP8 packages. Solder a DIP8 chip socket into each of those six positions being sure to orient the notch in the socket to align with the notch on the PCB silkscreen. Solder the sockets without the chip inserted into them. Leave them empty for now.

REMAINING COMPONENTS: Finally solder the four push buttons, the two trimpots (note that they are two different values), the buzzer (note that it is polarized), the two 3.5mm audio-style jacks, and lastly the OLED display.

SOCKETED COMPONENTS: Once all of the soldering is complete, the six amplifier chips may be inserted (minding the orientation of the notch). Also, the Arduino Nano may be inserted with the USB connector at the edge of the BioSense Board.

Step 10: Electrical Safety and Power Supply Switches

In the schematic diagram for the HackerBoxes BioSense Board, note that there is a HUMAN INTERFACE (or ANALOG) section and also a DIGITAL section. The only trances that cross between these two sections are the three analog input lines to the Arduino Nano and the +9V battery supply which can be opened up using the USB/BAT switch S2.

Out of an abundance of caution, it is common practice to avoid having any circuit connected to a human body powered by wall power (line power, mains power, depending upon where you live). Accordingly, the HUMAN INTERFACE portion of the board is only powered by a 9V battery. However unlikely it may be that the computer suddenly puts 120V onto the connected USB cord, this is a little extra insurance policy. An added benefit to this design is that we can power the entire board from the 9V battery if we do not need a computer connected.

ON/OFF SWITCH (S1) serves to disconnect the 9V battery from the circuit entirely. Use S1 to turn the analog portion of the board completely off when not in use.

USB/BAT SWITCH (S2) serves to connect the 9V battery to the digital supply of the Nano and OLED. Leave S2 in the USB position when the board is connected to a computer via the USB cable and the digital supply will be provided by the computer. When the Nano and OLED are to be powered by the 9V battery, just switch S2 to the BAT position.

NOTE ON SUPPLY SWITCHES: If S1 is ON, S2 is in USB, and there is no USB power provided, the Nano will try to power itself through the analog input pins. While not a human safety issue, this is an undesirable condition for the delicate semiconductors and it should not be prolonged.

Step 11: OLED Display Library

As an initial test of the OLED display, install the SSD1306 OLED display driver found here into the Arduino IDE.

Test the OLED display by loading up the ssd1306/snowflakes example and programming it into the BioSense Board.

Be sure this works before moving ahead.

Step 12: BioSense Demo Firmware

Shall we play a game, Professor Falken?

There is also a cool Arkanoid game in the SSD1306 examples. For it to work with the BioSense board however, the code that initializes and reads the buttons must be modified. We have taken the liberty to make those changes in the "biosense.ino" file attached here.

Duplicate the arkanoid folder from the SSD1306 examples to a new folder that you have named biosense. Delete the arkanoid.ino file from that folder and drop in the "biosense.ino" file. Now compile and upload biosense to the nano. Hitting the rightmost button (button 4) will launch the game. The paddle is controlled by button 1 to the left and button 4 to the right. Nice shot there, BrickOut.

Hit the reset button on the Arduino Nano to go back to the main menu.

Step 13: Pulse Sensor Module

A Pulse Sensor Module may interface to the BioSense Board using the three pin header at the top of the Board.

The Pulse Sensor Module uses an LED light source and an APDS-9008 ambient light photo sensor (datasheet) to detect LED light reflected through a fingertip or earlobe. A signal from the ambient light sensor is amplified and filtered using an MCP6001 op-amp. The signal may then be read by the microcontroller.

Pressing Button 3 from the main menu of the biosense.ino sketch will relay samples of the pulse sensor output signal over the USB interface. Under the TOOLS menu of the Arduino IDE, select the "Serial Plotter" and make sure that the baud rate is set to 115200. Gently place your fingertip over the light on the pulse sensor.

Additional details and projects associated with the Pulse Sensor Module may be found here.

Step 14: ​Electromyograph (EMG)

Plug the electrode cable into the lower 3.5mm jack labeled EMG and position the electrodes as shown in the diagram.

Pressing Button 1 from the main menu of the biosense.ino sketch will relay samples of the EMG output signal over the USB interface. Under the TOOLS menu of the Arduino IDE, select the "Serial Plotter" and make sure that the baud rate is set to 115200.

You can test out the EMG on any other muscle groups - even the eyebrow muscles in your forehead.

The EMG circuit of the BioSense Board was inspired by this Instructable from Advancer Technologies, which you should definitely check out for some additional projects, ideas, and videos.

Step 15: Electrocardiograph (ECG)

Plug the electrode cable into the upper 3.5mm jack labeled ECG/EEG and position the electrodes as shown in the diagram. There are two basic options for ECG electrode placement. The first is on the inside of the wrists with the reference (red lead) on the back of one hand. This first option is easier and more convenience but is often a little noisier. The second option is across the chest with the reference on the right abdomen or upper leg.

Pressing Button 2 from the main menu of the biosense.ino sketch will relay samples of the ECG output signal over the USB interface. Under the TOOLS menu of the Arduino IDE, select the "Serial Plotter" and make sure that the baud rate is set to 115200.

The ECG/EEG circuit of the BioSense Board was inspired by the Heart and Brain SpikerShield from Backyard Brains. Check out their site for some additional projects, ideas, and this cool ECG video.

Step 16: Electroencephalograph (EEG)

Plug the electrode cable into the upper 3.5mm jack labeled ECG/EEG and position the electrodes as shown in the diagram. There are many options for EEG electrode placement with two basic options shown here.

The first is on the forehead with the reference (red lead) on the earlobe or mastoid process. This first option can simply use the same snap-style leads and gel electrodes used for ECG.

The second option at the back of the head. If you happen to be bald, the gel electrodes will also work here. Otherwise, forming electrodes that can "poke through" hair is a good idea. A lock-washer style solder lug is a good option. Use needlenose pliers on the small tabs (six in this case) inside the washer to bend then all to protrude in the same direction. Placement under an elastic headband will gently force these protrusions through hair and into contact with the scalp below. As necessary, conductive gel can be used to improve the connection. Simply mix table salt with a thick liquid such as petroleum jelly or a slurry of water and starch or flour. Salty water alone will also work but will need to be contained within a small sponge or cotton ball.

Pressing Button 2 from the main menu of the biosense.ino sketch will relay samples of the EEG output signal over the USB interface. Under the TOOLS menu of the Arduino IDE, select the "Serial Plotter" and make sure that the baud rate is set to 115200.

Additional EEG projects and resources:

This Instructable uses a similar design as the BioSense EEG and also demonstrates some additional processing and even how to play EEG Pong!

Backyard Brains also has a nice video for EEG measurements.

BriainBay

OpenEEG

OpenViBe

EEG signals can measure stroboscopic brainwave effects (e.g. using Mindroid).

Step 17: Challenge Zone

Can you display the analog signal traces on the OLED in addition to the Serial Plotter?

As a starting point, check out this project from XTronical.

It may also be useful to have a look at the Tiny Scope project.

How about adding text indicators for signal rates or other interesting parameters?

Step 18: BioBox Monthly Subscription Box

Applied Science Ventures, the parent company of HackerBoxes, is involved in an exciting new subscription box concept. BioBox will inspire and educate with projects in the life sciences, bio hacking, health, and human performance. Keep an optical sensor out for news and charter member discounts by following the BioBox Facebook Page.

Step 19: HACK THE PLANET

If you have enjoyed this Instrucable and would like to have a box of electronics and computer tech projects like this delivered right to your mailbox each month, please join the HackerBox revolution by SUBSCRIBING HERE.

Reach out and share your success in the comments below or on the HackerBoxes Facebook Page. Certainly let us know if you have any questions or need some help with anything. Thank you for being part of HackerBoxes. Please keep your suggestions and feedback coming. HackerBoxes are YOUR boxes. Let's make something great!

5 People Made This Project!

Recommendations

  • Clocks Contest

    Clocks Contest
  • Casting Contest

    Casting Contest
  • Make it Move Contest

    Make it Move Contest
user

We have a be nice policy.
Please be positive and constructive.

Tips

6 Questions

0

This is my first hackerbox and the first involved soldering project. I had trouble inserting the AD623N DIP8 chip into the DIP socket and broke off one of the pins. On this instructable it says AD623N, on the top of the chip it says "AD623AN #1641 2943908". If I order a replacement chip, what exactly do I need to order? I found several similarly named chips but not the exact one?

Any AD623AN in an 8pin DIP package should work fine. Before you spend the $10-15 buying one, shoot an email to support@hackerboxes.com and see if they can find one to send to you.

0

This is my first Hackerbox and I'm having a great time. It is assembled and working so now I'm starting to explore how to clean up the 60 hz interference, make better use of the OLED, etc.

Question: There are a few parts in the kit that seem unrelated such as the heat shrink tubing and the TRRS breakout. What are those for?

0

I see! Gives me an idea for converting the ECG leads to alligator clips for different electrode pads I have access to. I'm now in the process of getting the wave form to the OLED and having some success. Now just need to figure out how to filter out the 60 Hz noise. What a great box!

1 more answer

Hey Greg. We are glad that you are enjoying HackerBox #0026. Use of the TRRS breakout is shown in Step 16 for the EEG interface. The tubing is for your supply bin and is useful for many projects. Your use of the phrase "a few parts in the kit" points to the confusion here. HackerBoxes are not kits. A particular HackerBox may include one or more kits, or even no kits. In this case, most of the box is related to one project so it may feel like a kit. That is usually not the case. A HackerBox is a bunch of stuff each month for electronics hobbyists and there is a general educational/entertaining theme for each box, however the entire box is not intended to be singular in purpose.

added linked driver from get hub to library manager which allows me to bring up snowflake example but the oled never comes on. Is the driver installed by simple adding library or is there a run command somewhere in the 1306 master file to allow me to install driver???

Similar here unfortunately. But I think mine is broken or something. It got it to come on twice but then it turned off after a little. I can't get it to come on again. I tried re-soldering everything and no luck :(

I would like to purchase kit 0026 bio sense.I looked at you tube. But there was no mention of eeg probes or connections. Can you clarify this anomaly. There was only EEG provisions.

See Step 16 Above. Thanks!

How do you read EEG? What do I use for electrodes? I am confused bout the EEG portion of th circuit.

Thanks

See Step 16 Above. Thanks!

Couple hours and not sure what file is supposed to install the drivers. Add files to library and uploaded snowflake but still get nothing on my screen and power is good. get this message

/Users/wes/Documents/Arduino/libraries/ssd1306-master/examples/snowflakes/snowflakes.ino:163:106: warning: narrowing conversion of '((((int)ssd1306_displayHeight()) >> 3) + -1)' from 'int' to 'uint8_t {aka unsigned char}' inside { } [-Wnarrowing]
s_pool.setRect( (SSD1306_RECT) { 0, 0, (ssd1306_displayWidth()>>3) - 1, (ssd1306_displayHeight()>>3) - 1 } );

33 Comments

I was wondering where is the link for the arduino code that we will need for the complete assembly. To Upload

4 replies

If you look at the example code, it is just reading from one of the ADC pins and sending it right back out the Serial. This is a great project to get going on the analog data handling, graphing, data scaling, peak detection... lots of good things.

Here is my take on it:

https://1drv.ms/u/s!AhyShnjzqvHtn_hodV_r33e-UzQMBQ

I used some of the examples provided by article. I don't have proper attribution, sorry to original authors, and some of the comments are invisible. I was coding for me, late at night.

I can't seem to get your code to compile. There are errors that reference the FIR library. I'm not so sure that I have the right library installed. I downloaded one for Arduino which I located on a google search but it doesn't seem to pan out. I'm guessing that you are using the FIR library to smooth out the very noisy signal that this circuit is producing. Maybe you could provide a link to the library that you used? I'd love to try it out!

In the Arduino IDE, go to Sketch, Include Library, Manage Libraries. Then install the FIR Filter library, Adafruit ssd1306 Library, and the Adafruit GFX Library, I used all the newest versions and the program compiles and runs.

There isn't one, really. Although it's strait forward putting the codebase together. You just have to take your time and really follow the instructions.

First you have to download the display driver library, and install that. Once you've done that, pop into the examples folder that you just installed and copy out all the files in the arknoid example.

Then make your own folder called "biosense" and paste the arknoid files into that. Once done, delete the arknoid.ino file, download the biosense.ino file from above and put it into that folder.

If you've done everything right, you should now be able to build and upload.

finally getting around to this project, and the tinyscope link now has me thinking... I wonder what hardware changes to the board would be necessary to turn the Biosense PCB into a pocket oscilloscope. Since both are designed to measure and record voltage changes over time, it should be possible. Would probably be handy for reading digital signals on arduinos and such.

There have been recent changes to the ssd1036 library that lead to biosense.ino compile errors like: "biosense:279: error: 'ssd1306_setRamBlock' was not declared in this scope"

To resolve, either roll back to version 1.4.12 of the ssd1306 library, or add

#include "lcd/lcd_common.h"

and replace all instances of

ssd1306_sendData

with

ssd1306_sendPixels

Having issues finding "ssd1306.h" in the github folder. Downloaded the whole folder and installed as directed, but not sure where to point to for the library install. Help please?

1 reply

Disregard, managed to get the library installed and Arkanoid to run. However, the touch buttons aren't working for some reason. I'll have to take a look at that. Solder contacts look good though.

FYI: Did anyone have trouble getting a good signal from their pulse sensor module? I was getting a very feeble signal. It was almost buried in noise. I got a replacement and now I have a strong steady signal that's working very well. So, maybe I was just unlucky or it could be that there are some funky sensors out there. I got my replacement from Aliexpress.

I've been trying to look up the pin numbers on the semantic diagram, but when I zoom in, the letters and numbers are to blurry to read.

Anyone else find a way to read it ???

Got part way through, to getting U1 and U2 connected. Hooked it up to the battery and turned it on. I get 5V from the supply on the top of the board. Had to chase down where the -9V supply should be (from what I can tell, pin 5 of U2), and it varies from -0.4V to 0.8V. Double-checked the soldering on the pins, and capacitors C4, C5, C6 and C7, as well as the values of those capacitors. Still nothing. My thought is that U2 (the MAX1044 chip) may be dead.

I did check the power switch, and it turns out that when in the "off" position, all 3 pins are shorted. This is not the first time the switches from a hackerbox have been sub-optimal quality.

4 replies

We've never had any problems with these switches, but they can be damaged during soldering if too much heat is applied, if the contact mechanism is deformed, or if solder is drawn up into the switch mechanism. These switches are manufactured by the tens of millions and are about as ubiquitous as it gets. There are probably numerous of them in equipment around all of our homes.

I mainly mention the switches because this is the second mini switch like this that I've received in a hackerbox that doesn't operate properly. I've soldered dozens of projects, and even smaller surface mount components, so I'm doubtful that I'm heating them too much or getting solder into the switch.

My bigger concern is the MAX1044 chip not working properly.

I had similar problems working with the switches. What can happen is the metal case of the switch comes into contact with the solder pad on the top side of the PCB and/or gets accidentally soldered to it. Insulate the switch from the PCB (layer of two of tape on the board, poke leads through) or use a thin spacer that could be removed after soldering. No more issues. The switches themselves are fine.

I've had three bad switches in a row.

I've done professional electronics for most of my life and can tell you these are really crappy switches, or else I've had a terrible run of bad luck...

Q: What is the calibration procedure for the two pots?

Anybody have a problem with their pulse sensor running hot? Off the
biosense board it ran hot. It was so hot I could only hold my finger
there for barely a second. From the pulse sensor site, I connected it to
my Uno as shown and it was the same result. I tried holding my finger
long enough to try to see something on the serial plotter, but I nearly
burned my finger. Just curious.

Are there any drawing files for the board? I would like to 3D print up a case and a drawing would really help.

It works great, plotting graphs, beeping on heart beats... lot of fun! Thanks for a great kit!

1 reply

There was a tray created by one of the discord users, it's linked at https://wiki.hackerboxes.community/index.php?title=HB0026