Magic LED/Switch box - how is it done? - Page 1
Forum section: electronics / general

author: deephaven
author_rank: Frequent Contributor
timestamp: September 01, 2011, 07:48:23 am
content: OK you clever people, how is this done?

author: Jimmy
author_rank: Regular Contributor
timestamp: September 01, 2011, 08:16:33 am
content: Clever Video editing the camera position never moves it can be done easily

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: September 01, 2011, 08:45:45 am
content: The box is light and does not appear to have feet, yet it didn't slide about at all when opened - I suspect there are wires through the bottom. There is plenty of space inside those bayonet LED bases for circuitry.The taking the switch covers off is the giveaway - It would be possible to make a 'real' device that allowed swapping of lamps.Ditto the battery removal.

author: ejeffrey
author_rank: Super Contributor
timestamp: September 01, 2011, 09:24:06 am
content: Quote from: mikeselectricstuff on September 01, 2011, 08:45:45 amI'm not sure. One thing I noticed is that the switches are flipped in a different order after changing the switch covers. That could certainly be a red herring, but it could also be a a hint to the real operation. Wires going to foot pedals is the simplest explanation, but would be kind of disappointing

author: FreeThinker
author_rank: Frequent Contributor
timestamp: September 01, 2011, 10:27:27 am
content: The answer is simple guys!! It's Magic, you will be claiming Santa Claus does not exist nextSheeesh!

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: September 01, 2011, 11:22:29 am
content: Quote from: ejeffrey on September 01, 2011, 09:24:06 amYes - it could just be a predetermined sequence, just triggered by any switch actuation.Something else I noticed is that the switches are always operated progressively - until the battery removal, they are all turned on one after the other, then turned off one at a time.After the battery is removed, they are only operated one at a time.There would be enough room inside those bases for a few of the smallest button cells and some circuitry, maybe a PIC10F - my guess is it's sensing voltage/current and using this to step through a predetermined sequence

author: Psi
author_rank: Super Contributor
timestamp: September 01, 2011, 12:40:52 pm
content: He might have four focused light sources which are mounted above and can shine on each of the lamp locations and illuminate whatever is present there.It would be a simple matter of turning them on/off at the same time as he moved the switches on the box visible in the video.

author: Gall
author_rank: Frequent Contributor
timestamp: September 01, 2011, 02:36:57 pm
content: Probably nothing to do with that, but...I did very similar trick. I had only two wires and two LEDs. To control both LEDs I used AC source and diodes in series to switches (cut one half-wave).Note that LED 1 is swapped with LED 3, and switch 2 is swapped with switch 4. Does it mean that this device allows simple swapping only?

author: Gall
author_rank: Frequent Contributor
timestamp: September 01, 2011, 03:03:41 pm
content: Quote from: mikeselectricstuff on September 01, 2011, 11:22:29 amMaybe not a button cell, maybe a EDLC. But doesn't matter.There are 4 bits of information (16 combinations) in LED polarity and 24 combinations of LEDs. All LEDs have different forward voltage so their order may be determined automatically.

author: Rufus
author_rank: Super Contributor
timestamp: September 01, 2011, 03:15:30 pm
content: Just video overlaying of lit LEDs. The box and camera don't move at all, he never blocks a lit LED with his hand. I reckon at about 1:46 the green LED comes on slightly before the switch clicks.

author: Gall
author_rank: Frequent Contributor
timestamp: September 01, 2011, 03:28:43 pm
content: Quote from: Rufus on September 01, 2011, 03:15:30 pmNo.I can show yo such a box in front of you. You can touch such a box. No camera. No video.The classical variant of this trick is done with light bulbs. The secret is: always turn on bulbs from left to right for the first time. The circuit has a built-in timer and does reset in a few seconds; a pause indicates that you swapped bulbs.More advanced techniques do not rely on left-to-right order, they sense the presence of bulbs and their insertion order. You have to turn on switches in the order of bulb insertion (or in reverse order).LEDS can be sensed by their forward voltage so the circuit always knows their color order (and insertion order too, and polarity too). Enough information to do lots of tricks.Most advanced technique uses some kind of password to enable the trick so only the magician is able to show it. In everybody else's hands the box behaves just as four LEDs with four switches, ignoring colors completely. That's funny.The hardest thing here is to hide extra wires, either by conductive coating on the clear plastic or by imitating an ordinary insulated wire with a cable made of thin enameled wires. It also may be possible to hide tiny microcontrollers directly in bulb sockets and switches and use something like Dallas 1-Wire protocol between them.

author: Zero999
author_rank: Super Contributor
timestamp: September 01, 2011, 05:11:40 pm
content: Quote from: Gall on September 01, 2011, 03:28:43 pmYou've got it.The circuit is reset when all the switches are off and a certain delay has elapsed. The bulbs then all light from left to right, then when each bulb is quickly turned on and off the controller learns the sequence which can be repeated again and again.Here's a link to another forum which contains some code.http://www.electro-tech-online.com/electronic-projects-design-ideas-reviews/35517-magic-mini-magic-switchboard-should-i-make-kit-11.html#post276128You could use any little MCU with enough pins. Now this is the sort of thing you wouldn't bother wasting a 32-bit MCU on, 8-bit all the way lol.

author: deephaven
author_rank: Frequent Contributor
timestamp: September 01, 2011, 05:24:52 pm
content: I'm pleased the explanation is technical. I would have been really disappointed if it had been editing or external lights shining on it.Do you think it is significant that, when he takes the cells out, he switches the LEDs on only one at a time? Possibly due to the lower capacity hidden battery.

