User Tools

Site Tools


Personal Log: PiGI Testing

Some time ago i stumbled upon the PiGI project, joined the chatroom and somehow convinced chrono to send me a prototype board. Thanks for that! So here will be a summary of my testing of the PiGI.

The Geiger-Mueller-Tube

I bought an old russian SBM-20 tube on ebay for 26$ and soldered some cable to both ends and isolated the ends with heat-shrink tubing. Then i soldered it to my PiGI with some leads that I thougt had sufficient isolation for high voltages.

The PiGI and my Pi

Well, connecting the PiGI is pretty easy, just push it onto the pin headers. But I also came up with some other possibilities. To connect the PiGI to a breadboard (and Arduino and stuff) I soldered my own breadboard-adapter.

And if you build two and get a ribbon cable, you can also connect your PI to the breadboard.

I compiled the software examples you can find here and got it to work, but right now I can't even remeber how LOL I focussed more on the Arduino stuff below.

The PiGI and Arduino

Connecting the PiGI to an Arduino (or other microcontroler) is easy. Just connect 3.3V to pin 1, 5.0V to pin 2, GND to pin 25, and connect the interrupt D2 of the Arduino to pin 7 of your PiGI.

Simple Beeper

// Simple PiGI beeper for Arduino, 2014, by "JamesT42"
// Written in Arduino 1.0.5 IDE
// License:  Creative Commons - Attribution - Share Alike http://creativecommons.org/licenses/by-sa/3.0/

// Connect the PiGI to D2, which is Interrupt 0
// This program lights up a LED and plays a tone. You can also use a small beeper (the ones you simply connect
// to 5V and where you cant vary the frequency of the tone) connected to the same Pin as the LED.

#define TonePin           A2            // Pin for the speaker
#define ToneFreq          200           // Frequency of the tone
#define LED               13            // Pin for optical signal, you can also connect a beeper here

volatile long counter = 0;
long lastcounter = 0;


void setup() {
   /*
  Activating the Interrupt: If the signal on Pin 2 drops below the threshold "FALLING",
  the function CountInterrupt() is called
   */
  attachInterrupt(0, CountInterrupt, FALLING);
  pinMode(LED, OUTPUT);
  pinMode(TonePin, OUTPUT);
}

void loop() {

  if (counter > lastcounter) {
  maketone();
  lastcounter = lastcounter + 1;
  if (counter > lastcounter + 10) {
    lastcounter = counter;
    }
  }

}

void maketone() {
  // play tone and turn on LED
  tone(TonePin, ToneFreq);
  digitalWrite(LED, HIGH);
  // delay blocks the program, only usable for lower count rates, should upgrade to something without delay!
  delay(25);
  // stop the tone playing and turn off LED
  noTone(TonePin);
  digitalWrite(LED, LOW);
}

void CountInterrupt() {
  // just count the events
  counter = counter + 1;
}

Simple counter

// Simple PiGI counter for Arduino, 2014, by "JamesT42"
// Written in Arduino 1.0.5 IDE
// License:  Creative Commons - Attribution - Share Alike http://creativecommons.org/licenses/by-sa/3.0/

// Connect the PiGI to D2, which is Interrupt 0
// This program counts the events in a predefined timespan (countingtime) and outputs the resulting cpm
// (counts per minute) to the serial port of your PC. So open up the Serial Monitor!

long lasttime = 0;
long counter = 0;
long countingtime = 30000;  // 30 seconds
float cpm = 0.0;

void setup() {
   /*
  Activating the Interrupt: If the signal on Pin 2 drops below the threshold "FALLING",
  the function CountInterrupt() is called
   */
  attachInterrupt(0, CountInterrupt, FALLING);
  // Init the serial port
  Serial.begin(57600);
  Serial.println("PiGI Simple Counter");
}

void loop() {
  
if (millis() - lasttime > countingtime) {
  lasttime = millis();
  cpm = (float)counter / countingtime * 60000;
  Serial.print("I counted ");
  Serial.print(counter);
  Serial.print(" events in the last ");
  Serial.print(countingtime/1000);
  Serial.print(" seconds, that amounts to ");
  Serial.print(cpm);
  Serial.println(" cpm");
  counter = 0;
  }
}

void CountInterrupt() {
  // just count the events
  counter = counter + 1;
}
To improve the program, one should calculate some type of running average on the cpm values.

