New to Electronics / Arduino - want to make my basic arduino project permanent.

Hi,
I am brand new to this. Have owned my Arduino starter kit for about 3 weeks and have no background in electronics and limited experience in coding...the perfect place to start...
It was suggested that I give Arduino a go as I love creating things, usually out of wood, and this could be a new avenue for me to explore.

So, I have worked through the starter kit projects wih my kids (trying to inspire them to learn something new) and decided to undertake a basic project of my own...I wanted to use a single digit seven segment lcd display to act like a dice and return a random number between 1 & 6 when a button was pushed. A bit of research later and I managed it.

But, as before I love to make things that I can touch (and my kids love the promise of my pretend dice) so I immediately thought..."how can I encase all of this in a small wooden cube and my kids can use it when they play board games". This is where I start to butt my head against my own ignorance and I was hoping for some assistance so I can continue down the path i have chosen.

My issues are:

  • in my head the wooden cube is smaller than my Arduino Uno, so I need to find a way to shrink it all.
  • researched the above and see a lot about programming an Atmega chip with a bootloader and (from what I can tell) creating a smaller single job controller to include within a project. This kinda makes sense to me but I have had real trouble finding someone who has provided a tutorial on this which goes all the way from a prototype on a breadboard to a finished physical product and my lack of understanding of everything is making this hard to know the steps to take.
  • even if I was able to blag my way through the instructions I found to do the above using ArduinoISP, I couldn't see any instructions on how to incorporate a 9V battery into my project, whether this is the appropriae power source for a project such as this) or how to use the Atmega chip to run peripheral componentary as mentioned above.

I would really like a hint in the right direction as I have stalled somewhat.

Any help appreciated.

Cheers,
Sam

Second start on a reply. How are your soldering skills?

Replace the Uno with a Nano without the pins and solder #30 wires to the pins and your display.

With the single LCD you should get several hours from a 9 volt battery.

Paul

Paul_KD7HB:
Second start on a reply. How are your soldering skills?

Replace the Uno with a Nano without the pins and solder #30 wires to the pins and your display.

With the single LCD you should get several hours from a 9 volt battery.

Paul

Thanks for the response, Paul.

My soldering skills are at the same level as my electronics knowledge and ability to code. :slight_smile: Defintiely keen to learn.

I am unfamiliar with the reference to #30 wires. What are they?

Thanks again.

I think that in this context #30 refers to the wire diameter (AWG30).

Instead of the suggested nano, you can also consider a SparkFun Pro Mini which is even smaller. You will however need a 'programmer' (which can be your Uno loaded with specific code).

ArduiNO_IDEA:
I couldn't see any instructions on how to incorporate a 9V battery into my project, whether this is the appropriae power source for a project such as this

That is probably because it is a rather inappropriate power source. I suppose they might exist, but I have never heard of a single digit LCD. I believe you can make an Arduino with a Uno chip and a just a couple of peripherals, but would suggest it would be easier to use

a 3.3v Pro Mini
a LiPo battery
a large single digit LED
a couple of peripherals for battery charging
a touch-sensitive device to trigger
a piezo thingy to confirm a new "throw"

all recessed into an expertly-routed a 40mm wooden cube, nicely polished, which would impress your kids no end...

Why not think outside the box? Forget the dice. Think of something that spins.

sterretje:
I think that in this context #30 refers to the wire diameter (AWG30).

Instead of the suggested nano, you can also consider a SparkFun Pro Mini which is even smaller. You will however need a 'programmer' (which can be your Uno loaded with specific code).

Thanks. Noted on the wire reference.

I appreciate that alternate option. I'm looking for as small as possible, so I will look into both the Pro Mini and the Nano.

Nick_Pyner:
That is probably because it is a rather inappropriate power source. I suppose they might exist, but I have never heard of a single digit LCD. I believe you can make an Arduino with a Uno chip and a just a couple of peripherals, but would suggest it would be easier to use

a 3.3v Pro Mini
a LiPo battery
a large single digit LED
a couple of peripherals for battery charging
a touch-sensitive device to trigger
a piezo thingy to confirm a new "throw"

Thanks Nick.
Did a bit of a look into the LiPo battery option and that is pretty cool. Will look a bit further into it.
Right you are one the LCD/LED mistake. Thanks.
I went with coloured LED's to signify the rolled number rather than a piezo to signify a new throw. But thanks.

Nick_Pyner:
all recessed into an expertly-routed a 40mm wooden cube, nicely polished, which would impress your kids no end...

Now you're talking...that is exactly what I had in mind!

Aggertroll:
Why not think outside the box? Forget the dice. Think of something that spins.

Starting simple...I want something finshed and tactile and to learn some new skills on the way. This is the start of my journey!!

Below is my finished code. I am sure it could be more elegant, but it does what I want.

int a = 2;  //int for LED digit Pins
int b = 3;
int c = 4;
int d = 5;
int e = 6;
int f = 8;
int g = 9;

int redPin1 = 10; //int for colour LED pins
int redPin2 = 11;
int bluePin = 12;

int buttonPin = 7; //int for Button pin

int val = 0; //int for button state

void setup() {
 pinMode(a, OUTPUT); //set LED digit pins as OUTPUT
 pinMode(b, OUTPUT);
 pinMode(c, OUTPUT);
 pinMode(d, OUTPUT);
 pinMode(e, OUTPUT);
 pinMode(f, OUTPUT);
 pinMode(g, OUTPUT);

 pinMode(buttonPin, INPUT); //set button pin as INPUT

 pinMode(redPin1, OUTPUT); //set colour LED pins as OUTPUT
 pinMode(redPin2, OUTPUT);
 pinMode(bluePin, OUTPUT);

 randomSeed(analogRead(0)); //reset Random command
}

