# Project using PIC16f and accelerometer

Status
Not open for further replies.

#### nidhin1806

##### New Member
Hai everyone...
I am really new to microcontroller programming etc. I recently took a course on PIC microcontrollers and was impressed by its wide potential. Also i was impressed by the wide application of accelerometer devices.
I would like to do a project based on PIC16f microcontrollers that includes a accelerometer. So all you geniuses please help me by giving some cool ideas.
Looking forward for some good responses...

nidhin

#### nidhin1806

pls help..

##### New Member
Why would we do the job for you? without being tough, its your project and you could at least post a complete schematic of your project...

There are a lot of tutorials and datasheet on google, get to know what you are doing in details would be useful.

#### DirtyLude

##### Well-Known Member
I think he wants an idea of what to make rather than how to make it.

Maybe some type of balancing system, or alarm, or accel input for a user interface.

#### skyhawk

##### New Member
OK! How about a controller? The orientation of the controller relative to the gravitational field controls a virtual object in a PC.

#### nidhin1806

##### New Member
Thanks DirtyLude and skyhawk... i liked a project i saw on net about a mouse using it.. it was quite good actually, but need some software and usb connectivity. i was thinking of some simpler and practically useful projects..

thanks..

#### nidhin1806

##### Banned
skyhawk, just learn the protocol to communicate with a PS3 controller, they have full axis measurment abilities.

#### DirtyLude

##### Well-Known Member
Or a Bluetooth connection to a Wiimote.

#### nidhin1806

##### New Member
Idea

My idea is to create a die (like the one used in playing board games). The number generated on the die is a random number between 1 and 6. The structure is made of a 3X3X3cm (max.) of transparent acrylic (maybe) or glass. Inside each face is attached a 7-segment display which are all connected together so that number displayed on each face is the same (unlike normal die). The number to be generated is decided by the program in the PIC. {I am thinking of using the randi() function which generates a random integer between two limits}. When the cube is held stationary it displays nothing on the faces (or maybe blinks). But when it is thrown and hits the ground, the accelerometer detects the impact and sends a signal to the microcontroller to start generating a number. The output of the microcontroller is connected to all the 7-segment displays.

Please suggest a PIC which has at least 1 analog input and enough ports to connect & 7-segment displays, as using our 16f877 would not be practical and it would be bulky. Also please suggest a suitable accelerometer available here. I have learned to use ADXL32x with PIC. Would that be suitable for this project? Please say if this project can be done with our present knowledge of the subject. My main hurdles are to include the 7-segment display, accelerometer and the PIC in the small cube. Also I would have to supply power to the components through button cells. Is this possible?

The use of this die can be made at casinos where unlike normal dice this cannot be tampered and generates a truly random number. Thus 'Loss Prevention' can be implemented.

#### skyhawk

##### New Member
Since all displays will read the same, all you need is 7 outputs. One analog input and 7 outputs can be handled by a chip such as a 16F676.

https://www.electro-tech-online.com/custompdfs/2009/12/40039E.pdf

The microcontroller is available in surface mount packages to save space. Since the drive capability of the PIC is limited you may need a driver for the LEDs to get adequate brightness.

It you use a 3-axis accelerometer you can know which face is up, and you could light only that face. In that case you would need 6 more pins to switch the displays. A 16F690 would be adequate in that case.

https://www.electro-tech-online.com/custompdfs/2009/12/41262E.pdf

What are the smallest 7 segment displays that you have available. The displays that I'm familiar with are rather thick. Putting 6 of them in a cube that size won't leave much room for the other conponentsb

Last edited:

#### birdman0_o

##### Active Member
The battery life would be dreadful, unless it goes into sleep mode.

Last edited:

#### Mr RB

##### Well-Known Member
3-axis accelerometer requires 3 ADC inputs, not 1.

#### DirtyLude

A nice 3 axis digital accel is the Freescale MMA7xxx series. I have a few MMA7456 chips here, but it looks like the are end of life'd. The new one looks like the MMA7660 for 1.5g 3 axis I2C. So two wire, no ADC required. If you can order from Mouser, it's just $2.36 in singles. That's pretty crazy considering what I paid a couple years ago for some ADXL accels. MMA7660FCR1 Freescale Semiconductor Board Mount Accelerometers EDIT: All of these chip packages are leadless, but since you are talking about an ADXL which is leadless, I'm assuming you wouldn't have any problems with this. Last edited: #### birdman0_o ##### Active Member Mark, have you ever come across a break out board for one? #### DirtyLude ##### Well-Known Member Mark, have you ever come across a break out board for one? I have, but they are$55.

KIT3468MMA7455L Freescale Semiconductor Acceleration Modules & Development Tools

I'd make up a few, but I only have one MMA7456 left and I only order from Mouser about once a year because small orders shipped to Canada cost too much.

Hmm... I just checked it and they have a USPS option again for $8. I don't know. I might make an order before the end of the year and pick up 4 or 5 of the MMA7660's. #### birdman0_o ##### Active Member How much would you charge for a board? #### Mr RB ##### Well-Known Member I don't want to cost DirtyLude a PCB sale, but if you want an easy to work with 3 axis accelerometer it's hard to beat this tiny pre-made PCB for$14.95;

Pololu - Accelerometers & Gyros

#### birdman0_o

##### Active Member
Darn, I just got one on ebay for 20\$ It's adjustable from 1.5, 3, 6g's though. I don't see why I would ever need more than 2g's though :O

Status
Not open for further replies.

Replies
7
Views
5K
Replies
21
Views
3K
Replies
16
Views
2K
Replies
5
Views
2K
Replies
7
Views
2K