Generating random numbers (proof-of-concept)

Recently, i visited a lecture about computer physics, and when we discussed different random number generators I had the idea to implement a random number generator based on radioactive decay. See this Sparfun tutorial for the principles or this page.

// Geiger-Mueller-Counter for random numbers, 2013, by "JamesT42"
// Written in Arduino 1.0.5 IDE
// License:  Creative Commons - Attribution - Share Alike http://creativecommons.org/licenses/by-sa/3.0/

// Connect the PiGI to D2, which is Interrupt 0

// Defining the variables
volatile unsigned long t1 = 0;
volatile unsigned long t2 = 0;
volatile unsigned long t3 = 0;
volatile unsigned long t4 = 0;
volatile unsigned long T1 = 0;
volatile unsigned long T2 = 0;
volatile unsigned long time = 0;
volatile unsigned long counter = 0;
volatile int number = -1;

void setup() {
 
  // Init the serial port
  Serial.begin(57600);
  Serial.println("Geiger-Mueller-Interface for random numbers");
  
  /*
  Activating the Interrupt: If the signal on Pin 2 drops below the threshold "FALLING",
  the function Interrupt() is called
  */
  attachInterrupt(0, Interrupt, FALLING);
}

void loop() {
  
// Does nothing

}



void Interrupt() {   // Interrupt-function
 
  time = micros();   // Save the current time
  counter = counter + 1;   // Count all events

  switch (counter % 4)     // Division modulo 4
  { 
    case 0:
      t1 = time;
      break;
    case 1:
      t2 = time;
      break;
    case 2:
      t3 = time;
      break;
    case 3:
      t4 = time;
      T1 = t2 - t1;
      T2 = t4 - t3;
      if (T1 == T2)
      {
        // Do nothing, this can happen if the clock resolution is not high enough
      }
      else 
      {
        if (T1 > T2)
        {
          number = 0;
          Serial.print(number);
        }
        if (T1 < T2)
        {
          number = 1;
          Serial.print(number);
        }
      }
      break;
  }
  return;
}
To improve the program, you should switch the logic of what is 0 and 1 every time. That can be accomplished by changing to modulo 8 and copying cases 0/1/2 to 4/5/6 and switching the 0/1 in case 3 to be case 7.

Discussion

chrono, 2014/02/14 19:52

Nice one! For me it felt the opposite of convincing, you just jumped in and started to dis/prove the dead-time calculation - which I had my doubts about but didn't feel confident enough to tackle alone - and seemed generally excited about becoming/being part of the loose team of people who actually work on it. You freely and generously gave the most precious thing we can give: time.

Therefore, it seemed only logical and fair to build another prototype board for you, so that you can experiment with it and report back how it went, sort of like a Ghetto-Peer-Review. :)

And here you did, so thank you :)

Angel17, 2023/08/08 12:57

What an interesting post. Thanks for sharing this one. Best Bar Metairie, LA

Municipal bonds, 2023/09/24 14:04

The post is great, thanks for sharing it. Cordial greeting from our website with highlighted information on the financial concept of municipal bonds.

UFABET, 2023/10/05 11:13

Wonderful article Thanks for sharing the information with us New football news every day Report on the progress of the football industry to follow every situation UFABET stick to every event to report to everyone to get to know before anyone reports news with accuracy that you can trust with ยูฟ่าเบท fast service team 24 hours a day No minimum deposit! Your account safe with us ufabet เข้าสู่ระบบ

EBINGO, 2024/01/20 03:00

Highly recommended did this. Very interesting information. Thanks for sharing! jackpot bingo

superedan, 2024/01/29 04:01

In the vast landscape of online games, a new and exciting addition has taken the gaming community by storm – the Watermelon Game.

25fox, 2024/02/12 23:39

Buy a driver's license Hello, welcome to the world's largest online driver's license organization. We sell authentic and registered driving licenses and we have several driving schools with which we collaborate.

https://origineelrijbewijskopen.com/

https://origineelrijbewijskopen.com/2023/11/10/rijbewijs-kopen-telegram/

https://origineelrijbewijskopen.com/2023/10/24/rijbewijs-kopen-nederland/ https://origineelrijbewijskopen.com/2023/11/01/rijbewijs-kopen-belgie/

