Need Arduino / electrical help

Discuss your home observatory!
User avatar
KathyNS
Co-Administrator
Articles: 0
Posts: 935
Joined: Thu Apr 25, 2019 11:47 am
Location: Nova Scotia
Contact:

TSS Photo of the Day

Need Arduino / electrical help

#1

Post by KathyNS »

I have an Arduino with a 4-relay shield mounted on it. One of the shield relays turns on 12 volt power to an off-board relay, which in turn switches on 12 volt power to my pier equipment. The software and hardware work well, turning on my mount, filter wheel and focuser, as long as the camera is not plugged in. When the camera starts up, either because the relay got turned on or from being plugged in after the power has already been turned on, the Arduino stops communicating via the USB connection. It will still receive and act upon received commands, but it will not acknowledge them. The COM port becomes locked. The condition can only be rectified by rebooting the Arduino. The USB connection to the computer must be unplugged and reconnected in order to re-establish the COM port.

Is it possible that the surge of current to the camera is causing a spike that scrambles the Arduino's brain? How? And how can I correct it?

Thanks for any ideas.
Image
DSO AP: Orion 200mm f/4 Newtonian Astrograph; ATIK 383L+; EFW2 filter wheel; Astrodon Ha,LRGB filters; KWIQ/QHY5 guide scope; Planetary AP: Celestron C-11; ZWO ASI120MC; Portable: Celestron C-8 on HEQ5 pro; C-90 on wedge; 20x80 binos; Etc: Canon 350D; Various EPs, etc. Obs: 8' Exploradome; iOptron CEM60 (pier); Hall's Harbour Observatory (H2O)
OhNo
Pluto Ambassador
Articles: 0
Posts: 465
Joined: Sun May 12, 2019 1:59 pm
Location: Saskatchewan, Canada

TSS Photo of the Day

Re: Need Arduino / electrical help

#2

Post by OhNo »

:popcorn: Is this a new issue or one going back to when you first stared using your design? I am not savy at all about Arduino. A friend of mine (not a member here) has adapted it to many applications. I will forward a link to this thread and see if he can see what the issue may be.
Scopes: SkyWatcher 8" Quattro, Celestron C8, SkyWatcher ST120, Orion ST80, SharpStar 61EDPH II. SLT 130 Celestron, Orion 90mm f/10
Mounts: CGEM, CG-4, EQ2, Alt Az, SLT
Cameras: ZWO ASI533MC Pro, ZWO ASI120MM, Canon 1100D
User avatar
KathyNS
Co-Administrator
Articles: 0
Posts: 935
Joined: Thu Apr 25, 2019 11:47 am
Location: Nova Scotia
Contact:

TSS Photo of the Day

Re: Need Arduino / electrical help

#3

Post by KathyNS »

This entire system is new. I have tested it quite a lot with no load, and it all operates as designed. It only started doing this when I hooked it up in the dome and started switching power for the actual devices.
Image
DSO AP: Orion 200mm f/4 Newtonian Astrograph; ATIK 383L+; EFW2 filter wheel; Astrodon Ha,LRGB filters; KWIQ/QHY5 guide scope; Planetary AP: Celestron C-11; ZWO ASI120MC; Portable: Celestron C-8 on HEQ5 pro; C-90 on wedge; 20x80 binos; Etc: Canon 350D; Various EPs, etc. Obs: 8' Exploradome; iOptron CEM60 (pier); Hall's Harbour Observatory (H2O)
OhNo
Pluto Ambassador
Articles: 0
Posts: 465
Joined: Sun May 12, 2019 1:59 pm
Location: Saskatchewan, Canada

TSS Photo of the Day

Re: Need Arduino / electrical help

#4

Post by OhNo »

I though you were using this to run things since spring. Correction noted.So load is the culprit.
Scopes: SkyWatcher 8" Quattro, Celestron C8, SkyWatcher ST120, Orion ST80, SharpStar 61EDPH II. SLT 130 Celestron, Orion 90mm f/10
Mounts: CGEM, CG-4, EQ2, Alt Az, SLT
Cameras: ZWO ASI533MC Pro, ZWO ASI120MM, Canon 1100D
User avatar
ARock
Jupiter Ambassador
Articles: 0
Posts: 227
Joined: Mon May 13, 2019 4:06 am
Location: USA

