Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Make a shorter version with 12 gates instead of 24 #20

Closed
oskarscholander opened this issue Jan 27, 2022 · 21 comments
Closed

Comments

@oskarscholander
Copy link

I love this project!

I would suggest adding a short version that supports 12 gates instead of your original 24. Some type of hives here in Sweden doesn't have as wide opening as Langsroth has.

@chinswain
Copy link

+1 for the UK also, 90% of beehives here are National with small entrances (5").

@chinswain
Copy link

Hi all, my PCBs arrived today:

20220416_154755

I'm trying to work out a way to mount it to my hive as it's a little long. Would anyone be able to shorten the PCB design to 34cm or less?

20220416_154710
20220416_155000

@oskarscholander
Copy link
Author

oskarscholander commented Apr 19, 2022

This would be a great improvement to this project. In your case you are quite easily able to cut away some of the box material, but the most common hive entries in Sweden are only 12cm long.

I would love to have the knowledge on how to change the schematic properly but I don't know how :D

@hydronics2

@chinswain
Copy link

Unfortunately it is a shared hive, I've been disallowed from cutting it. I'm currently learning Kicad, I think we can modify the design fairly easily.

@oskarscholander
Copy link
Author

Aaah I see.

Haha, I downloaded Kicad right after I wrote the last comment to you! 😂 Let's try to do this!

@oskarscholander
Copy link
Author

@chinswain I wont be able to create a shorter version.

Do u have a spare PCB to sell to a fellow beekeeper in Sweden?

@chinswain
Copy link

I've cut mine and starting building them so no spare.

@oskarscholander
Copy link
Author

@chinswain hope your hives are healthy! How is the bee counter project going?

@selmanonal
Copy link

Is anyone who made shorder version of the pcb?

@chinswain
Copy link

chinswain commented Apr 27, 2024

I've started looking at this again.

I cut the PCB as pictured (discarding bottom half) and soldered the components, LED test works:
p1
Screenshot_20240427_172551_Chrome

The shift registers also work, I disabled the LED's and shorted 3v to each input which resulted in the expected output on the serial monitor.

Could it be insufficient power from the PC USB or maybe due to the jumpers not being soldered? I cannot see the LED's on the camera when using the test shift register code which I assume is due to them being on for such a short period.

Here's the modified shift register test code:


const int LATCH = A5; 

const byte powerGates1 = 15;

void setup ()
{
  
  SPI.begin();
  SPI.beginTransaction(SPISettings(3000000, MSBFIRST, SPI_MODE2)); //3Mhz
  
  Serial.begin (115200);
  Serial.println ("Begin switch test.");
  pinMode (LATCH, OUTPUT);
  digitalWrite (LATCH, HIGH);

  pinMode (powerGates1, OUTPUT);
  digitalWrite(powerGates1, LOW);
  
}  // end of setup

byte switchBank1;
byte oldSwitchBank1; 
byte switchBank2;
byte oldSwitchBank2; 
byte switchBank3;
byte oldSwitchBank3; 

void loop ()
{
  digitalWrite(powerGates1, HIGH);
  delayMicroseconds(15); //first 24 gates only need 15us while gates closer to the end need ~40us-75us
  
  
  digitalWrite (LATCH, LOW);    // pulse the parallel load latch
  delayMicroseconds(3);
  digitalWrite (LATCH, HIGH);

  delayMicroseconds(3);
  
  digitalWrite(powerGates1, LOW);

  switchBank1 = SPI.transfer (0); //8
  switchBank2 = SPI.transfer (0); //16
  switchBank3 = SPI.transfer (0); //24
  
  byte mask = 1;
  int sensor = 1;

  for (int i = 1; i <= 8; i++)
  {
    if ((switchBank1 & mask) != (oldSwitchBank1 & mask))
      {
      Serial.print ("Switch ");
      Serial.print (sensor);
      Serial.print (" ");
      Serial.println ((switchBank1 & mask) ? "ir triggered" : "none");
      }  // end of bit has changed
    mask <<= 1; 
    sensor++; 
  }  // end of for each bit

  mask = 1;
  sensor = 9;
  for (int i = 1; i <= 8; i++)
  {
    if ((switchBank2 & mask) != (oldSwitchBank2 & mask))
      {
      Serial.print ("Switch ");
      Serial.print (sensor);
      Serial.print (" ");
      Serial.println ((switchBank2 & mask) ? "ir triggered" : "none");
      
      }  // end of bit has changed
    mask <<= 1; 
    sensor++; 
  }  // end of for each bit

  mask = 1;
  sensor = 17;
  for (int i = 1; i <= 8; i++)
  {
    if ((switchBank3 & mask) != (oldSwitchBank3 & mask))
    {
      Serial.print ("Switch ");
      Serial.print (sensor);
      Serial.print (" ");
      Serial.println ((switchBank3 & mask) ? "ir triggered" : "none");
    }  // end of bit has changed
    mask <<= 1;
    sensor++;  
  }  // end of for each bit

  oldSwitchBank1 = switchBank1;
  oldSwitchBank2 = switchBank2;
  oldSwitchBank3 = switchBank3;

  delay (20);   // must be greater than 7.5ms (see notes at top of code)
} ```

@chinswain
Copy link

chinswain commented Apr 27, 2024

I just tested using a TV infra red remote control which triggered all of the sensors using the above script so I'm not sure what the issue is, must be the LEDs?

Edit: I think the problem is with the LED power for sure, the camera used to test has IR night vision with the IR filter removed so the LEDs should appear vastly brighter...

Update: It looks like the issue is with the MOSFET, if I bypass it the LED's are significantly brighter. I tried another MOSFET (NDP6020P) which increased the brightness slightly but nowhere near the level of the bypass. I've ordered a new FQP30N06L, hopefully it's just a dud.

@chinswain
Copy link

The new NDP6020P arrived today, same issue. Does anyone have any ideas?

Bypassing the MOSFET:

image

With NDP6020P

image

@hydronics2
Copy link
Owner

hydronics2 commented May 2, 2024

Hey, I'm just trying to catch up... What is the problem? The IR LEDs are not triggering a 3.3V sensor output? Is that correct?

I see you tested the shift registers by shorting 3.3v to the shift register input. That was smart to test. There is also sufficient IR in any semi-direct sun light that will also trigger the sensors and perhaps your IR remote control (I never tried that but cool idea). I like to use a small piece of white paper at a short distance away from the sensor (about 1/4" to 3/8").

Be careful with those LEDs! The LEDs work OK with the 22ohm resistors installed. Good enough to test the functionality of the shift registers. Once the jumpers are soldered, the LEDs should only be allowed to stay ON for a maximum of 100us.... otherwise they will burn themselves out.

image

@chinswain
Copy link

chinswain commented May 2, 2024

Hi Thomas,

Thanks for replying and thanks for making the PCB available to the public.

The problem is the LED's are barely lighting up, I cannot work out why. Bypassing the MOSFET pads 2 & 3 proves everything is soldered correctly but using the MOSFET the LED's barely light up at all. From crude testing I assumed there was an issue with the NDP6020P from china, so ordered a few from Amazon and eBay (It's no longer available from reputable stores) but it's the same with them all (Can you recommend any others that would work?)

After many failed attempts at modifying in KiKad we've cut your PCB in half, in theory it should work looking at the schematics. We cut it exactly here:

image

Everything works fine, gates respond to an IR remote and IR LED's on cameras trigger them. Any ideas?

@hydronics2
Copy link
Owner

Ok, so when you bypass the mosfet (shorting across the mosfet) everything works? LEDs trigger the sensors?

image

FYI, you don't want to bypass the mosfet if you have soldered these jumper pads.... Does that make sense? I'm not sure the documentation emphasized this enough. The LEDs can get damaged if the forward voltage is at 3.3V for any length of time over 100us.
image

@chinswain
Copy link

Exactly, via a webcam with the IR filter removed they are very bright, pads are open and when I short the MOSFET pins it's for less than a second.

@hydronics2
Copy link
Owner

Ok, if those solder pads are open then you can short the mosfet all day and there is no problem.

The other mosfet you mentioned, the NDP6020, is a P-channel mosfet. The one we need is an N-channel mosfet. The generic one I listed the FQP30N06 is super generic. It should work fine but you can substitute another one as long as it is type N-channel and the threshold voltage is around 2.5V, and the pinout is the same (the ordering of the pins is G, D, S as opposed to D, G, S or something else). The threshold voltage is the voltage needed to turn it ON.

Try jumping 3.3V to the Gate 'G' pin. This should mimic the way the micro-controller turns the mosfet ON. If that works then you may just have a damaged trace from the micro-controller to the 'G' pin. This is common when you solder/resolder. Its easy to fix by adding a little jumper wire between the micro-controller pin and the 'G' pin.

image

@chinswain
Copy link

chinswain commented May 2, 2024

jumping 3.3V to the gate produces the same result (very dim LED's). I've checked the traces with a multimeter and can't find any breaks, the 3.3V signal is making it to the gate pin of the MOSFET.

I noticed the drain is only 2v when under load, without the LED's it's 3.3v on a breadboard, if I add a standard LED to the drain and 3V source it drops from 3.3V to 2.6V.

Everything points towards the MOSFET I think? Bizarre as I've tried three some different sources...

ChatGPT suggests IRF3708PBF as an alternative, Vgs is 2.8V.

Here's my FQP30N06L, this was from eBay, I've just ordered a few from AliExpress...
image

@hydronics2
Copy link
Owner

hydronics2 commented May 3, 2024

I think both mosfets should work... but sticking with the FQP30N06L for now...

Can you check the voltage at the Drain pin when the gate is triggered ON. Looking at the FQP30N06L datasheet there should be ~40mV resistance between the drain and the source. If we do our LED math and evaluate the current across 2 LEDs, with forward voltage of 1.25V each, supply voltage of 3.3V, and a 22ohm resistor, our current is about 36ma.

So the voltage drop across the mosfet from drain to source is 36ma x 40mV => 0.001V... so pretty much nothing. Sorry to be rambling on here... I'm just thinking out loud because its been awhile sense I looked at this and to be honest I haven't considered for some time the resistance of an N-channel mosfet. I knew it was small but that is really small. So we should be getting good current passing through this mosfet with little resistance...

All this is to ask, can you verify again what voltage you are reading at the drain pin when the gate is triggered ON? Could it be you have a short somewhere on your gate pin? Does the gate pin show a resistance of 10k to ground? There are mosfets that don't trigger at 3.3V and need a full 5V to reach threshold... and those FQP30N06L are so generic, perhaps they're getting manufactured with other specifications??

image

@chinswain
Copy link

Hi Thomas,

It looks like it was the MOSFET, I replaced it with this and it's working perfectly:

IRLB8721PbF
N channel power MOSFET
TO-220 Package
Vds = 30V max
Max current = 62A
Vgs = 2.35V max
Rds_on = as low as 8.7 milliohm - depending on Vgs

https://cdn.shopify.com/s/files/1/0176/3274/files/irlb8721pbf.pdf?v=1646930126

Thanks for replying!

So that confirms it - if people want a shorter version, just cut exactly as shown.

@hydronics2
Copy link
Owner

good to hear! I made a note on the readme page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants