Arduino Diorama

by carijn in Circuits > Arduino

691 Views, 1 Favorites, 0 Comments

Arduino Diorama

DSC05363.JPG

This diorama uses an Arduino Uno for the hardware, and one small breadboard to put all the components on. I had acces to an Arduino Sparkfun kit, but you can buy the parts seperately as well.

The diorama itself can be personalized as much as you like, this instructable is mostly for the hardware. I will explain a little about how I made my diorama though.

The video of my diorama can be found here:

Supplies

- Software:
Free, downloadable software: https://www.arduino.cc/en/software

- Hardware:
Sparkfun kit, extra wiring (and soldering iron and tin) and aluminium foil/tape, or separate parts:

- 1 Arduino Uno with USB cable
- 1 DC-motor
- 1 motor driver
- wiring
- soldering iron and soldering tin
- 3 LED lights
- aluminium foil/tape
- 1 "10K ohm" resistor
- motor driver
- 3 "330 ohm" resistors

- Diorama materials:

- cardboard box, painted black
- cardboard plate that fits in the box
-foam and paint for decoration
-reusable straw for the street lights

Arduino Code:

First step is to download Arduino here: https://www.arduino.cc/en/software

To get the DC motor, the LED lights, the aluminium button and the potentiometer to work, I made the following code (see file). In the code, wherever a scentence starts with //, I wrote an explanation about the different parts of the code. These parts are of no influence on the code itself. Copy and paste this code in an Arduino file.

To check if the code works, you will need to build the hardware. See next steps.

Building Hardware

20210514_090119.jpg

In this drawing all the parts are shown and where they have to be connected. There is a more detailed explanation in the following steps.

DC Motor and Potentiometer

DSC05372.JPG
DSC05373.JPG
DSC05374.JPG
DSC05375.JPG
DSC05376.JPG
DSC05377.JPG
DSC05378.JPG

First I connected my DC motor and potentiometer. You also need a motor driver for this. (see images).

wires to - from:

motor/motor driver/arduino

vm to Vin

vcc to +

GND to -

A01 to wire on motor

A02 to wire on motor

PWMA to pin 3

AI2 to pin 4

AI1 to pin 5

STBY to pin 6

potentiometer/arduino:

the potentiometer has 3 pins itself. the middle one goes directly to arduino: analog pin A2

the other two go to + and - on the breadboard.

Led Lights

DSC05379.JPG
DSC05381.JPG
DSC05382.JPG
DSC05383.JPG

I used three led lights for street lights, that will go on when the potentiometer is turned on.

One of the images explains how to connect the lights to the breadboard and the arduino.

The pins on the Arduino Uno I used are pin 11,12 and 13.

Aluminium Button/sensor

DSC05366.JPG
20210506_110246.jpg
20210506_110839.jpg
20210506_110922.jpg
20210506_111526.jpg

The "road" exists out of two aluminium circles, that, when they are connected, they will act as a button that overrides the potentiometer and so the orange car. The red car has aluminium on the bottom, and acts as the bridge between the two parts of the road.

One part of the aluminium road is wired to pin 8 on the arduino uno board. The other one is connected to the - on the breadboard, via a 10K ohm resistor, just like a button would. (See image step 2 for wiring.)

To connect the road to the arduino below, I used some tape with aluminium on it connected to wiring, and made slots right next to the aluminium road parts. I slid the other side of the tape through the slots and connected them on the surface.

Soldering

20210506_112257.jpg
20210512_152954.jpg
20210512_152930.jpg

When all the components are added and work, the ones that need to be extended to reach the right spot in the diorame, need to be soldered to extra wiring.

In my version of the diorama these are:

-the 3 leds

-the potentiometer

It is also possible to use the wiring like the one on the photo with the (blue) potentiometer, which is a less permanent solution.

Building the Diorama

20210506_120358.jpg
20210506_120416.jpg
DSC04746.jpg
DSC05357.JPG
DSC05358.JPG
DSC05359.JPG
DSC05360.JPG
DSC05361.JPG
DSC05363.JPG
DSC05366.JPG

For the streetlights I used a hard plastic reusable straw (from Ikea) that I cut in three equal parts, and made a plastic top for the streetlights. I drew road stripes between the aluminium parts to make it look more like a road.

I used some foam to make a double bottom in the box to create space for the breadboard and the arduino.

The boulders are made from different types of (mattress) foam, as an experiment.

I also used foam clay (silk clay) around the "tree", and painted them to make them look like rocks.

The fencing by the streetlights are painted hot glue on plastic.

The car that goes around is held by the iron wire connected to the DC motor. I needed to be able to disconnect the parts so I DIY-ed a connection for this with some cardboard and plastic that fits snug on the motor, but when you want it to be more permanent, I recommend just (hot) gluing the wire to the motor, being careful not to glue it stuck on the floor.