Coloring Magnetism

by diegoleonherrera2 in Circuits > Arduino

105 Views, 7 Favorites, 0 Comments

Coloring Magnetism

image.png

MAKING THE INVISIBLE VISIBLE

COLORING MAGNETISM (English version)


INTRODUCTION

Magnetism is an invisible phenomenon that has always captivated me, and with this project, I want to showcase it in various colors.


This form of energy can be simulated using 49E Hall effect sensors, a neodymium magnet, an Arduino Nano, and an 8x8 LED NeoPixel matrix.


The Hall effect is the differential power that appears perpendicular to the magnetic field lines of an electric current when it is subjected to the perpendicular force of a magnetic field.


To achieve this, we use four 49E sensors that deliver a linear voltage at their output,


proportional to the magnetic field they detect on their front when a magnet is brought near.


These voltages are sent to an Arduino Nano that controls an 8x8 RGB matrix. That is, 64 LEDs arranged in four quadrants.


Each sensor controls a quadrant and produces a color and brightness proportional to the output voltage, which depends on the distance of the magnet in front of the sensor.


If the magnet's north pole approaches the front of the sensor (the area marked with text), the corresponding quadrant lights up green. If the magnet approaches the south pole, the quadrant lights up red, or blue if it touches the sensor.


--------------------------------------------------------

VISIBILIZAR LO INVISIBLE

COLOREANDO EL MAGNETISMO (Versión español)

  1. INTRODUCCIÓN

El magnetismo es un fenómeno invisible que siempre me ha cautivado y con este proyecto quiero mostrarlo en varios colores.

Esta forma de energía puede simularse mediante sensores 49E de efecto hall, un imán de neodimio, un arduino nano y una matrix neopixel de 8 x 8 leds.

El efecto hall es la potencia diferencial que aparece perpendicular a las líneas de flujo de una corriente eléctrica cuando ésta es sometida a la fuerza perpendicular de un campo magnético.

Para lograr esto usamos 4 sensores 49E que entregan un voltaje lineal en su salida.

proporcional al campo magnético que detectan en su parte frontal cuando acercamos un imán.

Estos voltajes se envían a un arduino nano que maneja una matriz RGB de 8 x 8. O sea, 64 leds dispuestos en 4 cuadrantes.

Cada sensor maneja un cuadrante y produce un color y un brillo proporcionales al voltaje de salida, el cual depende de la distancia del imán que se encuentra al frente de tal sensor.

Si el polo norte del imán se acerca a la parte frontal del sensor (Parte marcada con texto) el cuadrante respectivo se ilumina de color verde y si se acerca al polo sur el cuadrante se ilumina de color rojo o de color azul si toca el sensor.




ARDUINO NANO MOUNTING

Insert or fix the Arduino Nano more or less in the middle of the breadboard

POWER BREADBOARD

Insert the power module into the breadboard, maintaining the polarity, but without electrical power yet.


WARNING: Do not connect the 8x8 matrix and the Arduino to the computer's port because it handles very little power and could be damaged.

SENSORS MOUNTING

Take 4 groups of 3 female-male dupont cables and insert one of each of the female-type ends into a 49E sensor.

POWER SENSORS

Connect the two male prongs of these four groups to the positive and negative terminals of the breadboard, according to the following diagram.

SIGNALS SENSORS TO ARDUINO

And connect the male tips on the right that deliver the sensor signal to pins A0, A1, A2 and A3 of the Arduino Nano

POWER 8 X 8 MATRIX

Connect the power cables of the 8 x 8 matrix to the breadboard, respecting its polarity (Positive or VCC and negative or GND).

DATA MATRIX TO ARDUINO

Connect the 8x8 matrix data cable to digital pin #6 of the Arduino Nano

POWER ARDUINO NANO

Power the Arduino with small wires at Vcc 5v (+) and at gnd (-)

CIRCUIT SCHEMA

ESQUEMA COLORMAG.jpg

CODE INO

CODING

To generate the Arduino IDE code needed for this project, I used Google Gemini 3, giving it the following instruction or prompt:


“Give me the Arduino IDE code for an Arduino Nano with the following conditions: I have four 49E Hall effect sensors to illuminate an 8x8 NeoPixel matrix. Each sensor controls a 4x4 quadrant of LEDs. The color and brightness of the LEDs in the respective quadrant are proportional to the output voltage of the 49E sensor, which, in turn, depends on the intensity of the magnetic field of the magnet in front of the sensor.”


After three corrections, it generated the code shown below, which is uploaded to the Arduino IDE on the computer and from there to the Arduino Nano via a USB cable using the Upload tab.


Once the code has been uploaded to the Arduino Nano, it can be disconnected from the computer.


Next, turn on the breadboard's power module and move a magnet around the 49E sensors and observe the results on the 8 x 8 matrix (See attached video)