Design project with magnets + IR sensor + LEDs

Hi everyone ! I'm a design student and my mothertongue isn't english so... please stay great ::slight_smile:

I'm actually working on what will (hopefully) become a lamp. I already made a shape prototype and it will look approximately like this : https://benjaminmotoc.tumblr.com/post/166309286360/glumi-first-prototype-of-curiosity :slight_smile:

The idea is to put all the electronic [Arduino UNO+TCRT5000 IR sensor+battery+LEDs] inside of the wooden part.
I'll angle the IR upward (underneath a thin see-through acrylic surface) and program the LEDs according to the distance in-between the white floating shape and the wooden part.

The principle would be to have a variation of LED's light intensity when you make the floating shape "bouncing" with your finger (it's working with magnets, no magic ::slight_smile: ) or I'll just make it blink ON/OFF according to the up-and-down movements.
Moreover, when the white shape is taken off from the tube, the LEDs should turn off too...

I think it's electronically not that complexe but I'm really bad for this... Like really.
I rade/watched articles and tutos but I don't get it. The more I do research, the more I dig into ampers, Arduino, resistors, ohms.. the more I lose myself.

My peers and teachers adviced me to post this on the Arduino forum which is, I hope a nice shot !

Did anyone already work with this sensor and might know how I can make it happen ? Pictures really help me.
I'm working on it (and on side projects) for weeks and I feel more and more stupid. Moreover, the deadline is soon soon...

Help !! Thanks for your attention and happy new year :smiley:
Cheers and I'll show you the final outcome for sure

I think your first test is to see if the IR will go through the acrylic plastic. The beam will have to go through twice.

Paul

There's a good chance that your acrylic is not transparent to IR indeed.

Another thing: it doesn't look like an Uno is going to fit in there. Look at the Mini and the Pro Micro, a much smaller form factor, and far more suited for permanent installations like this one.

Are the LEDs going to be in the bouncy part, or in the base?

As you have a transparent tube around it, you could consider lighting up that tube as well by putting some LEDs in the base of it.

Did anyone already work with this sensor and might know how I can make it happen ?

The problem with that sensor is that it will be affected by ambient light and give a poor reading.

I would recommend something like this Adafruit VL6180X Time of Flight Distance Ranging Sensor (VL6180) [STEMMA QT] : ID 3316 : $13.95 : Adafruit Industries, Unique & fun DIY electronics and kits

Given the magnet suspension, I would also consider trying a Hall Effect sensor to measure the varying distance from the magnetic sources.

Thank you for your reactions !

The Arduino board will go in the wooden part, which will be bigger at the end :slight_smile:
The acrylic board will be 2mm thick, so I guess it will be ok... otherwise I'll go for a 1mm :confused:
The LEDs will be in the base, so it will indeed lighten up the acrylic tube :slight_smile:

ben_mtc:
The acrylic board will be 2mm thick, so I guess it will be ok... otherwise I'll go for a 1mm :confused:

That it is transparent to visible light doesn't necessarily mean it's transparent to IR (and the other way around).
Some plastics are completely opaque to IR - PMMA blocks wavelengths of 2800-25000 nm, which includes a large part of IR. You'll really have to try this out. If it's blocking, 1 mm blocks just as well.