Wiring help with ULN2803a transistor array

Are you building a cockpit, planning to build one or just dreaming, this is your cockpit builder meeting point

Moderators: russ, Ralph

Message
Author
Kaellis991
Posts: 581
Joined: Mon Sep 07, 2020 8:49 am

Re: Wiring help with ULN2803a transistor array

#21 Post by Kaellis991 »

jph wrote: Sun Sep 04, 2022 3:33 pm
1. Do the momentary switches provide an input to the arduino which AM will read? Are those switches connected to GND and a pin on the arduino as shown?
2. If the switch is closed does AM read a high output on pins 6 or 7 and then writes to the dataref / command in Xplane to switch on the autopilot in the sim?
3. Does AM then at the same time send a high output to pins 12 and 13 to signal the array to connect the GND side of the magnet circuit or does AM read the dataref in the sim and use that to activate pins 12 and 13?
Hi Kirk
1. yes
2. when switch closed AM reads a LOW as they are normally read as HIGH when inactive due to the internal WPUs. When the switch is closed the port pin sees a LOW.

I presume these are 'real' switches that you operate yes ?
If so, and the electromagnets hold the switches depressed when AP active then what you say sounds right - providing all the data is available and accessible to you. I would not have thought that the sim is aware of the electromagnets - only the AP engaged, which you can use as the energising signal.

By using the ap engaged to energise the electromagnets the sim logic should operate correctly so in the event of an ap disconnect via the aircraft systems the switches will be release automatically.


Joe
Joe,
Thanks for the prompt reply.

Yes the "real" switches are those on the autopilot that stay closed when the magnet is energized by the same switch.
So it makes sense that the real switch input will be read by AM and then writes to the autopilot dataref to move the sim switch.
Then the sim switch dataref is read and AM will send a HIGH to the appropriate darlington pins and thus switch the appropriate array.

I think I understand it but I'd like to test the darlington without the AM code and the sim in the loop.
Using my breadboard with the darlington installed, I assume I can use the A/P switches to open and close the 5v side coming from the arduino.
Is this correct?
image.png

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Wiring help with ULN2803a transistor array

#22 Post by jph »

Looking good !

Stand well back and 'light 'em up Bob!' :lol:
Joe. CISSP, MSc.

Kaellis991
Posts: 581
Joined: Mon Sep 07, 2020 8:49 am

Re: Wiring help with ULN2803a transistor array

#23 Post by Kaellis991 »

jph wrote: Sun Sep 04, 2022 4:10 pm Looking good !

Stand well back and 'light 'em up Bob!' :lol:
Still have all my limbs.... ;)

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Wiring help with ULN2803a transistor array

#24 Post by jph »

I always consider that a really good start :mrgreen:

I listened and couldn't hear any any screaming from across the pond so thought it would be ok.
Next time I should look at the board first haha ;)
Joe. CISSP, MSc.

Kaellis991
Posts: 581
Joined: Mon Sep 07, 2020 8:49 am

Re: Wiring help with ULN2803a transistor array

#25 Post by Kaellis991 »

Love it when a plan comes together....

There is a part of the array circuit that I think baffles many. I certainly have a difficult time understanding the idea of a 14v and 5v circuit sharing a common ground.

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Wiring help with ULN2803a transistor array

#26 Post by jph »

It is because of the open collector outputs on the darlington array.

A transistor is a 3 legged fuse haha - well, no, but it has 3 connections, base , collector, and emitter.
On an NPN device like that the emitter is connected to ground, the base is connected to the arduino pin, and the collector is 'floating' it isnt connected to anything.
With a transistor if you pass a small current from base to emitter then it will induce a large current to flow from collector to emitter. - it is a 'common emitter circuit' where both 'sides' only share a ground.

What you connect to the collector is up to you. The base / emitter circuit is the Arduino pin high and low and the collector emitter circuit is the high voltage side of the ULN, the ground is shared by both.
Think of it like a relay where the input coil is connected to gnd at one end and so is one side of the output. the input energising coil is your arduino pin and you can connect a large voltage current to the relay output terminal - but one is always connected to ground.

Probably as clear as mud ?. ;)
Joe. CISSP, MSc.

Post Reply