Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

[SOLVED] Delayed single pulse circuit after power on

Status
Not open for further replies.

hafrse

Advanced Member level 4
Joined
Aug 6, 2007
Messages
116
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,300
Hello,

Looking for a circuit that switches on and off a low power relay (SMD) after power on.

Details:

After about 20 sec. adjustable with a pot, on power on , the circuit should switch on a relay for about 2 sec and then off again.

Many thanks in advance!
 

danadakk

Full Member level 6
Joined
Mar 26, 2018
Messages
337
Helped
62
Reputation
123
Reaction score
63
Trophy points
28
Activity points
1,673
Quick and dirty way of doing this, use mBlock to code on an Arduino Nano board. Here is a workable example.

1599070860546.png


Regards, Dana.
 
  • Like
Reactions: hafrse

    hafrse

    points: 2
    Helpful Answer Positive Rating

hafrse

Advanced Member level 4
Joined
Aug 6, 2007
Messages
116
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,300
Great! I have not worked with Arduino before, doing that through software then no need for pot :), only a constant value for the delay I set in the code.
I assume that I need to add some circuit for the low power relay since the outputs are not powerfull enough?
 

betwixt

Super Moderator
Staff member
Joined
Jul 4, 2009
Messages
14,287
Helped
4,706
Reputation
9,427
Reaction score
4,471
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
121,967
If you want to use an MCU you can do it cheaper and simpler than with Arduino. Why not simply use a dual monostable like an NE556? You would need some additional hardware even if an Arduino was used.

Brian.
 

    hafrse

    points: 2
    Helpful Answer Positive Rating

danadakk

Full Member level 6
Joined
Mar 26, 2018
Messages
337
Helped
62
Reputation
123
Reaction score
63
Trophy points
28
Activity points
1,673
Basic proto with Arduino -

1599078730819.png



You can get SSR for Relay which will operate off Arduino, or a sensitive relay.

Note this can also be done with an ATTINY85, 8 pin UP (Arduino code compatible) but it takes a Arduino board to program it.

I hooked up pot because I thought you wanted a variable delay to turning on the relay.

Note when you use mBlock that interfaces to the Arduino IDE to program the board.

MBlock takes the block configuration you setup in 3 'rd window and generates the Arduino code for you.
As you become proficient you can start looking at that code to get a feel for C. It won't teach you C you still
have to study that in detail, buts its a soft start in that direction.

You can power board thru its USB program connection or add a cap to this board for external power
and supply external source.

Once you get used to block languages there are a number of variants, one for example allows your Arduino to speak
text string over a PC with just one block, like to make a talking voltmeter for example. These other block languages have
other features as well. Lots of fun. More info over here - https://forum.allaboutcircuits.com/threads/arduino-uno-coding.166920/#post-1475504

Advantage of using Arduino or ATTINY85 is timing accuracy over T and V. Much better than the Pleistocene era 555 timer
like solutions.

Regards, Dana.
 
Last edited:

    hafrse

    points: 2
    Helpful Answer Positive Rating

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
17,841
Helped
4,011
Reputation
8,022
Reaction score
3,907
Trophy points
113
Activity points
117,989
Hi,

My solution initially was a two comparator circuit with a couple of Rs, Cs, Ds...because the requirement was a pot.

But yes, i'd do it with a 8 pin low power AVR ... because I'm most familiar with AVRs. Any other microcontroller will do, too.

Klaus
 

    hafrse

    points: 2
    Helpful Answer Positive Rating

hafrse

Advanced Member level 4
Joined
Aug 6, 2007
Messages
116
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,300
I decided to proceed with the ARduino track since it appeared to me now that the timing is critical when to switch on the relay i, ie more precission in the timing needed. No problem with C or C++ just that I had not touched Arduino yet , and now it is a good oppurtinity! :)
 

SunnySkyguy

Advanced Member level 5
Joined
Sep 26, 2007
Messages
6,743
Helped
1,675
Reputation
3,348
Reaction score
1,643
Trophy points
1,413
Location
Richmond Hill, ON, Canada
Activity points
50,727
For a really quick and dirty timer, use an HC4060 clock timer and some 3 input gate to choose the delay and duration counter values and next msb to disable the clock at the end of the pulse with inverted or non-inv. output
 

Attachments


danadakk

Full Member level 6
Joined
Mar 26, 2018
Messages
337
Helped
62
Reputation
123
Reaction score
63
Trophy points
28
Activity points
1,673
What accuracy are you targeting for delay and relay 2 sec on time ?

The ATTINY85 shows -

1599130877801.png


The ATMEL 328 familiy shows also roughly same accuracy on internal RC. Thats used on Arduino boards.

Regards, Dana.
--- Updated ---

An alternative is PSOC (over T and V, internal osc) -

1599131712814.png

More accuracy of course can be had with xtal.

1599134316571.png

PSOC, think FPGA like but with lots of analog. Many components that can be dragged and dropped onto
canvas. In PSOC a component is onchip resource. This is a single chip design.

Attached is a component list.

IDE (PSOC Creator) and compiler free, board to do this is $10.

Right hand window shows resources used/left. As you can see chip has many more
resources that can be used. Like DSP, DDS, OpAmps, logic, LUT, its onchip Vref is good for
+/- 1%

You can do custom component designs, for example I did a Verilog coded 64 bit serial in
parallel out shift register for a design. Thats was a codeless design, just needede one line of
code, a start instruction.


Regards, Dana.
--- Updated ---

Forgot to add component catalog. Keep in mind in PSOC a component is an onchip resource.


Regards, Dana.
 

Attachments

Last edited:
  • Like
Reactions: hafrse

    hafrse

    points: 2
    Helpful Answer Positive Rating

hafrse

