Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

[SOLVED] Delayed single pulse circuit after power on

Status
Not open for further replies.

hafrse

Full Member level 3
Joined
Aug 6, 2007
Messages
169
Helped
1
Reputation
2
Reaction score
3
Trophy points
1,298
Activity points
2,413
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!
 

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
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?
 

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
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
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
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! :)
 

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

  • sn54hc4060[1].pdf
    1.1 MB · Views: 117

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

  • 1599130863279.png
    1599130863279.png
    120.9 KB · Views: 141
  • Component List (2).pdf
    183 KB · Views: 89
Last edited:
  • Like
Reactions: hafrse

    hafrse

    Points: 2
    Helpful Answer Positive Rating
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

  • nano.jpg
    nano.jpg
    291.3 KB · Views: 132
  • nano1 (1).jpg
    nano1 (1).jpg
    374.5 KB · Views: 139

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
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.


http://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
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.


http://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 http://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 http://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 :)
 

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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top