Very new to electronics and I'm wondering if you can help me with wiring this project I'm working on. I need a push button to do two things, start a timer and move a servo (once the timer starts). Also, I want to have a PIR sensor in it to decrease time whenever a movement occurs. I believe that I can pull this off with my programming background but I have no idea how to even start it without the proper wiring on the breadboard, etc.
Here are the sensors/actuators I'm using:
- push button
- servo motor
- 4-digit 7 segment display
- PIR sensor
The pushbutton, servo and PIR sensor are easy to connect, each requires only one pin.
For the pushbutton, configure the pin using "pinMode(pin number, INPUT_PULLUP);", then you only need to connect your button between the pin and ground. It will be active-low.
Exact connection of the PIR detector will depend on the type used though, so a link to the PIR detector or it's specs would help.
The servo should ideally be connected with the +V and ground connected to a separate power supply, then the ground connection of that supply connected to the Arduino ground. The signal input connects to the Arduino, of course. You can control it very easily using the Servo library.
The 4-digit 7-segment display will need some more thought. I'd recommend that you search for a suitable driver module, then follow it's directions for connection. When looking for a driver, pay attention to whether your displays are common-cathode or common anode. I've only ever used a separate driver IC, (MAX7219 for common-cathode), for my displays, and not an off-the-shelf module, so can't point you in the direction of a specific module or seller.
You could also possibly control the display directly, using transistors for the common-cathode/common anode connections, if you really want to. More info on that, and an associated library, here:- SevSeg Library
You could always come back to this thread for further advice once you've determined how you want to drive the display, and when you have further details on the PIR detector, in particular it's output. Some have a relay output, and some, (most common on eBay etc), have a digital active-high output.