True Random Number Generator

Ionacu Teodor Alexandru 1222A

Introduction

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 a unique and immersive gaming experience. Let the temperature shape your luck and add a new dimension to your gaming adventures!

General Description

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 outcomes, this project introduces a temperature sensor to add a touch of unpredictability. The temperature reading influences the generated number, making it more akin to true randomness. By incorporating the ambient temperature into the randomization process, the project mimics the characteristics of natural random events, similar to true random number generators used in various applications. This unique feature brings an element of surprise and authenticity to the game, providing players with a more immersive and engaging experience. Whether it's a casual game among friends or an exploration of random number generation, this project offers an exciting blend of electronics, chance, and scientific principles.

Hardware Design

Components

  • DHT11 temperature sensor
  • Arduino UNO board
  • Buzzer
  • Button
  • LEDs
  • Breadboard
  • Resistors

Physical Project

Software Design

Libraries used
  • <DTH.h>
Funcții implementate:
  • setup(): This function is called once at the beginning of the program and is responsible for initializing the pins and sensors.
  • generateRandomNumber(): This function reads the temperature from the sensor and generates a random number based on the temperature value. It combines the temperature reading with the traditional random number generation to add an element of unpredictability.
  • 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.
  • 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.
Code for the project

Conclusions

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

01.05.2023 - Initial Documentation 10.05.2023 - Ordered the needed parts 15.05.2023 - Started testing the parts 30.05.2023 - Finished the project

Resources

pm/prj2023/avaduva/random.txt · Last modified: 2023/05/30 02:33 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