Need some help with reading an AC24v pulse using the K8055

Hey *

I installed some dimmers in my house and these things work via a push button; you push the button and it sends a 24v ac current to a dimming component.

The final goal is to measure, using the K8055, how long the button was pressed in milliseconds. I should be able to record this data using the digital in on the k8055 but because I’m a n00b when it comes to electronics I haven’t a clue on where to start.

I’m pretty sure I can’t connect the 24v AC signal wire directly onto the digital in on the k8055,… So, hence, my question is, how can I connect my 24v AC to my digital in on the k8055? I can read simple electronic schema’s if you are so kind to post one.

Thanks in advance!

Yves

The first step is to join the grounds of the 24v ac signal with the velleman card. This may already be done for you, otherwise, an earth wire may be required between the ground of the 24v signal and the ground of the velleman board.

Next, rectify the 24v ac signal by putting a diode 24vac ->|- 24vac rectified - if you can understand my poor diode drawing. Putting a large value capacitor between the rectified signal and ground will give you an approximate dc value of around 24v dc.

You must then step down the voltage by a factor of 5 to get to around five volts. There are two ways of doing this:

  1. put a 4k resitor and a 1k resistor in series. Attach the 4k to the rectified and filtered output of the diode, and the 1k to ground. This will give approx 5V, which can be read by the velleman digital input if you’re brave. Personally, I would isolate it with an optoelectronic isolator.

  2. Put a 3k and 1k in series and attach as above. This will give you around 6v. You then need a zener diode across this 6v output to bring it down to a safer value, probably 4.7v.

As for a diagram

24Vac --D1–|----------|
| R1
C1 |-------|----- Opto isolator -----Digital input
| R2 Z1
| | |
-----------Ground-------------------------------------------------

D1 = any recifying diode capable of handling 50V
C1 = 10microfarad (really more or less anything)
R1 = 3k
R2 = 1k
Z1 = 4.7V zener

Sorry, all the spaces diappeared from my diagram

Thanks, Nigel!
I’ll try the second approach tomorrow

Cheers!

Yves

I had my resistor values wrong. The ouptut from the recifying diode will only be 24vdc for the half cycle, in other words, the output after the diode will be 12vdc, albeit a non-contant.

If you can, use a 5kohm variable resitor in place of the 3k or 4k resistor and vary it, probably down to 2kish and measure the output with a voltmeter or oscilloscope if you have one. Otherwise, you’ll just have to guess.

I made some simulations. It seems that voltage divider of 4k / 1k is rather good for this purpose.
You have to add only the diode D1, capacitor C1 and resistors R1 and R2.
All the rest is inside the K8055 card.
R7 is needed only for simulation purposes.
Circuit:

Waveforms:

There is about 90ms delay due to the discharge time of the capacitor. You have to correct your results with that amount of time.

This is an alternative solution. You can use the pulse counter of the K8055.
You can use the functions ReadCounter and ResetCounter to read and reset the counter. This gives you 20ms resolution to the time reading. Only problem may be to know when the counter is stopped. Best solution is to connect the filtered signal (as in the previous example) to other K8055 digital input and read the counter when that pulse ends.


Hi :smiley:
I have the same problem as this post author buy not with AC 24V but with AC 230v
Could you please help me with simple circuit for my solution.

Advanced thanx!!!

For safety reasons it is important that you isolate the 230VAC from the K8055.
Easiest is to use a transformer e.g.: velleman.be/be/en/product/view/?id=583
If you select 230V / 24V transformer you can use the circuits illustrated earlier in this thread.