Announcement

Collapse
No announcement yet.

Hattusa Pulse

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Hattusa
    replied
    I haven't made the PCB yet, but I created the simulation file for the proteus. I am slowly writing the code. Those who want to test can download and test.

    http://https://www.dosyaupload.com/1..._Code_Test.zip


    Code:
    /*
    Hattusa Pi Detector software
    */
    #include <Wire.h>               // Wire kütüphanesini ekliyoruz.
    #include <LiquidCrystal_I2C.h>  // LiquidCrystal_I2C kütüphanesini ekliyoruz.
    #include <Adafruit_ADS1X15.h>
    #include <EEPROM.h> /* EEPROM fonksiyonları için kütüphane dahil edilmelidir. */
    
    LiquidCrystal_I2C lcd(0x20, 20, 4);  // 16 karakter, 2 satır LCD için bağlantı adresi:0x20
    Adafruit_ADS1015 ads;                /* Use this for the 12-bit version */
    #define Pulse 8
    #define T0 3
    #define T1 2
    #define FerroSound 5
    #define NonFerroSound 9
    #define Enter 11
    #define Up 12
    #define Down 13
    bool BluetoothConnection = false, PressOk = false;
    uint8_t PulsePower, T0Delay, T1Delay, MenuSet, TsrHold, pTsrHold, EnterCounter, PressTime = 50;
    uint8_t EnterSelect, UpSelect, DownSelect;
    float Batery, pBatery;
    long PressCount;
    void setup() {
      pinMode(Pulse, OUTPUT);
      pinMode(T0, OUTPUT);
      pinMode(T1, OUTPUT);
      pinMode(FerroSound, OUTPUT);
      pinMode(NonFerroSound, OUTPUT);
      pinMode(Enter, INPUT);
      pinMode(Up, INPUT);
      pinMode(Down, INPUT);
      digitalWrite(Pulse, HIGH);
      BluetoothConnection = EEPROM.read(1);
      if (BluetoothConnection) Serial.begin(115200);  //start connection if bluetooth will be used
      PulsePower = EEPROM.read(2);
      if (PulsePower == 255) PulsePower = 150;
      T0Delay = EEPROM.read(3);
      if (T0Delay == 255) T0Delay = 50;
      T1Delay = EEPROM.read(4);
      if (T1Delay == 255) T1Delay = 25;
      TsrHold = EEPROM.read(5);
      if (TsrHold == 255) TsrHold = 50;
      Interrupt3Set();
      lcd.init();
      lcd.backlight();
      bool flipflop = false;
      for (int x = 0; x < 16; x++) {  //We wait for a while for the coil to energize and the signal to form, the opening menu has been added
        flipflop = !flipflop;
        if (flipflop) {
          lcd.setCursor(0, 0);
          lcd.print("HATTUSA OPENING!");
        } else {
          lcd.setCursor(0, 0);
          lcd.print("                ");
        }
        lcd.setCursor(x, 1);
        lcd.print(">");
        Batery = BattMeasure();
        delay(100);
      }
      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print("TSR:");
      lcd.print(TsrHold);
    }
    void loop() {
      Batery = BattMeasure();
      if (Batery != pBatery) {
        lcd.setCursor(10, 0);
        lcd.print(Batery);
        lcd.print("V ");
        pBatery = Batery;
      }
      if (TsrHold != pTsrHold) {
        lcd.setCursor(0, 0);
        lcd.print("TSR:");
        lcd.print(TsrHold);
        pTsrHold = TsrHold;
      }
    
    /*    Main Menu Functions      */
      ButtonControl();
      if (PressOk) {
        if (millis() - PressCount > 500) {
          lcd.setCursor(0, 1);
          lcd.print("                ");
          PressOk = false;
        }
      }
    }
    void ButtonControl() {
      EnterSelect = digitalRead(Enter);
      UpSelect = digitalRead(Up);
      DownSelect = digitalRead(Down);
      /**  Enter Button Function   **/
      if (EnterSelect == 0) {
        EnterCounter = 0;
        while (EnterSelect == 0) {
          EnterCounter++;
          EnterSelect = digitalRead(Enter);
          delay(100);
        }
        if (EnterCounter < PressTime) {
          lcd.setCursor(0, 1);
          lcd.print("   G R O U N D  ");
          PressCount = millis();
          PressOk = true;
        } else {
          MenuSet++;
          if (MenuSet > 3) MenuSet = 0;
        }
      }
      /*    Up Button Funciton  */
      if (UpSelect == 0) {
        if (MenuSet == 0) {
          TsrHold++;
          if (TsrHold > 99) TsrHold = 99;
          EEPROM.write(5, TsrHold);
        }
        if (MenuSet == 1) {
          //to be written
        }
        if (MenuSet == 2) {
          //to be written
        }
        if (MenuSet == 3) {
          //to be written
        }
        delay(200);
      }
      /*    Down Button Funciton  */
      if (DownSelect == 0) {
        if (MenuSet == 0) {
          TsrHold--;
          if (TsrHold < 1) TsrHold = 1;
          EEPROM.write(5, TsrHold);
        }
        if (MenuSet == 1) {
          //to be written
        }
        if (MenuSet == 2) {
          //to be written
        }
        if (MenuSet == 3) {
          //to be written
        }
        delay(200);
      }
    }
    float BattMeasure() {
      float bat;
      int adc = analogRead(A0);
      return bat = (adc * (5.0 / 1023.0)) / 0.2326;  //10k /(33k +10k) =>0.2326
    }
    
    /*   timer2 interrup setting */
    void Interrupt3Set() {  // 1000 Hz (16000000/((124+1)*128))
      noInterrupts();
      TCCR2A = 0;
      TCCR2B = 0;
      TCNT2 = 0;
      OCR2A = 124;
      TCCR2A |= (1 << WGM21);
      TCCR2B |= (1 << CS22) | (1 << CS20);
      TIMSK2 |= (1 << OCIE2A);
      interrupts();
    }
    /*   timer2 interrup function */
    ISR(TIMER2_COMPA_vect) {
      digitalWrite(Pulse, LOW);
      delayMicroseconds(PulsePower);
      digitalWrite(Pulse, HIGH);
      delayMicroseconds(T0Delay);
      digitalWrite(T0, HIGH);
      delayMicroseconds(5);
      digitalWrite(T0, LOW);
      delayMicroseconds(T1Delay);
      digitalWrite(T1, HIGH);
      delayMicroseconds(5);
      digitalWrite(T1, LOW);
    }
    ​[URL="http://https://www.dosyaupload.com/1r4hm/Hattusa_Code_Test.zip"][/URL]

    Leave a comment:


  • ivconic
    replied
    Software...?
    Pack it with 7Z, RAR, ZIP, anything, than upload it to your Google Drive and share the link here.

    Pick option "Anyone with the link":

    Click image for larger version

