Like most websites, SGL uses cookies in order to deliver a secure, personalised service, to provide social media functions and to analyse our traffic. Continued use of SGL indicates your acceptance of our cookie policy.

# Relays for Lesvedome

## Recommended Posts

Posted (edited)
6 hours ago, hughgilhespie said:

I think one resistor will be fine - perhaps Alan could confirm that?

If the IN+ and IN- do connect  across the LED of the opto-isolator like your previous diagram Hugh, then the resistor in series with the LED is not really a pull-up resistor, but a LED current limiting resistor. The board spec I listed above specifies trigger current of 5mA which would be the current through the LED. As the LED drops around 2V the series resistor needs to be (12-2V) / 5mA which is 2k ohms. Having a single resistor with the IN+ connections joined together the 5mA resistor current gets split between the LEDs if more than one relay needs to be turned on. Having three relays on, each LED only gets 1.6mA which may not be enough to switch its associated opto-isolater transistor reliably. It would be better to have a separate resistor for each IN+ to the +12V so that each LED gets 5mA whether 1, 2 or 3 relays need to be turned on.

Measuring across the IN+ and IN- terminals with a multimeter on ohms may not be a reliable method to determine whether there is a series resistor as the multimeter may not supply enough voltage or current to turn on the LED and give an accurate lower value resistance reading. I would connect a resistor from one IN+ terminal to +12V, (ideally a 2k one but if you only have 5k resistors it should still work. Connecting two 5k resistors in parallel will give you 2.5k which would be fine). Then with your multimeter on volts, measure across the resistor and connect the IN- to ground. Hopefully you should hear the relay click. If the multimeter is reading about 10V then there is no on board resistor, and your external resistor is needed. If the multimeter reads around half that, between say 4V and 6V then there is an on board resistor of a similar value already there, and there should be no need for an external resistor. In this case as Hugh said the IN+ can be connected to +12V.

Alan

Edited by symmetal

##### Share on other sites

Hugh

There was no difference in the readings on any of the 4 relays so I guess that the resistor(s) is/are needed.

Thanks

Peter

##### Share on other sites

Alan

I had my reply written but not sent - so when I pushed the submit reply button it had not come in yet.  I'll get my bag of resistors out now for that further testing.

Thanks

Peter

##### Share on other sites

Alan

I used a 5K resistor and got 4.65V, no click that I could hear though.

So, I presume no resistors needed after all?

Thanks

Peter

##### Share on other sites
Posted (edited)

Ah! good, Peter. That would strongly imply there is a resistor on the board and it's of a similar value to the your 5k. Leaving off your external resistor and connecting IN+ to 12V that would put 2mA through the LED, less than the 5mA quoted on the board spec but will still enough to light the led sufficiently for the opto-isolater to work. (If it didn't they wouldn't have used that value)

The lack of relay clicking is still a bit intriguing. Perhaps the two 5k resistors that were in series when you did your test and only allowing 1mA through the LED was not enough to trigger it. Connect the IN+ to +12V and ground the IN- for the final test. Any relay click then? If not check they haven't sneakily used quiet relays by measuring across the relay contact terminals with your multimeter on continuity check. With the relay off there should be a short circuit between COM and NC and an open circuit between COM and NO. When the relay is triggered, see if you then get a short circuit between COM and NO and an open circuit between COM and NC. Check the relay which corresponds to the IN+ and IN- terminals you've used to trigger it.

I've actually just ordered one of the relay boards off ebay as they are very cheap and could be useful. I believe they all come from China so it may be up to 2 weeks before it arrives. If you're still having trouble then I should be able to help you out more easily.

Alan

Edited by symmetal

##### Share on other sites

Alan,

Good analysis! I think you are spot on and the voltage measurements show that there is a current limiting resistor in series with the photodiode. Hopefully, Peter's tests will confirm that the relay will operate as required with the IN+ terminal connected directly to the positive rail when the IN- terminal is shorted to ground. It's a nice idea of yours to order a relay board yourself. They do seem useful things to have around.

