
Arduino Relay Control with Remembered State
- or -
Post a project like this2722
£50(approx. $68)
- Posted:
- Proposals: 8
- Remote
- #2052642
- Completed
Electronics design, analog design, embedded coding ,PCB design and software(CCS,HTML,Javascipt, Java, Python,Matlab, PHP,Wordpress)

166208748679718704041515212681848206747814612582208369
Description
Experience Level: Entry
I am running an Arduino Pro Mini 5v 16Mhz version, with the following pins connected on a custom designed PCB.
Pin Number Function
23 Input from Battery –
24 Input from Battery +
21 VCC to Button
A0 Other side of the button
GPIO 6 To Relay Coil +
GND to Relay Coil GND
The function of the system is to read when the button is presses (needs software debouncing) hen activate the relay connected between pins “GPIO6” and “GND” for a defined time.
The system need to be aware of the buttons state too as it should “re-play” the current state once the Arduino is powered on.
For the purpose of the explanation, button state 0 is when it has not been pressed, button state 1 is when it has been pressed.
Button State 0 – Do nothing, wait for the button to be pressed. Store current button state as 0
Button state 1 (button pressed and stored state is 0) – Latch relay coil for 1 second, then un-latch. Store current button state as 1
Button State 1 (button pressed and stored state is 1) – Do nothing, store current button state as 0
If the system is powered on, and button state is 0, then it should simply wait for a button press. If the button has been pressed in the past the “Stored State” will be 1, then once the system boots up, it should read the button state is “1” and automatically activate the relay. If the button state is already set as 1 and it is pressed again, then return button state to 0 and perform no other action other than wait for a button press.
Please see the attached PCB drawing for reference. I do not yet have the PCB's made, so have no test hardware. But if you could test this locally, or provide a guarantee that any issues will be rectified once the boards are delivered, that would be great. All it needs to do it essentially store and remember the button state and activate a relay for a defined period of time.
Pin Number Function
23 Input from Battery –
24 Input from Battery +
21 VCC to Button
A0 Other side of the button
GPIO 6 To Relay Coil +
GND to Relay Coil GND
The function of the system is to read when the button is presses (needs software debouncing) hen activate the relay connected between pins “GPIO6” and “GND” for a defined time.
The system need to be aware of the buttons state too as it should “re-play” the current state once the Arduino is powered on.
For the purpose of the explanation, button state 0 is when it has not been pressed, button state 1 is when it has been pressed.
Button State 0 – Do nothing, wait for the button to be pressed. Store current button state as 0
Button state 1 (button pressed and stored state is 0) – Latch relay coil for 1 second, then un-latch. Store current button state as 1
Button State 1 (button pressed and stored state is 1) – Do nothing, store current button state as 0
If the system is powered on, and button state is 0, then it should simply wait for a button press. If the button has been pressed in the past the “Stored State” will be 1, then once the system boots up, it should read the button state is “1” and automatically activate the relay. If the button state is already set as 1 and it is pressed again, then return button state to 0 and perform no other action other than wait for a button press.
Please see the attached PCB drawing for reference. I do not yet have the PCB's made, so have no test hardware. But if you could test this locally, or provide a guarantee that any issues will be rectified once the boards are delivered, that would be great. All it needs to do it essentially store and remember the button state and activate a relay for a defined period of time.
Chris H.
100% (15)Projects Completed
13
Freelancers worked with
11
Projects awarded
67%
Last project
7 May 2023
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies