Drive a solid state relay with low voltage

I'd like to drive some SSRs but my input signal is only 0.4V high, and the SSR lowest input voltage is 3V.
How can I drive these? If it can be useful, I have also a 6V VCC.

With such a low voltage, you won't even be able to switch on a transistor (needs 0.7V min). You could use an op-amp as a non-inverting amplifier, and get a 4V swing. Or, you could use a comparator and compare your signal with, say, a 0.2V fixed voltage.

Take a look at the Seiko S-882Z series charge pump which has a 0.3V - 3V input.
Also look at the Advanced Linear 0V threshold MOSFETs (e.g. ALD110900ASA)

(* jcl *)

Thank you guys! I'll have a look on your suggestion right now.

The 0.4V is coming from a 1-wire switch called DS2406.
The data sheet says "PIO channel A sink capability of 50mA at 0.4V; maximum operating voltage of 13V at PIO-A"

http://pdfserv.maxim-ic.com/en/ds/DS2406.pdf

There isn't 0.4V coming out of the output. It is an open drain which means it sinks
current and doesn't source current.

You need to put a pull-up resistor on the output (one end of the resistor to the
output the other end to your six volt supply). You will then get a signal that
is either 6V or 0.4V.

(* jcl *)

Thank you Jluciani for the reply... I tried the pull-up resistor as shown in this example circuit to drive a relay

I don't have 1k resistor, so i tried with 220 or 2.2k, the 10k on its place, the voltage now has been increased but the difference between on or off it's again 0.4V. Also I noticed when I try to measure voltage output with the tester the Arduino VRM heats up a lot which I suppose i'm doing a short circuit.
Is it correct the circuit in the picture? Maybe it's the 2N3906 that does the magic, but I don't have it.

The LED is reversed in the schematic.

You need a transistor to drive the relay. The 3906, as shown, will work. You
could use an NPN -- wire one side of the relay coil to +5V and the other
side to the collector of the NPN. The base would attach to PIO output as shown.

(* jcl *)

I'm working with the pull-up resistor....