Re: Need Arduino / electrical help

#5

Post by ARock »

Does the camera connect to the computer using USB as well, directly or through a USB hub?
If the Arduino, receives and acts on the commands, it is likely sending acks as well. Maybe the problem is on the computer side? Not sure if you tried this, but can you send the commands to the arduino using the serial monitor in the Arduino IDE instead of the some application? That can let you see what is happening on the arduino port.
AR
Scopes: Zhumell Z8, Meade Adventure 80mm, Bushnell 1300x100 Goto Mak.
Mount: ES EXOS Nano EQ Mount, DIY Arduino+Stepper RA drive.
AP: 50mm guidescope, AR0130 based guidecam, Canon T3i, UHC filter.
EPs: ES82 18,11,6.7mm, Zhumell 30,9mm FJ Ortho 9mm, assorted plossls, Meade 2x S-F Barlow, DGM NPB filter.
Binos: Celestron Skymaster 15x70 (Albott tripod/monopod), Nikon Naturalist 7x35.
User avatar
SkyHiker
Orion Spur Ambassador
Articles: 0
Posts: 614
Joined: Sat May 11, 2019 8:40 pm
Location: Santa Barbara, CA

TSS Photo of the Day

Re: Need Arduino / electrical help

#6

Post by SkyHiker »

Is the Arduino powered by USB or do you use external power? If you use external power, is the ground the same as that of the PC? Just wondering if it could be caused by lack of power from the USB port or incompatible groundings. Any time you connect external devices you should worry about that. This holds for the camera too. If it is powered independently, what ground does it use? One example how some device protects against that is my SSAG, it uses optocouplers to avoid such problems.
... Henk. :D Telescopes: 6" Mak-Newt (Comet Hunter), ES ED127CF, ES ED80, Zhumell Z12, Coulter Odyssey 10, AT6RC, Venture RX-7, Celestron Skymaster 20x80, Mounts and tripod: Losmandy G11S, AVX, LXD55, Tiltall, Cameras: Fuji X-a1, Canon SX40, Xt, XSi, T6, ELPH 100HS, DIY: Dob and camera barndoor trackers, afocal adapter, Dob with foldable base and Az/Alt setting circles, Accessories: SSAG, Plossls, Barlows, Telrad, laser collimators (Seben LK1, Z12, Howie Glatter), Cheshire, 2 Orion RACIs 8x50, Software: DSS, ImageMagick, PHD, Nebulosity, Photo Gallery, Gimp, CHDK
User avatar
SkyHiker
Orion Spur Ambassador
Articles: 0
Posts: 614
Joined: Sat May 11, 2019 8:40 pm
Location: Santa Barbara, CA

TSS Photo of the Day

Re: Need Arduino / electrical help

#7

Post by SkyHiker »

Is the Arduino connected to your PC? Is the camera connected to your PC? Is the camera powered by the 2nd relay? Are both relays tied to the same ground? Is the PC tied to that same ground (and the Arduino too if it is powered by your PC)? Does the problem happen when your camera is not plugged into the PC?
... Henk. :D Telescopes: 6" Mak-Newt (Comet Hunter), ES ED127CF, ES ED80, Zhumell Z12, Coulter Odyssey 10, AT6RC, Venture RX-7, Celestron Skymaster 20x80, Mounts and tripod: Losmandy G11S, AVX, LXD55, Tiltall, Cameras: Fuji X-a1, Canon SX40, Xt, XSi, T6, ELPH 100HS, DIY: Dob and camera barndoor trackers, afocal adapter, Dob with foldable base and Az/Alt setting circles, Accessories: SSAG, Plossls, Barlows, Telrad, laser collimators (Seben LK1, Z12, Howie Glatter), Cheshire, 2 Orion RACIs 8x50, Software: DSS, ImageMagick, PHD, Nebulosity, Photo Gallery, Gimp, CHDK
User avatar
KathyNS
Co-Administrator
Articles: 0
Posts: 935
Joined: Thu Apr 25, 2019 11:47 am
Location: Nova Scotia
Contact:

