Quad 24V isolated switch for most Odroids
- mctom
- Posts: 2574
- Joined: Wed Nov 11, 2020 4:44 am
- languages_spoken: english, polish
- ODROIDs: OGA, XU4, C2, M1, H3+, SP3, Vu8M
- Location: Gdansk, Poland
- Has thanked: 347 times
- Been thanked: 441 times
- Contact:
Quad 24V isolated switch for most Odroids
I made a thing.
It was shelved as a board for XU4, with additional IR sensor, but things have changed and now I'm replacing XU4 with M1 as a project base.
M1 has on board IR sensor so that went away, and 40-pin 2.54mm socket is almost twice as big as its XU4 counterpart, so I could comfortably fit all these screw terminals, finally.
Right! So this is a heavy duty switch designed specifically for 24V, but should work with anything in 12-50V range (LM317 is the limit really).
All switches are low side, so one can switch all sorts of loads like valves, LED strips, motors, heaters, fans, stuff like that. A general rule of thumb is, don't do low side switching with stuff wired to other stuff.
They are isolated, which means they can switch voltage from independent source, with different ground than Odroid's ground. The maximum difference is up to 2500Vrms. That's what the optocoupler's datasheet says. But in case of this board keep it reasonable.
Personally I'm gonna use this to operate the 24V radiator valve and 24V LED strips, all of which support PWM. This board can rapidly switch MOSFETs thanks to dedicated gate drivers.
That pretty much explains why there's a temperature sensor, too. Two footprints allow to fit either LM35 or LM50 and some other pin-compatible models. Both are wired to ADC input and will work within allowed input voltage range as long as you don't decide to bake your Odroid in the oven.
(There is a protection just in case you did).
And finally, screw terminals. You like them on the top? Sure. Maybe on the bottom? Go ahead. Hence why I didn't overlap SMD components with screw terminal footprints.
Stuff is available here: https://github.com/tomek-szczesny/gpio_ ... d_switches
It was shelved as a board for XU4, with additional IR sensor, but things have changed and now I'm replacing XU4 with M1 as a project base.
M1 has on board IR sensor so that went away, and 40-pin 2.54mm socket is almost twice as big as its XU4 counterpart, so I could comfortably fit all these screw terminals, finally.
Right! So this is a heavy duty switch designed specifically for 24V, but should work with anything in 12-50V range (LM317 is the limit really).
All switches are low side, so one can switch all sorts of loads like valves, LED strips, motors, heaters, fans, stuff like that. A general rule of thumb is, don't do low side switching with stuff wired to other stuff.
They are isolated, which means they can switch voltage from independent source, with different ground than Odroid's ground. The maximum difference is up to 2500Vrms. That's what the optocoupler's datasheet says. But in case of this board keep it reasonable.
Personally I'm gonna use this to operate the 24V radiator valve and 24V LED strips, all of which support PWM. This board can rapidly switch MOSFETs thanks to dedicated gate drivers.
That pretty much explains why there's a temperature sensor, too. Two footprints allow to fit either LM35 or LM50 and some other pin-compatible models. Both are wired to ADC input and will work within allowed input voltage range as long as you don't decide to bake your Odroid in the oven.
(There is a protection just in case you did).
And finally, screw terminals. You like them on the top? Sure. Maybe on the bottom? Go ahead. Hence why I didn't overlap SMD components with screw terminal footprints.
Stuff is available here: https://github.com/tomek-szczesny/gpio_ ... d_switches
- Attachments
-
- 2022-11-09-222159_1818x1264_scrot.png (139.86 KiB) Viewed 704 times
-
- 2022-11-09-215326_880x713_scrot.png (385.07 KiB) Viewed 704 times
-
- 2022-11-09-215344_949x740_scrot.png (410.63 KiB) Viewed 704 times
- mad_ady
- Posts: 11188
- Joined: Wed Jul 15, 2015 5:00 pm
- languages_spoken: english
- ODROIDs: XU4 (HC1, HC2), C1+, C2, C4 (HC4), N1, N2, H2, Go, Go Advance, M1
- Location: Bucharest, Romania
- Has thanked: 647 times
- Been thanked: 1053 times
- Contact:
-
- Posts: 55
- Joined: Sat Sep 10, 2022 10:47 pm
- languages_spoken: english
- Has thanked: 1 time
- Been thanked: 17 times
- Contact:
Re: Quad 24V isolated switch for most Odroids
Nice thing, it allows the use of PLC actuators. This means that the M1 can be used as a PLC, only equivalent inputs for sensors are missing.
- mctom
- Posts: 2574
- Joined: Wed Nov 11, 2020 4:44 am
- languages_spoken: english, polish
- ODROIDs: OGA, XU4, C2, M1, H3+, SP3, Vu8M
- Location: Gdansk, Poland
- Has thanked: 347 times
- Been thanked: 441 times
- Contact:
Re: Quad 24V isolated switch for most Odroids
Means that transition from "on" to "off" state should take something in 100ns - 10us range.
Conversely, a simpler gate driver with npn and a resistor, is easier and cheaper to build, but operates relatively slowly and dissipates substantial heat during transition. This is still acceptable in many applications where state transition happens relatively rarely (say less often that once per second).
I wanted to emphasize that this board supports PWM, because not all do. Not sure what frequency is practical, I'm aiming at 100+Hz for LED and 1Hz for heater valve.
This board might be used with almost anything that has 40-pin GPIO (the temperature sensor will work with a number of Odroids only, though, due to unique ADC input on the header).usual user wrote: ↑Thu Nov 10, 2022 3:26 pmThis means that the M1 can be used as a PLC, only equivalent inputs for sensors are missing.
I designed isolated inputs too some time ago but didn't find much use for it.
- mctom
- Posts: 2574
- Joined: Wed Nov 11, 2020 4:44 am
- languages_spoken: english, polish
- ODROIDs: OGA, XU4, C2, M1, H3+, SP3, Vu8M
- Location: Gdansk, Poland
- Has thanked: 347 times
- Been thanked: 441 times
- Contact:
Re: Quad 24V isolated switch for most Odroids
The design has been updated: Now one optocoupler is used directly (to pull up or down some external logic signals).
I'll be using this to mute my audio amp when idle.
I also uploaded production files on github.
I'll be using this to mute my audio amp when idle.
I also uploaded production files on github.
- Attachments
-
- 2022-11-25-172912_811x692_scrot.png (170.69 KiB) Viewed 597 times
-
- 2022-11-25-172930_798x552_scrot.png (115.65 KiB) Viewed 597 times
-
- 2022-11-25-172950_1032x738_scrot.png (46.25 KiB) Viewed 597 times
- mctom
- Posts: 2574
- Joined: Wed Nov 11, 2020 4:44 am
- languages_spoken: english, polish
- ODROIDs: OGA, XU4, C2, M1, H3+, SP3, Vu8M
- Location: Gdansk, Poland
- Has thanked: 347 times
- Been thanked: 441 times
- Contact:
Re: Quad 24V isolated switch for most Odroids
I added an invincible DS18B20 as another temperature sensing option.
The reason why it wasn't included before is simple - the board was previously designed for XU4, and there was no 3.3V logic.
The changes are reflected in the git repo.
The scope of target Odroids has been narrowed down to M1 only, as different platforms may have OneWire interface by default on a different physical pin.
The reason why it wasn't included before is simple - the board was previously designed for XU4, and there was no 3.3V logic.
The changes are reflected in the git repo.
The scope of target Odroids has been narrowed down to M1 only, as different platforms may have OneWire interface by default on a different physical pin.
- Attachments
-
- 2022-11-27-212021_948x715_scrot.png (208.99 KiB) Viewed 577 times
- rooted
- Posts: 9968
- Joined: Fri Dec 19, 2014 9:12 am
- languages_spoken: english
- Location: Gulf of Mexico, US
- Has thanked: 777 times
- Been thanked: 580 times
- Contact:
Re: Quad 24V isolated switch for most Odroids
If the pin is different on other devices you could add jumpers or dips but I'm sure that would complicate the routing.
- mad_ady
- Posts: 11188
- Joined: Wed Jul 15, 2015 5:00 pm
- languages_spoken: english
- ODROIDs: XU4 (HC1, HC2), C1+, C2, C4 (HC4), N1, N2, H2, Go, Go Advance, M1
- Location: Bucharest, Romania
- Has thanked: 647 times
- Been thanked: 1053 times
- Contact:
Re: Quad 24V isolated switch for most Odroids
The default pin can be changed via dtb on every board. Via overlay, or the old fashioned way with fdtput.
- mctom
- Posts: 2574
- Joined: Wed Nov 11, 2020 4:44 am
- languages_spoken: english, polish
- ODROIDs: OGA, XU4, C2, M1, H3+, SP3, Vu8M
- Location: Gdansk, Poland
- Has thanked: 347 times
- Been thanked: 441 times
- Contact:
Re: Quad 24V isolated switch for most Odroids
I assumed that the "Default onewire pin" can be reassigned programatically and I guess that got confirmed. 
I wouldn't worry about all that, I don't expect this module to get much attention.
So I took a liberty to make it tailored to my specific needs.

