Arduino Trigger Pulse to SN74121

Hi everyone,

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

The main issue is within the monostable SN74121 and the Arduino Due. The Arduino output is meant to trigger the 74121 on the B input (pin 5), the 74121 needs a positive pulse on it's input to be triggered. The pulse generated from the trigger should be around 100-200ns long with the timing components (resistor and capacitor). I used the code from the instructables site but I'm not sure the trigger pulse is being fired or is working.

For example, at pin 1 (Qbar) if the pulses exists it will lower the voltage from pin 2 of the ICL7667 when I connect the trigger wire. However, this is not the case and pin 2 of the ICL7667 remains at 3.88V. The code I'm using to trigger the 74121 is shown below:

#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 ;
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() 

{
        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);     
   }

I'm not sure how to see if Arduino is actually toggling between 0 & 1, as The 74121 needs a positive pulse at the input to being triggered. This trigger pulse comes from the Arduino. When the 74121 is being triggered, it's output changes from high to low for a very short time (i.e. Only 100 ns). Therefore the 7667 goes from low to high also only for 100 ns but I can't see this with a multimeter and don't have an oscilloscope,

You can breadboard a temporary logic probe from a monostable to see if the pulse is occurring.

The pulse out of the 74121 is so short in duration that your meter cannot recognize it.
Use what LarryD suggested or even a divide by 2 with an LED to see it.

Is SN74121 necessary at all? I mean, the Arduino Due is quite fast and I think if port manipulation is used instead of 'digitalWrite' it will be able to generate the necessary short signal for ICL7667. I am just curious.

Even placing an LED at the output of 74121, the pulse is still hard to see because it happens so fast

Maybe if you have a second Arduino (Due), it is possible to use it as a logic analyzer. Connect 1 of its pins to the output of the SN74121 and program it to count with interrupts and periodically send data over the serial connection and\or flashing LED.

temporarily change the 50pF timing cap on the '121 to a much higher value. That will stretch the pulse to something you could see with an LED.

1 Like

Right, good idea. The loop has a 1000 milliseconds delay, so you can put a fairly large RC values on the ‘121. without the pulses running into each other.

It looks like the 7667 driver can handle 10 mA, you could see the pulse at an output of that chip with an LED and resistor drawing half or less of that plenty bright.

a7

Thanks all for the help. I made a separate circuit on the breadboard with just the 74121 and larger RC components. I used a 40kohm resistor and 47uF capacitor which produces a pulse width of around 1.3 seconds. Timed the LED and got 1.27 seconds. Therefore the trigger signal from Arduino does work! Just very hard to see it with smaller RC values. Thanks!

The 1nF capacitor on the trigger input is completely bogus, remove it.

Secondly the SN74121 is TTL, you should be using the CMOS part, 74HC121.