Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - Using ADC value to create timer on delay

(you are viewing a thread; or go back to list of threads)

Using ADC value to create timer on delay (by Jason)
I want to use an ADC value to alter a timer delay.
My intention is to use a potentiometer to set a time delay period.

ie. to run an operation for a pre determined time which is set by the potentiometer.

Im working on a little homebrew project for a friend who wants to automate a bottle washer

Any help or ideas would be most appreciated
Sun Sep 9 2012, 13:49:06
(no subject) (by Chris)
What type of CPU/codegenerator do you use ?
Sun Sep 9 2012, 22:42:58
(no subject) (by Jason)
I have not decided on a CPU yet,
I was not sure if a specific CPU was required to obtian the code i needed

look forward to your reply
J.
Sat Sep 15 2012, 06:32:15
(no subject) (by Chris)
The generic recipe is this.

LDmicro export text
no MCU assigned, 4.000000 MHz crystal, 100.0 ms cycle time


LADDER DIAGRAM:

|| ||
|| Xinput _ ATime ||
001||-------] [------+----[OSR_/ ]----+--------------------{READ ADC}---- ||
|| | | ||
|| | _ | ||
|| +----[OSF \_]----+-------------------{MASTER RLY}--- ||
|| | ||
|| Rinit_done | ||
||-------]/[-----------------------+ ||
|| ||
|| ||
|| ||
|| ||
|| {MUL Atime :=} ||
002||-------------------------------------------{ Atime * 3 }--------- ||
|| ||
|| {ADD Atime :=} ||
||-------------------------------------------{ Atime + 100 }--------- ||
|| ||
|| ||
|| ||
|| ||
|| ||
003||-----------------------------------------------------{MASTER RLY}--- ||
|| ||
|| ||
|| ||
|| ||
|| Xinput [Atime >] {SUB Atime :=} ||
004||-------] [------+----[ 0 ]-------------{ Atime - 1 }--------- ||
|| | ||
|| | [Atime ==] Youtput ||
|| +---[ 0 ]----------------------------( )------- ||
|| ||
|| ||
|| ||
|| ||
|| Rinit_done ||
005||----------------------------------------------------------( )------- ||
|| ||
|| ||
|| ||
||------[END]--------------------------------------------------------- ||
|| ||
|| ||
Sat Sep 15 2012, 09:52:02
(no subject) (by Chris)
As attachement.
Sat Sep 15 2012, 09:53:20, download attachment pot_time.txt
(no subject) (by Chris)
With 100 ms cycle, this gives one interval between
10 seconds and approx 5 minutes or 1-31 seconds on 10ms interval cycle.
Sat Sep 15 2012, 10:01:10
(no subject) (by Chris)
If you want simulate it.
Instead of setting the output Youtput, you can use the
master relay if more actions are required.
Sat Sep 15 2012, 10:22:24, download attachment pot_time.ld
(no subject) (by Jason)
Thanks Chris
much appreciated
Fri Sep 21 2012, 16:26:13
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):