Educational Project! How the Binary Code Works!
by cristinepotu7171 in Circuits > Arduino
1027 Views, 13 Favorites, 0 Comments
Educational Project! How the Binary Code Works!
Hello, today I present to you a very simple project, a combination of education and microcontrollers. The working mode of the binary code is presented, more precisely how we read a digit in binary code. The device automatically decodes and displays on a 7-segment led display.
Supplies
- Arduino Nano
- 7 segments led ,common cathode
- 4xLDR 10...20k
- 4x3k9 rezistors
- 1x22ohm resistor
- breadboard and jumper wire
- Visuino softwarea
- cardboard
- bumper sticker
Schematic Diagram
The electrical scheme is very simple, the photoresistors are connected to analog pins A1...A4. The LED display has a common cathode (+common) and is connected through the 22 ohm resistor to the 3V3 pin.
- The code is compiled in Visuino, but you can also find the code in INO format attached. You can see the 4 "Compare analog value" components that read the value from the photoresistors and switch to 1 logic if a certain value is exceeded. Depending on certain parameters, it may be necessary to adjust the value of these comparators as indicated in the attached images. Previously, connect the analog inputs to the serial pin and read the value. Do this only if the display does not work properly when obstacles pass in front of the photoresistors.
- Choose the correct port and upload the code to the Arduino.
Construction and Operation
- The assembly is performed on a test board following the electrical diagram. Any other option can be used. I mounted the photoresistors on another test board and the Arduino and the display on another board, as seen in the images.
- I cut 10 pieces of cardboard to the same dimensions (3x12 cm) on which I marked with the marker the 4 positions of the photoresistors. According to the binary table, I cut out next to each photoresistor aiming to obtain the 10 numbers from 0 to 9.
- The operating principle is intuitive, when the photoresistor is blocked by light, it has a value of 0. When it has a cut-out to its right, it has a value of 1. Take as an example the number 5, according to the binary table: 0101, so the first photoresistor is blocked, the second cut-out, of third closed, fourth cut out.
- 0101=digit 5.
Start the Device
- The device is supplied with voltage. If everything works, when placing the cardboard with the attached number next to the photoresistors, the respective number will appear on the LED display. Particular attention must be paid to respecting the first bit (the first photoresistor) in relation to the positioning of the cardboard. The first bit is in pin A1.
- If you liked my project, don't forget to give a like.
- Thank you!