Minimal PIC required for 6 input application

Hi guys,

I am trying to design a project that will read one of 6 NO switches to detect the position of a six sided cube. So, if the die face is showing a 4, a switch will close to indicate this. I have a 4-direction tilt switch and would add a couple of single direction tilt switches in a back-to-back configuration.

I wondered about using a PIC with 6 I/O, one for each switch. This would result in a data signal being sent to a transmitter which would be received some distance away to finalize the project.

What is the smallest PICAXE chip I could use for this application? Can I get away with a simple 08M2? I should say, space is at a premium: I'd like to stick this in a cube less than 3/4" across.

Thanks
Doug
 

MartinM57

Moderator
A PICAXE, 6 tilt switches, some components, some sort of (RF/Bluetooth/IR?) transmitter and a power supply - all in a 3/4" cube?
 
Indeed, its not so much the PICAXE thats the issue, its the rest of the stuff.
Yes, but there are some very small data transmitters. The battery adds some added volume :(
That's why I need to sort out a very small tilt switch mechanism.
I initially thought that the 6 I/O switches would be the best solution, but the smallest PIC for that might be a 14 pin or and 18 pin.
On the other hand, if I I used a 08M2, it has fewer inputs, but I could use X ohm resistors with the tilt switches such that each switch has a significant increase in value. The PIC could read the resistance and send a value to the RF transmitter. Is the 08M2 capable of that level of discrimination?

Nitrous
 

hippy

Ex-Staff (retired)
On the other hand, if I I used a 08M2, it has fewer inputs, but I could use X ohm resistors with the tilt switches such that each switch has a significant increase in value. The PIC could read the resistance and send a value to the RF transmitter. Is the 08M2 capable of that level of discrimination?
The 08M2 has 3 analogue inputs so you could connect 2 switches per ADC. The 08M2 should be capable of discriminating between the four states a 2 switch pair is in.
 

westaust55

Moderator
To take hippy's concept a step further, with a single ADC input it is possible to detect several switches.

I believe BCJKiwi (and his aquaintence Joh) was the first to provide details on a circuit for a matrix keypad into a single ADC input a few years ago - a scheme I have utilised myself since then.

For Nitrous2000 a similar scheme could be used in the "Die" as per the attached sketch. These are guesses at resistor values.
With a rolling die, the PICAXE code would need to wait until a stable ADC reading was identified to know that the roll had finished.
 

Attachments

Last edited:

JimPerry

Senior Member
Simplest is to use a bunch of 1n4148 diodes to encode the 6 switches into 3 inputs - then there would be outputs left to do something with ;)
 

Svejk

Senior Member
Use an accelerometer. Really easy to detect the side, requires only 3 inputs, whole setup can be really small. For a dice not good anyway as the assembly will influence the 'randomness' of it.


PS: cubes are _always_ 'six sided'.
 

Buzby

Senior Member
It looks like you are building a magic prop ?.
Is it something like a 'Hidden Vision' box where the punter places a cube in a lidded box, and the performer then says which face is uppermost ?.

If so, there may be other options easier to implement.
 
Busby: you da'man

The die is never rolled, beyond the spectator turning over a few times to get a "hidden" value the mentalist must devine :)

As it turns out, the battery looks like it could be the rte limiting step in terms of keeping the size down. I was thinking of potting the whole thing in plastic resin, charging through a couple of pinpoint electrodes in the corners.

Doug
 

Buzby

Senior Member
A fundamental Rule of Magic - Never reveal the method to those not in the Circle.
( But you will be aware of that, I'm sure. )

Now one very useful skill that is not a secret, and again I'm sure you will recognise, is distraction.
Maybe the die is not where you should be concentrating, that's the punters job !.

PM me for my ideas that may make your prop (a) easier to build , (b) available for very close inspection .
 

crossthreaded

New Member
I've built circuits into milk carton lids with a DIP '08, I don't think the size is a "big" issue here, although I would second the accelerometer suggestion; these are quite tiny.

Can I thank nitrous for correctly using the single of die.

If you want to pot the solution, how about a die with brass spots? any number of combinations for charging points.
 

cbounds

New Member
I know the guy who makes these marketing 6 sided dice you are trying to make.... He uses a magnet to touch to the "1" on the dice to shut it off. Also an accelerometer is used.
 
I'm from Canada. We're quite particular about things like die and dice.
You's guys no that, right? ;)
When you say milk carton lids, I'm not sure what size you're actually referring to.
Nitrous
 

crossthreaded

New Member
I've just been to the kitchen and the milk carton lids I used are internally 1 3/8 x 3/8 inches approx. I was installing a DIP 08M, 3 LEDs, a mini speaker, 3v button cell power and an LDR with supporting circuitry including decoupling and a charge pump to measure the LDR without a DC current drain (and using one pin).

You would need a three axis accelerometer, which can be a leadless surface mount device with a dozen connections. In my experience you have to be a bit careful with the power supply to these, but modern devices may be more forgiving. Of course if you can guarantee that your cube is always level (i.e. in one of 6 fairly precise orientations) you can get away with a 2-axis device, at the cost of a bit more software.
 

Buzby

Senior Member
I've not done work with 3-axis accelerometers, only single axis ones, and that was years ago, and not with a micro.
Those devices only gave a signal when they experienced acceleration, and no signal when stationary.

Do the new devices being discussed in this thread provide an indication of orientation, even when stationary ?.
 
Top