https://origineelrijbewijskopen.com/2023/11/07/rijbewijs-a-kopen/

https://origineelrijbewijskopen.com/2023/11/07/rijbewijs-kopen-prijs/

https://origineelrijbewijskopen.com/2023/11/07/rijbewijs-te-koop-belgie/

https://origineelrijbewijskopen.com/2023/11/10/belgisch-rijbewijs-kopen/

https://origineelrijbewijskopen.com/2023/11/10/rijbewijs-kopen-duitsland/ https://origineelrijbewijskopen.com/2023/11/10/rijbewijs-examens-kopen/

https://origineelrijbewijskopen.com/2023/11/10/rijbewijs-kopen-hongarije/

What a nice post! I'm so happy to read this. What you wrote was very helpful to me. Thank you. Actually, I run a site similar to yours. If you have time, could you visit my site? Please leave your comments after reading what I wrote. If you do so, I will actively reflect your opinion. I think it will be a great help to run my site. Have a good day.

https://cf-cc-qualitylab.com/

https://cf-cc-qualitylab.com/product/american-dollars-for-sale/

https://cf-cc-qualitylab.com/product/buy-counterfeit-aud-online/

https://cf-cc-qualitylab.com/product/buy-fake-british-pounds-online/

https://cf-cc-qualitylab.com/product/buy-fake-euro-banknotes-online/

https://cf-cc-qualitylab.com/product/buy-new-zealand-dollars-online/ https://cf-cc-qualitylab.com/product/buy-undetected-canadian-dollars/

It is incredibly average to see the best inconspicuous components presented in a basic and seeing way Thank you. Actually, I run a site similar to yours. If you have time, could you visit my site? Please leave your comments after reading what I wrote. If you do so, I will actively reflect your opinion. I think it will be a great help to run my site. Have a good day.

https://cf-cc-qualitylab.com/product/paypal-flip/

https://cf-cc-qualitylab.com/product/western-union-flip/

https://cf-cc-qualitylab.com/product/cash-app-flip/ https://cf-cc-qualitylab.com/product/western-union-flip-sale/

https://cf-cc-qualitylab.com/product/legit-paypal-flip/

https://cf-cc-qualitylab.com/product/legit-cash-app-flip/ https://cf-cc-qualitylab.com/product/buy-cloned-cards/

https://cf-cc-qualitylab.com/product/buy-credit-card-dumps-online/

https://cf-cc-qualitylab.com/product/cloned-credit-cards-for-sale/ https://cf-cc-qualitylab.com/product/legit-paypal-money-transfer/

https://cf-cc-qualitylab.com/product/legit-paypal-money-transfer/

https://cf-cc-qualitylab.com/product/western-union-money-flip/

https://cf-cc-qualitylab.com/product/hacked-cash-app/

Such an especially significant article. To a great degree charming to examine this article.I should need to thank you for the undertakings you had made for creating this astonishing article. https://cf-cc-qualitylab.com/product/automated-money-developer-machines/

https://cf-cc-qualitylab.com/product/high-quality-automatic-solution/ https://cf-cc-qualitylab.com/product/ssd-chemical-solution-packaging-materials/

https://cf-cc-qualitylab.com/product/vector-paste-ssd-solution/ https://cf-cc-qualitylab.com/product/humine-activation-powder/

https://cf-cc-qualitylab.com/product/99-99-pure-gallium-metal-alloy-for-mercury-replacement/ https://cf-cc-qualitylab.com/product/automated-money-developer-machines/

I am another client of this site so here I saw different articles and posts posted by this site,I inquisitive more enthusiasm for some of them trust you will give more data on this points in your next articles.

https://cf-cc-qualitylab.com/2024/02/01/western-union-uberweisen-umdrehen/ https://cf-cc-qualitylab.com/2024/02/01/kaufen-sie-western-union-umdrehen/

https://cf-cc-qualitylab.com/product/automated-money-developer-machines/

https://cf-cc-qualitylab.com/2024/02/01/koop-western-union-omzet/

https://cf-cc-qualitylab.com/2024/01/31/acquistare-lanciare-western-union/

https://cf-cc-qualitylab.com/2024/01/31/contanti-ribaltabili-della-western-union/

https://cf-cc-qualitylab.com/2024/01/30/volteo-de-dinero-de-western-union/

