MOSFET issues with PDLC Smart Film

I don't know for sure if this is the correct category, I apologize if it is not.

I have a bug I can’t figure out in my current project. It is supposed to receive an input, turn on a sheet of PDLC film (AKA Smart Film), wait a time, turn it back off, and then start monitoring for a new input. It should be so simple which makes this all the more frustrating haha. I’m currently using a nano. The PDLC film has a little power supply thing (that I expect is the cause of all of my problems) that goes from a usb input, through a little black box with a button, to the film. The button turns on/off the film with a press and with a hold if fades on/off. The main issue is I don’t really know what it does. Here is a picture with the case opened up.

I attached an oscilloscope to the output of the power supply (I’m pretty new to using a scope, I’ve only used one a handful of times) and this is the waveform. When the button is held the amplitude grows and shrinks. The smart film company told me that their normal power supplies are 60V AC. The power supplies I have are their small sample supplies.

I found out that if I plugged in the usb the sheet would turn on and if I unplugged it it would turn off. My thought was I could just use a relay to control the 5VDC power input so I don’t have to get into how the power supply works. I then decided to try using a MOSFET for the first time. Everything seemed to work fine on my breadboard so I went ahead and soldered up a more permanent solution. I started noticing bugs on that circuit board, but when I went back to the bread board I found them there as well.

Essentially the circuit will seem to be working fine for a while and then sometimes it just freezes up. It seems to be hanging my code for some reason, or maybe it is throwing the Arduino into a reboot loop. It only happens sometimes, enough that I didn’t notice before I made my soldered board, but it always does eventually. Ive had it hang searching for an input so it never reads the button press and I’ve had it hang after the relay turns on so it never turns back off.

I’ve tried a bunch of things to try to fix it. I tried the code with and without delays. I’m back to my breadboard to make sure it wasn’t my soldered version. I originally was running 5V to Vin to power the board, so I thought maybe it wasn’t getting enough power. I ran the 5V power directly to the 5V pin and the problem persists. I added a resistor between the output pin and the MOSFET because I read that somewhere but that didn’t change it either. When I unplug the PDLC power supply from the circuit I haven’t noticed the bug yet, so I’m almost positive it is causing my issues.

I don’t know if maybe I need to add some sort of diode or something to protect the Arduino from back voltages or something. I thought I could try using the scope to find a voltage spike but I’m not sure where to look for it. Basically I’ve tried everything I can think of and I’m at the end of my know-how. I would greatly appreciate any assistance!

here are photos of my circuit "diagrams" and the board I soldered.


code with delay() :

const int readerPin = 12;
const int relayPin = 13;

const unsigned long readerTimeout = 10000;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(readerPin, INPUT_PULLUP);
  pinMode(relayPin, OUTPUT);
  digitalWrite(relayPin,LOW);
}

void loop() {
  // put your main code here, to run repeatedly:
  Serial.println("nothing");
  if (digitalRead(readerPin) == LOW) {
    Serial.println("reader");
    digitalWrite(relayPin, HIGH); 
    Serial.println("relay on");
    delay(readerTimeout);
    Serial.println("wait over");
    digitalWrite(relayPin, LOW);
    Serial.println("turned off");
  }
}

Thanks in advance

I think that this is due to the expected AC supply where your MOSFET only switches the positive half cycle. This will polarize the film and possibly damage it. You can try a TRIAC to switch the supply voltage on and off, or a relay.

I am switching the usb side of the power supply though, so shouldn't I be avoiding that issue? The power supply goes: usb (5V through MOSFET) -> black box -> output to film

Hi, @rascalvcicfinn
Have you Googled;

PDLC film (AKA Smart Film) arduino

Tom.. :grinning: :+1: :coffee: :australia:

Okay.

You really should have a 10k resistor from gate to ground to turn off the MOSFET.
Considering the film power converter is a black box at the moment, placing a diode across the input isn't a bad idea. It wouldn't hurt. Banded side on the +5V.

Great, I'll try that this morning and see what happens

When I added those components it almost seemed like the error would happen sooner for some reason. Maybe I haven't hooked up the MOSFET correctly? I'm interrupting the ground side, is that the proper way to do it? Do you think my issues could be caused because my 5V power supply is powering both the arduino and the PDLC power supply and they aren't isolated? I do have an AC SSR, do you think I'd have better luck putting it after the black box instead of my current setup?

I finally got the error to happen while the arduino was on the serial monitor. It was saying "nothing" and then the line when the button was pressed says "nothingC" before freezing there. I put the output on pin 13 so the onboard LED would help me see what's going on. The last few times it has frozen the LED flashed briefly before it got stuck. So the pin went high for at least a moment before it turned off and froze. It is probably different when I was having it freeze while the film was on, but that happens more rarely.

Could very well be. Can you use a second 5V source for the Nano? Connect the 2 grounds together.

You can try placing a large capacitor across +5V and Gnd in your pcb

where I bring power into the board, correct?

I don't have a Hantek scope so the following steps are generic.
See if you can capture your +5V dropping out. Set your scope as follows:
Acquisition > single
Trigger > Normal, level 4V, falling edge, Ch1

Press Run/Stop until STOP in the upper left of screen becomes Ready, or something like that.

I suspect you will see it drop from 5V. Press Run/Stop reach time you see Stop in upper left

Correct

If you try to set up the scope, set Sweep to about 5mS

So why don't you give it a try?

Sorry to bump this thread. Do you know which is the fastes transition time you can get with your pdlc. From off to on to off.
Thanks

I haven’t done any sort of measurements, but they go from off to on instantly (to normal observation) but tend to fade from on to off. The time varies too for some reason. I don’t know if that is normal behavior of PDLC or if it is something with they way I have mine set up. If I had to guess I would say it can take anywhere up to a 3-4 seconds to turn off, but often is quicker than that.

Thanks a lot. I've found one pdlc that, at last at the tech docs, has a response -overall off on off- of 12ms. Im not at home right now where i have the url but, if you want, i can post it here.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.