Educational Project! How the Binary Code Works!

by cristinepotu7171 in Circuits > Arduino

858 Views, 12 Favorites, 0 Comments

Educational Project! How the Binary Code Works!

thunb.jpg
Binary code

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

snapshot135.png
snapshot137.png
Z1621.jpg
download (8).png
download (2).jpg
download (1).png
snapshot139.png
snapshot143.png
  1. Arduino Nano
  2. 7 segments led ,common cathode
  3. 4xLDR 10...20k
  4. 4x3k9 rezistors
  5. 1x22ohm resistor
  6. breadboard and jumper wire
  7. Visuino softwarea
  8. cardboard
  9. bumper sticker

Schematic Diagram

nano.jpg

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.

download (1).png
Screenshot (33).png
Screenshot (36).png
Screenshot (38).png
  • 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

snapshot131.png
snapshot132.png
snapshot137.png
snapshot138.png
snapshot139.png
snapshot140.png
snapshot141.png
snapshot143.png
snapshot145.png
download (9).png
  • 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

Screenshot (39).png
Screenshot (40).png
Screenshot (42).png
IMG_20230927_172657.jpg
snapshot145.png
  • 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!