Tuesday, 15 January 2019

Hysterical fun

“If ever there was a guilty age, this is it. Guilt and hysteria. And at the bottom of it all, like an evil dragon, lies Fear.” 
Henry Miller

Assuming hysteria and hysteresis have the same etymology (they don't) is only natural given how frustrating and what maniacal fun it has been to amend the magnificent magnetic magic lamp project that has been a little dormant of late.

The original idea (for kids of course!) was to have a candle night light that can be turned on and off with a "magic" wand (a piece of dowel and a couple of magnets). The project stalled when we could not work out a way to reliably use a magnetic hall effect sensor (at the moment a 49E) as a switch.

The voltage from a hall effect sensor changes according to the strength of the proximate magnetic field as shown on the datasheet.
So it should be simple to ask an Attiny13a to keep an eye on a pin connected to the sensor and then wake up and be a candle when asked. The reality is that the analog signal contains noise which corrupts the message from the magic wand. See the pic below.

The top signal is typically noisy, and the red dotted line was how we used to check for wand usage - as a single voltage point. The resultant red digital middle output signal reflects the noise as the original analog input oscillates about the single point, confusing the microcontroller. However, if we can set a top and bottom voltage (as shown by the green dotted lines) then the noise becomes irrelevant and the digital signal is clean.

So next was research, reading, more research, watching and then playing. We settled on the LM393 comparator to be the Schmitt trigger that we needed for hysteresis.

A few iterations later and it works a treat!

All manner of bits connected
The next phase is to make a few prototypes for testing (in particular how long the batteries might last with a dormant attiny13a plus a listening 49E sensor and a live comparator in the circuit). It would be great we think to have a few "candles" about the place which can be activated at will with a single magnetic wand. Stay tuned.




1 comment:

  1. I am not surprised there are no comments to this pesky problem - try a little fairy dust with the wand :).

    Sounds like you are having fun.

    On this side of our magnificent island we are just trying to work out why sitting in the pool on a hot day does not reduce one's core temperature.

    Hugs to you all,
    Jill

    ReplyDelete