TSS Photo of the Day

Re: Need Arduino / electrical help

#8

Post by KathyNS »

Thank you, @SkyHiker. That is very helpful. I think you might be on to something re the grounds. I had wondered if I had what audio engineers call a ground loop.

The Arduino is connected to the PC by the USB port. It is powered separately, but of course if the external power is removed, it will draw power from the USB. The camera, of course, also connects to the PC. I haven't tried connecting the camera's power while its USB was unplugged. That's a good test; I will try it.

All the grounds are connected at the moment. The PC would share in the common ground via the USB connections. I think I can fairly easily isolate the ground of the camera's power supply. I will give that a try and see if that improves the situation.
Image
DSO AP: Orion 200mm f/4 Newtonian Astrograph; ATIK 383L+; EFW2 filter wheel; Astrodon Ha,LRGB filters; KWIQ/QHY5 guide scope; Planetary AP: Celestron C-11; ZWO ASI120MC; Portable: Celestron C-8 on HEQ5 pro; C-90 on wedge; 20x80 binos; Etc: Canon 350D; Various EPs, etc. Obs: 8' Exploradome; iOptron CEM60 (pier); Hall's Harbour Observatory (H2O)
User avatar
KathyNS
Co-Administrator
Articles: 0
Posts: 935
Joined: Thu Apr 25, 2019 11:47 am
Location: Nova Scotia
Contact:

TSS Photo of the Day

Re: Need Arduino / electrical help

#9

Post by KathyNS »

ARock wrote:
Mon Jul 27, 2020 1:03 am
Does the camera connect to the computer using USB as well, directly or through a USB hub?
If the Arduino, receives and acts on the commands, it is likely sending acks as well. Maybe the problem is on the computer side? Not sure if you tried this, but can you send the commands to the arduino using the serial monitor in the Arduino IDE instead of the some application? That can let you see what is happening on the arduino port.
Yes, the Arduino connects to the computer via USB. There is no way to tell if the problem is the Arduino's USB transmit or the computer's USB receive. I can send commands to the Arduino via the serial monitor, and those commands take effect. The serial monitor does not receive responses either.
Image
DSO AP: Orion 200mm f/4 Newtonian Astrograph; ATIK 383L+; EFW2 filter wheel; Astrodon Ha,LRGB filters; KWIQ/QHY5 guide scope; Planetary AP: Celestron C-11; ZWO ASI120MC; Portable: Celestron C-8 on HEQ5 pro; C-90 on wedge; 20x80 binos; Etc: Canon 350D; Various EPs, etc. Obs: 8' Exploradome; iOptron CEM60 (pier); Hall's Harbour Observatory (H2O)
User avatar
yobbo89
Milky Way Ambassador
Articles: 0
Posts: 1569
Joined: Sat May 11, 2019 7:44 pm
Location: australia qld brisbane

TSS Photo of the Day

Re: Need Arduino / electrical help

#10

Post by yobbo89 »

hey kathy, what is your project about that you're doing exactly ? remote power on and power off for the mount ?, any plans for usb connection,disconect via the same method ? i have a spare audrino so would make use for me , saves me from going out in the cold to reset any droped out device :lol: .
scopes :gso/bintel f4 12"trust tube, bresser messier ar127s /skywatcher 10'' dob,meade 12'' f10 lx200 sct
cameras : asi 1600mm-c/asi1600mm-c,asi120mc,prostar lp guidecam, nikkon d60, sony a7,asi 290 mm
mounts : eq6 pro/eq8/mesu 200 v2
filters : 2'' astronomik lp/badder lrgb h-a,sII,oIII,h-b,Baader Solar Continuum, chroma 3nm ha,sii,oiii,nii,rgb,lowglow ,Thousand Oaks Solar Filter.
extras : skywatcher f4 aplanatic cc, Baader MPCC MKIII Coma Corrector,Orion Field Flattener,zwo 1.25''adc.starlight maxi 2" 9x filter wheel

Image
User avatar
OzEclipse
Orion Spur Ambassador
Articles: 0
Posts: 532
Joined: Sat May 11, 2019 8:11 am
Location: Canberra, Australia, 35S, 149E
Contact:

TSS Photo of the Day

Re: Need Arduino / electrical help

#11

Post by OzEclipse »

yobbo89 wrote:
Mon Jul 27, 2020 12:38 pm
hey kathy, what is your project about that you're doing exactly ? remote power on and power off for the mount ?, any plans for usb connection,disconect via the same method ? i have a spare audrino so would make use for me , saves me from going out in the cold to reset any droped out device :lol: .
Yobbo,
You live in Brisbane. I grew up there. It never gets cold - wimp! :D

Joe
Amateur astronomer since 1978
Astronomical interests : astrophotography, visual observing, nightscape photography, solar eclipse chasing
asteroidal occultations, nightscape astrophotography workshops
Bortle 1-2 skies, 149 E, 35 S
web site : http://joe-cali.com/
SCOPES - ATM 18" Dob, Vixen VC200L, ATM 6"f7, ED80
MOUNTS- EM-200, iEQ45, Push dobsonian with Nexus DSC
CAMERAS : Pentax K1, K5, K01 / VIDEO CAMS : TacosBD, Lihmsec
User avatar
OzEclipse
Orion Spur Ambassador
Articles: 0
Posts: 532
Joined: Sat May 11, 2019 8:11 am
Location: Canberra, Australia, 35S, 149E
Contact:

TSS Photo of the Day

Re: Need Arduino / electrical help

#12

Post by OzEclipse »

Hi Kathy,

Is it possible that the surge of current to the camera is causing a spike that scrambles the Arduino's brain? How? And how can I correct it?
It sounds like you are on the right track with other advice. For future reference, if you are worried about spikes, placing a small capacitor across dc lines acts as a short to damp out any spikes. Does nothing to the DC power line or dc signals.

Cheers

Joe
Last edited by OzEclipse on Mon Jul 27, 2020 1:48 pm, edited 1 time in total.
Amateur astronomer since 1978
Astronomical interests : astrophotography, visual observing, nightscape photography, solar eclipse chasing
asteroidal occultations, nightscape astrophotography workshops
Bortle 1-2 skies, 149 E, 35 S
web site : http://joe-cali.com/
SCOPES - ATM 18" Dob, Vixen VC200L, ATM 6"f7, ED80
MOUNTS- EM-200, iEQ45, Push dobsonian with Nexus DSC
CAMERAS : Pentax K1, K5, K01 / VIDEO CAMS : TacosBD, Lihmsec
User avatar
yobbo89
Milky Way Ambassador
Articles: 0
Posts: 1569
Joined: Sat May 11, 2019 7:44 pm
Location: australia qld brisbane

TSS Photo of the Day

Re: Need Arduino / electrical help

#13

Post by yobbo89 »

OzEclipse wrote:
Mon Jul 27, 2020 1:42 pm
yobbo89 wrote:
Mon Jul 27, 2020 12:38 pm
hey kathy, what is your project about that you're doing exactly ? remote power on and power off for the mount ?, any plans for usb connection,disconect via the same method ? i have a spare audrino so would make use for me , saves me from going out in the cold to reset any droped out device :lol: .
Yobbo,
You live in Brisbane. I grew up there. It never gets cold - wimp! :D

Joe
haha, i think because it's always humid and hot most of the year,as soon as it hits below 26 deg in " winter" with extra " " ,it becomes kaotic frozen weather ! haha , i'd say climate change difference is what gets me .
scopes :gso/bintel f4 12"trust tube, bresser messier ar127s /skywatcher 10'' dob,meade 12'' f10 lx200 sct
cameras : asi 1600mm-c/asi1600mm-c,asi120mc,prostar lp guidecam, nikkon d60, sony a7,asi 290 mm
mounts : eq6 pro/eq8/mesu 200 v2
filters : 2'' astronomik lp/badder lrgb h-a,sII,oIII,h-b,Baader Solar Continuum, chroma 3nm ha,sii,oiii,nii,rgb,lowglow ,Thousand Oaks Solar Filter.
extras : skywatcher f4 aplanatic cc, Baader MPCC MKIII Coma Corrector,Orion Field Flattener,zwo 1.25''adc.starlight maxi 2" 9x filter wheel