Advanced Member level 4
Joined
Aug 6, 2007
Messages
116
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,300
Got the Arduino nano today, Tried to create a simple block but has problems:

1 - Connect works ok, it connects to the arduino nano V3.1 board
2 - upload fails.

Please see attached pictures

Many thanks for any help
--- Updated ---

What accuracy are you targeting for delay and relay 2 sec on time ?

The ATTINY85 shows -

View attachment 163838


The ATMEL 328 familiy shows also roughly same accuracy on internal RC. Thats used on Arduino boards.

Regards, Dana.
--- Updated ---

An alternative is PSOC (over T and V, internal osc) -

View attachment 163841

More accuracy of course can be had with xtal.

View attachment 163842

PSOC, think FPGA like but with lots of analog. Many components that can be dragged and dropped onto
canvas. In PSOC a component is onchip resource. This is a single chip design.

Attached is a component list.

IDE (PSOC Creator) and compiler free, board to do this is $10.

Right hand window shows resources used/left. As you can see chip has many more
resources that can be used. Like DSP, DDS, OpAmps, logic, LUT, its onchip Vref is good for
+/- 1%

You can do custom component designs, for example I did a Verilog coded 64 bit serial in
parallel out shift register for a design. Thats was a codeless design, just needede one line of
code, a start instruction.


Regards, Dana.
--- Updated ---

Forgot to add component catalog. Keep in mind in PSOC a component is an onchip resource.


Regards, Dana.
Posted an update in the same thread
 

Attachments


danadakk

Full Member level 6
Joined
Mar 26, 2018
Messages
337
Helped
62
Reputation
123
Reaction score
63
Trophy points
28
Activity points
1,673
Take a look at this -


Also in Arduino, example project, do a project that loads standard firmata.




Regards, Dana.
--- Updated ---

One other issue, on Arduino sometimes the Windows system installs
thew wrong driver for the USB interface to an Arduino board.

Use Zadig to install the correct driver. Google this "Arduino Zadig driver"
for more info.

Regards, Dana.
 
Last edited:
  • Like
Reactions: hafrse

    hafrse

    points: 2
    Helpful Answer Positive Rating

danadakk

Full Member level 6
Joined
Mar 26, 2018
Messages
337
Helped
62
Reputation
123
Reaction score
63
Trophy points
28
Activity points
1,673
It can be a tad frustrating Arduino boards getting drivers right. Good news is

web is full of people who have gone thru this.

1) Arduino itself has firmware on it basically for boot loading code into it.
Some block languages have their own firmware that has to be loaded into
it before using the block language,but mBlock does not require this. I think
Snap4Arduino for example needs this.

2) When you buy a nano, or other Arduino board not all suppliers have programmed
correct firmware in them. Thats usually the first thing I do when I receive one.

2) Also on Arduino board has a USB interface chip that requires a windows driver
Sometimes this loads correctly, other times one has to use Zadig to replace the
win driver with libusb-win32 driver. I think this is needed when using USBAsp
programmer, which is another programmer more versatile that one internal to
Arduino IDE.

http://www.wch.cn/download/CH341SER_ZIP.html You have to pick english then do the download, this is for USB CH340 type
on board.


https://roboticsbackend.com/arduino-standard-firmata-tutorial/#:~:text=Now that you have your,Firmata library is not installed.

Also just to add to the confusion I just did a Nano baord firmata install, and had to pick "Atmega 328P ( Old Bootloader) as
chip when installing firmata. The program comiled allright but would not burn. Trust that there is success at the end of the
Arduino Bataan Death March :)

Regards, Dana.
 
Last edited:
  • Like
Reactions: hafrse

    hafrse

    points: 2
    Helpful Answer Positive Rating

hafrse

Advanced Member level 4
Joined
Aug 6, 2007
Messages
116
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,300
It can be a tad frustrating Arduino boards getting drivers right. Good news is

web is full of people who have gone thru this.

1) Arduino itself has firmware on it basically for boot loading code into it.
Some block languages have their own firmware that has to be loaded into
it before using the block language,but mBlock does not require this. I think
Snap4Arduino for example needs this.

2) When you buy a nano, or other Arduino board not all suppliers have programmed
correct firmware in them. Thats usually the first thing I do when I receive one.

2) Also on Arduino board has a USB interface chip that requires a windows driver
Sometimes this loads correctly, other times one has to use Zadig to replace the
win driver with libusb-win32 driver. I think this is needed when using USBAsp
programmer, which is another programmer more versatile that one internal to
Arduino IDE.

http://www.wch.cn/download/CH341SER_ZIP.html You have to pick english then do the download, this is for USB CH340 type
on board.


https://roboticsbackend.com/arduino-standard-firmata-tutorial/#:~:text=Now that you have your,Firmata library is not installed.

Also just to add to the confusion I just did a Nano baord firmata install, and had to pick "Atmega 328P ( Old Bootloader) as
chip when installing firmata. The program comiled allright but would not burn. Trust that there is success at the end of the
Arduino Bataan Death March :)

Regards, Dana.
Thanks Dana for the information! I used now this web site https://create.arduino.cc/ to download, yes, it appeared that the nano I got has the old boot loader, I configured correctly (installed the driver nedded, chosed correct Arduino , port number and the old boot loader) and now I can upload through https://create.arduino.cc/ without any errors!
Now I can configure the timing exactly as needed, many thanks for all help I got! lot of board for 4 Euros including shipping from Germany :)
 

danadakk

Full Member level 6
Joined
Mar 26, 2018
Messages
337
Helped
62
Reputation
123
Reaction score
63
Trophy points
28
Activity points
1,673
Here is a block language with some differences/capabilities, that operates inside
Arduino IDE.



Flowcode -



Regards, Dana.
 
Last edited:
  • Like
Reactions: hafrse

    hafrse

    points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top