1
\$\begingroup\$

I'm building this Instructables project: Body-ultrasound Sonography With Arduino, which is using ultrasound to see inside the body. However I'm having some issues with the sender circuit, shown below:

1

The Arduino is being used to trigger the SN74121 and so a short 100-200ns should e created and sent to the ICL7667. From this a switching pulse between 0-9V should be generated to drive the power mosfet, IRL620.

However, my issue is the ICL7667. At pin 6 my output is 0v and doesn't change. At pin 2 and 4 the voltage measures to be 3.88V. Therefore the power mosfet gate isn't being turned ON. Not sure what I'm doing wrong. I'm using the IC7667.

I'm also using two DC power bench supplies that are set to 9V/1A and are connected together to give +9V/GND/-9V.

Full circuit diagram : 2

Circuit Wirings, the blue cable going to SN74121 is Arduino trigger. 3

DC bench power supply, the current being drawn from the circuit: 4

Arduino Code:

#define pin_output 5
#define pin_input_magnification 4
#define pin_input_sleep 3

unsigned long start_time;
unsigned long stop_time;
unsigned int values[600];    // Array with the read voltage values


int i, j;
int Trigger_time;    // Duration of the trigger pulse

// =========================
// ========= SETUP =========
// =========================

void setup()
   {
    Serial.begin(115200);  
    
    REG_ADC_MR = 0x10380080;              // change from 10380200 to 10380080, 1 is the PREESCALER and 8 means FREERUN
    ADC -> ADC_CHER = 0x03;               // enable ADC on pin A7
    
    pinMode(pin_output, OUTPUT);
    pinMode(pin_input_magnification, INPUT);    // Switch-input for magnification
    pinMode(pin_input_sleep, INPUT);            // Switch-input for sleep-mode   
    digitalWrite(pin_output, LOW); 
 
    Trigger_time = 1;                     //Duration of the trigger pulse

// ========================
// ========= LOOP =========
// ========================


void loop()
   {
    for (j = 0; j < 18; j++)   // Display of 18 scans side by side in the x-direction
       {   
        // Output of the trigger signal
        // ==========================
    
        digitalWrite(pin_output,HIGH);
        //delayMicroseconds(Trigger_time);
        digitalWrite(pin_output,LOW);
        


        // Reading in the US reflections
        // ===========================

        start_time = micros();
        
        if (digitalRead(pin_input_magnification) == LOW)   // without time extension reading of 300 values; recorded time span = 120 µsec
           {
            for(i = 0; i < 300; i++)
               {
                while((ADC->ADC_ISR & 0x03)==0);  // wait for conversion
        
                values[i] = ADC->ADC_CDR[0];      //get values

                //delayMicroseconds(1);
               }
           }
        else       //reading of 600 values ​​with time extension; recorded time span = 240 µsec
           {
            for(i = 0; i < 600; i++)
               {
                while((ADC->ADC_ISR & 0x03)==0);  // wait for conversion
        
                values[i] = ADC->ADC_CDR[0];      //get values

                //delayMicroseconds(1);
               }
            
           }
    
        //delayMicroseconds(100);
        //delay(5);
    
        
        stop_time = micros();

        Serial.print("Total time for 300 values: ");
        Serial.print(stop_time-start_time);
        Serial.println(" microseconds");
        Serial.print("Average time in microseconds per conversion: ");
        Serial.println((float)(stop_time-start_time)/300);
        
        
        
        Serial.println("Values: ");
        
        for(i = 0;i < 600; i++)
           {
            Serial.println(values[i]);
           }
        

        // Interrogate the pause button
        // =====================
        
        if (digitalRead(pin_input_sleep) == HIGH)
           {

            while(digitalRead(pin_input_sleep) == HIGH)
               {
                // sleeping
               }
           }
             
        delay(1000);    
       }
      
   }
\$\endgroup\$
4
  • \$\begingroup\$ Where are you connecting the minus 9 volts? \$\endgroup\$
    – Andy aka
    Aug 9, 2021 at 8:56
  • \$\begingroup\$ Hi @Andyaka, the -9V is used in the receiver + peak detector circuit to power the op-amps. I'll attach the full circuit diagram. \$\endgroup\$ Aug 9, 2021 at 9:09
  • \$\begingroup\$ Pin 6 is VDD on the 7667, did you mean pin 5 and 7? \$\endgroup\$
    – Oskar Skog
    Aug 9, 2021 at 10:05
  • \$\begingroup\$ Hi! @OskarSkog yes, apologies I meant pins 5 and 7. \$\endgroup\$ Aug 9, 2021 at 10:36

2 Answers 2

0
\$\begingroup\$

It seems that the Arduino output is not triggering the 74121 monostable on the B input p5 positive edge >2V.

Once you get the arduino output toggling between 0 & 1 and the 74141 output is not changing, that could mean the pulse width is too small. Putting your ungrounded finger across the radial cap or changing it to a bigger one ought to make visible Vavg readings on the output on 74141 p1 and also the 7661 and the FET Vdc avg.

\$\endgroup\$
10
  • \$\begingroup\$ Yes, I thought this too but I was using the code from the Instructables site. \$\endgroup\$ Aug 9, 2021 at 12:58
  • \$\begingroup\$ Did you verify pulses? \$\endgroup\$ Aug 9, 2021 at 13:07
  • \$\begingroup\$ I only have a multimeter, therefore can't look 'inside' the circuit. But when I print the trigger to serial it outputs 1 each time. \$\endgroup\$ Aug 9, 2021 at 13:16
  • \$\begingroup\$ If the pulses exist then Qbar will lower voltage from stuck high pin 2 at 3.88V when you connect the blue wire \$\endgroup\$ Aug 9, 2021 at 13:22
  • \$\begingroup\$ Okay, I was thinking that since the IC7667 is an inverting mosfet, if there's a HIGH at the input pins I'll get 0V on the output pins. Also 74121, needs a positive pulse to be triggered, therefore the output changes from HIGH to LOW in a very short time (100-200ns). Therefore, ICL7667 only goes high for 100-200ns therefore the reason I think I'm not seeing the switching voltage is because it happens too fast for the multimeter to see. \$\endgroup\$ Aug 9, 2021 at 13:25
0
\$\begingroup\$

I've managed to resolve the issue with not knowing if Arduino was triggering the 74121 or not. I made a separate circuit with just the 74121 and larger RC components so the pulse width would be longer. With the new RC components I calculated the new pulse width to be 1.3 seconds. I timed the LED going from LOW-HIGH and I got 1.27 seconds. Therefore Arduino does trigger the monostable but it's just really hard to see with the smaller RC components. Thanks!

\$\endgroup\$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.