Image
User avatar
ARock
Jupiter Ambassador
Articles: 0
Posts: 227
Joined: Mon May 13, 2019 4:06 am
Location: USA

Re: Need Arduino / electrical help

#14

Post by ARock »

KathyNS wrote:
Mon Jul 27, 2020 11:20 am
Yes, the Arduino connects to the computer via USB. There is no way to tell if the problem is the Arduino's USB transmit or the computer's USB receive. I can send commands to the Arduino via the serial monitor, and those commands take effect. The serial monitor does not receive responses either.
Another way to determine what the Arduino is doing is to use the Arduino's LED which is connected to one of the pins. You could add light flashing patterns to the arduino code upon USB recieve/transmit and look for them. The shield might get in the way though.

Which relay shield are you using?
AR
Scopes: Zhumell Z8, Meade Adventure 80mm, Bushnell 1300x100 Goto Mak.
Mount: ES EXOS Nano EQ Mount, DIY Arduino+Stepper RA drive.
AP: 50mm guidescope, AR0130 based guidecam, Canon T3i, UHC filter.
EPs: ES82 18,11,6.7mm, Zhumell 30,9mm FJ Ortho 9mm, assorted plossls, Meade 2x S-F Barlow, DGM NPB filter.
Binos: Celestron Skymaster 15x70 (Albott tripod/monopod), Nikon Naturalist 7x35.
turboscrew
Jupiter Ambassador
Articles: 0
Posts: 241
Joined: Sat Jun 20, 2020 9:22 am
Location: Nokia, Finland

Re: Need Arduino / electrical help

#15

Post by turboscrew »

Hmm, if Arduino executes the commands, it can't be messed up. I wonder if the camera and Arduino use the same USB HUB. In that way the camera's USB signal line could affect the Arduino's USB transmit line without affecting Arduino's receive line. So if you could power the camera without camera USB attached...?

A power surge would either reboot Arduino or crash it. In either case it wouldn't execute the commands.
Also, in digital electronics, ground loops are often wanted, whereas in analogue electronics they are usually avoided.
In digital electronics ground coupled interference is seldom a problem.
Senior Embedded SW Designer
Telescope: OrionOptics XV12, dobsonian, all manual.
Image
User avatar
Mac
Milky Way Ambassador
Articles: 0
Posts: 1059
Joined: Tue Sep 24, 2019 4:07 pm
Location: Akron OH

TSS Photo of the Day

Re: Need Arduino / electrical help

#16

Post by Mac »

I would put a separate powered USB hub between the PC and Arduino. The Arduino may be sensitive to voltage fluctuations too from the USB devices getting power from the PC. The PC could be throttling available power.

I've dealt with many similar types of conditions with my credit card processing software and terminal devices connected by USB over the years and this was always a good practice.
Steve

Scopes : Explore Scientific ED102 Triplet APO - Celestron 6" SCT - Orion 50mm
Mount : AVX EQ | Software : KStars - EKOS - Stellar OS | Cameras : ZWO ASI533MC ASI1600MM Nikon D7500 ZWO ASI120MM-mini
CPU : iMac 27" - iPad Pro - Ubuntu/Debian Raspberry PI3/4 | Misc : Thousand Oaks dew controller - DewNot straps - Optolong L-enhance - Orion .8 reducer - ZWO EAF
Image Processing : PixInsight - LightRoom - Photoshop - macOS - Windows 10

My Backyard Astrophotography Group
https://www.facebook.com/groups/864169394072061/
turboscrew
Jupiter Ambassador
Articles: 0
Posts: 241
Joined: Sat Jun 20, 2020 9:22 am
Location: Nokia, Finland

Re: Need Arduino / electrical help

#17

Post by turboscrew »

Also, since the camera is powered through a relay, it's probably not affecting the Arduino's power that much.
To me it sounds like the camera messes the USB. ("The USB connection to the computer must be unplugged and reconnected in order to re-establish the COM port.")
Senior Embedded SW Designer
Telescope: OrionOptics XV12, dobsonian, all manual.
Image
User avatar
KathyNS
Co-Administrator
Articles: 0
Posts: 935
Joined: Thu Apr 25, 2019 11:47 am
Location: Nova Scotia
Contact:

