Arduino: Random Options Picker

About: Stay thinking 24/7

Arduino: Random Options Picker is a tool to generate a random name based on your options, with unlimited options, and different Random Seed every time you push the button. I spent +$36. Time needed just about 2-3 hours. Let's get started.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Preparing...

Here's the things you gonna need:

(1) Arduino Uno

(1) 16x2 LCD

(1) Breadboard

(1) Button

(1) Potentiometer 10kΩ

(1) Resistor 220Ω

(18) Wire or Jumper Wire

(1) Arduino Cable to USB or 9V Battery + DC Adaptor

Step 2: Making...

The form is technically looks-like on the graph. Simple. Follow it and done.

Step 3: Uploading...

Once you have finish the "plugging cable" and "stuffs", it's time to upload the code to the Arduino.

Step 4: Finishing...

Once you have finished, try to use it. When you push the button, it will shows a random name from your options for 5 sec (you can change the time from the code).

*P.S. If necessary, you can make a case or any alternative, so it can look cleaner and tidier.

Step 5: Extras

If the LCD don't show any text, but just blocks or weird languages somehow like error, you can:

1. Make sure that all your cables are fine and can be used.

2. Make sure that your cables, LCD, button, and Potentiometer are plugged at the right spot.

3. If it still not working, Reset the Arduino, or Re-Make it.

Arduino All The Things! Contest

Participated in the
Arduino All The Things! Contest

Full Spectrum Laser Contest 2016

Participated in the
Full Spectrum Laser Contest 2016

Share

    Recommendations

    • Indoor Lighting Contest

      Indoor Lighting Contest
    • Make It Fly Challenge

      Make It Fly Challenge
    • Growing Beyond Earth Maker Contest

      Growing Beyond Earth Maker Contest

    8 Discussions

    0
    None
    sdreoos

    9 months ago

    Hello, trying a 20x4 display (I need longer sentences) on I2C it doesn't work...any suggestion please?

    #include <Wire.h>
    #include <PCF8574_HD44780_I2C.h>
    PCF8574_HD44780_I2C lcd(0x27,20,4);
    char *players[]={
    "John",
    "Marie",
    "Bob",
    "Richard",
    "Michael",
    "Madeleine",
    "Samuel",
    "Michelle",
    "Jennifer",
    "Claire",
    };
    long player;
    int val1 = 0;
    int BUTTON1 = 13;
    void setup() {
    lcd.begin(20, 4);
    pinMode(BUTTON1, INPUT);
    }
    void loop() {
    lcd.setCursor(0,1);
    lcd.print(millis() / 1000);
    val1 = digitalRead(BUTTON1);
    unsigned long seed=seedOut(50);
    randomSeed(seed);
    if (val1 == HIGH) {
    for (int i=0;i<1;++i) {
    player = (random(sizeof(players)/sizeof(char*)));
    lcd.setCursor(0, 0);
    lcd.print(players[player]);
    delay(5000);
    lcd.clear();
    }
    }
    else
    {
    return;
    }
    }
    unsigned int bitOut(void) {
    static unsigned long firstTime=1, prev=0;
    unsigned long bit1=0, bit0=0, x=0, port=0, limit=10;
    if (firstTime) {
    firstTime=0;
    prev=analogRead(port);
    }
    while (limit--) {
    x=analogRead(port);
    bit1=(prev!=x?1:0);
    prev=x;
    x=analogRead(port);
    bit0=(prev!=x?1:0);
    prev=x;
    if (bit1!=bit0)
    break;
    }
    return bit1;
    }
    unsigned long seedOut(unsigned int noOfBits) {
    unsigned long seed=0;
    for (int i=0;i<noOfBits;++i)
    seed = (seed<<1) | bitOut();
    return seed;
    }

    0
    None
    ehudwill

    3 years ago

    I like this. I want to build a random number generator.

    2 replies
    0
    None
    haydians09ehudwill

    Reply 3 years ago

    Yeah that could work too. But I suggest you to use the random number generator code, because this one is for options you made.

    0
    None
    ehudwillhaydians09

    Reply 3 years ago

    I would like to make a device that generates all manner of randomness. Mostly for use in an RPG setting.

    0
    None
    haydians09asharma172

    Reply 3 years ago

    Of course it can. There's a lot cheaper LCD with blue light in Amazon and cheaper wires and stuffs. Or even cheaper by using Serial.println, not by LCD.

    0
    None
    Samuel_Alexander

    3 years ago

    Really simple and can be very useful for some occasions ;)

    One question, what is the function of the number below the name?

    1 reply
    0
    None
    haydians09Samuel_Alexander

    Reply 3 years ago

    Well at first I'm trying to put a timer below the name, but since I still haven't find out what's the code, I turned it into a stopwatch.