If I connect a 10k resistor to the PIO pin and +5V (I'm using Arduino power now), I see the 0.4V on - 0V off.
If I connect a 10k resistor to the +5V and a 220ohm resistor to the PIO pin, I see between the two resistor 1.25V on and 0.90V off.
If I don't have correct high and low voltages I think I can't drive the transistor...

I really can't sort this out :frowning:

Are you keeping the data line high when you stop transmitting data? Since the
one-wire device is powered from the data line it needs to be high (for a minimum
period of time) to charge its internal capacitor.

In the diagram the pin one label on DS2405 is wrong. It should be GND not VDD.
The part is wired correctly.

(* jcl *)

Do you have a pull up to +5 on the DQ line? You need one.

Thank you guys for the replies!
Yes I have the pull-up resistor for 1-wire bus and the code keeps the data line high.. I'm using the tried-and-true OneWire library :slight_smile:

I spent the whole evening trying all sorts of circuits and understanding the meaning of "open drain" and "sink capability".
I ended up with conclusion that if I feed +5V, an open drain transistor like the DS2406 PIO pins with sink capability of 0.4V means it can go from +5.0V to +4.6V.
It can't go from +5.0 to +0.4V, though I'd like if it could work like this. Do you agree?

The problem is that I have a high at 5.0V and a low at 4.6V. But I need to drive a solid state relay which has a >3V high, and a L298 H-bridge which has a >2.3V high.
How can I bring down the voltage enough to fall between the thresholds?

I tried this circuit and doesn't work

I used a BC547B which I think it's the same, and with +5V to the collector, 0-0.4V on the base I have 0-0.08V on the emitter.

I spent the whole evening trying all sorts of circuits and understanding the meaning of "open drain" and "sink capability".
I ended up with conclusion that if I feed +5V, an open drain transistor like the DS2406 PIO pins with sink capability of 0.4V means it can go from +5.0V to +4.6V.
It can't go from +5.0 to +0.4V, though I'd like if it could work like this. Do you agree?

No. Open drain means there is no current flow when the device is off.
If you attach a pull-up resistor from 5V to an open drain you will get
either 5V (open drain == no current == no voltage drop) or 0.4V which
is called out in the specification.

If the BC546 is an NPN transistor (as shown) it will not work per the schematic.
You need a PNP.

I would verify the voltages at all of the pins of the 2405. It seems like something
is not connected properly. Verify that the datapin is staying high.

(* jcl *)

Thank you for the patience... the problem is that no one have ever used DS2405/DS2406 on Arduino, and the few schematics I found on the net are far from perfect, as you noticed :smiley:

This is the circuit I made. I tried different values for PIO-A pull-up resistors but when I measure voltage between +5V and PIO-A it's always +5V or +4.6V, the difference is exactly the sink voltage which is strange.

You were right about the data line that must be kept high... I forgot this and promptly added the flag to the latest write command before the delays. But the behavior is the same :frowning:
Here's the code, it uses official OneWire library:

#include <OneWire.h>

// DS2406 PIO switch management example

OneWire ds(10);  // on pin 10

void setup(void) {
  // initialize inputs/outputs
  // start serial port
  Serial.begin(9600);
}

void loop(void) {
  int HighByte, LowByte, TReading, SignBit, Tc_100, Whole, Fract;
  byte i;
  byte present = 0;
  byte data[16];
  byte addr[8];
  byte status[0];
  
  status[0]=7;
  
  if ( !ds.search(addr)) {
      Serial.print("No more addresses.\n");
      ds.reset_search();
      return;
  }

  Serial.print("R=");
  for( i = 0; i < 8; i++) {
    Serial.print(addr[i], HEX);
    Serial.print(" ");
  }

  if ( OneWire::crc8( addr, 7) != addr[7]) {
      Serial.print("CRC is not valid!\n");
      return;
  }

  if ( addr[0] != 0x12) {
      Serial.print("Device is not a DS2406 family device.\n");
      return;
  }
  ds.reset();                  //reset bus
  ds.select(addr);             //select device previously discovered
  ds.write(0x55);              //write status command
  ds.write(0x07);              //select location 00:07 (2nd byte)
  ds.write(0);                 //select location 00:07 (1st byte)
  ds.write(0x1F);              //write status data byte (turn PIO-A ON)
  Serial.print ("VALUE=");     //read CRC16 of command, address and data and print it; we don't care
  for ( i = 0; i < 6; i++) { 
 data[i] = ds.read();
   Serial.print(data[i], HEX);
 Serial.print(" ");
 }
  ds.write(0xFF,1);            //dummy byte FFh to transfer data from scratchpad to status memory, leave the bus HIGH
  delay(2000);                 //leave the things as they are for 2 seconds
  ds.reset();
  ds.select(addr);
  ds.write(0x55);
  ds.write(0x07);
  ds.write(0);
  ds.write(0x3F);              //write status data byte (turn PIO-A OFF)
  Serial.print ("  VALUE=");
  for ( i = 0; i < 6; i++) { 
 data[i] = ds.read();
    Serial.print(data[i], HEX);
 Serial.print(" ");
 }
  ds.write(0xFF,1);
  delay(2000);
}

I'd like to find the culprit, anyway for my project it's enough to bring the voltage down enough to reach the threshold value, which is 2.3V @ 100uA for L298 and 3.0V @ 3.0mA for solid state relays...of course this can work if these devices haven't a big tolerance. can I do this with just a few resistors?

I tried different values for PIO-A pull-up resistors but when I measure voltage between +5V and PIO-A it's always +5V or +4.6V, the difference is exactly the sink voltage which is strange.

This is the bit that is wrong. You should not see this. As you are seeing it then it suggests that you have something wrong with your implementation.

That last schematic is right although maybe 2K2 pull ups in place of 4K7 but that shouldn't matter. So you have to find out what you are doing wrong. I have used these devices (although not on an arduino but that does not matter) and you will get the full logic swing if your hardware is implemented correctly.
Double check that you have identified the correct pins for the package you have.

The circuit looks correct as labeled. I did not compare the pinout that you drew with
the datasheet.

The pull-up values look OK. I would have gone with 10K values but 4.7K should work
fine.

The circuit, as shown, should give you 5V and 0.4V. Since it is not I would not
use it as is. There is something basic that is wrong (which is difficult to troubleshoot remotely). Either the pinout is wrong, you are not making good connections, the software is not setting up the PIO properly or the device is bad.

(* jcl *)

Thank you again for the replies!
I've tried also 10k and 2k2 resistors, the values change but again the voltage range is 0.4V.
The DS2406 are correctly detected from the Arduino, maybe it's just wrong the sequence of commands I send...
At this point I think I should buy a 1-wire USB master to drive directly from a PC... I'm still far from become an Arduino guru (I started just 4 months ago).
No one of the OneWire library authors have posted here recently, and everyone in the forum appear to use just the DS18X20 thermometers... so there isn't tried and true sketches for these devices.

Maybe do you know a community where I can ask for 1-wire devices?

This is a circuit I have built and got working:-

I will see if I can dig it out and write some arduino software over the weekend.

Wohooo wonderful!!! Thank you again for your help Mike!
I'll go today to the shop to buy the resistors and the transistor you used in that circuit

Just a few more considerations:

the datasheet says "Status Memory location 7... provides the bus master a memory mapped access to the channel flip-flops that control the PIO output transistors... The channel flip-flops are accessible through bit locations 5 and 6... The power-on default for the...channel flip-flops is all 1's. Setting a channel flip-flop to 0 will make the associated PIO-transistor conducting or on; setting the flip-flop to 1 will switch the transistor off, which is identical to the power-on default".

According to what the datasheet says, the DS2406 when powered up should NOT let current flow thorugh its PIO pin because of the default setting. But I tried several DS2406's just powering up them without hooking to the 1-wire bus, and all of them let current flow.
Or maybe it's just me that doesn't have the know-how to understand what's written in the paper :smiley:

For 1-wire bus pull-up resistor I'm using a 4.7k 0.5W resistor (yellow-purple-red-gold)
For PIO pull-up resistor I used 4.7k, 10k and even cascaded 3x10k with no difference

Ok I did notice you are talking about a DS2406 where I have used a DS2405.
As I said I will try and find my set up this weekend and see if I can get it to work again.