author: ejeffrey
author_rank: Super Contributor
timestamp: September 01, 2011, 05:26:22 pm
content: Quote from: deephaven on September 01, 2011, 05:24:52 pmThat would be my guess.

author: Gall
author_rank: Frequent Contributor
timestamp: September 01, 2011, 07:22:59 pm
content: Quote from: Hero999 on September 01, 2011, 05:11:40 pmIn fact, it isn't the only way. It may be done even better to make it more tricky to guess!If the circuit senses the presence of bulbs, it can remember the order the bulbs are inserted into sockets. Then you can switch them on either in this order or in reverse order.If you're using LEDs, you can encode something with their polarity or forward voltage. I.e., you may have 4 variants of behaviour: from left to right, from right to left, insertion order, reverse insertion order. These four variants may be encoded by four combinations of polarities of leftmost and rightmost LEDs, so even if someone tries to notice the order you turn these LEDs on, you don't have to use the same all the times!As I stated before, the MCU with a built-in ADC may even determine the LEDs order directly. This may be used to make a nice gift - the same thing but fully automatic. Of course the color buttons should be fixed positions - or invent some way to sense them! Probably I'll make such a toyI decided to put a bunch of magnet wire through heat-shrink tubing, this will be indistinguishable from ordinary hook-up wire.

author: Fraser
author_rank: Super Contributor
timestamp: September 01, 2011, 08:34:27 pm
content: Ref power source. I built an inductive power supply some years back that worked on the same principle as an electric toothbrush charger. The power 'transmitter' coil goes under the table and the 'receiver' coil is positioned under the battery holder. Notice that the battery holder seems raised and moves when he removes the battery.....If I were doing it, I would have the inductive pickup in the foam tape fixing for the battery holder. Fine wire would then connect to the battery holder terminals. You can get quite a few mA via inductice power couplingThe batteries may be a total red herring and are not needed at all.Just my thoughts on it...... likely wrong, but hey it's a possibility.

author: ejeffrey
author_rank: Super Contributor
timestamp: September 01, 2011, 09:16:35 pm
content: In the previous version linked to, the trick was apparently that the bulbs always light in the same order. The first run trains the MCU, and then after that it doesn't matter what order you flip the switches, the bulbs always light in the same order.This unit doesn't operate exactly the same. It appears to me that the bulbs always light left to right. In the first trial the sequence is 1,2,3,4. Then, after exchanging the bulbs, they light 3,4,1,2. After switching the caps, they light 2,3,4,1. The last two sequences are 1,2,3,4. Then the trick is just to figure out which lamp to light first. One possibility is the order the lamps are turned off. In each case the first lamp turned off is the first one turned on in the next sequence. Before the second run, the lamps are turned off 3,4,2,1, before the third run they are turned off 2,3,4,1, and before each of the last two runs the switches are turned off 1,2,3,4.There are any number of variations you can imagine. You could detect the presence of buibs and the order of their insertion/removal. With LEDs you can detect the bulb color by measuring the forward drop with a very small current. A nice variant would be to, for instance, always light the red LED first and then go left to right.There are more complicated things you can do, but I suspect the simplest solutions will always win. Good magic tricks work based on misdirection. The important thing is to make it easy for the magician to get it right while allowing maximum audience participation in choosing how to reorder the LEDs and switches. Obviously if you could actually detect the cap colors you could make the 'perfect' device that simply always lit the right color LED, but failing that you want to make it as simple to as possible for the magician to recalculate the proper switch order.

author: Zero999
author_rank: Super Contributor
timestamp: September 01, 2011, 09:24:46 pm
content: Quote from: Gall on September 01, 2011, 07:22:59 pmThere's design which includes current sensing on the site I linked to.QuoteThat could work but it doesn't explain the buttons though.QuoteI personally like the designs which use incandescent lamps. I think it would be cool to build a mains powered one with 25W incandescent lamps.Quote from: Aurora on September 01, 2011, 08:34:27 pmIs it just me or do the LEDs get dimmer when the batteries are removed? This could also be part of the trick.I think there's a hidden battery compartment as it's much easier to implement than inductive coupling.

author: RCMR
author_rank: Frequent Contributor
timestamp: September 01, 2011, 10:25:58 pm
content: Quote from: Rufus on September 01, 2011, 03:15:30 pmNote that at 1:31, the switch second from left turns on the Yellow (right-hand) lampbutAt 1:38, the yellow lamp remains illuminated after the switch second from the left is turned off and that yellow lamp only goes off when the right-hand switch is turned off.There has been a change of switch/lamp mapping between turning on the lamps and turning them off.Hence, there appears to be some kind of pre-programmed sequencing of the connections which the operator has memorized.The use of the large-size LEDs would also hint that perhaps they are self-powered and each one is intelligent.

author: Gall
author_rank: Frequent Contributor
timestamp: September 02, 2011, 07:14:49 am
content: Quote from: Hero999 on September 01, 2011, 09:24:46 pmWhy not? I.e., always turn on red first, then yellow... You may have up to 16 different algorithms encoded by LED polarities.Incadescent lamps may be evn simplier since they are big enough. It is possible to detach Edison screw carefully asnd hide, i.e., a triac and a MCU right in the lamp.Using bigger switches also simplifies the task. A big button cap should be able to hide RFID label or something. The best thing you can do is to use these old knife switches (but this probably requires you go low-voltage). There are 12V and 36V incadescent lamps that use the same E27 thread as 220V ones, not sure about E26 110V lamps.