I am a beginner in electronics and am trying to build a small device that vibrates every n seconds while the device is on. I have done some research and found that the materials I most likely need are: a vibration motor, a coin cell battery power source, a 555 timer or PIC, and maybe a transistor or resistor. I want the device to be small, and the only function needs to be that it vibrates every n seconds while the device is turned on. I am wondering what the best way to go about building something like this is?
You're not very specific, so I'm assuming you're in search of a simple project to start building experience:
- You're hesitating between a PIC and a 555:
- If you choose the 555 path, then your project is going to be only that: a motor that goes on and off periodically. For any addition you will need to change completely your circuit. Or start a new one.
- If you choose the PIC path, then you will learn how to build micro-controlled circuits. Any addition to the circuit will be a new module to the micro-controller, and you can go further in a more progressive way. I would advocate for the PIC although it may take you longer to reach your goal. And be a little more expensive, as you need to buy the ICD.
This could be the initial idea for your circuit. All of it works at 5V, so you don't need to bother with additional sources. You can connect it to any USB power supply (avoid using your computer as supply, you don't want this kind of risk)
Start by building the block (A):
- The PIC, fed by USB, and the ICD connector. The goal is to establish communication between your computer and the PIC.
Then add block (B):
- A simple LED, to see "something" happening. This would be your hello world.
- The goal is for you to program something in the PIC, and manage to use a timer.
Then add block (C):
- A transistor and the motor.
- The programming is nearly the same as the LED, but this time it activates the transistor and, therefore, the motor.
Finding the right components is always quite hard. Those are only suggestions:
- Actually, any would do, provided it is through hole and can be powered at 5V.
- There are lots of good alternatives, but if you choose the microcontroller Microchip, then you need the MPLAB ICD.
- MPLAB In Circuit Debugger:
- The Pic Kit 4 is the cheaper version
- Use it to program the microcontroller while it is connected to the target circuit.
- Any 20mA, 5MM red with 1.8V of forward voltage would do.
- 20mA without load.
- 145mA with rated load.