Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

for new project: random number generator with memory

Status
Not open for further replies.

teletot

New Member
I'm looking for information for a new project:
when pushed touch button, a lcd display should show a 8 digit random number for approx. 15 sec., in a memory function the generated numbers should be stored with date and time stamp and shown, on demand by scroll function, on display. Stand alone system on printboard, battery operated.
 
How many button pushes do you need to store?
 
Seems like you could do this with a battery backed-up ucontroller. With careful packing, each button push would generate about 8-10 bytes. With 2K bytes of ram, you could store >100 events... One with an SD card interface would not require battery-back-up and could store millions of events...
 
A Microchip 24lc128 EPROM memory stores 16k by 8bits. It's easy to interface and costs 75 cents.
The first thing to do is determine which components will be needed.
Microcontroller,Display,Button,Memory?
 
How are you going to generate a perfect 8 decimal digit random number?

There are probably three easy methods;
1. generate a digit 0-9 for eight iterations
2. generate a number in exact range 0-99999999
3. generate a 27bit number (range 0-134217727) and discard result and re-run if over 99999999
 
With careful packing, each button push would generate about 8-10 bytes.
A timestamp having a 1 second resolution over a 20 year span only requires 29.2 bits; 8 digit number only needs 26.6 bits. That's a total of 56 bits (7 bytes).

One with an SD card interface would not require battery-back-up and could store millions of events...
This project needs battery backup for the realtime clock (for the timestamps). The clock can be in the microcontroller or an external RTC IC.
 
If you're happy to use an ATMEL AVR device, then you'd need:
* ATMEGA48/88/168/328 (just one of these) Revision D or later (or the 32kHz TOSC is no good),
* a 32kHz crystal for the RTC,
* an HD44780 LCD (I'm assuming you're OK with one of the 2x16 character modules..???),
* a switch,
* some capacitors e.g. 2x 16pF, 1x 10uF, 2x 100nF,
* a programmer, e.g. USBISP or USBASP
* batteries and holder, and
* a programming connector (e.g. 2x5 or 2x6 DIL pin header).

This can be programmed easily using AVR-GCC or WinAVR C compilers.

Regarding saving the numbers and timestamps, the program memory can be used for this purpose; just note that blocks of 32 bytes should be written at a time (RAM or EEPROM can be used for short-term storage of this data).
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top