I wouldn't worry about all that, I don't expect this module to get much attention.

- mctom
- Posts: 2574
- Joined: Wed Nov 11, 2020 4:44 am
- languages_spoken: english, polish
- ODROIDs: OGA, XU4, C2, M1, H3+, SP3, Vu8M
- Location: Gdansk, Poland
- Has thanked: 347 times
- Been thanked: 441 times
- Contact:
Re: Quad 24V isolated switch for most Odroids
Yay, the board has been built!
I decided to mount screw terminals on the bottom and direct optocoupler output on the top.
The board has been built with LM50 temperature sensor and I already regret that. I wanted to use it for measuring room temperature, alas I'm getting grossly inaccurate results.
By the way, there is an error in Wiki, the correct path for reading the ADC value through sysfs is as follows:
sudo cat /sys/bus/platform/drivers/rockchip-saradc/fe720000.saradc/iio:device0/in_voltage7_raw
Raw result averaged over 13 samples is 443.85, which translates to 781mV, which is.. 28.1 deg C.
The reason why I wanted to test that is it's really cold in here tonight.. Certainly not 28.1
Oh well, here goes a superposition of all possible error sources: temp sensor, 1.8V reference, ADC itself.. And some amount of M1's self-heating.
I'll try again with DS18B20 tomorrow.
I decided to mount screw terminals on the bottom and direct optocoupler output on the top.
The board has been built with LM50 temperature sensor and I already regret that. I wanted to use it for measuring room temperature, alas I'm getting grossly inaccurate results.
By the way, there is an error in Wiki, the correct path for reading the ADC value through sysfs is as follows:
sudo cat /sys/bus/platform/drivers/rockchip-saradc/fe720000.saradc/iio:device0/in_voltage7_raw
Raw result averaged over 13 samples is 443.85, which translates to 781mV, which is.. 28.1 deg C.
The reason why I wanted to test that is it's really cold in here tonight.. Certainly not 28.1

