Sinister7


Sinister7 embedded into a Munny

So………

I’m an engineer. I’ve been trained to think logically and employ scientific method pretty much all of the time with whatever’s presented before me (though my wife may argue that point). And yet, I believe in all manner of kooky fringe stuff. Or at least I’m willing to entertain possibilities based on what I don’t know. UFO’s? Absolutely. Ghosts? I eat‘em up. Well, why not? I’ll never be running for political office. I can examine evidence with the best of them and I certainly don’t need an “expert” to interpret what I’m seeing for me. I can look at these things and I draw my own conclusions.

I know what you’re thinking. The now classic X-Files “I want to believe” poster, right? Well, maybe. But if you start with the double-slit experiment and extrapolate macroscopically, there’s a possibility that we literally make our own reality (I’m paraphrasing a few well known authors here). And if everyone’s reality is tailored for them, everyone’s opinion is equally suspect. Now I’m not talking about things like Ohm’s law that seems to work for everyone. I’m talking about stuff like 10 people all seeing the same apparition. Mass hallucination? Please. The outliers from the bell curve. The things that make you stop and say “that’s not how the world is supposed to work”. These are the things that need closer examination because these are the “red flags” on reality that tell us that we don’t understand everything that’s going on. But I digress…

Now I’ve got some science at my disposal, not to mention just about any gadget I want to make it happen. What to do, what to do…

Ouija boards have always been interesting. They pick up, I don’t know…vibes? Transmit the thoughts and/or will of an unseen entity through the hands of the people surrounding it to a planchette that spells out messages from the great beyond, or something like that. Does it really work? Beats me. I can’t quantify that sort of thing so I couldn’t tell you for sure. The engineer in me says “no way”, but experience causes me to temper that answer.

I have no idea how to pick up “vibes” electronically. The prevailing theory on ghosts and spirits seems to be that they are some sort of free-floating energy field, or rather, they manifest themselves that way. Exactly what sort of energy? Well, I see some guys on a popular TV show running around with various meters sensing electrostatic and electromagnetic fields. I can do that.

A Ouija board is a little complicated for a first try here, so I want to tone it down a bit. The Magic 8 ball has always been one of my fave toys. I dig the whole Schrödinger’s Cat thing with the little thingy inside of it in the purple sloshy stuff, picking up the impressions of the environment to tell my fortune. I can’t call it a Magic 8 ball though, so I’ll call it the Sinister 7.

http://www.sparkfun.com/images/tutorials/Sin7/Sinister7Logo-K-L.jpg

Thanks to Anndréa Boe for creating this sweet logo.

Here’s what I’m thinking. I need a random number generator, but I want to integrate surrounding fields into the generation. I’ll start with a Logomatic as the base platform because it has the ADC channels of an LPC2138 broken out. I can also start with that firmware to hopefully minimize my work. And I’ll use the SD card for a custom message list. That should make it interesting. I’ll also need some kind of display…the Nokia knock-off and supporting breakout boards ought to do. Lastly I’ll need an accelerometer to tell when the device has been rolled over so I can generate a new answer - almost like an electronic Magic 8 Ball.

At the time of this writing I’ve actually completed my first prototype, the proof-of-concept model composed of the above list having preceded it. We’ve just moved our office to a new location, and for the life of me I can’t find the first one I built. It’s this horrible Frankenstein conglomeration of parts, but it works and it’s cool as far as I’m concerned. And it cheeses me off to no end that I can’t find it. Ah, well. What follows is a retrospective of how I made the thing work.


The Random Number Generator

At the heart of the device is the random number generation. This is our interface to the “unknown”. If the spirits can talk to us, this is how they’ll be doing it.

My first attempt at random number generation was to use 3 ADC channels. The idea was to let them float with long wires attached to them so the surrounding fields were directly affecting the number generated. I used the lowest 3 bits of each ADC channel (each channel is 10 bits) and combined them into a 9-bit number for a range of 0 to 511. The ADC window is 0V to 3.3V, which makes the lowest 3 bits sensitive to about 26mV of ambient noise. I also sequentially rotated the position of each 3-bit field within the 9-bit number to make sure that no one reading could dominate the other two.

To test the generator I set up a special piece of code that would just run and keep track of how many times each number from 0 to 511 was picked. When I pushed the stop button after a while, it would dump the result to a terminal. Have a look at the result below.

http://www.sparkfun.com/images/tutorials/Sin7/FirstPlot.JPG

That doesn’t look very random, does it? It’s worth reminding the reader at this point that there’s another factor in the randomness that should be considered, that being the timing of the user’s hand in turning the device upside-down and right-side up. This test didn’t take that into consideration. But the plot shows that for any given time the result is more likely to be in a few obvious places. We can’t have that, so on to take two.

The solution ended up being remarkably simple. In fact, I’m almost embarrassed to suggest it. But hey, we’re all friends here. I kept the first setup, but now each subsequent random number is created from the last number plus the new one. If the old number and the new number add up to be greater than 511, I subtract 512 to get it back in the window. The result? Have a look.

