Car battery through X2 DO?

Topics about the Hardware of Revolution Pi
User avatar
Kiobod
Posts: 11
Joined: 19 Oct 2017, 09:27
Answers: 0

Car battery through X2 DO?

Post by Kiobod »

Hello all,
I'm working on a project with a Rev Core and a Rev DIO. All I want to do right now is turn some LEDs on and off. That is, ones that I wire up :) I've mastered the art of turning on and off the built-in LEDs haha.

As there are no consumer electronics stores in my area, I've tried several more home-grown solutions to find something that fits the bill so that I can turn lights on and off with my Rev Pi DIO. The only problem is, the DIO doesn't seem to like any of the circuits I've tried to wire up.

I started with a 12V car battery and some car lights, but the DIO red LED for DO never switched to green. As a novice electrician, I didn't want to go more powerful, so I've run the gambit of smaller batteries, but the DIO seems perfectly indifferent to them all.

Would anyone have a suggestion as to a power source and actuators I could find nearby, or do I need to order some specific equipment on Amazon?

Thanks,
Kiobod
User avatar
volker
Posts: 1046
Joined: 09 Nov 2016, 15:41
Answers: 1

Re: Car battery through X2 DO?

Post by volker »

Hi KIobod,
I think the best way to start is to view the video tutorial or read the written ones (go to SUPPORT and then TUTORIALS):
Video Tutorial #8 and #12-16 are about DIO. I'm sorry but there are German version only. But in #12-16 you can see a nice wiring with light bulbs...
I understand from your posting that you may not have connected X2 as described in the"connecting the power supply"tutorial.
please use for you purpose the same power supply you are using for the X4 main supply connector. Do connect +24V as well as GND of BOTH terminals (input AND output supply) to the 12-24 V power supply. this may be a car battery but with 12 V you will have the first level of "under voltage detection" on the DIO and thus will see the red warning light. You can simply ignore this indication if you know that the cause is using 12 V instead of 24 V.

Having powered the output stage this way you may connect any light indicator which has appropriate voltage (LED or bulb). If you are using a pure LED you need to use a series resitor to limit the current to the LED current of your LED. Please refer to many internet pages where you can find calculation sfor the correct value. In general with a red LED and 24 V you will need at least 1kOhm (for 20 mA LED) up to 6.8 kOhm (for a 4 mA LED) . With 12 V you may start with 2.7 kOhm and go down to 560 Ohm until you get the desired current or intensity.

You need to connect any actuator between one of the output pins and GND if you use the default output mode which is "high side switch" and which behaves like a normal switch between 24 (12) V and the outpt pin. If you use the "push-pull-mode" of the outputs you could also connect between output pin and GND but this would reverse the function (light is on when output is a 0).

Hope this helps to get on with your experiments. Please keep asking if you don't get forward. Also try googling for terms like "high side switch" etc. to learn more about such output circuits.
Unser RevPi Motto: Don't just claim it - make it!
User avatar
Kiobod
Posts: 11
Joined: 19 Oct 2017, 09:27
Answers: 0

Re: Car battery through X2 DO?

Post by Kiobod »

Thanks so much for the response, I will be investigating! The lack of English tutorials has slowed me down a bit but I totally understand.

The one question I've had (for a while actually) about the link that you posted - the wiring described on the DIO page for the X2 is only the live wire on the leftmost terminal. You, however, as well as the wiring indications on the DIO, would suggest wiring two live wires and two ground, positioned:

1 2 3 4
LIVE DO GND DO GND DI LIVE DI

I'm confused by the lack of similarity in the docs and the device itself.

Cheers,
Kiobod
User avatar
Kiobod
Posts: 11
Joined: 19 Oct 2017, 09:27
Answers: 0

Re: Car battery through X2 DO?

Post by Kiobod »

For clarification I attempted to add some pictures of my wiring, however, I'm not finding an option to include an image file.

Allow me to describe briefly the wiring as it is now, and the behavior exhibited:

Battery + ---> DO 24V on the X2
DO 0V on X2 ---> Battery -

Any DO, regardless of what I write to it with piTest or with PiCtory, can complete a circuit from DO + ---> Battery -, actuating an LED.
If I could break circuits on the DO, I wouldn't have any further qualms. Getting the DIO to write the pins to off is what I've been trying to figure out.

Cheers,
Kilen
User avatar
volker
Posts: 1046
Joined: 09 Nov 2016, 15:41
Answers: 1

Re: Car battery through X2 DO?

Post by volker »

