

Simonoids. It's 'Simon' in an Altoids can powered by Arduino - jgrahamc
http://blog.jgc.org/2012/05/simonoids-its-simon-in-altoids-can.html

======
TazeTSchnitzel
Sorry, am I missing something here? It just seems like one of many simple
electronics projects, nothing strikes me as very special about it.

~~~
jgrahamc
You're not missing anything, except, perhaps that simple is ok. For some
people projects like this are quite complex, for others trivial. My personal
purpose in building this is that it was fun, the blog post is there so that
others can see how they themselves might build something like this.

------
simcop2387
I'm curious how he tackled the issue of the random number generator in the
arduino. The fairly simple one included in avr-libc would be prone to
repeating after a power off.

There's two ways I can think of to deal with that, save the state in the
EEPROM so that it doesn't repeat, or add a hardware based random number
generator, i'd like to know which he ended up going with.

~~~
jgrahamc
It's in the source code on github
([https://github.com/jgrahamc/simonoids/blob/master/simonoids....](https://github.com/jgrahamc/simonoids/blob/master/simonoids.ino)).
I use a combination of reading the microsecond time (hoping that there'll be
some variation because of the ADC conversion time), reading floating ADC
inputs and storing random values from previous execution in the EEPROM:

    
    
      // Set the random number generator from a seed generated by reading from a 
      // floating analog pin or two
      
      long seed = micros();
      for ( int i = 0; i < 1000; ++i ) {
        seed += analogRead(0);
        seed += analogRead(1);
        seed += micros();
      }
      
      // Use EEPROM locations to store a value from the random number generator so that from 
      // switch on to switch on the seed will change even if the above loop always gave the same
      // value
      
      for ( int i = 0; i < 4; ++i ) {
        seed += (long)EEPROM.read(i);
      }
      
      randomSeed(seed); 
    
      for ( int i = 0; i < 4; ++i ) {
        EEPROM.write(i, random(0,255));
      }

~~~
simcop2387
Ah I had missed the link to the github code in there. I like the idea of
reading some floating analog pins to get some entropy.

