Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Optical sensor port 4 & 5
#1
Hi

Having some fun testing the Robotank... got the email alert working on ATO and temp so all go there.

I have plugged in the optical sensors box but the optical sensor does not seem to read / work.
The float switch is also plugged DC3 in and works +5VDC or 0VDC
The outlet turns on and stays on - optical sensor in and out of water - nothing.

Is there anyway to test the optical sensor?
I am correct to say no jumper is required for 4 and 5?

Thanks
Reply to top
#2
Hi, glad things are coming along.

Just to clarify, DC3 float isn't controlled through reef-pi, it's a hardware backup and only cuts power to DC port 3, it won't control any outlets.

Sounds like you're using the extension box for optical sensor so there are no jumpers to set but you do need to go to the sensor connector and tick the "reverse" option.

   
Reply to top
#3
Hi - yes DC3 float 5VDC on and off - all working on port 3. So happy with this...

Optical sensor is the issue it does not work at all through your optical box using the ATO
If I reverse the sensor in connector as you asked pump stays off
If I do not reverse the sensor pump stays on

Nothing I do with the sensor will make a difference
So the optical sensor is not working - I have put it in a glass of water - nothing.

How can i test to see if the problem is the:
1) sensor
2) Optical box
3) Robotank board

Any way to fault find this...
Thanks
Reply to top
#4
Great, one more thing on the DC3 float, the green plug on your optical extension is the same, you can plug the float in controller or extension but not both.

The behavior you get from "reversing" the connector is normal. When the sensor is working properly it should put out 0v in one position and 3.3v in the other, reversing the connector flips the logic, when sensor puts out 3.3v that can be on or off in reef-pi depending on how that is set, it's a nice feature.

I marked up an image, does your extension board look like this?

The board does have solder jumpers but they should be set for optical but it is possible as this was a DIY kit I didn't solder them which will be the problem.

I marked green dots on picture how they should be set, one for "opt" and 2nd jumper "P-D". 

Then with the extension plugged in make sure you are getting 5v to the board. I marked the GND and +5v pin going into extension.

And finally you can see a trace highlighted going to sensor 4 port. That's the signal wire. The pin to the left on USB goes to the other sensor port. You can check there to see if the sensor is putting out 0v or 3.3v when wet/dry. 

   
Reply to top
#5
I marked green dots on picture how they should be set, one for "opt" and 2nd jumper "P-D".
They all look good - except a wire strand maybe? I removed it and it did not change anything... in BLk circle.

[Image: MOVkGzi.jpg]

Then with the extension plugged in make sure you are getting 5v to the board. I marked the GND and +5v pin going into extension.
I am getting -2.9V I checked my meter and from mu limited experience the leads are not backwards.. BLk is in COm port...
Should be 5V

I am getting +5V across the float switch - BLk lead on the float side closest to the optical sensors

And finally you can see a trace highlighted going to sensor 4 port. That's the signal wire. The pin to the left on USB goes to the other sensor port. You can check there to see if the sensor is putting out 0v or 3.3v when wet/dry. 
I think I got this right = -2.7V from both the blue and white signal wires too GND (USB)  on optical sensor 1 (4) - I am a bit lost on that one.
Reply to top
#6
Hmm, this is a little confusing. Don't know what to think of the negative voltage, especially the -2.9v. I think you are doing it correct, black lead on casing of USB, and even if probes were backwards it should read -5v.

So if you plug in just the USB cable you can't get +5v on USB case and that left pin?

If you unplug the extension and check the same points on USB on controller board do you see +5v? If so do you have any USB cable you can try?

If 5v isn't making it to the extension something is wrong. I'm also confused that you get +5v on the green float switch (I assume the one on extension) as that's the same source from USB socket, maybe bad probe connection?
Reply to top
#7
Rob you were right make no sense at all - until I purchased a new USB-A too USB - A cable.
working perfectly now.

thanks for the great support!!!
Reply to top
#8
No problem. I might know the problem with that cable but it didn't hit me earlier.

I have a cable I plugged in and doing so made the controller lose power or at least I thought it did as the power light went out, this also happened to one other person. If you plug that cable back in controller does the power light on controller board go out?

Turns out some USB cables have the shield and that +5v pin I'm using as one so it's a dead short on controller but thankfully the regulator seems to shut down enough to protect things.
Reply to top
#9
Hi Rob,
Plunged in the offending cable, the crap one and i did not see any difference in the green lights, is this the power light.
Red light did not change either.
Green light not on the PH board....by the power plug?  it did not change.

