Hi friends,
2 separate ultrasonic head inputs.
I am doing a project about skin care. I used Arduino Mega Rev3 in this project. The PNP transistor does not work in the circuit. As you can see, digital pin 46, which is connected directly to B5 from the Arduino, is set to HIGH in the setup, but the signal still goes to the headers.
C0 is working and I can change the title, but I could not make both titles not work at the same time.
I wonder if R702-R703 10k resistors are too much?
I have an oscilloscope. Can you please help me with where I need to test or replace it?
Things I tried;
Assigning 46 as input.
Changing the header directions, even though I know it won't happen.
Bringing the adjustable resistor R704 from the beginning to the end (only increases the power)
The code does not compile because I only gave the relevant part to avoid wasting your time. I set it to HIGH during the setup phase, logically the Ultrasonic heads should not work.
The code and circuit attached, thanks friends.
int SonicPin = 46;
int pinC0 = 37;
bool Sonic = 0;
bool c0ayar=0;
void setup() {
pinMode(SonicPin, OUTPUT);
pinMode(pinC0, OUTPUT);
digitalWrite(SonicPin, HIGH);
digitalWrite(pinC0, LOW);
}
void loop() {
if (Sonic == 1) { // Sadece Sıcak Soğuk, kart B0 j201 6v
//Serial.println("0x31, Hammer high olucak :-------- ");
digitalWrite(SonicPin, LOW); //DİKKAT PWMLE ÇALIŞTIRILIP AYAR TYAPILACAK !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 50 hz yani 20ms periyot yüzde 20 de çalıştarım
delay(4);
digitalWrite(SonicPin, HIGH);
delay(16);
if(c0ayar ==1 ){
digitalWrite(pinC0,HIGH);
}
if(c0ayar ==0 ){
digitalWrite(pinC0,LOW);
}
} else if (Sonic == 0) { //
//Serial.println("0x31, Hammer low olucak : ----------");
digitalWrite(SonicPin, HIGH);
}
}


