The Dicer

Have some fun using this handy box with shuffle and counting abilities, supported by 8-bit sound effects.

Feb 18, 2019

3203 views

3 respects

Components and supplies

1

Passive Buzzer

2

On/off button

5

Shift Register 74HC595

40

Resistor 10k ohm

6

Resistor 1k ohm

5

Lever arch switch

1

Resistor 100 ohm

3

Resistor 2.7k ohm

2

Momentary button

5

Diode Led Red 5mm

35

Diode Led White 5mm

3

Resistor 3.3k ohm

1

Arduino Nano R3

3

Resistor 5.1k ohm

Tools and machines

1

Soldering Station

1

Drill

Project description

Code

Blinking Leds with no delay() function

arduino

With just simple mod (%) operator we can take millis() into action and specify if this is the right time ON state, or OFF state.

Control Four Switches non-exclusive with just one analog pin

arduino

Right use of 5 resistors combinantion allow you to detect four switches non-exclusive. Assuming you are using 3 sets of such setting covers up to 12 switches which is more than enough for this project. Each of 3 sets works as below: - we put positive "+" current (5V) to each resistors: 1k ohm, 2.7k ohm, 3.3k ohm and 5.1k ohm. - each resistor is connected to switch (on/off or momentary) - after switches we are merging all 4 lines into resistor 1k ohm - before 1k ohm resistor we take line into analog input - after 1k ohm resistor we put it to the ground (GND) Pressing buttons is changing resistances in this parallel scheme in non-random way so the result can be extraced as 4-bit value.

Play melody on your buzzer

arduino

I have barely used this function here to emulate menu clicks but can be exhanced to give more length to it. The idea is to create array of 2 values : note & duration. The note represents C4-C7 frequnecy, while duration tell us for how long this should sound.

5 Shift registers daisy chained to control 40 Leds.

arduino

By using 5 shift registers 74HC595 we can control 40 outputs with just 3 pins on arduino board. When we will understand the mechanics behind it, it is very simple to reuse with another projects

Play melody on your buzzer

arduino

I have barely used this function here to emulate menu clicks but can be exhanced to give more length to it. The idea is to create array of 2 values : note & duration. The note represents C4-C7 frequnecy, while duration tell us for how long this should sound.

Blinking Leds with no delay() function

arduino

With just simple mod (%) operator we can take millis() into action and specify if this is the right time ON state, or OFF state.

Control Four Switches non-exclusive with just one analog pin

arduino

Right use of 5 resistors combinantion allow you to detect four switches non-exclusive. Assuming you are using 3 sets of such setting covers up to 12 switches which is more than enough for this project. Each of 3 sets works as below: - we put positive "+" current (5V) to each resistors: 1k ohm, 2.7k ohm, 3.3k ohm and 5.1k ohm. - each resistor is connected to switch (on/off or momentary) - after switches we are merging all 4 lines into resistor 1k ohm - before 1k ohm resistor we take line into analog input - after 1k ohm resistor we put it to the ground (GND) Pressing buttons is changing resistances in this parallel scheme in non-random way so the result can be extraced as 4-bit value.

5 Shift registers daisy chained to control 40 Leds.

arduino

By using 5 shift registers 74HC595 we can control 40 outputs with just 3 pins on arduino board. When we will understand the mechanics behind it, it is very simple to reuse with another projects

Downloadable files

Dicer Schematic

Describes used connections

Dicer Schematic

Comments

Only logged in users can leave comments

mbedni

0 Followers

0 Projects

Table of contents

Intro

3

0