[Image: VZal1m2.jpg]
Reply to top
#10
Must be a different issue with that cable, all those lights would have went out. It doesn't matter, I just thought maybe that was it. The green light near power plug is power light and light on pH will flash when the circuit is read.
Reply to top
#11
Hey Rob.  Wonder if you can help me as well.  I've been experiencing similar problems with my optical water sensors not working properly for ATO in ReefPi.  I have sensor attached to extension board port 4.  Also tried port 5 and 6.  Same result.  Also tested second water level sensor.  Same result.  "Connector" check box "reverse" checked, it activates my pump constantly no matter if sensor is in water or not.   I have status "disabled" in pic as i don't want my pump to drain my RO container.  

I also read thread to check my optical extension board to make sure the "O" has been soldered properly.  I attached pic as well of my board.

(02-10-2021, 05:53 PM)hemiroyd Wrote: Hey Rob.  Wonder if you can help me as well.  I've been experiencing similar problems with my optical water sensors not working properly for ATO in ReefPi.  I have sensor attached to extension board port 4.  Also tried port 5 and 6.  Same result.  Also tested second water level sensor.  Same result.  "Connector" check box "reverse" checked, it activates my pump constantly no matter if sensor is in water or not.   I have status "disabled" in pic as i don't want my pump to drain my RO container.  

I also read thread to check my optical extension board to make sure the "O" has been soldered properly.  I attached pic as well of my board.
Sorry not sure how to properly attach images        
Reply to top
#12
(02-10-2021, 05:53 PM)hemiroyd Wrote: Hey Rob.  Wonder if you can help me as well.  I've been experiencing similar problems with my optical water sensors not working properly for ATO in ReefPi.  I have sensor attached to extension board port 4.  Also tried port 5 and 6.  Same result.  Also tested second water level sensor.  Same result.  "Connector" check box "reverse" checked, it activates my pump constantly no matter if sensor is in water or not.   I have status "disabled" in pic as i don't want my pump to drain my RO container.  

I also read thread to check my optical extension board to make sure the "O" has been soldered properly.  I attached pic as well of my board.

Sorry not sure how to properly attach images

Hi hemiroyd, sounds like your are doing everything correctly and the jumpers on board are good, you can see the small trace between the O pads. 

Did you get a USB cable from me or purchase one? I've discovered there are 3 different USB pinouts so thinking it might be that.

If you have a continuity meter touch the USB housing at both ends to see if they connect.
Reply to top
#13
(02-10-2021, 08:57 PM)Rob F Wrote:
(02-10-2021, 05:53 PM)hemiroyd Wrote: Hey Rob.  Wonder if you can help me as well.  I've been experiencing similar problems with my optical water sensors not working properly for ATO in ReefPi.  I have sensor attached to extension board port 4.  Also tried port 5 and 6.  Same result.  Also tested second water level sensor.  Same result.  "Connector" check box "reverse" checked, it activates my pump constantly no matter if sensor is in water or not.   I have status "disabled" in pic as i don't want my pump to drain my RO container.  

I also read thread to check my optical extension board to make sure the "O" has been soldered properly.  I attached pic as well of my board.

Sorry not sure how to properly attach images

Hi hemiroyd, sounds like your are doing everything correctly and the jumpers on board are good, you can see the small trace between the O pads. 

Did you get a USB cable from me or purchase one? I've discovered there are 3 different USB pinouts so thinking it might be that.

If you have a continuity meter touch the USB housing at both ends to see if they connect.
Tested continuity on both ends of USB with my multimeter.  Good.  This was included cable in package that was sent when I purchased deluxe assembled controller package with AC power bar.  3 Different USB pinouts?  I can try and purchase a new diff USB cable to check.
Reply to top
#14
Ok thanks, cable shouldn't be a problem. Yeah crazy never a standard, you could get USB cable with 4 pins connected + shield (what you have and need), 4 pins connected no shield, or 4 pins connected but pin 4 + shield is same which causes a short.

I just pulled out a new cable to make sure my batch is ok and I setup on sensor port 4, it worked so something wrong, maybe sensor, I'm guessing you got that from me too?

A couple minor things to verify. First change the change frequency to 1 second so it's more responsive, helps with testing.

I see you have equipment or macro assigned, just so you know if you didn't the sensor would work, that had me spinning in circles once.

As you can see on the board I have the sensors backwards when you look at the the extension in the case, port 4 is what you would think is port 6 and vice versa, port 5 is obviously ok. Maybe it's as simple as that?

And just to verify, sensor port 4 should be using pin 20 from Raspberry Pi in the connectors. Maybe post a picture of the connectors page in reef-pi if you can.
Reply to top
#15
(02-10-2021, 11:04 PM)Rob F Wrote: Ok thanks, cable shouldn't be a problem. Yeah crazy never a standard, you could get USB cable with 4 pins connected + shield (what you have and need), 4 pins connected no shield, or 4 pins connected but pin 4 + shield is same which causes a short.

I just pulled out a new cable to make sure my batch is ok and I setup on sensor port 4, it worked so something wrong, maybe sensor, I'm guessing you got that from me too?

