–>

Purple Mood Light Cube – How to use PIC16F917 With Analog 2 Axis Accelerometer

led Cube

I love mood light , so I decided to build a motion controlled mood light.



Step 1: The Electronic Circuit



Hardware

The circuit is simple. It consists of the Microcontroller, Accelerometer and 6 LEDs.

Components:
1 Microchip PIC 16F917 (or any Microcontroller of your choice) from Amazon US or eBay
1 Analog Devices ADXL206 (or any Accelerometer of your choice) from  Amazon DE or eBay

3 Red LEDs from Amazon , Amazon DE or eBay

3 Blue LEDs from Amazon , Amazon DE or eBay

1 40 PIN ic Socket from Banggood Amazon DE or eBay

1 8 PIN Socket from  Amazon DE or eBay

1 9 Volt Battery from , Amazon DE or eBay

1 9 Volt Battery Connector from Banggood Amazon DE or eBay

1 Holed board from , Amazon DE or eBay


Schematic 

As shown in the diagram.

First, you need to assemble the circuit, solder the parts then program the software that does all functions.
The programmer is a circuit I built myself before . The 16F917programmer you can find it in my blog here. PicProm

You can find the programmer in the following instructable:

https://www.instructables.com/id/PIC-16F917-Microcontroller-Programmer/

Step 2: Software


I wrote the software for this project in C language. Compiled it with HiTechPIC compilerand used Proteus 7 simulation environment.



You can find the source code, HEX file and simulation model inside the zip file of the project. I assembled the code and generated the HEX file that must be downloaded to the microcontroller.



The software that loads the program into the microcontroller DE chip is called “loader” can be downloaded from the link below.
Once you are finished loading the software into the microcontroller, install the Microcontroller chip into its socket in the circuit.



You can find the programmer in the following instructable:

https://www.instructables.com/id/PIC-16F917-Microcontroller-Programmer/

Attachments

Step 3: Cube Body


I built the body from old CD-ROMs I don’t need any more. I cut them into 6 squares by an architects saw DE in such a way that when put beside their each other have the maximum structure strength. I glued them together by a wax gun.

I scratched the surface of the CD-ROMs with Sand Paper for good light diffusion.

I made a hole for the switch of the circuit so it can be accessed from outside of the cube.
The board is installed on the bottom side of the cube by wax and thin wires. After you finish installing the cube, make sure to arrange the LEDs in near spherical shape to get the best illumination. And get them as far as possible from sides of the cube that will make them look better.

Step 4: Beads Cover

In order to make this beads case just bring 2 colors of beads, crystal string, and scissors DE

using 4 beads create a circle then for each one attach 3 beads from the other color to form a circle and when you finish the original four you will get a square.

measure the length of the square to determine the no. you need in each face of the cube, in my case i found that i need 16 square in each face: 8 with purple center and 8 with the reverse with considering that the bottom will have less squares by 1 for the electrical button, so i made them and attached them together.

bring your cube and fix faces together to cover the cube and in the bottom face i attached only one side to make it like a door to be able to open it and replace battery.

in order to make that door close firmly to not harm the circuit when you shake it, i used the Velcro for the door and also to close the beads above the door as shown in the picture.


Shake and enjoy .

Thank you for reading this post.

Please check my author page on Amazon. Feel free to browse my books for sale and free books.

amazon.com/author/ahmedebeed


Learn By Making: Embedded Systems Tutorial for Students and Beginners

https://amzn.to/2JS24rG

Embedded Systems, Electronics: My Projects Collection From Instructables

https://amzn.to/33nqb9e

Arduino 2020 Guide: With Easy Twelve Projects to Get Started

https://amzn.to/36gh6kz

1 thought on “Purple Mood Light Cube – How to use PIC16F917 With Analog 2 Axis Accelerometer”

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top