https://cf-cc-qualitylab.com/2024/01/30/comprar-voltear-de-western-union/

https://cf-cc-qualitylab.com/2024/01/28/transfert-dargent-western-union/

https://cf-cc-qualitylab.com/2024/01/28/retournement-de-western-union/

https://cf-cc-qualitylab.com/2024/01/27/online-kredietkaart-dumps-kopen/

https://cf-cc-qualitylab.com/2024/01/27/gekloonde-kredietkaarten-te-koop/

https://cf-cc-qualitylab.com/2024/01/27/gekloonde-kaarten-kopen/ https://cf-cc-qualitylab.com/2024/01/27/kaufen-sie-kreditkarten-dumps-online/

https://cf-cc-qualitylab.com/2024/01/27/geklonte-karten-dumps-zum-verkauf/

All things considered I read it yesterday yet I had a few musings about it and today I needed to peruse it again in light of the fact that it is extremely elegantly composed.

https://cf-cc-qualitylab.com/2024/01/27/kaufen-sie-geklonte-karten/

https://cf-cc-qualitylab.com/2024/01/27/acquistare-scarico-di-carte-di-credito-in-linea/ https://cf-cc-qualitylab.com/2024/01/27/carte-di-credito-clonate-in-vendita/ https://cf-cc-qualitylab.com/2024/01/27/carte-clonate-in-vendita/ https://cf-cc-qualitylab.com/2024/01/26/comprar-volcados-de-tarjetas-de-credito/

https://cf-cc-qualitylab.com/2024/01/26/tarjetas-de-credito-clonadas-a-la-venta/ https://cf-cc-qualitylab.com/2024/01/25/comprar-tarjetas-clonadas/ https://cf-cc-qualitylab.com/2024/01/25/acheter-des-dumps-de-cartes-de-credit-en-ligne/

https://cf-cc-qualitylab.com/2024/01/25/cartes-de-credit-clonees-a-vendre/

https://cf-cc-qualitylab.com/2024/01/25/cartes-clonees-a-vendre/ https://cf-cc-qualitylab.com/2024/01/23/requisitengeld-zum-verkauf/ https://cf-cc-qualitylab.com/2024/01/23/falschgeld-kaufen/

https://cf-cc-qualitylab.com/2024/01/23/gefalschter-euro-zum-verkauf/

https://cf-cc-qualitylab.com/2024/01/21/koop-valse-polymeerbiljetten/ https://cf-cc-qualitylab.com/2024/01/21/koop-valse-bankbiljetten/

 Actually, I run a site similar to yours. If you have time, could you visit my site? Please leave your comments after reading what I wrote. If you do so, I will actively reflect your opinion. I think it will be a great help to run my site. Have a good day.

https://cf-cc-qualitylab.com/2024/01/21/koop-valse-euro-bankbiljetten/

https://cf-cc-qualitylab.com/2024/01/21/comprar-dinero-falso-en-linea/

https://cf-cc-qualitylab.com/2024/01/21/comprar-dinero-falso/

https://cf-cc-qualitylab.com/2024/01/21/billetes-de-euro-a-la-venta/

https://cf-cc-qualitylab.com/2024/01/17/soldi-realistici-in-vendita/

https://cf-cc-qualitylab.com/2024/01/17/acquistare-denaro-falso/ https://cf-cc-qualitylab.com/2024/01/17/banconote-in-euro-in-vendita/ https://cf-cc-qualitylab.com/2024/01/17/argent-accessoire-a-vendre/ https://cf-cc-qualitylab.com/2024/01/17/acheter-des-billets-indetectables/ https://cf-cc-qualitylab.com/2024/01/17/faux-euros-a-vendre-en-ligne/

https://cf-cc-qualitylab.com/2024/01/09/buy-euros-online-cyprus/

https://cf-cc-qualitylab.com/2024/01/09/fake-polymer-notes-for-sale/

https://cf-cc-qualitylab.com/2024/01/09/counterfeit-money-for-sale/

https://cf-cc-qualitylab.com/2024/01/09/buy-fake-dollar-bills/

https://cf-cc-qualitylab.com/2024/01/09/buy-prop-money-canada/

https://cf-cc-qualitylab.com/2024/01/09/buy-fake-polymer-notes/

Enter your comment. Wiki syntax is allowed:
V U O T A