Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Magic: The Mini-magic Switchboard should I make it a kit?

Status
Not open for further replies.
Brian Hoskins said:
Neat trick. During the part where he puts all the caps behind his back and asks his friend to pick one, I guess he had to make certain that his friend picked the colour who's bulb was fitted in the 1st position?

Brian
You are correct. This is the slight of hand I was talking about much earlier. It is an old staple. Ask a person to pick a hand then keep or discard without regard to the choice. The magician never specifies if he is going to keep or discard your choose. Because of that most people do not catch on.
 
Assembled board

Attached is a pic of the finished board. The switch connector was to close to the processor socket but using a right angle header was a good work around. The problem is fixed foil_1C2.pdf.

This board is setup to bulbs. It can also be assembled for use with LEDs.
 

Attachments

  • asm 021e.jpg
    asm 021e.jpg
    135 KB · Views: 1,246
I finally got around to building a board and writing some code for this.

The code starts of in learning mode and will assign switches in the order they are switched to bulbs from 1 to 4. Once all switches are assigned it goes into display mode. It stays in display mode until either, a bulb is removed or replaced, a preset sequence is entered or the timer times out AND all switches are off.

The code is self explanatory and is only 230 byte long.

I haven't tried this on 3v0's board as I ended up making my own (due to dodgy eyesight and even dodgier soldering). I think the equates at the top are correct. Maybe someone can try it and let me know.

Mike.
 
Last edited:
Mike,

I should have made the board larger. I will spread things out a bit to make it easier to build. In the past I have given people grief for making things to small:eek:

The C code for the board is comming along. You must have done some nice work to get it is so little space.

wmmullaney,

I did not get the board in the mail as planned. I will be sending you an easier to solder version this week:)
 
This is what my prototype looks like. The board I made uses 2n7000 and 100k pull down resistors which are a little high - they take a while to discharge the pin capacitance. I can post the circuit and board if anyone needs a more spread out version.

Next step is to find a nice piece of wood and get working with the router to fit it inside.

Mike.
 
Last edited:
blueroomelectronics said:
I've been debugging a really simple version is asm. We'll have to compare code when we're done.

It'll be interesting to see how the various versions compare in the end. I added the timeout bit at the very end and think it makes it less flexible. Having it learn when a bulb is removed or a secret sequence is entered seems to work better.

@3v0,
Which C compiler are you using. I considered switching to a 627 so I could use the free HiTech compiler. I knew I should have waited until I had a socket for the 88.

Mike.
 
Pommie said:
It'll be interesting to see how the various versions compare in the end. I added the timeout bit at the very end and think it makes it less flexible. Having it learn when a bulb is removed or a secret sequence is entered seems to work better.

@3v0,
Which C compiler are you using. I considered switching to a 627 so I could use the free HiTech compiler. I knew I should have waited until I had a socket for the 88.

Mike.

Actualy I am thinking of redoing the board to use with a 18F1320 (or similar) so we can use the free compiler. I am using the CCS complier which is not free for the 88. I have never used the Hi-Tech compiler (that I can recall) and since I have been talking about not using the 16F chips I should put my money where... But porting from CCS to Hi-Tech should not be difficult.

I may also add some onboard status llights to help with debug. Either that or a serial port. Maybe a speaker too! Please stop me. Actualy I am thinking there are other games that could be played on this little box.

I am having fun with it. It is works fine the first time through. Just need to get it working right in a loop...

The IO is a simpiler without the bulb sense circuit.
 
This is a first draft of the code for the board with the bulb sensing circuit. I seems to be working but I am sure there are bugs and room for improvement. It has only been tested a few times during development.

I will not have time to work on the code much during the week. With that in mind I have opted to share it.

It is written in CCS which is not free for the 16F88. The code compiles to 511 words of memory. Could be smaller without the debug code but who cares ?

The program does not use any hardware other then the ports.

The HEX file is in the attached zip folder.

EDIT: If you build a board from my layout(s) check the pinout (EBC/CBE) of your transistors. It may not match what is show. The foil artwork is OK, it is just a matter of which way you face the transistors.
 

Attachments

  • SwitchBoardGameSense.c
    9.5 KB · Views: 581
  • SwitchBoardGameSense.zip
    1.2 KB · Views: 473
Last edited:
wmmullaney said:
Why do you like C over ASM?

I'd always rather use ASM.

The PC you do your development on is a computer so why not let it do more of the work for you.

I use C because it is easier on my brain! Actualy C code is said to be faster to develope and easier to maintain. Granted a person who is very good at a given assembler can do quite well.

I am used to using C. When I work all our development was done in C. If we needed more speed we would drop in a bit of assembler but that was rare.

It is easier to move from processor to process using C. I still have to understand the processor but I do not have to be fluent in it. If you change the port definitions a few other bits on the Switchboard code it will run on any processor hooked to 4 switches and 4 transistors driving bulbs

I have no problem with people uisng ASM of any sort. I have been there, done that, on a number of machines. Moved on if you will.
 
Last edited:
I'm also ASM user, but I know that C is used in many industrial. I wanted to learn up C for 24F during the semester break, but didn't seem to have enough time. Hopefully I can get to learn it soon. It is useless without any action :p
 
I have succeeded in coloring bulbs.

The method is inspired by the page Mark posted.

I did all my mixing in a single 1 liter soda bottle cap. Rinse clean after each color.

To make the bulbs easier to handle wrap masking tape around the base and add a tab below the bulb. This tab makes them easier to handle.

To color the bulbs I added about 1/3 to 1/2 parts water to 1 part Elmer's while glue. I then mixed in several drops of food coloring. To get a color you like start with a drop or two of coloring and increase as desired. You can dip the bulb/roll the bulb in the mixture to see how it looks. If you do not like it just rinse off the glue and try again.

The bulbs will dry to a hazy lackluster finish. To correct this and to add durability spray the bulbs with clear acrylic spray, dry between coats.


That's it. Have fun.
 
There exists some special enamel for light bulbs. Normally you can get red, yellow, green and blue enamel. In Germany you can get it from Conrad Electronics and Westfalia.

I would like to built a bigger version of this project with 230 volts main input and 4 sockets of the type E27. Coloured bulbs (230 V, 15 W) are a common item, so I would not need to paint the light bulbs. Has anybody designed a circuit design for this? I would try some triacs and a LC- unit to prevent electromagnetic problems. Of course the main PCB would need a power supply and there should be a fuse in the mains supply.
 
abrell said:
There exists some special enamel for light bulbs. Normally you can get red, yellow, green and blue enamel. In Germany you can get it from Conrad Electronics and Westfalia.

I would like to built a bigger version of this project with 230 volts main input and 4 sockets of the type E27. Coloured bulbs (230 V, 15 W) are a common item, so I would not need to paint the light bulbs. Has anybody designed a circuit design for this? I would try some triacs and a LC- unit to prevent electromagnetic problems. Of course the main PCB would need a power supply and there should be a fuse in the mains supply.

Use the existing circuit. The same transistors can drive relays instead of a bulbs. You could use triacs or solid state relays but since it switches infrequently relays would work fine.

Good to know about the special paint.

This is what my glue bulbs look like, not too tacky :eek:

**broken link removed****broken link removed**
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top