Areas of special interest are: Python, MatLab, Arduino, micro-controllers, PC interfacing, realtime timing, PC hardware, MEMS(accelerometers/gyros), multiple thread/processor programming, electronics, object-oriented approach to programming , machine learning, quasi-random number generation (when a psychologist asks for random they never truly mean random) and VB.net. Click here for some videos of VB.net programs that I have written in the past, I now mainly create experiments using Python and now, due to COVID, I create online experiments using Javascript (on Gorilla.sc).
Interface unit to replace parallel port. Based on the Stimulator unit, but instead of a stimulator output it will have an input facility. USB timer, further development of. This will enable users to measure the time between two or more (7 max) events to a resolution of 1µ second (one millionth of a second), the results are sent to the users computer via USB Serial communication, thus allowing the PC to record the data and not the user. This was originally developed to speed up the testing process of the reaction pad, and also the subsequent tesing of other devices used in the department to measure participants reaction times. This version used an 8 bit microcontroller but I plan to use a 32 bit microcontroller for the final version as there is not any real cost difference between the two but performance of the 32 bit microcontroller is at least 3 times better. Hicks Pad reaction timers, another update. This will based on using a Standard LCD touch screen unit, with an additional high speed touch screen on top. The unit will be multifunctional (not just Hicks), mobile and completely self contained i.e. have its on computer. The high speed touch screen (1millisecond accuracy) will be designed and built in house, this won't be used to control the cursor position, but just to get position and timing. USB Heart Rate monitor with GSR. compatible with Mac OS , Linux and Windows. This device uses an ear clip to measure the heart rate and two finger electrode to measure GSR, the combined data is output via USB (serial mode). Ad Instruments , Stimulus Isolator, GSR Amp ,2 Channel Recorder and software Biopac GSR/Stimulator STM200, MP150 GSR100, UIM100 Artis Oxymon 24, NIRS MRI Safe 32" HD screen with dedicated PC MRI response pads, FORP4 and FORP 2+2 StarStim 8, tdcs system Dremel DigiLab, 3D printer Content last updated: 26/01/2023 Written and Maintained by Gary Freegard
Student Project Allocation. Modify the existing version to use multiple cores, current version will only use single core. In theory if the work load could be split over two cores then duration would be halved, in reality it may be more like 0.6, so a task that took 60 minutes would be completed in around 36 minutes and if this load was split over an additional two cores then it would take 21.6 minutes and so on, for each doubling in the number of cores used the time take is reduced by 40%.
Analogue Event Marker. A microcontroller based unit to allow event marking on the NIRS. The NIRS has an analogue input which can be used for event marking. The device will connect via USB to the stimulus PC,
and is able to produce two analogue outputs between 0 and 3.3V, either pulsed or continous.
When run it will create a text file, the filename will be year, month, day,
hour and minutes e.g. 201802151345.txt. This file holds the results for each "pump" and "collect", there are elapsed time in milliseconds for each "pump", balloon count, pump count and total winnings.
Interface unit to replace parallel port (plus Stimulator output). This is an update to the Shocker PC interface,
which is used to convert the signal from a PC parallel port into one that is suitable for the Biopac and stimulator. The new unit receives power and signals via the USB, and convert these serial signals
into a) an 8 bit parallel signal, used for event marking, and b) a signal that can drive a stimulator, (time restricted pulsed output). All these outputs will be isolated (3KV) from the incoming signal
for safety reasons. Plus as an extra safety precaution a watchdog timer is used to ensure that if there is a problem that could cause excess shock to be administered then the device is reset
USB Audio device It was originally planned to use a dsPic which has a built in 2 channel audio DAC. The current version uses a Teensy 3.2 with an audio adapter board (CD quality). Though this
device is run at a higher sample rate to reduce latency further, from triggering to sound production is less than 1 millisecond.
This allows the unit to create its own audio, different frequencies, and volumes for either channel. This will allow the researcher to change the audio signal within the experiment if required. It
has built in routines to provide simultaneous, delayed, and overlapping signals, which can be selected within the experiment.
The device has a headphone output and an amplified output, which can be used to drive tactile devices.
Future: to add an external trigger, currently using USB
Student Project Alloaction This was developed in python to automate/speed up the allocation of third year project students to lecturers. It has also been used for Master students allocation as well.
Initially it was written using numpy but due to the slow performance (it would take almost nine hours to allocate 286 out of 302)it was updated to use
numba. This update increased the speed by over 100 times, it would take three minutes to allocate the 286 students (94.7%). An hour would allocate 287
students, five hours would allocate 288 students.
Though this device can be used for other purposes, i.e. two such devices would allow the user to control an item's position on a screen vertically and horizontally, rather like an Etch A Sketch ™.
Video Rating
Pong
This device was designed for use by parents to rate their feelings whilst watching their children during a sports event. The position of the dial is recorded every second, for upto 8 hours when fully charged.
It uses an optical encoder (ENS1J-B28-L00256L)produced by Bourns, product page. The encoder produces 256 pulses
per rotation. The dial is physically restricted to 180 degrees of movement. A Real Time Clock is used
to wake the unit every second, this allows the current rating to be measured, and then once every three seconds these values are saved along with a timestamp to the internal memory(small SD card) The reason that
the data is only written every three seconds is to reduce power comsumption, powering up the SD card and then writing the data is the one power hungry item that could be modified to reduce power usage and increase
operation time. The onboard microcontroller is run at a low speed and is sleeping when not measuring the dial position and saving then data, the power to the encoder is only applied when a measurement is to be made.
Tasks so far completed are:
   Delay Discounting Money
   Iowa Gambling Task
   Arrow Flankers
   N-Back
   BART
   Visual Analogue Scale