Regards, Hugh

##### Share on other sites

Alan

So, if no click when testing without the in-line resistor on the 12+ into IN4+ and with IN4- (Relay 4 is the trigger relay) connected to  ground then I do the continuity check across the relay outputs of Relay 4 and and should expect to see continuity between COM4 and NC4 and no continuity between COM4 and NO4?

If I do not get those indications during the continuity check what does that suggest I need to do?

Thanks, Peter

##### Share on other sites

Peter,

I only suggested checking relay terminal continuity as a way to check if the relay may be working but you can't hear it click. When the relay is 'off' there will be continuity between COM (Common) and NC (Normally Closed) and when it is triggered 'on' there will be continuity between COM and NO (Normally Open). The COM terminal flips continuity between the NC and NO terminals when the relay is operated.  If you don't get that we will have to start scratching our heads some more.

It's difficult trying to analyse something remotely when you don't have a circuit diagram to work with, and you have to make educated guesses as to how it's actually wired.

Alan

##### Share on other sites

Peter,

I'm sure you know this, but in order for the relay to operate, as well as connecting the IN+  and IN- terminals,  you also need to have the relay board connected to the 12 volt supply. The relay won't operate if you are only connecting to the IN terminals.

Regards, Hugh

##### Share on other sites

Alan and Hugh

Thanks for your two replies. I will have a go with that test when I get home.

Hugh, looking back at the newest iteration of my circuit diagram I have:

12V+ connected to the 3 IN+ terminals, DC+ and COM4 on the relay board and to the brown lead on the Hall Effect Switch

12V- connected to Digital Output Grd on the VM110; NO1, NC2, NO4, NO2 and NC1 on the Relay board.

I hope that is correct.

Thanks, Peter

##### Share on other sites

On Hugh's behalf your +12V connections you mentioned are correct. The -12V however doesn't go to NO4, NO2 and NC1 and it doesn't on the drawing which is correct in that respect.

Alan

##### Share on other sites

Alan and Hugh

I went back a stage as I had not connected 12V+ to DC+ for the testing over the past evenings.  I've now done so.  I  get the click now and the continuity checks OK, as suggested.  However the voltage across the resistor is now 8.06V which is higher than the 4-6V figure suggested.

So, does that mean that I do need to have the resistor on each of the IN+ lines?

I am though now  confused about the 12V - supply line.  When I follow the diagrams that I did and posted,  to me they show a direct connection to the VM110 ground, N01 and NC2. It also shows a connection through a diode to NC1, NO2 and NO4.  Those connections were copied from the first diagram I posted, which I'd downloaded, showing the ELK single and double relays.

If those connections are wrong what should 12V - be connected to?

Thanks, Peter

##### Share on other sites
Posted (edited)
1 hour ago, pmlogg said:

Alan and Hugh

I went back a stage as I had not connected 12V+ to DC+ for the testing over the past evenings.

Oooh!  Okay, glad the relay's now operating.

