fbpx
Student Engineering Project

Random Number Generator using PIC Microcontroller

(Four Bit Code Generator) A random number generator using PIC Microcontroller that displays a random number between 0 & 65535 is the design.

⚙Embedded Systems ◆Student Project
Random Number Generator using PIC Microcontroller project prototype
Completed project — Random Number Generator using PIC Microcontroller Click to view

Project Overview

(Four Bit Code Generator) A random number generator using PIC Microcontroller that displays a random number between 0 & 65535 is the design. The circuit finds variety of applications in our day to day life. The circuit is based on PIC16f628A Microcontroller, seven segments LED display and few passive and active electronic components. The seven segment LED display is directly connected to the port B of the microcontroller through transistor (BC547).

Push button switch is connected between the microcontroller and (VSS) ground, whenever the switch is pressed the display is grounded and the current number generated by the controller is flashed in the seven segment display. The microcontroller is programmed with a group of numbers generating randomly. The programming language is c, circuit design is done in Proteus Labcenter ISIS and the printed circuit board (PCB) is done in Proteus Labcenter ARES. This Four Bit Code Generator or randomly generated number is given to the output port with a delay of ten (10) seconds.

This generated number is assigned a bit pattern in accordance with the seven segment display (common cathode) but the number is not displayed until the switch is pressed. Random number generator finds applications in random number drawing, bank token, lot taking, selection process and further more. Moreover it may find application in digital code locking in which two synchronized random number generator and transmitter and receiver are to be used. This material is a simple random number generator which generates a number between 0 and 65535 boxed into a 4 bit digit display.

This has applications in the field of digital code locking and lot taking for selection process. The system comprises a push button keypad connected to the 8 bit microcontroller PIC16F628A. This is one of the popular Microcontrollers. It has only 18 pins and there are 16 input/output lines. The microcontroller has a flash memory of 32Kbytes, 1 Kbyte EEPROM and 2 Kbytes RAM. The microcontroller is programmed to generate a random number with a delay of 10 seconds at the instant of pressing the push button switch number generated at that instant is displayed.

The PIC16F628A is a low-power CMOS 8-bit microcontroller based on the PIC enhanced RISC architecture. By executing powerful instructions in a single clock cycle, the PIC16F628A achieves throughputs approaching 1 MIPS per MHz allowing the system designer to optimize power consumption versus processing speed. The PIC core combines a rich instruction set with 32 general purpose working registers. All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU), allowing two independent registers to be accessed in one single instruction executed in one clock cycle.

The resulting architecture is more code efficient while achieving throughputs up to ten times faster than conventional CISC microcontrollers.

The PIC16F628A provides the following features: 32K bytes of In-System Programmable Flash with Read-While-Write capabilities, 1K bytes EEPROM, 2K bytes SRAM, 23 general purpose I/O lines, 32 general purpose working registers, three flexible Timer/Counters with compare modes, internal and external interrupts, a serial programmable USART, a byte oriented 2-wire Serial Interface, an SPI serial port, a 6-channel 10-bit ADC (8 channels in TQFP and QFN/MLF packages), a programmable Watchdog Timer with internal Oscillator, and five software selectable power saving modes.

The Idle mode stops the CPU while allowing the SRAM, Timer/Counters, USART, 2-wire Serial Interface, SPI port, and interrupt system to continue functioning. The Power-down mode saves the register contents but freezes the Oscillator, disabling all other chip functions until the next interrupt or hardware reset. In Power-save mode, the asynchronous timer continues to run, allowing the user to maintain a timer base while the rest of the device is sleeping. The ADC Noise Reduction mode stops the CPU and all I/O modules except asynchronous timer and ADC, to minimize switching noise during ADC conversions.

How the System Works

  1. The system is described in the historical project documentation preserved for this project.
  2. The documented inputs, controller or processing stages receive and process the relevant project signals.
  3. The controller or circuit performs the functions described in the original project material.
  4. The documented outputs provide the project response, indication or control.
HAVE AN ENGINEERING PROJECT IN MIND?

Let's develop it properly.

START A PROJECT