Differences

This shows you the differences between two versions of the page.

Link to this comparison view

pm:prj2023:avaduva:random [2023/05/29 01:46]
teodor.ionascu1507
pm:prj2023:avaduva:random [2023/05/30 02:33] (current)
teodor.ionascu1507 [Software Design]
Line 5: Line 5:
 ====Introduction==== ====Introduction====
 <​nowiki>​ <​nowiki>​
-The True Random Number Generator (TRNG) ​project ​utilizes an Arduino Uno, LEDs, a microphone, and capacitors to generate unbiased and unpredictable random numbers based on ambient noise. By capturing noise signals with the microphone and using them to seed the Arduino'​s random ​number ​generator, ​the project provides ​practical solution for generating true randomness with visual feedback through blinking LEDs.+Introducing the Dice Game with Temperature Sensor! This interactive ​project ​combines the excitement of a dice game with the unpredictability of temperature fluctuations. By integrating a DHT temperature sensor, each roll of the dice is influenced by the current temperature reading. As you press the button, LEDs flicker, a buzzer plays a slot-like melody, and the dice display a number ​affected by the temperature,​ offering ​unique and immersive gaming experienceLet the temperature shape your luck and add a new dimension to your gaming adventures!
 </​nowiki>​ </​nowiki>​
 ====General Description==== ====General Description====
 <​nowiki>​ <​nowiki>​
-The True Random Number Generator (TRNG) ​project ​utilizes an Arduino Uno board, LEDs, a microphone, and capacitors ​to create ​device that generates random numbers based on ambient noise. The project taps into the inherent variability in noise signals ​to produce unbiased and unpredictable random numbers, which have applications in cryptography,​ gaming, simulations,​ and other domains requiring random data. +The Dice Game with Temperature Sensor is an intriguing ​project ​that combines the excitement of a dice game with the concept of true random number generation. Unlike traditional dice games that rely on predictable outcomesthis project introduces ​temperature sensor ​to add touch of unpredictability. The temperature reading influences ​the generated number, making it more akin to true randomnessBy incorporating ​the ambient temperature into the randomization process, the project mimics the characteristics of natural random eventssimilar ​to true random number ​generators used in various applicationsThis unique feature brings an element of surprise and authenticity ​to the gameproviding players with more immersive and engaging experience. Whether it's a casual game among friends or an exploration of random number ​generationthis project offers an exciting blend of electronics,​ chance, and scientific principles.
- +
-The Arduino Uno serves as the control unitproviding ​the necessary processing power and I/O capabilities. The microphone captures ambient sound signalswhich contain random fluctuations. These signals are used to seed the Arduino'​s ​random number ​generator, ensuring the generated numbers are truly random. +
- +
-Visual feedback is provided through LEDs connected ​to the Arduino boardblinking briefly whenever ​new random number ​is generated. Capacitors may be utilized for noise filteringsignal conditioningor biasing purposes. +
- +
-The TRNG project combines the Arduino platform'​s flexibility with ambient noise sources to offer a practical ​and accessible solution for generating random numbers with high entropy. +
 </​nowiki>​ </​nowiki>​
-====Electrical diagram==== 
-{{ :​pm:​prj2023:​avaduva:​electrical_diagram_ciucu_ovidiu.png?​nolink&​300 |}} 
 ====Hardware Design==== ====Hardware Design====
 {{ :​pm:​prj2023:​avaduva:​hardware_design_ciucu_ovidiu.png?​nolink&​300 |}} {{ :​pm:​prj2023:​avaduva:​hardware_design_ciucu_ovidiu.png?​nolink&​300 |}}
 ====Components==== ====Components====
-  *MQ-3 sensor+  *DHT11 temperature ​sensor
   *Arduino UNO board   *Arduino UNO board
   *Buzzer   *Buzzer
   *Button   *Button
-  *LCD display with I2C module+  *LEDs
   *Breadboard   *Breadboard
 +  *Resistors
  
 ====Physical Project==== ====Physical Project====