A couple minor things to verify. First change the change frequency to 1 second so it's more responsive, helps with testing.

I see you have equipment or macro assigned, just so you know if you didn't the sensor would work, that had me spinning in circles once.

As you can see on the board I have the sensors backwards when you look at the the extension in the case, port 4 is what you would think is port 6 and vice versa, port 5 is obviously ok. Maybe it's as simple as that?

And just to verify, sensor port 4 should be using pin 20 from Raspberry Pi in the connectors. Maybe post a picture of the connectors page in reef-pi if you can.
I know this is a head scratcher.  Tried both optical sensors that i ordered with your kit.  Both exhibit same problem. 

Yes I noticed sensors on boards were opposite of documentation. I noticed that after a few of my earlier tests.  I thought that was my problem but even when I switched to port 5 to test , or made the correction from port 4 to port 6 same issue.  

Just so I understand how it's supposed to work. I'm assuming when i setup in ATO tab in Reef Pi, the optical sensor IN water will not trigger my assigned equipment "pump".  When water level is low and sensor is OUT of water it will trigger my equipment "pump" to turn on and fill my sump.  When optical sensor senses water again it will shut off my pump?  Or do I need a second sensor at high level water mark to turn off pump?  Either way when I move optical sensor from in water to out, nothing happens.  My pump stays on the entire time.

Is there a way to test continuity or resistance of sensor?  

I'll change check frequency to 1 sec to see if it helps.  

I'm also willing to cut connector off and plug straight to sensor port on board.  I'll just have to add jumper to optical for that sensor port.
   
Reply to top
#16
Thanks, looks like you're doing everything correctly. It's really hard to imagine 2 bad sensors or 3 bad ports. Now I'm starting to think it's the pump port, I should have mentioned this.

If you're using a DC port I have seen the mosfet get stuck on, this can happen if something is connected backwards or just a bad mosfet. Have you tried a different port?

A good test for the sensors is add an AC outlet on equipment tab, then for reference add the equipment graph on dashboard so you see the red/green bar. Control that with ATO and you should see the green turn to red and vice versa. It does take 10 seconds or so for the dashboard to update.

You only need one optical for ATO, it will turn on/off the pump. It's good to use the backup float on the DC port as well.
Reply to top
#17
Tried the 1 sec frequency check. No dice.

I also tried previously in my testing various equipment ports to see of in fact it was something to do with the port like you mentioned. No luck. Even tried an AC port. Attached a AC circuit tester that has visual indicator. Same result. With connector port reversed it always keeps equipment triggered. With “reversed” unchecked equipment never turns on with sensor going from in water to out.
I’ll try and find another USB A to A at work tomorrow. I’ll also cut connector off of sensor cable and wire straight to a sensor port on board. That will help eliminate the optical board and USB cable as possible culprits.

.....it couldn’t be be an issue with a driver or anything being corrupt in reefpi? I’m on 4.1 but started on 3.5 and sensors never worked. Everything else works fine, temp sensor, analog light control. Dc port to turn on my 12v fan.

Thanks for your continuous help and staying up
Late trying to help me figure this out.
Reply to top
#18
No problem, I'm a night guy.

It could be something in reef-pi, this is very strange. If you are ok with starting over follow the instructions on this page, it will overwrite the database and add the drivers and connectors needed for controller. After this go to equipment, add any outlet for testing, then go to ATO tab, select port 4 and it should work.

https://docs.google.com/document/d/1t9ma...5qkcuznso3
Reply to top
#19
I just looked at the Pi pinout, port 3, 4 and 6 are also for SPI, if that's enabled on Pi those wouldn't work for sure. That script should disable it either way.
Reply to top
#20
Ok I’ll try to reload reef pi tomorrow.

Just for giggles I setup another ATO instance and assigned port 5 with no sensor connected to the port. I assigned action to equipment to one of my power heads on my AC bar.
It did the same thing as port with optical sensor connected. With reverse selected power head stayed on. With reversed unchecked, nothing happen. Is this normal even without any sensor attached to port?

Is there a ssh command to disable SPI? I’m not sure what SPI is or how it might have been enabled but It’s worth a shot before I reinstall everything
Reply to top


Possibly Related Threads…
Thread Author Replies Views Last Post
  Only the first temperature port seems to be active Jmgr 3 2,854 11-27-2021, 03:14 PM
Last Post: Rob F
  KXC-Y25-V wiring question to optical extension kukulin 5 3,732 10-31-2021, 05:05 PM
Last Post: Rob F
  Optical CO2 bubble counter? Sideways 3 3,196 01-23-2021, 04:20 PM
Last Post: Rob F
  optical sensor help jsweir 17 10,253 12-23-2020, 06:10 PM
Last Post: Rob F

Forum Jump:

Current time: 04-29-2024, 10:37 AM