Whitebox - UF-CSSALT/SMARTS-SDK-Unity-Asset-Package GitHub Wiki
The Whitebox runs on an Arduino Uno and shield PCB that plugs into the top of the Arduino. Version 2.3 of the shield circuit schematic is as follows:
The Arduino is connected to three ports (J1-J3) which are in turn connected to the peripheral interface devices. This includes:
- TUI (Tangible User Interface) Camera Controller
- Ultrasound Probe
- CVA/RA Needle
From left to right: CVA/RA needle, TUI Camera Controller, Ultrasound Probe
Attached to each of these peripheral devices and their ports is the respective circuitry necessary for operation. There are certain commonalities between all ports: pin 1 is always connected to Vcc (5V) and pin 5 is always connected to ground. Furthermore, 10kΩ pull down resistors are used throughout the design with digital and analog inputs.
The TUI has a 10kΩ pull down resistor connected to pin 6 of the port. Pin 6 is connected to a push button switch (SPST) on board of the TUI. This allows the user to tell the microcontroller when they actually wish to change the camera input. The TUI internal hardware is as follows:
The ultrasound uses two analog inputs (A3 and A4) to determine when pressure is being applied to the probe's end. Each side of the probe contains a pressure sensor that varies voltage when pressure is applied. The ultrasound screen will not display unless sufficient pressure is applied to both of the pressure sensors.
The CVA/RA needle requires the use of the most external circuitry to function properly. A thumper motor connected to pin 5 is used to provide tactile feedback. The voltage rating of the thumper motor is 3.3V, but the Arduino outputs 5V. To drop this voltage to an appropriate level a LM3940 voltage regulator is used with bypass capacitors on the input and output to stabilize the resulting waveform. A flyback diode is included to handle the voltage spike that occurs after an inductive load's (in this case the motor) current supply is suddenly reduced by a significant amount. This can damage the micro-controller.
A relay is used to turn the valve inside the needle on and off. The user will be able to fill the syringe with air when the valve is open and unable to fill the synrine when the valve is closed. This allows the program to simulate accessing a vein and filling the syringe with blood during a procedure. The relay is controlled by digital I/O pin 2 and connected to pin 2 of the needle peripheral header.
The internal construction of the CVA/RA needle is as follows:
The Whitebox is powered and grounded in the following manner. The yellow line is 12V, the red line is 5V, and the two black lines are ground. The 5V line and one of the ground lines are wired to the Arduino to ensure it is powered consistently even if the USB hub is unplugged.
A status LED is connected to digital I/O pin 13 in series with a 470Ω resistor to limit current.
In V2.3 of the design a two input header was connected to the Arduino's Vin and ground pins. This should allow the board to be powered externally using a 5V source.
The Arduino software is located in Arduino Sketch/SMARTSMC as SMARTSMC.ino. The Arduino communicates with the computer and SDK using a serial connection. In SMARTSMC.ino this is acheived using the Serial library (Serial.print(), Serial.flush(), etc.). In Microcontroller.cs this is acheived using SerialPort. Depending on the values received by the Arduino from the simulation it will perform certain actions or state changes with the attached peripheral devices. This includes opening or closing the needle valve, sending a tactile thump to the needle thumper motor, changing the camera perspective when the TUI button is pressed, etc.
The software's flow is as follows:
The Arduino communicates with the computer using the Serial library. The baud rate for communication is 19200, which is reflected in both Microcontroller.cs and SMARTSMC.ino. The serial connection between the computer and Arduino is provided through the USB connection to the hub which is then plugged into the computer.
The serialEvent() function is called whenever the Arduino receives a serial communication. The system has been set up to interpret alphanumeric ASCII characters (capital letters only) and execute commands based on them. The commands are named in the following manner:
- CommandA()
- CommandB()
- ...
- Command9()
The ASCII characters "-" and "*" are reserved for the microcontroller handshake and data send requests explicitly. These characters should not be used as command characters.
Some of the command functions are already filled in and in use by the SMARTS SDK, others are free for user implementation. The CSSALT reserved commands and their respective functionalities are:
- CommandP()
- Zeros out syringe valve pressure
- Command1()
- Thumps the needle thumper motor in an obvious and easily palpable manner.
- Command2()
- Thumps the needle thumper motor in a subtle manner.
- Command3()
- Opens syringe valve.
- Command4()
- Closes syringe valve.
- Command6()
- Turn needle LED Green
- Command7()
- Turn needle LED Blue
- Command8()
- Turn needle LED Red
- Command9()
- Turn needle LED off
The other commands can be implemented however the user desires. Unimplemented commands are marked with /DO NOTHING/ inside the function body.
To perform the handshake between the computer and the Arduino the simulation first sends "-" to the Arduino. The Arduino sends ">" .
The Arduino must be on COM 5 to communicate successfully with the computer
If the handshake is done, the main loop of the program will:
- Check for TUI button presses
- Check for FSR pressure increases on the ultrasound probe (is the probe being pushed down?)
- Checks syringe valve pressure
- If no data has been received from Unity for the last 500ms, flash the LED.
The microcontroller file which is loaded onto the Arduino Uno is located in SMARTSMC/SMARTSMC.ino.