Sorry for the confusion.
Let me clarify:
DI is the sencondary power supply for digitalk inputs. It is isolated from PiBridge (PiCore) GND as well as from DO which is secondary power supply for digital outputs. In industrial environments you will often need different GND reference for inputs and outputs.
I hope the differences are just due to a mixup of different devices:
RevPi DI is a device for just 16 inputs and needs only DI secondary power supply. (the case has only this printed on top)
RevPi DO is a device for just 16 outputs and needs only DO secondary power supply. (the case has only this printed on top)
RevPi DIO is a device with 14 inputs and 14 outputs and needs both secondary power supplies. (the case has both printed on top)

So please let me know which of the tutorials with DIO has connected just one of the secondary power supplies. Maybe Dirk has just just the outputs and thus did not connect DI power (or vice versa).
Unser RevPi Motto: Don't just claim it - make it!
User avatar
volker
Posts: 1046
Joined: 09 Nov 2016, 15:41
Answers: 1

Re: Car battery through X2 DO?

Post by volker »

Have you switched the forum to English language? If not and you're on German user interface please click on register card "Dateianhänge" to add any files to your posting. You may then click on
"Im Beitrag anzeigen" to copy the file directly into the text of your posting:
Eu.gif
Eu.gif (71.77 KiB) Viewed 6097 times
However I have not got your wiring. But if you connect any actuator between + battery and digital outputs this will not work! As I've explained in my first answer we do have high side switches. So the outputs work like any ordinary switch between + battery and the output. You will need to wire the output pins to LED / actuator and the actuator to GND!!! (- of Battery):
Battery + to 24 V O of RevPi DIO X2
Battery - to 0 V O of RevPi DIO X2
Battery - to LED cathode
LED anode to output pin (e.g. O1)
Please note you can not change outputs in the PiCtory tool!!! The value editor does only accept the default value for the outputs, not any actual value. It does also never display any actual value!
You need to use piTest or write your own ypthon script to acces the process image to change outputs. So please write a 1 to O_1 (if you did not change the names in PiCtory) like this:
piTest -w O_1,1
you should get a response like this:
"Set bit 0 on byte at offset 81. Value 1"
Your LED should light.
send
piTest -w O_1,0
and your LED should darken...
Unser RevPi Motto: Don't just claim it - make it!
User avatar
Kiobod
Posts: 11
Joined: 19 Oct 2017, 09:27
Answers: 0

Re: Car battery through X2 DO?

Post by Kiobod »

Sincere thanks for your manifold and prompt replies.

As regards wiring of the X2 for the DIO, I have found the source of the error! This page https://revolution.kunbus.com/tutorials ... er-supply/ has missing information which is correctly displayed on this page https://revolution.kunbus.de/tutorials/ ... chliessen/
User avatar
Kiobod
Posts: 11
Joined: 19 Oct 2017, 09:27
Answers: 0

Re: Car battery through X2 DO?

Post by Kiobod »

Figured out how to attach files, derp

Please see the following.

The problem which still persists is that regardless of what I write to the pins (now only using the ./piTest -w O_1,0 command in the demo file) they all continue to complete the circuit and turn on the LED.

Thank you again for your advice,
Kiobod
Attachments
small wiring 2.jpg
small wiring 2.jpg (120.81 KiB) Viewed 6095 times
small wiring 1.jpg
small wiring 1.jpg (104.45 KiB) Viewed 6095 times
User avatar
volker
Posts: 1046
Joined: 09 Nov 2016, 15:41
Answers: 1

Re: Car battery through X2 DO?

Post by volker »

You're absolutely right! The table is uncomplete. I've forwarded this info to our docu team and they will complete it a.s.a.p.
Your wiring seems to be correct. But if both LEDs are continuously RED this is not what I've assumed. The undervoltage indication for 12 V would be IN red flashing and OUT green.
Both LED red could mean that you've not configured the device correctly in PiCtory. Please go to command line and enter piTest -d and post the system output.

Go to PiCtory and drag&drop RevPi Core V1.2 and then RevPi DIO (please take the correct side) on your workspace. Then click File -> Save and then Tools -> driver reset.
Then again go to command line and enter piTest -d and please post the system output if things should still not work.
Unser RevPi Motto: Don't just claim it - make it!
User avatar
Kiobod
Posts: 11
Joined: 19 Oct 2017, 09:27
Answers: 0

Re: Car battery through X2 DO?

Post by Kiobod »

Attached is the output of ./piTest -d. This has been configured this way since unboxing and initial config.

Is it possible that the DO is receiving overvoltage? The highest I've ever observed it at was around 30V, as the battery itself fluctuates. However, the status of the LED's did not change even when using a 1.5V AA battery, the smallest one I tried. I also tried two AA's in series and a 9V battery. None of them exhibited behavior different to essentially letting the circuit complete through the DO pins without any impedance or breakage.

Cheers,
Kiobod
Attachments
dash d output.JPG
dash d output.JPG (29.81 KiB) Viewed 6076 times
Post Reply