Yes there is a connection via the diode from 12V- (lets call it 0V or Gnd as that's what it is in reality) terminal to NC1, NO2 and NO4. But notice the diode is connected in reverse. The arrow on the diode symbol indicates the current flow direction when it conducts, so the left hand end of the diode (anode) has to be more positive than the right hand end (cathode) in order to conduct current. As the anode is connected to 0V it will only conduct if the cathode goes more negative than 0V which it can't do in normal operation. So in normal operation the diode is effectively not there and is an open circuit. The only purpose of the diode is to suppress any negative voltage spikes generated by the motor when the motor is turned off. If you follow the diagram the diode is actually connected across the motor terminals. It's an unwanted side-effect of suddenly removing the power from large value inductors which is what the motor is, in effect. NC1, NO2 and NO4 are connected to +12V when relay 4 operates to supply power to the motor. Relays 1 and 2 control the motor direction.

To satisfy my curiosity and to test my initial thought as to whether it works like the ELK-924 with a separate + or - trigger. Remove the resistor from the IN+ terminal, but don't connect the IN+ to +12V. Just leave IN+ disconnected. Connect the 12V to the DC+ and DC- of the relay board as you've done and just touch IN- to ground (DC-) and see if the relay clicks again. If it does we don't have to worry about external resistors or any connections to IN+.

The fact that your latest test drops 8V across the external 5k resistor implies that the on-board resistor is only around 1k2. If IN+ is connected directly to 12V then 8mA would flow through the opto LED, which isn't a problem as they will work with a wide range of currents. With your 5k resistor in circuit the LED is only carrying 0.89mA but it is still working enough to trigger the relay. It's possible the IN+ is intended to be connected to 5V logic switching if required rather than 12V. The LED would only carry 2.5mA if IN+ was from 5V which would work nicely.

Do the test in my previous paragraph to see if it mimics the ELK-924 which will solve a lot of problems and report back.

Alan

Edited by symmetal

##### Share on other sites

Alan

Back to the 12V- connection question. If the 12V- connections to NC1, NO2 and N﻿O4 are for circuit protection should be kept?  What about the 12V- connections to NC2 and NO1, which are not diode protection.  Are they OK as drawn?

Once the connections to the relay board are confirmed I hope to move on to doing a trial wiring up of the system, using a little 12V motor as a substitute for the dome motor and, for the moment, skipping the inter-connections to the Pulsar/Rigel legacy system.

Thanks

Peter

##### Share on other sites

Peter,

The circuit as drawn should be correct. The diode where it is, protects the whole circuit and not just a part of it. Following the diode connections it is connected across the motor all the time which is what you want. Redrawing the circuit in a different way but keeping the connections the same would make it a lot clearer. If I have time I'll redraw it which should hopefully make it easier to follow.

Hope the test goes well. Using a small motor for testing is a good idea, as if there are problems it shouldn't do any harm.

Alan

##### Share on other sites

Alan

That's great.  I'll do that what you suggested tonight and report back.  If all is well after tonight's testing I'll aim to proceed with making the wiring loom.

Drawing circuits is not something I normally do.  Using the images rather than pure diagram was really just to help me when I come to do the connections. There are a lot of crossing wires which I don't like.

There is also still some mechanical work to do.  My sensor box needs spring tensioning as it in one quadrant the encoder's sensor wheel was coming out of contact with the dome rim.  I've prototyped that using bits and pieces that I had lying about which worked fine. I've ordered stainless equivalents, some drilling, then adjustments will be required.

Hopefully, thanks to the help from you, Hugh and others I may have a working system soon.

Thanks, Peter

##### Share on other sites

Alan

Connected as  you suggested no click and no illuminated LED from the relay.

So, should it be the 5K relay in the circuit as shown, or a different value resistorand/or one on the way into each of the three IN+connections?

##### Share on other sites

Peter,

OK, so the resistors from each of the IN+ connections to +12V are required. I would use 1k resistors if you have them. This would pass 4.5mA through the opto-isolator LED which is reasonable. Using your 5k resistors it would only pass 1.6mA (yesterday I said it was only 0.89mA with 5k resistors but got my sums wrong). A 1k resistor should measure 4.5V across it when the relay is operated, if you want to measure it.  A 2k resistor would also work fine too. It's not that critical. As you found out it does work with 5k but I would use a lower value just to be sure of definitely switching the relay. 3 resistors are needed, 1 from each IN+ to +12V.

Alan

##### Share on other sites

Alan

OK, like this?  From another EM14 user I've read that with 5V I need to add a 560 Ohm on the + line into the encoder.  I've drawn that in too.

Thanks, Peter

##### Share on other sites

Yes, that looks right Peter regarding the 1k resistors. If you want to put a 560R in the 5V to the encoder that should be fine. It could be just to reduce any noise on the 5V supply.

Alan

##### Share on other sites

Alan

Good stuff! I'll make a start on wiring up tomorrow night.

Thanks, Peter

##### Share on other sites
Posted (edited)

Peter,

Here's a quick sketch I did of your circuit which may make the relay/diode connections clearer. I drew the Ground connections as ground symbols to save cluttering the diagram with lines. The ground symbols are of course all connected together in reality. There's also no need for a double pole switch to the 7Ah battery as all the Ground/0V connections can be left connected to avoid things floating when not used. The Rigel motor output connections may need to be swapped over depending on which way the motor turns to make it drive in the same direction as your new system. I didn't draw in the hall effect 12V wire as it would be a bit messy so arrowed the connection instead.

Edit: It's worth checking that the USB 0V connection from the raspberry pi is connected to Gnd on the VM110 board. I'm sure it will be or things won't work properly.

Also, I didn't notice on your diagram until I redrew it but the symbol you had for the 12V 7Ah battery was drawn the wrong way around. The long line is +ve and the short line is -ve.

Corrected diagram posted a few posts down.

Alan

Edited by symmetal

##### Share on other sites

Hi Peter,

One problem with your latest layout drawing is that you don't have a connection between the ground of the 12 volt supply and the DC- connection on the relay board. You do show a connection between the Relay board DC- and the GND connection on the Velleman board but these boards are using separate power supplies and there is no common ground rail.

Alan's drawing for this is correct - he shows all the modules connecting to the SAME ground point. You do need this connection and it needs to be one with a decent wire size as all the motor current will flow through it.

I am struggling a bit with Alan's drawing of the relay switching as I can't see a path for the current through the motor to ground - this may well just be me but as I see it when Relay 4 operates - to turn on the motor - it connects NO4 to the 12 volt rail. This then connects 12 volts to NC2  and NO1.

Relays 1 and 2 are the motor direction relays and are both switched by the Velleman DO2 output. As drawn, with the relays in the NC position, NC2 sends 12 volts to one side of the motor. The other side now needs to be connected to ground. However, it is connected to COM1 and NC1 - as Relay 1 is not activated - and also connected to NO2. At this point the path ends - no connection to ground, no motor turning...............

Final point - sorry to be so negative. You DO NOT NEED a resistor in the supply line to the Bourns encoder!!!!!!!! I think I know who recommended this and it is just plain wrong. I have attached the manufacturer's data sheet for the EM14 range. All that is needed is a connection to a 5 +/- 0.25 volt supply.

I will have a look at the relay circuit in more detail later - as I said I could be wrong on this but at the moment I can't see it working.

HTH,

Regards, Hugh

##### Share on other sites
Posted (edited)

Hugh, you're right. I missed off the motor ground connection.   The junction between relay1 NC and relay2 NO should also go to ground. As this is carrying the motor current as you say it should be connected to the battery negative and not just go to a VM110 Gnd or similar. Wiring from the battery to the relay contacts and motor should be using thick wire (10A rated at least) while the wiring to the VM110 can be thinner wire as they are carrying much less current.

Checking the encoder spec afterwards you're right that the 5V to it's power pin is what it needs. 560R is a bit high for filtering, 5R6 would be OK but it's not actually needed.

Peter's drawing shows the Relay board DC- going to a Gnd on the VM110 and the battery -ve going to another ground connection on the VM110. The three Gnd connections on the VM110 would be joined together on the board so there is no need for all three to be connected together to Gnd externally, just one would do, but I generally always show all Gnd terminals as going to Gnd.  I'll post an amended diagram later.

Edited by symmetal

##### Share on other sites

Hi Alan,

With the extra ground connection from NC1 / NO2, it looks like everything is good.

Regards, Hugh

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×

• ### Recently Browsing   1 member

×
×
• Create New...