TSS Photo of the Day

Re: Need Arduino / electrical help

#18

Post by KathyNS »

turboscrew wrote:
Mon Jul 27, 2020 3:27 pm
Hmm, if Arduino executes the commands, it can't be messed up. I wonder if the camera and Arduino use the same USB HUB. In that way the camera's USB signal line could affect the Arduino's USB transmit line without affecting Arduino's receive line. So if you could power the camera without camera USB attached...?
I will be testing with the camera's USB unplugged as soon as I get a chance.

The Arduino and the camera are on totally different USB hubs, connected to different ports on the computer. There are about as far apart, electrically, as it is possible to be. The hub that the Arduino is on is a powered hub, so I am pretty sure that I am not overloading the computer's USB port.
Image
DSO AP: Orion 200mm f/4 Newtonian Astrograph; ATIK 383L+; EFW2 filter wheel; Astrodon Ha,LRGB filters; KWIQ/QHY5 guide scope; Planetary AP: Celestron C-11; ZWO ASI120MC; Portable: Celestron C-8 on HEQ5 pro; C-90 on wedge; 20x80 binos; Etc: Canon 350D; Various EPs, etc. Obs: 8' Exploradome; iOptron CEM60 (pier); Hall's Harbour Observatory (H2O)
User avatar
Mac
Milky Way Ambassador
Articles: 0
Posts: 1059
Joined: Tue Sep 24, 2019 4:07 pm
Location: Akron OH

TSS Photo of the Day

Re: Need Arduino / electrical help

#19

Post by Mac »

Not sure of the quality of the hub you're using but they vary quite a bit. Don't overlook a wall-brick that's underpowered or not working at full output. They slap them things together very quickly and often with bad tolerance components. Ensure your drivers are up-to-date. USB devices should be able to be plugged in and unplugged without disruption to the connection and host device. That points to flakey drivers and/or bad software.

If you can easily switch them, give it a try.

What is the length of your cable and did you try another?
Steve

Scopes : Explore Scientific ED102 Triplet APO - Celestron 6" SCT - Orion 50mm
Mount : AVX EQ | Software : KStars - EKOS - Stellar OS | Cameras : ZWO ASI533MC ASI1600MM Nikon D7500 ZWO ASI120MM-mini
CPU : iMac 27" - iPad Pro - Ubuntu/Debian Raspberry PI3/4 | Misc : Thousand Oaks dew controller - DewNot straps - Optolong L-enhance - Orion .8 reducer - ZWO EAF
Image Processing : PixInsight - LightRoom - Photoshop - macOS - Windows 10

My Backyard Astrophotography Group
https://www.facebook.com/groups/864169394072061/
turboscrew
Jupiter Ambassador
Articles: 0
Posts: 241
Joined: Sat Jun 20, 2020 9:22 am
Location: Nokia, Finland

Re: Need Arduino / electrical help

#20

Post by turboscrew »

KathyNS wrote:
Mon Jul 27, 2020 4:23 pm
turboscrew wrote:
Mon Jul 27, 2020 3:27 pm
Hmm, if Arduino executes the commands, it can't be messed up. I wonder if the camera and Arduino use the same USB HUB. In that way the camera's USB signal line could affect the Arduino's USB transmit line without affecting Arduino's receive line. So if you could power the camera without camera USB attached...?
I will be testing with the camera's USB unplugged as soon as I get a chance.

The Arduino and the camera are on totally different USB hubs, connected to different ports on the computer. There are about as far apart, electrically, as it is possible to be. The hub that the Arduino is on is a powered hub, so I am pretty sure that I am not overloading the computer's USB port.
I'm not worried about overloading, but misbehaving USB device messing up the USB host. Something, like one of the signals shorted or something. The host's logic (state machine) goes bananas. Have you tried a different cable?
For the camera, that is.

Unplugging and replugging an USB cable usually causes reloading (or restarting) of the driver.
Senior Embedded SW Designer
Telescope: OrionOptics XV12, dobsonian, all manual.
Image
Post Reply

Return to “Home observatories”