Your Name Hidden in Binary Code Inside the CD!
by cristinepotu7171 in Circuits > Arduino
323 Views, 2 Favorites, 0 Comments
Your Name Hidden in Binary Code Inside the CD!
In this project I present the reading of a text written on a CD in binary code and its display on a small display with the help of an Arduino.A project that uses writing in binary, hexadecimal and char code.
Supplies
1.Arduino Nano
2.ULN2003 stepper motor driver
3.stepper motor 28BYJ
4.5xTCRT5000 infrared sensor
5.push button
6.Oled 64x128 I2C display
7.4x4k7 resistor
8.4x150 ohms resistor
9.breadboard and jumper wires
10.4xLED
11.Visuino software
Schematic Diagram
The electrical scheme is quite simple. Notice the notation of the sensors from 1...4 and their connection to the analog pins of the microcontroller, A0...A3. Each sensor corresponds to a Led noted in the order in the diagram. During the practical implementation, order 1 towards the outside of the CD is taken into account. The assembly will be powered on the Vin pin (ATTENTION, THIS IS NOT THE 5V PIN!), as shown in the wiring diagram.
The Code
- The code is built in Visuino software. We open the code and immediately notice the 3 modes of reading-encoding-decoding, respectively binary to hexadecimal-hexadecimal to char. Depending on the mechanical construction and the tolerance of the electronic components, the values read from the sensors differ from case to case. The 4 analog inputs from the sensors, A0...A3, are connected in turn to the serial pin and the values that make a safe switch between the two operating modes of the sensors are read. Change this value by reading the value of each sensor separately.
- Also, a complete rotation cycle of the CD differs from one montage to another, it is adjusted from the TIMER component specified in the photo. The speed of the engine changes within small limits by changing the clock frequency of the CLOCK GENERATOR component.
- We choose the correct port and load the code into the Arduino.
Downloads
Mechanical Construction
- The mechanical construction can be approached in any other way and with any other materials. I chose what I had on hand. Great attention will be paid to the rigidity of the mechanical construction, a poor construction will compromise the entire system.
- The sensors are mounted at a distance of approximately 6-8 cm. I opted for gluing them on a test board, offering better mechanical stability. The CD gear I chose a wheel from another project, its outer rubber ensuring a safe rotation of the CD.
- The sensors will be mounted in such a way that they cover the entire width of the CD. Considering that the surface of a CD is highly reflective in infrared, we mounted a cardboard obstacle between the sensors so that they do not influence each other, as can be seen in the images.
The Principle of Operation
- The operating principle is simple: Whenever a black color passes over one of the 4 corridors of the sensors, the sensor in the respective area changes its analog output value and the Arduino reads this. Basically, the word will be written in 4 bits on the CD in binary code. Let's take the letter E as an example. In the ACII table in the images it has the hexadecimal value 45. In binary code we have the two characters: 4=0100, that is, on the 4 corridors it will appear in order, on the first corridor nothing, that is 0, on corridor 2 we have 1 and on 3,4 we have 0. This is character 4 in binary code: 0100.
- Same for 5: first aisle, nothing, that is 0, aisle 2 we have 1, aisle 3 nothing, 0, aisle 4, we have 1. Character 5=0101.
- 1 corresponds to the area colored in black and 0 has nothing drawn on the CD.
Start the Device
- We inscribe the CD with the text we want. Remember that each letter is made up of 2 binary characters, as I presented above the letter E. Each sensor has its status signaled by an LED when the motor makes a complete rotation. Attention when filling in with the marker on the CD, it will be tried as much as possible to respect the same dimensions between the characters.
- We turn on the device and if the settings and CD inscription are correct, the text will appear on the screen.
- If you liked my project, please leave a comment and a like.
- Thank you!