-{{ :​pm:​prj2023:​avaduva:​pozaproiect1_ciucu_ovidiu.jpeg?nolink&​300 ​|}} +{{:​pm:​prj2023:​avaduva:​ionascu1_2023-05-30_at_01.54.28.jpeg?200|}} 
-{{ :​pm:​prj2023:​avaduva:​pozaproiect2_ciucu_ovidiu.jpeg?nolink&​300 ​|}} +{{:​pm:​prj2023:​avaduva:​ionascu2_2023-05-30_at_01.54.06.jpeg?200|}} 
-{{ :​pm:​prj2023:​avaduva:​pozaproiect3_ciucu_ovidiu.jpeg?nolink&​300 ​|}} +{{:​pm:​prj2023:​avaduva:​ionascu3_2023-05-30_at_01.53.48.jpeg?200|}}
 ===== Software Design ===== ===== Software Design =====
 == Libraries used == == Libraries used ==
  
-  *<Wire.h>​ +  *<DTH.h>
-  *<​LiquidCrystal_I2C.h>+
  
 == Funcții implementate:​ == == Funcții implementate:​ ==
-  * **void setup()**: +  ***setup():​** ​This function is called once at the beginning of the program and is responsible for initializing ​the pins and sensors. 
-    ​Declare the pins +  ***generateRandomNumber():** This function reads the temperature from the sensor ​and generates ​random number based on the temperature value. It combines the temperature ​reading ​with the traditional random number generation to add an element of unpredictability. 
-    ​Initialize ​the LCD display +  ***playSlotSound():​** This function plays a slot machine-like sound effect using the buzzer. It utilizes predefined arrays of notes and durations to create the desired sound. 
-    * Display ​the initial text ("​Press ​the button"​) +  ​***flickerLEDs():​*This function controls ​the LEDs connected to the dice pins and makes them flicker rapidly, creating an animated effect during the dice roll. 
- +  ***loop():** This function is the main execution loop of the program. It continuously checks if the button is pressed and performs the dice roll sequence, including playing the sound, flickering the LEDs, generating the random number, ​and displaying it on the dice LEDs.
-  * **void loop()**: +
-    ​Verify if the button has been pressed  +
-    ​If the button has been pressed ​the Buzzer starts ​and makes noise every second for 5 seconds +
-    * The LCD displays that the sensor is reading +
-    After 5 seconds ​the buzzer ​stops +
-    The code computes ​the average value read by the sensor +
-    The condition blocks inside ​the code verify ​the value and display ​the appropriate message+
  
  
 ==Code for the project== ==Code for the project==
-{{:​pm:​prj2023:​avaduva:​etilotest.rar|}} +{{:​pm:​prj2023:​avaduva:​trngdice.rar|}}
 ====Conclusions=== ====Conclusions===
-It has been a fun experience learning how to create ​an Alcohol tester. I believe that this device can be later used if needed. My knowledge regarding the Arduino technology has definitely improved.+It has been a fun experience learning how to create ​a True Random Generating Dice game. I believe that this device can be later used if needed. My knowledge regarding the Arduino technology has definitely improved.
  
 ===== Journal ===== ===== Journal =====
 01.05.2023 - Initial Documentation 01.05.2023 - Initial Documentation
-03.05.2023 - Ordered the needed parts +10.05.2023 - Ordered the needed parts 
-10.05.2023 - Started testing the sensor +15.05.2023 - Started testing the parts 
-28.05.2023 - Finished the project+30.05.2023 - Finished the project
  
 ===== Resources ===== ===== Resources =====
-  * Hardware diagram [[https://​www.circuito.io/​]] 
   * Arduino IDE [[https://​www.arduino.cc/​en/​software]]   * Arduino IDE [[https://​www.arduino.cc/​en/​software]]
-  * Site for components: [[https://​www.sigmanortec.ro/]]+  * Site for components: [[https://​www.optimusdigital.ro/ro/]]
 <​html><​a class="​media mediafile mf_pdf"​ href="?​do=export_pdf">​Export to PDF</​a></​html>​ <​html><​a class="​media mediafile mf_pdf"​ href="?​do=export_pdf">​Export to PDF</​a></​html>​
pm/prj2023/avaduva/random.1685314008.txt.gz · Last modified: 2023/05/29 01:46 by teodor.ionascu1507
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0