http://www.sparkfun.com/images/tutorials/Sin7/SecondPlot.JPG

That’s what we in the biz call noise. And that will do just fine. With a random field of 512 choices, we can pack our SD card with up to 512 custom messages. Oh, the possibilities.
 


The Display

I grabbed one of our Nokia breakouts off the shelf and commenced hammering it into place on top of the Logomatic SD socket. It took me a while to get it to kick, but I finally got it to go. All the example code we have on the site helped, though none of it is what I’d call “drop in”. I’d always wanted to play with one of these, though, and this was a good excuse.

http://www.sparkfun.com/images/tutorials/Sin7/Sinister7-05-L.jpg

I had initially set it up on the second SPI port on my LPC2138, which you can set up as 9-bits and whatever else the display requires that I can’t remember at this point. But in the end I bit-banged it because I didn’t have the test gear available to analyze the hardware SPI port when it choked. It seems to work well enough, and I’ll call that a win.

One thing that bummed me out, though, was the booster circuit on the breakout board that’s supposed to drive the backlight. It just didn’t have enough juice to make me happy and I kept seeing funny lines come through periodically. So I made my own booster out of a little breakout board I did a while back that has an MC34063. I kluged that guy onto the side of the Logomatic, spliced the lines in the right places and now it works like a charm.


The Accelerometer

If we’re going to emulate the operation of a Magic 8 ball, we need to be able to tell when the device is flipped over. But it’s not just emulation we’re after. The timing of the motion, combined with whatever sort of fields the user may be carrying or emanating, is the user’s direct input into the random number generation. So the role of the accelerometer is important, but it doesn’t have to be anything fancy. I used an ADXL320 breakout right off of our shelves and wired it up to a fourth ADC channel.

http://www.sparkfun.com/images/tutorials/Sin7/Sinister7-07-L.jpg

The only thing worth noting with regard to the up-down reading is that I put some hysteresis in the measurement (I reset the switching threshold based on whether I’m going from up to down or down to up). The reason for this is because, if you’ve got only one threshold set, the noise on the accelerometer line is enough that there’s an angle where the thing will completely flip out. Easy fix, though.

How the Prototype Works

Pretty well! Oh sure, I had to do some silly things to make it more aesthetically pleasing (like centering the responses both horizontally and vertically, jeez was that a pain), but in all I’m quite pleased with the result.

The prototype has 3 wires attached to the ADC sensing channels, each of about 8 inch length. At power up, the device reads a message list from the SD card (a text file that you can edit with notepad or wordpad). When you roll it upside down it starts going through the random number generator, repeatedly generating new numbers until you roll it back over. The 512 random choice window is divided up by the number of messages found in the message list. The message number is the randomly generated number divided by the number of messages. The appropriate message gets displayed until you roll it over again. And so on.


The First Hardware Revision

After making the prototype out of various parts, I made one that was dedicated to its purpose. It’s a double-decker design. The display is on the top, along with two buttons and a tri-color LED. The booster circuit is on the bottom of the top board. The top and bottom boards are joined mechanically by 4 stand-offs and a 12-pin header.

The image “http://www.sparkfun.com/tutorial/Sin7/Sinister7-03-L.jpg” cannot be displayed, because it contains errors.

The bottom board carries the processor, the SD card, and a few new bits. I’ve set it up intending to power it with one of the 1000mAh lipo cells that we sell. And as such, I put a lipo charge and protection circuit on it along with a mini USB port so it can be recharged easily. I’ve also gone to an LPC2148 thinking that I may get the USB to work so you could access the message file directly over USB, but I haven’t got that working yet.

The image “http://www.sparkfun.com/tutorial/Sin7/Sinister7-01-L.jpg” cannot be displayed, because it contains errors.

The problems that I’ve found with the first rev hardware are 1) I jacked up a couple of the lines to the accelerometer, and 2) I’ve got a cap on the bottom of the top board and a diode on the top of the bottom board that are heatedly arguing the validity of the Pauli Exclusion Principle. Anyway, I’ll have to fix these things in the next rev. They’re not really show-stoppers, but it’s not right. In the meantime, we’ve got some cool toys to play with around here.

http://www.sparkfun.com/images/tutorials/Sin7/Sinister7-04-L.jpg


The Current State of the Firmware

The more I play with this thing, the cooler I think it is. But it’s not my intention to blow my own horn, as it were. I didn’t invent another PSP, just a gadget. But it’s a gadget with a theory of operation that spans a couple of pretty different schools of thought. And it’s not BS; it does exactly what I say it does. It takes some amount of information from the user along with some amount of information from the surrounding electrical field and it combines them into new and particularly unique information. Is it valid information? Are these messages from the great beyond? Is it just random chance wrapped up in a package for a techno-geek? That’s for the user to decide for themselves.