MRI Compatible foot switch. There was a requirement for participants to make responses using their feet whilst in the MRI. As the cost to purchase such a system was too high I was asked if it was
possible to make.
The outcome were two foot switches, which were made with a 3D printer, each with a switch that contained minimal magnetic material.
These are then mounted on a purpose built frame, made from MDF, with the ability to change the height (3 positions) of the switches to match participants feet. For connectivity MRI compatible leads
from Biopac were used. The signals from the switches
are sent to a purpose built USB HID interface, this interface turned these signals into simulated keyboard presses (8 and 9 keys).
Front image Side image
Parallel Port Card dll for 32/64 bit Windows. New desktop PCs are generally be supplied without a parallel port, as it has been replaced by USB based ports. Unfortunately this doesn't
allow users to easily send triggers/markers between PCs i.e. between stimulus PC and EEG PC. I was able to modify the source code for the standard 32/64 bit driver (based on inpout32.dll), which now allows
the use of parallel port add in cards on Windows 32/64 based PCs. The dll needed
to be modified as the address range was limited to 0x7FFF. Info
Modernisation of Hicks Pad reaction timers. Current pads rely on using old PCs (Pentium2/3) with specialist cards. Video Replacement
pads have onboard microcontrollers for millisecond accuracy and USB ports. This enables the pad to be connected to any new
PC (currently Windows only) for setup and collection of data. Future developments:
   Bluetooth connectivity would allow multiple pads to be connected to one PC/laptop.
   A totally self contained unit no need for a separate PC.
   Redesign the housing, to reduce weight and ease transportation.
