DollaS Dancer

 

Introduction:

My girlfriend came up with this crazy idea!
Turning a barbie into a dancer on a stage,

The stage is coin bank, so you have to put money into it to make it dance for you.

 

Dolla

Figure (0): Barbie Toy

 

Description:

 

BOM:

0. Barbie with swimming suit.

1. Right Angle Gear Motor: voltage is 4.5-6V with a no load current of 190mA, output shaft is 9mm long and the gearbox ratio is 48:1 with a wheel speed of 140 RPM (unloaded)

2. Dual Ball Bearing Hub

3. 1.50” Aluminum Channel

4. 1/4" aluminum pole

5. 1/4" wood pole

6. Aluminum box "I found it in the recycling where I work"

7. Plexiglas cover.

8. 8 ohm speaker

9. Mp3 Player Audio Decoder Board

10 Switcher Power Module  LMZ36002EVMLMZ36002EVM see below for more info

RoadTest Review the TI LMZ36002EVM - Review

11. L298N Motor Drive Controller Board Module Dual H Bridge.

12. PIR Motion Sensor.

13. MCU ATMEL ATMEGA328P

 

dc motordc motor

Figure (1): Right Angle Gear Motor

bearing

Figure (3): Dual Ball Bearing Hub

channel

Figure (4): Dual Ball Bearing Hub

 

box

Figure (6.8): Aluminum box with speaker.

 

Plexiglas

Figure (7): Plexiglas cover.

 

 

mp3 player

Figure (9): Mp3 Player Audio Decoder Board

 

Figure (10): Switcher Power Module  LMZ36002EVMLMZ36002EVM

motor driver

Figure (11): L298N Motor Drive Controller Board Module Dual H Bridge.

 

pir

Figure (12): PIR Motion Sensor.

mcu

Figure(13) MCU Arduino Tiny

 

 

Full System:

fbd

Code:

 

' ******************************************************************************

' * Title         : DallaS Dancer                                                      *

' * Version       : 1.0                                                                     *

' * Last Updated  : 06/2/2017                                                      *

' * Target Board  : Atmel 328p module                                        *

' * Target MCU    : ATMega328p                                                 *

' * Author        : Molham Kayali                                                    *

' * IDE           : BASCOM AVR 2.0.7.5                                           *

' * Peripherals   : Motors Control                                                  *

' * Description   : DollaS Dancer control                                       *

' ******************************************************************************

 

 

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

'-----------------------[Definitions]

Declare Function Pir1() As Byte

Declare Function Pir2() As Byte

 

 

$regfile = "m328pdef.dat"

$crystal = 8000000

$baud = 9600

'$Sim

'-----------------------

'-----------------------[GPIO Configurations]

Config Pind.2 = Output : Dc1 Alias Portd.2 : Reset Dc1

Config Pind.3 = Output : Dc2 Alias Portd.3 : Reset Dc2

 

Config Pind.4 = Input

 

Config Adc = Single , Prescaler = Auto , Reference = Internal

 

 

Dim Motion As Byte

Dim Motion2 As Byte

 

 

Start Adc

Wait 3

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

'--->[Main Program]

 

 

Do

   Motion = Pir1()

    If Motion = 1 Then

 

     Gosub Move_forward : Waitms 200

     Gosub Move_backward : Waitms 200

 

    End If

 

Loop

End

'---<[End Main]

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

'--->[Move Renbot with 4 motors forward]

Move_forward:

 

 

   Set Dc1 : Reset Dc2

   Waitms 100

Return

'-----------------------

 

 

'--->[Move Renbot with 4 motors backward ]

Move_backward:

 

 

   Reset Dc1 : Set Dc2 :

   Waitms 100

Return

'-----------------------

 

 

'--->[Front PIR sensor]

Function Pir1() As Byte

Local Adcvalue As Integer

 

 

      Adcvalue = Getadc(0)

    If Adcvalue < 512 Then

      Motion = 1

 

 

    Else

      Motion = 0

 

 

    End If

End Function

 

 

'-----------------------