Right now, the code starts out with a simple splash screen, then it goes to a menu. The menu contains 3 items currently: Fortune Teller, Powerball Numbers and I Ching. Why Powerball? Hey, somebody’s gotta win. This seems like as reasonable of a way to pick the numbers as any. And I Ching? Yeah…I don’t have that working yet. I wanted something else for the menu and that seemed a likely thing to have, especially since it’s basically just a 1 to 64 random number thing. Right up the Sinister 7’s alley. Anyway, one of the buttons is to scroll through the menu and the other is to select. The tri-color LED tells me when the random number generator is operating. I was using it for debugging, but I have no reason to remove it, so there you are.


In Conclusion

At the beginning I mentioned Ouija boards and thought that would be a cool place to start. Then I stepped back and suggested that it would be harder to do than I wanted. But really, if you were to load the message file with all the letters of the alphabet instead of complete messages, you’d pretty much have your Ouija board. Although, it would only be operated by a single person, and the self-proclaimed Ouija “experts” would tell you that that’s a no-no because it opens you up to all sorts of bad ju-ju.

More than that, you could have this thing generate whole pages of text and play your own version of the Bible code game. That would be pretty interesting.

So what might I have done differently? Well, there are probably dozens of different ways that I could have used the ADC channels to generate the random number. I just chose one way that seemed to work pretty effectively. Beyond that, I think the design is pretty tight.

However, I had an interesting conversation with someone recently regarding the random number generator.  I'll warn you now that this is going to get pretty "fringy", if you know what I mean.  So everybody baton down the freaky-hatches and try to weather the storm with me.

If we assume that we're operating a Sinister 7 like a Ouija board, and we assume that there's also some unseen entity sitting next to us trying to cause the right letters to appear on the screen, and if we also assume that the only way said entity can cause such to happen is by means of manipulation of some kind of ectoplasmic appendage...well, it would be pretty hard to do with something that's geared to read the noise in the room (which is what we have).  What's the solution?

What I would probably do (and may do) is to set up the ADC channels to work additively.  Or maybe even just one channel.  Or maybe three channels additive, but with the reading window between 1000 and 2000 (so if each 10-bit ADC has 1024 discreet choices, the range for 3 adding would be 0 to 3072).  Within the "valid" read space, I'd set up 26 windows that would select between letters (A to Z).  Then I might set up a minimum hold time to select and display a letter.

But there are problems with a setup like that.  For example, the unseen entity may require some kind of feedback to see that they were selecting the right letter, and the hold time I just mentioned would probably hose that up.  Then there's ambient noise issues.  If you're in a house, you'll likely pick up 60Hz like crazy.  And if that's the case (and the level of the noise is high enough) it's likely that you'll never see the reading settle on anything.  Then there's the field that each corporeal player is carrying.  How's that going to affect the reading?  And just how sensitive does it have to be to pick up a ghost arm, anyway?  How do you quantify such problems??? But I digress...

Lastly and for what it’s worth, I became an engineer not just to play with electronics, but to become more knowledgeable about how the world works. Funny how all the schooling has left me with the feeling that I know less than ever. How does the world work? Not a clue, but I operate by a set of rules that seem to work for me. And I’d much sooner poke and prod my surroundings myself to see how they twitch before I’d take someone else’s explanation of my perception. I offer this project as a small example of that spirit, no pun intended. And I recognize how fortunate I am to work someplace where this sort of nonsense isn’t just tolerated, it’s encouraged. Thanks Nate.

And no, I haven’t won the freaking lottery yet.

~Pete

Comments 5 comments

  • Member #511770 / about 10 years ago / 1

    Where is this tutorial gone?

  • ai4rv / about 14 years ago / 1

    Hey Pete,
    Great little gizmo--however, with regard to the energy you are harvesting, you hit the nail on the head with your reference to picking up 60 Hz noise. That's the problem--those wires are simply antennas, and will pick up radio stations, 60 Hz, etc. Why not try hooking some actual transducers to the ADCs? For instance you might try a temp sensor to pick up a "cold breeze" or a phototransistor to catch "moving shadows" or whatever. You could even get more sophisticated and maybe catch phase-transitions of light AND cold spots, to sense a ghost...?
    Worth a try....
    (BTW, as you articulated your reasons for "becoming an engineer," those are my same reasons for becoming a scientist!)
    Good work and good luck with future projects!

  • esm / about 14 years ago / 1

    Just FYI: it looks like all the images in this tutorial are throwing "Forbidden" errors.

  • dizzychicken / about 16 years ago / 1

    nice work id so buy one, or make one. Do you have a rough step by step to make one of these? cuz its AWESOME.. seriously i would make one

  • TheTrustedOne / about 16 years ago / 1

    absolutely awesome, only one question, how hard would it be to include a serial connection to a PC so when it is not making predictions it can give information like weather and news updates, possibly using a client on the PC display an RSS feed?