USB Heart Rate monitor , compatible with Mac OS , Linux and Windows. This device uses an ear clip to measure the heart rate and the output is via USB (serial mode). It also has a push button
which can be used to mark events.
USB rotary rating pad. compatible with Mac OS , Linux and Windows. These pads are designed to use existing drivers in the
operating systems, and so are 'plug and play'. These are designed to be user configurable, allowing the output to be change from the following,
0 to 4, 0 to 6, 0 to 9, up/down arrow keys or left/right arrow keys.
Video
USB reaction pad , compatible with Mac OS , Linux and Windows. These pads are designed to use existing drivers in the
operating systems, and so are 'plug and play'. The pads offer a 2 millisecond reaction time resolution, which is significantly
better than a USB keyboard(10-12ms). The pads can be designed to a user specific needs, within the available parts. Future
development: The addition of an external trigger input, thus allowing the unit to measure the reaction time without an USB/system
latencies.For further information Or watch a
Video
Pursuit Rotor, development of software version. The standard Pursuit Rotor is a variable speed rotary turntable that has a circular target. This target is made up of two or more metal rings; the
participant has to try to keep a wand, which has a metal tip, on the target.
The wand is connected to a counter, which is used to indicate the number of times that the target was hit.
I have developed a software version of this test to see whether it is feasible to replace the mechanical system.
Video
The benefits of this system are:
The ability to have multiple tests.
The ability to introduce a delay between user position and visual feedback position.
The data is recorded in a standard CSV format.
The program is able to compensate for different ratio screens and graphics tablets.
It is portable, can be used on a laptop or desktop, with either a mouse or graphics tablet.
It is possible to have different target trajectories, standard is circular, others are rectangular and triangular.
It will work on all current Windows operating system from XP up, as long as there is a driver for the graphics tablet.
It is significantly more flexible than the mechanical system.
Audio switch, High Speed This is a unit that is capable of switching an audio signal on and off when it is required with
a higher degree of accuracy and precision than is achievable when using standard PC hardware and software. It was built for a PhD students research, and the result are published in Boyce, W., Whiteford, S., Curran, W., Freegard, G., & Weidemann, C. (2020). Splitting time: Sound-induced illusory visual temporal fission and fusion. Journal of Experimental Psychology: Human Perception and Performance, 46(2), 172-201.
For further information
Vigilance This program was originally developed in the 90s using the latest PCs(286/386) and written in Pascal for use in MS-Dos.Old
The purpose of this test is to show a series of random numbers on the screen, at a rate of 100 per minute, each number being shown for 150 milliseconds every 600 milliseconds. The participant presses the space bar when they see three consecutive odd or even numbers.
Unfortunately this code will no longer function on any new desktop PCs or laptops. To enable the continued use of this test, I wrote a version in VB.net that uses DirectX for the graphics as this enabled the synchronising of the displaying a number with the screen refresh.
Unfortunately I wasn't able to get the program to work on a Windows Vista, so after a little rewrite to incorporate SlimDX (a wrapper for DirectX),
the program is now able to run on multiple Windows based operating systems (32 and 64 bit).New
Shocker PC interface, development of. This was initially required to allow a first person shooter up game (Half Life 2) which has been modified to carrying out an experiment, to apply a shock
via either the AD Instruments or Biopac stimulator. The current version is used as interface between the presentation PC and stimulator and or Biopac MP150. The shock output is 50Hz signal, with the
shock being on for 2ms, the maximum duration of the pulsed output is 250ms. It will not except another trigger for another 250ms. Plus as an extra safety precaution a watchdog timer is used to ensure that if there is a problem that could cause excess shock to be administered then the device is reset. This unit is designed to be used where all the equipment is powered via
a medical grade isolation tranformer.
A version which uses opto-couplers is currently being designed, this will provide a level electrical isolation between the PC and Biopac/shocker that is in excess of that than can be provided by
Biopac's own isolator.
USB Joystick Video
USB Air Mouse Video
Currently these examples are not calculating the angle but are using the acceleration (due to gravity) in the x and y direction. Ideally the
angle should be used but this will require a significant piece of programming as these microcontrollers do not have the ability to calculate
the square root or the arctangents of numbers , which is necessary to calculate the angle.
Young, H.,, Freegard, G., & Benton, D. (2022). Mediterranean Diet, Interoception and Mental Health: Is it time to look beyond the 'Gut-Brain Axis'? Physiology & Behavior
Young, H., Davies, J., Freegard, G., & Benton, D. (2021). Nonsuicidal Self-Injury Is Associated With Attenuated Interoceptive Responses to Self-Critical Rumination. Behavior Therapy, 52(5), 1123-1136.
Hoon, A., Freegard, G., Dymond, S., Hoon, A., & Freegard, G. (2020). Symbolic generalization of the near-miss in simulated slot-machine gambling. Behavior Analysis: Research and Practice, 21(1), 13-25
Boyce, W., Whiteford, S., Curran, W., Freegard, G., & Weidemann, C. (2020). Splitting time: Sound-induced illusory visual temporal fission and fusion. Journal of Experimental Psychology: Human Perception and Performance, 46(2), 172-201.
Reed, Phil., Smale, D., Freegard, Gary. & Owen, D.(2017).Human performance on random interval schedules Journal of Experimental Psychology: Animal Learning and Cognition
Young, H.A., Williams, C., Pink, A.E., Freegard, G., Owens, A. & Benton D. (2017). Getting to the heart of the matter: Does aberrant interoceptive processing contribute towards emotional eating?PLOSone.
May, R., Stewart, I., Baez, L., Freegard, G. & Dymond, S. (2017). Arbitrarily applicable spatial relational responding. Journal of the Experimental Analysis of Behavior.
Bradshaw, C. A., Freegard, G., Reed, P.(2015) Human performance on random ratio and random interval schedules, performance awareness and verbal instructions Learning & Behavior
Munnelly, A., Freegard, G., & Dymond, S. (2013). Constructing Relational Sentences: Establishing Arbitrarily Applicable Comparative Relations with the Relational Completion Procedure. The Psychological Record. 63, 1-18.
Dymond, S., Schlund, M. W., Roche, B., De Houwer, J. & Freegard, G. (2012) Safe from harm: Learned, instructed, and symbolic generalization pathways of human threat-avoidance. PLOSone
Hooper, N., Stewart,I., Duffy, C., Freegard, G., & McHugh, L. (2012) Modelling the direct and indirect effects of thought suppression on personal choice. Journal of Contextual Behavioral Science,1, 73-82
Seabury, T., Benton, D., & Young, H. (2022).Interoceptive differences in elite sprint and long-distance runners: A multidimensional investigation. PLOSone
Brennan, A., Marstaller, L., Burianova, H., Benton, D., Hanley, C., Newstead, S., & Young, H. (2022).Weaker connectivity in resting state networks is associated with disinhibited eating in older adults. Proceedings of the Royal Society B, 286
Hayley A. Young, Chantelle M. Gaylor, Danielle de Kerckhove, Heather Watkins and David Benton (2019) Interoceptive accuracy moderates the response to a glucose load: a test of the predictive coding framework International Journal of Obesity, 46
Kell Grandjean da Costaa, Menna Price, Henrique Bortolottia, Maria Luäza de Medeiros Rägoa, Daniel Aranha Rägo Cabral, Raquel David Langer, Gleydciane Alexandre Fernandes, Hassan Mohamed Elsangedy, Eduardo Bodnariuc Fontes. (2019)Fat mass predicts food-specific inhibitory control in children. Physiology & Behavior
Newstead S, Young H, Benton D, Jiga-Boy G, Andrade Sienz ML, Clement RM, Boy F (2017).Acute and repetitive fronto-cerebellar tDCS stimulation improves mood in non-depressed participants.Experimental Brain Research
Dymond, S., Molet, M., & Davies, L. (2017).The impact of arbitrarily applicable relational responding on evaluative learning about hypothetical money and shock outcomes. Quarterly Journal of Experimental Psychology, 70, 1684-1699.
Xia, W., Dymond, S., Lloyd, K., Vervliet, B. (2017).Partial reinforcement of avoidance and resistance to extinction in humans Behaviour Research and Therapy.
Price, M., Higgs, S. & Lee, M. (2016). Snack intake is reduced using an implicit high-level construal cue. Health Psychology,Vol 35(8), Aug 2016, 923-926.
Reed, P. (2015). The structure of random ratio responding in humans Journal of Experimental Psychology: Animal Learning and Cognition, 41(4), 419-431
Still, K., May, R., Rehfeldt, R., Whelan, R. & Dymond, S. (2015). Facilitating derived requesting skills with a touchscreen tablet computer for children with autism spectrum disorder. Research in Autism Spectrum Disorders, 19, 44-58
Cameron, G., Schlund, M. & Dymond, S. (2015) Generalization of socially transmitted and instructed avoidance. Frontiers in Behavioral Neuroscience 9
Jiga-Boy, G., Toma, C. & Corneille, O. (2014). Work more, then feel more: The influence of effort on affective predictions PLOS ONE
Hassoulas, A., McHugh, L. & Reed, P. (2013). Avoidance and behavioural flexibility in obsessive compulsive disorder. Journal of Anxiety Disorders, 44, 31-45.
Osborne, L. A., Middleton, R. M., Jones, K.H., Ford, D. V., Noble, J. G. (2013) Desirability and expectations of the UK MS Register: Views of people with MS. International Journal of Medical Informatics
Wang, T., Dymond, S. (2013).Event-related potential correlates of emergent inference in human arbitrary relational learning Behavioural Brain Research.
Kingsley, M., Penas-Ruiz, C., Terry, C., Russel, M. (2013). Effects of carbohydrate-hydration strategies on glucose metabolism, sprint performance and hydration during a soccer match simulation in recreational players Journal of Science and Medicine in Sport, Volume 17, Issue 2, 239-243.
McHugh, L. Procter, J. Herzog, M. Schock, A. Reed, P.(2012) The effect of mindfulness on extinction and behavioral resurgence Learning & Behavior
Bradshaw, C. A., & Reed, P. (2012). Relationship between contingency awareness and human performance on random ratio and random interval schedules. Learning and Motivation, 43, 55-65.
Reynolds, G. & Reed, P. (2012). Effects of a Downward Shift in Reinforcer Value on Stimulus Over-Selectivity. Learning and Motivation, 28(2), 148-153.
Dymond, S., Bateman, H., & Dixon, M. R. (2010). Derived transformation of children's pregambling game playing. Journal of the Experimental Analysis of Behavior, 94, 353-363.
Opensesame