Oh well, here goes a superposition of all possible error sources: temp sensor, 1.8V reference, ADC itself.. And some amount of M1's self-heating.
I'll try again with DS18B20 tomorrow.
- Attachments
-
- signal-2022-12-28-194811_002.jpeg (194.16 KiB) Viewed 383 times
-
- signal-2022-12-28-194811_003.jpeg (282.69 KiB) Viewed 383 times
-
- signal-2022-12-28-194811_004.jpeg (308.9 KiB) Viewed 383 times
-
- signal-2022-12-28-194811_005.jpeg (236.71 KiB) Viewed 383 times
-
- signal-2022-12-28-194811_006.jpeg (284.04 KiB) Viewed 383 times
- rooted
- Posts: 9968
- Joined: Fri Dec 19, 2014 9:12 am
- languages_spoken: english
- Location: Gulf of Mexico, US
- Has thanked: 777 times
- Been thanked: 580 times
- Contact:
Re: Quad 24V isolated switch for most Odroids
Nice looking little board, good thing you got it done before new years since it has 2022 on the silkscreen 

- mctom
- Posts: 2574
- Joined: Wed Nov 11, 2020 4:44 am
- languages_spoken: english, polish
- ODROIDs: OGA, XU4, C2, M1, H3+, SP3, Vu8M
- Location: Gdansk, Poland
- Has thanked: 347 times
- Been thanked: 441 times
- Contact:
Re: Quad 24V isolated switch for most Odroids
It gets even better.
I tested the same board and the same LM50 sensor with Odroid N2L. Got a result of 31.1 deg C.

I added a DS18B20 sensor, soldered some 15mm above the board, and it reports... 30.0 deg C.
I held the DS sensor in my fingers until it settled at 35.0 deg C, which looks about right - the result is not just shifted 10 deg C up.
I set up a 80mm fan so it blows at both sensors until the temperature has settled at:
LM50: 21.6 deg C
DS18B20: 23.1 deg C
That looks like a believable room temperature.
The conclusion is, this board can measure its own temperature, which has little to do with room temperature.