Name:	image.png
Views:	550
Size:	30.7 KB
ID:	411219​

    Leave a comment:


  • ivconic
    replied
    I have Proteus 8.6, yesterday I installed 8.15 too:

    Click image for larger version

Name:	image.png
Views:	551
Size:	119.9 KB
ID:	411217​

    Leave a comment:


  • Hattusa
    replied
    Originally posted by ivconic View Post
    Dang!

    Click image for larger version Name:	image.png Views:	0 Size:	11.3 KB ID:	411200

    Is it possible You to save it in earlier version?
    I am not sure Proteus can do that... must check.

    ​
    There are so many versions of proteus that we can't keep up. Does the picture of the schema not work for you?
    I will produce the PCB over the weekend and perform the sequencing of the board. my problem is software part, how should i share it? I thought I'd send you a private message about it, but I couldn't. How should I share the software part?
    please inform me...​

    Leave a comment:


  • ivconic
    replied
    This one is alright!

    Click image for larger version

Name:	image.png
Views:	556
Size:	297.3 KB
ID:	411202​

    Leave a comment:


  • ivconic
    replied
    Dang!

    Click image for larger version  Name:	image.png Views:	0 Size:	11.3 KB ID:	411200

    Is it possible You to save it in earlier version?
    I am not sure Proteus can do that... must check.

    ​

    Leave a comment:


  • ivconic
    replied
    Yes!
    But I didn't opened them yet.
    In a few minutes I will.

    Leave a comment:


  • Hattusa
    replied
    Originally posted by ivconic View Post


    That's what I wanted, THANKS!
    OK, now give me some time to analyze that and see...
    I will inform you, once I form a opinion on this.
    Did you download the proteus and sprint layout files?

    Leave a comment:


  • ivconic
    replied


    That's what I wanted, THANKS!
    OK, now give me some time to analyze that and see...
    I will inform you, once I form a opinion on this.

    Leave a comment:


  • Hattusa
    replied
    Click image for larger version  Name:	HattusaPCB.jpg Views:	0 Size:	107.7 KB ID:	411192

    These are the proteus and sprint layout files;


    ​

    Leave a comment:


  • Hattusa
    replied



    Click image for larger version  Name:	HATTUSA.jpg Views:	0 Size:	287.6 KB ID:	411188

    Leave a comment:


  • Hattusa
    replied
    Originally posted by ivconic View Post
    "...hi, since no one has received a suggestion, I have this analog structure for digital;
    a- I added 1 x 16x2 lcd
    b- I added 3 buttons
    c- I added an hc05 bluetooth module for future use for android or PC (I will activate it when the project progresses)
    d- it is the sound layer that upsets me. for two audio outputs, the atmega328 is a bit old architecture, there are 3 timers inside. I couldn't activate timer0 because timer0 is used for millis() and delay, I couldn't use timer1 because timer1 is used for spi, only timer2 remains, I couldn't use it in the sound stage because I used it for firing the mosfet and timing in TX. i wish i could use a more powerful MCU sure it would be easier. But for members I have to use atmega328...
    "


    a - No problem, piece of cake
    b - 5 is better than 3, if you explain the exact functions of those 3 buttons; I might understsand better the concept.
    c - No problem, piece of cake
    d - Don't worry too much about the architecture of Atmega, just clearly describe the processes you want the code to do.
    Changing a timer will only spoil some of the Cpp functions. Well-written code for a PI detector cannot rely on code written only in Cpp. You don't need many of these functions at all.
    Don't waste time on things that haven't happened yet. Instead, describe it clearly in the form of a descriptive algorithm; all the processes you want to happen in the code.

    Direct port/pin manipulation is 14 times faster than a similar function written in Cpp.
    All necessary timings will be done with the help of a timer(s).
    Outside the main code, independent and having the highest priority.
    Everything else comes later.
    ​
    ​Is it possible to finally get a better resolution schematic? And possibly Sprint files of already existing pcb from posted photos?
    This is the last time I asked about it.
    I hastily drew the schematic and am attaching it here. I also drew the PCB according to the diagram. I am using sprint layout, I am attaching that file as well. If you don't mind, I'll build the PCB next. In the code part, I plan to share the oscilloscope images step by step.

    The menu is simple with 3 buttons;
    1. menu button: make ground balance if pressed short, settings menu with long press
    2. Up button: If not entered in the settings menu, increase the sensitivity, and in the settings menu, increase the relevant setting.
    3. down button: decrease the sensitivity if it is not in the settings menu, and decrease the relevant setting in the settings menu.​

    Leave a comment:


  • Hattusa
    replied
    Originally posted by waltr View Post
    When I did my version of the Hammer Head II, I used a header to connect the processor. This allowed using any processor for very easy upgrades.
    See this thread: https://www.geotech1.com/forums/foru...ake-on-the-hh2

    Why do you 'Have' to use the very old atmega328? Which members?

    I think no one is responding to your thread due to this is a simple an old design. Good as a beginner's project but not much else.

    The Arduino Nano project is much more up to date.
    https://www.geotech1.com/forums/foru...rduino-nano-pi

    And the Voodoo has very interesting concepts.


    In a PI detector a Must Have feature in Ground Balance.
    I agree that this project is a very simple project. But rest assured, I have a lot to learn from you and you from me.
    I would like to use Arm, esp etc. mcu's, but members may have problems in discarding their hexes. In falezjo, I used atmega328p because members know how to load atmega hex easily.

    There are points that I do not know or can not overcome, I am an amateur. My main job is not electronics, but I have been busy with treasure devices for 15 years. You will understand that these devices are fun, have fun...​

    Leave a comment:


  • waltr
    replied
    When I did my version of the Hammer Head II, I used a header to connect the processor. This allowed using any processor for very easy upgrades.
    See this thread: https://www.geotech1.com/forums/foru...ake-on-the-hh2

    Why do you 'Have' to use the very old atmega328? Which members?

    I think no one is responding to your thread due to this is a simple an old design. Good as a beginner's project but not much else.

    The Arduino Nano project is much more up to date.


    And the Voodoo has very interesting concepts.


    In a PI detector a Must Have feature in Ground Balance.

    Leave a comment:


  • ivconic
    replied
    "...hi, since no one has received a suggestion, I have this analog structure for digital;
    a- I added 1 x 16x2 lcd
    b- I added 3 buttons
    c- I added an hc05 bluetooth module for future use for android or PC (I will activate it when the project progresses)
    d- it is the sound layer that upsets me. for two audio outputs, the atmega328 is a bit old architecture, there are 3 timers inside. I couldn't activate timer0 because timer0 is used for millis() and delay, I couldn't use timer1 because timer1 is used for spi, only timer2 remains, I couldn't use it in the sound stage because I used it for firing the mosfet and timing in TX. i wish i could use a more powerful MCU sure it would be easier. But for members I have to use atmega328...
    "


    a - No problem, piece of cake
    b - 5 is better than 3, if you explain the exact functions of those 3 buttons; I might understsand better the concept.
    c - No problem, piece of cake
    d - Don't worry too much about the architecture of Atmega, just clearly describe the processes you want the code to do.
    Changing a timer will only spoil some of the Cpp functions. Well-written code for a PI detector cannot rely on code written only in Cpp. You don't need many of these functions at all.
    Don't waste time on things that haven't happened yet. Instead, describe it clearly in the form of a descriptive algorithm; all the processes you want to happen in the code.

    Direct port/pin manipulation is 14 times faster than a similar function written in Cpp.
    All necessary timings will be done with the help of a timer(s).
    Outside the main code, independent and having the highest priority.
    Everything else comes later.
    ​
    ​Is it possible to finally get a better resolution schematic? And possibly Sprint files of already existing pcb from posted photos?
    This is the last time I asked about it.

    Leave a comment:

Working...
X