Tag: arduino

  • Building and Coding a Medical Device with C++ and Arduino Controller

    A personal confession up front, I am an highly functioning person with Autistic Spectrum Disorder, otherwise known as Asperger’s Syndrome. Science refers to us as being Neurodivergent which the Oxford Languages Dictionary defines as “differing in mental or neurological function from what is considered typical or normal (frequently used with reference to autistic spectrum disorders)”. Part of my neurological differences is that I am extra sensitive to Electro-Magnetic Fields (EMF), which helped me in my duties as a Signals Intelligence technical analyst on USN Submarines but not so much in everyday life. To provide relief from this extra sensitivity I researched different ways to relieve this ‘pain’. This article is about the creation of my medical device and how I built it using Arduino microcontroller and C++ to regulate the circuit power for the device.

    I will not be covering the science behind the medical device, this is covered in Ch. 9 of my book Battlespace of Mind: AI, Cybernetics and Information Warfare [link] [pdf]

    A brief overview of Arduino microcontrollers is related by Wikipedia:

    Arduino (/ɑːrˈdwiːnoʊ/) is an Italian open-source hardware and software company, project, and user community that designs and manufactures single-board microcontrollers and microcontroller kits for building digital devices. Its hardware products are licensed under a CC BY-SA license, while the software is licensed under the GNU Lesser General Public License (LGPL) or the GNU General Public License (GPL),[1] permitting the manufacture of Arduino boards and software distribution by anyone. Arduino boards are available commercially from the official website or through authorized distributors.[2]

    Arduino board designs use a variety of microprocessors and controllers. The boards are equipped with sets of digital and analog input/output (I/O) pins that may be interfaced to various expansion boards (‘shields’) or breadboards (for prototyping) and other circuits. The boards feature serial communications interfaces, including Universal Serial Bus (USB) on some models, which are also used for loading programs. The microcontrollers can be programmed using the C and C++ programming languages (Embedded C), using a standard API which is also known as the Arduino Programming Language, inspired by the Processing language and used with a modified version of the Processing IDE. In addition to using traditional compiler toolchains, the Arduino project provides an integrated development environment (IDE) and a command line tool developed in Go.

    (source: https://en.wikipedia.org/wiki/Arduino )

    In my device I used an Arduino Uno card which attaches to a bread board that has a simple electronic circuit for regulating electric current to a coil, the coil itself is considered a form of Transcranial Magnetic Stimulation, except in this case it is referred to as Transcerebral Magnetic Stimulation. First, I will cover the wiring of the bread board electric circuit then go over the code file which is used to program the Uno card.

    To begin we will need the following parts list:

    Parts list:

    • Arduino Uno Board, plus necessary connectors (purchase a starter kit online)
    • Arduino Breadboard
    • 1K Ohm Resistor
    • TIP120 to 220 Voltage Regulator
    • Diode 1N4007
    • Red LED (620nm Wavelength)

    Make the Circuit:

    see the breadboard completed image below and make sure your breadboard is oriented the proper way before adding electronic components to the board.

    1. connect LED to pin a21 and a22
    2. on the Arduino Uno out pin 9 to pin b21 infront right leg of LED on bread board. Connect gound pin 9 to Breadboard – negative base.
    3. Take 1K Ohm Resistor and connect to pin b21 in front of LED short leg, connect resistor out to pin f20 in front of 120 TIP V regulator.
    4. Voltage regulator, facing properly the plastic should be facing you with the metal end farthest away from you, metal hole mount to rear, place in pin g20,g19,g18
    5. Ground the regulator, grab a jumper cable short or med red one or other color as you wish. one end connect to negative rail the other end connect to right pin of voltage regulator place in j18
    6. Coil In, pin h19 in front of center of V regulator
    7. Diode, (grey strip is out) grey end into + positive pin 20 of breadboard base. In goes to pin j19 behind out to coil. (see video)
    8. Coil out, to + positive on board base rail pin 21, should be next to diode, to the left of the diode one pin location.

    Then your finished product should look like this:

    Program the Uno Card:

    the next step is to add the C++ logic to the card so.

    1. Connect your card via usb to your computer
    2. Open the Arduino IDE, download this at https://www.arduino.cc/en/software
    3. get a copy of the arduino code file from my github repo: https://github.com/autonomous019/ahronov-bohm-cybersecurity/blob/main/accelerate_frequency_driver.ino
    4. then upload it to the board, you can search the internet for plenty of videos on how to upload a sketch file to your card. Be sure to select the proper board and serial port for your board in the IDE.
    5. connect the power pin on the card to your bread board, use a jumper cable to connect pin9 on the card to in front of the led pin that is the in to the led, this is the long leg of the led.
    6. connect the card ground (“GRD”) to your bread board negative rail (-).

    if you were succesfull you should see a flashing red led light on the bread board.

    Some things to note about the sketch file, which is written in C++:

    int ledPin = 9;
    int sensorValue;     // variable to stores data
    const int adc = 0 ;   //naming pin 0 of analog input side as ‘adc’
    
    void setup() {
      
      pinMode(9, OUTPUT);
      Serial.begin(9600);  //init serial comm
      
    }

    this bit of code initializes pin 9 as the power source to the bread board.

    //add as many 'pins' or 'counters' to add random config to em waves for security, prevents others from hijacking your shield
    int random_key_1 = random_delay_time(6,30);
    int random_key_2 = random_delay_time(6,30);
    int random_key_3 = random_delay_time(6,30);
    int random_key_4 = random_delay_time(6,30);

    this code block sets a small security ‘salt’ to create a random time delay in the looping of the circuit power.

    The circuit uses a descending time delay from 24ms down to 6ms.

    int phaser_a = phase_former(24,3);
    int phaser_b = phase_former(22,3);
    int phaser_c = phase_former(20,3);
    int phaser_d = phase_former(18,3);
    int phaser_e = phase_former(16,3);
    int phaser_f = phase_former(14,3);
    int phaser_g = phase_former(12,3);
    int phaser_h = phase_former(10,3);
    int phaser_i = phase_former(8,3);
    int phaser_k = phase_former(6,3);
    
    
    }// ends loop()
    
    
    int phase_former(int delay_time, int point_duration) {
      int v = 0;
      digitalWrite(9,HIGH);
      delay(point_duration);
      digitalWrite(9,LOW);
      delay(delay_time);
      return v; 
    }

    we set up specific phases for the circuit then call those phases in phase_former() func.

    If you want to learn how to make the coil and want more information on the overall project see the github repo at https://github.com/autonomous019/ahronov-bohm-cybersecurity