5603

Uses an ATtiny85 paired with an AFB-MR1A ​​(aka AS5600) magnetic angular position sensor. The magnet is mounted under a rotary knob to capture a safe-type combination. The secret code is stored in EEPROM and can be changed New EEPROM code : UNLOCK_ANALOG_AT85_V01.ino


Magnetic rotary knob with a diametrical magnet rotating opposite the sensor.
Disc divided into 10 equal sectors → each digit = 36° (360° / 10).
ILS or push button triggers the microcontroller to wake up.
Detection of a valid mechanical movement sequence (left rotation, then right rotation, etc.).
Switch to code entry mode: the user turns the knob to form a digit (0–9).
Each digit is validated after a 1-second pause.
If a digit is incorrect: switch to security mode (mute + delay).
If the entire sequence is correct: unlock (relay activation).
If inactivity is too long or input is too long: return to sleep mode.

ATtiny85 with 1 MHz internal clock
PB2 (INT0): External interrupt via ILS sensor (detects approach to the button).
PB4: Activates the power supply to the position sensor (AS5600) via transistor. PB3 (ADC3): Analog angle reading.
PB1: Generates sounds via a buzzer.
PB0: Relay control (lock opening).
Power 5V or 3V3
See .pdf read me

Video link  ou Lien vidéo
https://youtu.be/R6UkJ7NgFYE 
Other option ::
Create a physical Mastermind-style game with a 4-digit code

Code to be solved with red/green feedback.
The maximum number of attempts allowed is set by definition in the CPU code at 10.
Generally, with a good strategy, it takes at most 7 to 8 attempts to guess any 4-digit code with red/green feedback.
SEE_code_Breaker.zip

//FR
Utilise un ATtiny85 associé à un capteur magnétique de position angulaire AFB-MR1A (alias AS5600) 
L'aimant est monté sous un bouton rotatif pour saisir une combinaison de type coffre-fort.
Bouton rotatif aimanté avec un aimant diamétral tournant en face du capteur.
Disque découpé en 10 secteurs égaux → chaque chiffre = 36° (360° / 10).
ILS ou bouton poussoir déclenche le réveil du microcontrôleur.
Détection d’une séquence mouvement type mécanique valide (rotation à gauche, puis à droite, etc.).
Passage en mode saisie de code : l’utilisateur tourne le bouton pour former un chiffre (0–9).
Chaque chiffre est validé après une pause de 1 seconde.
Si un chiffre est faux : passage en mode sécurité (mute + délai).
Si la séquence entière est correcte : déverrouillage (activation relais).
Si inactivité trop longue ou saisie trop longue : retour en mode sommeil.
Alimentation 5V ou 3V3
Voir le .pdf lisez moi
BOOM:
ATtiny85
AFB-MR1A ​​(AS5600)
Diametrical magnet
3 BC550 transistors (NPN)
1 1n4148 diode
1 buzzer
1 relay
1 10KΩ resistor
3 1KΩ resistors
Capacitors
1 100µF/16V
1 100nF
Autre option :
Créer un jeu physique de type Mastermind avec un code à 4 chiffres
VOIR_code_Breaker.zip
Code à trouver avec avec feedback rouge/vert.
Le maximum de tentatives autorisées est fixé par définition dans le code de l'UC à 10.
En général, avec une bonne stratégie, il faut au plus 7 à 8 coups pour deviner n’importe quel code à 4 chiffres avec feedback rouge/vert.