On the other hand, I had no idea the heat is so.. contagious. The observed temperature rise clearly comes from SBC itself, as there is nothing that could be hot on my module at this point.
- mctom
- Posts: 2574
- Joined: Wed Nov 11, 2020 4:44 am
- languages_spoken: english, polish
- ODROIDs: OGA, XU4, C2, M1, H3+, SP3, Vu8M
- Location: Gdansk, Poland
- Has thanked: 347 times
- Been thanked: 441 times
- Contact:
Re: Quad 24V isolated switch for most Odroids
And the final test, at least for now, was switching 12V loads via sysfs GPIO control, which works just fine. 
The test took much longer than it should due to a broken power supply cable. Lasted me some 10 years, sigh.
Unfortunately I don't have any 24V loads at hand, so couldn't test that directly, but there's no reason why it shouldn't work.
I expect to use this board somewhere this or next month for:
- Automatic audio amp mute (the direct output)
- 24V radiator fan
- 24V LED ambient lighting of a room (together with an IR remote digested by M1)
- Possibly 24V central heating valve, if a fan control alone won't be sufficient.
EDIT: Tested on ODROID N2L. It turns out most ODROID boards have the same one-wire pin as default.

The test took much longer than it should due to a broken power supply cable. Lasted me some 10 years, sigh.
Unfortunately I don't have any 24V loads at hand, so couldn't test that directly, but there's no reason why it shouldn't work.
I expect to use this board somewhere this or next month for:
- Automatic audio amp mute (the direct output)
- 24V radiator fan
- 24V LED ambient lighting of a room (together with an IR remote digested by M1)
- Possibly 24V central heating valve, if a fan control alone won't be sufficient.
EDIT: Tested on ODROID N2L. It turns out most ODROID boards have the same one-wire pin as default.
- mctom
- Posts: 2574
- Joined: Wed Nov 11, 2020 4:44 am
- languages_spoken: english, polish
- ODROIDs: OGA, XU4, C2, M1, H3+, SP3, Vu8M
- Location: Gdansk, Poland
- Has thanked: 347 times
- Been thanked: 441 times
- Contact:
Re: Quad 24V isolated switch for most Odroids
Sure, I tested it with N2L which has exactly the same pinout.
And I got 3 more PCBs to spare

- mctom
- Posts: 2574
- Joined: Wed Nov 11, 2020 4:44 am
- languages_spoken: english, polish
- ODROIDs: OGA, XU4, C2, M1, H3+, SP3, Vu8M
- Location: Gdansk, Poland
- Has thanked: 347 times
- Been thanked: 441 times
- Contact:
Re: Quad 24V isolated switch for most Odroids
And here are the first mods done to my module.
None of the outputs is wired to SBC's hardware PWM output by default. Thus I added a jumper wire connecting pins #26 and #33, so I can use PWM output (#33) from either ODROID M1 or N2L to drive SW1 output (#26). It is allowable as long as there's no big idea to enable both pins #26 and #33 on SBC as outputs at the same time.
I tested it with a roll of LED strip (24V 60W) at 2kHz and it worked perfectly, no signs of heating up, although I do not have access to thermal camera to prove it.
Another problem was thermal sensor being heated by SBC itself, so I soldered it to about 2 decimeters of IDC wire, which has the same raster of 1.27mm as the original TO-92 package. It works exactly the same, it's a digital device after all.
And finally, I added a diode on SW2, from negative to positive terminal, which is necessary should anyone wish to switch inductive loads, such as fans, motors and so on. I will be using one of the outputs for a radiator fan, so I added it preemptively to protect the MOSFET that could otherwise fail when switching the load off. I used SK24 diode in SMB package, which was too big to fit between the terminal pins, but that's what I had in stock.
The reverse voltage rating of a diode should exceed the input voltage, and similarly, repetitive peak forward current should be higher than the load's nominal input current.
None of the outputs is wired to SBC's hardware PWM output by default. Thus I added a jumper wire connecting pins #26 and #33, so I can use PWM output (#33) from either ODROID M1 or N2L to drive SW1 output (#26). It is allowable as long as there's no big idea to enable both pins #26 and #33 on SBC as outputs at the same time.
I tested it with a roll of LED strip (24V 60W) at 2kHz and it worked perfectly, no signs of heating up, although I do not have access to thermal camera to prove it.
Another problem was thermal sensor being heated by SBC itself, so I soldered it to about 2 decimeters of IDC wire, which has the same raster of 1.27mm as the original TO-92 package. It works exactly the same, it's a digital device after all.
And finally, I added a diode on SW2, from negative to positive terminal, which is necessary should anyone wish to switch inductive loads, such as fans, motors and so on. I will be using one of the outputs for a radiator fan, so I added it preemptively to protect the MOSFET that could otherwise fail when switching the load off. I used SK24 diode in SMB package, which was too big to fit between the terminal pins, but that's what I had in stock.
The reverse voltage rating of a diode should exceed the input voltage, and similarly, repetitive peak forward current should be higher than the load's nominal input current.
- Attachments
-
- signal-2023-01-21-161254_002.jpeg (248.73 KiB) Viewed 104 times
Who is online
Users browsing this forum: No registered users and 1 guest