void displayDigit(int digit) { //set numbers that use each segment of
  //Displaying segment a       //LED digit.
  if(digit!=1 && digit!=4)
  digitalWrite(a, HIGH);

  //Displaying segment b
  if(digit!=5 && digit!=6)
  digitalWrite(b, HIGH);

  //Displaying segment c
  if(digit!=2)
  digitalWrite(c, HIGH);

  //Displaying segment d
  if(digit!=1 && digit!=4 && digit!=7)
  digitalWrite(d, HIGH);

  //Displaying segment e
  if(digit==2 || digit==6 || digit==8 || digit==0)
  digitalWrite(e, HIGH);

  //Displaying segment f
  if(digit!=1 && digit!=2 && digit!=3 && digit!=7)
  digitalWrite(f, HIGH);

  //Displaying segment g
  if(digit!=0 && digit!=7 && digit!=1)
  digitalWrite(g, HIGH);
}

void turnOff() {  //function to turn off the LED digit
  digitalWrite(a, LOW);
  digitalWrite(b, LOW);
  digitalWrite(c, LOW);
  digitalWrite(d, LOW);
  digitalWrite(e, LOW);
  digitalWrite(f, LOW);
  digitalWrite(g, LOW);
}

void displayRandom() {
  int randomNumber;
  randomNumber = random(1,7);  //generate random number between 1 & 6

  digitalWrite(redPin1, HIGH); //turn on all Colour LED's
  digitalWrite(redPin2, HIGH);
  digitalWrite(bluePin, HIGH);
  displayDigit(randomNumber);  //display the generated random number via displayDigit function
  delay(1000);                 //wait a second
  
  digitalWrite(redPin1, LOW);  //turn off all Colour LED's
  digitalWrite(redPin2, LOW);
  digitalWrite(bluePin, LOW);
  turnOff();                   //turn off the LED Digit via turnOff function
  delay(500);                  //wait half a second 
  
  digitalWrite(redPin1, HIGH); //turn on all Colour LED's
  digitalWrite(redPin2, HIGH);
  digitalWrite(bluePin, HIGH);
  displayDigit(randomNumber);  //display the generated random number via displayDigit function
  delay(2000);                 //wait 2 seconds 

  digitalWrite(redPin1, LOW);  //turn off all Colour LED's
  digitalWrite(redPin2, LOW);
  digitalWrite(bluePin, LOW);
  turnOff();                   //turn off the LED Digit via turnOff function
}

void flashRandom() {           //A function to flash random numbers with longer delays 
  int randomFlashNumber;       //int to store the random number to flash
  int previousRandomNumber;

  
  for (int i = 1; i < 16; i++) {     //15 lengthening segments to flash a number in...
    randomFlashNumber = random(1,7); //generate a random number between 1 & 6
    if (randomFlashNumber != previousRandomNumber) {
      if (i <=10){                     //light 1st red pin only for first 10 segments
        digitalWrite(redPin1, HIGH);
        digitalWrite(redPin2, LOW);
      }
      else {
        digitalWrite(redPin1, HIGH);   //light both red pins for last 5 segments
        digitalWrite(redPin2, HIGH);
      }
      displayDigit(randomFlashNumber); //flash the random number
      delay(i*33);                     //flash the random number for lengthening periods
      turnOff();                       //turnoff the LED digit

      previousRandomNumber = randomFlashNumber;
    }
  }
}
void loop() {
  digitalWrite(redPin1, LOW);        //turn off all colour LED's
  digitalWrite(redPin2, LOW);
  digitalWrite(bluePin, LOW);

  val = digitalRead(buttonPin);      //read the Button state and set as Val integer
  if (val == HIGH) {                 //Button state = High if button is pushed.
     flashRandom();                  //flash the random numbers & light the red LED's
     displayRandom();                //flash the final number & light all LED's
  } else {
    turnOff();                       //Turn off when Button state = Low
  }
}

forget the huge pro-mini, get a digispark and cut off the USB to make is half the size.

get some rechargeable button batteries to run on 3.3 volts
hollow out a die and insert LED's in each of the sides
insert the micro and button
use a position sensing chip.
whatever side is up, gets the LED's to light.

it looks like a normal die but has LED's

put metal on each corner and charge by touching the corners.

and once you get this working, come back and we can help you get an ATTINY10 into a much smaller form factor, something more on the size of TO-92 Transistor.


btw, wire size is crudely based on how many strands of wire can fit into a 5/16 diameter hole. more strands = higher number. 12 strands are thicker, so only 12 fit, 30 stands are thinner, so more fit.
but it really also has a complicated formula based on cross sectional area. each next size larger is 1.126 times the area of the last size. more than you wanted to know !

the ARDUINO is a concept, not a thing. but we like to touch things. so, most of us consider an 'Arduino' to be an UNO equivalent. similar pin count. etc. as a concept or platform, it is any microprocessor that can be programmed with the Arduino IDE software. The chip manufacturer- ATMEL- makes a line of chips that fit that bill. the 'ARDUINO' is in the middle of that family. The ATTINY on the lower end the MEGA on the higher end with more pins. the ATTINY10 is 6 pins.

Lasty, 'dead bug' is a way of soldering to the chip without the use of a fiberglass board.
to get into a tiny space like the inside of a die. this might fit the bill