Driving High voltage loads with optoisolated 220VAC/16A switch by Arduino and OLinuXino

eduArdu is educational low cost Arduino board, it has plenty of resources like: LED 8×8 display, Joystick, Buzzer, Microphone, temperature sensor, Ultrasound distance meter, PIR sensor, IR emitter and receiver, Capacitive buttons, RGB LED, Lipo charger for stand alone work.

Here we will show you how you can drive high voltage loads like lamps, heaters etc with PWR-SWITCH connected to eduArdu.

Plug PWR-SWITCH in mains and the object you want to control plug in PWR-SWITCH receptacle.

Then connect “-” termianl of PWR-SWITCH input to eduArdu UEXT.pin2 and “+” terminal of PWR-SWITCH input to eduArdu UEXT.pin4.

In Arduino IDE make this program:

void setup() {
   pinMode(0, OUTPUT);
// the loop function runs over and over again forever
void loop() {
   digitalWrite(0, HIGH); // turn the PWR-SWITCH on
   delay(5000); // wait for a 5 seconds
   digitalWrite(0, LOW); // turn the PWR-SWITCH on
   delay(5000); // wait for a 5 seconds

The Lamp will start to blink 5 seconds on and 5 seconds off.

You can drive high voltage loads with A20-OLinuXino-LIME2 + LIME2-SHIELD:

In this setup connect “-” termianl of PWR-SWITCH input to LIME2-SHIELD GPIO.pin9 and “+” terminal of PWR-SWITCH input to LIME2-SHIELD GPIO.pin7 (GPIO271 in Linux) and you can use this code to switch on and off PWR-SWITCH:

echo 271 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio271/direction

echo 1 > /sys/class/gpio/gpio271/value

echo 0 > /sys/class/gpio/gpio271/value

or you can use Python and pyA20LIME2:

!/usr/bin/env python
from pyA20Lime2.gpio import gpio
from pyA20Lime2.gpio import port
from pyA20Lime2.gpio import connector
gpio.init() #Initialize module. Always called first
gpio.setcfg(port.PI15, gpio.OUTPUT)

gpio.output(port.PI15, gpio.HIGH)
gpio.output(port.PI15, gpio.LOW)

PWR-SWITCH is optically isolated EU style power load switch for up to 3500W, 230VAC/16A and can be driven with any microcontroller, Arduino, EPS32, or Linux computers directly with 3-24V

PWR-SWITCH hides the high voltage problems from the Arduino, ESP32, Raspberry Pi, Beaglebone, OLinuXino developers. It has 1500VAC optically isolation and can drive high voltage up to 230VAC / 16A loads safely.

To switch On or Off the loads from 3 to 24VDC can be used, so you can drive the loads with any microcontroller only 1mA is necessary to trigger the switch.

PWR-SWITCH is with EU stype plug and receptacle, so to use it in US or in UK you will need some of these:US to EU adapter, EU to US adapter or UK to EU adapter.

 PWR-SWITCH has CE-EMC and LVD certification.

Green LED show the switch status.

Open Source Hardware Linux board with industrial grade -40+125C temperature STMP1-OLinuXino-Lime2 prototype is live

We have progress on this board software. It now boots, we have been fighting the hardware and of course the issue was RTFM in this case RTFE (Errata) where STM well documented thar this chip requires oscillator and will not work with only crystal. We were misleaded by their kit schematic where they made provisions for both crystal and osciallator and being cheap we first bet on the crystal 🙂 .

Anyway after replacing the crystal with oscillator STMP1-OLinuXino-Lime2 got alive and here is the boot log: https://pastebin.com/ev94Jbk0

Our design is quite different from STM demo kit, we use different PMU, PHY HDMI so many things have to be done on the Linux support, but the results so far are very good.

Comparing RaspberryPI, BananaPi and A10-OLinuXino-LIME Power consumption and SATA performance


Hardware-Libre made interesting blog post which comparison between PaspberryPi, BananaPi and A10-OLinuXino-LIME.

Connecting GPS to OLinuXino and RaspberryPI


MOD-GPS is very sensitive, low power GPS SirfStarIII module with UEXT connector and can be connected directly to any of our boards. It sends NMEA messages with 19200 bps.

To connect it to OLinuXino is very easy just plug it to UEXT connector, to connect to RaspberryPI you will need RPI-UEXT adapter.

The Project files are at GitHub: https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/A13/MOD-GPS

MOD-GPS is with UART connection, as same UART is used in OLinuXino and RaspberryPI for console to work with MOD-GPS you should first disable the console and connect to OLinuXino or RaspberryPI via ssh.

In OLinuXino you should do this:

#vi /etc/inittab
Comment the line: “T0:23:respawn:/sbin/getty -L -a root ttyS0 115200 vt102”
Save the file and reboot.
!!!Before rebooting you should have working SSH

in RaspberryPi you should do the same but there the console UART name is ttyAMA0

After the reboot login with ssh and connect MOD-GPS to OLinuXino or RaspberryPI, then compile and run it:

#make clean
#./MOD-GPS --tty:"/dev/ttyXXX"

for OLinuXino ttyXXX is ttyS0 for RaspberryPi ttyXXX is ttyAMA0

if everything is OK you should see this picture:


congratulations now you have GPS to your linux board 🙂

Add Real Time Clock to OLinuXino and RaspberryPi with MOD-RTC


MOD-RTC is real time clock with battery backup. OLinuXino and RaspberryPi have no RTC so when the boards are powered off they lost their date/time setting.

This could be easily changed with MOD-RTC. OLinuXino have UEXT connector where MOD-RTC could be connected directly, RaspberryPI should have also RPI-UEXT adapter to may use MOD-RTC.

The code for MOD-RTC is on GitHub https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/A13/MOD-RTC

It’s written in Python so you have to install it before use. The code allow few things to be done. You can copy your board system clock to MOD-RTC with

#sudo python MOD-RTC.py --verbose --i2c=0 -w

you can read MOD-RTC date/time with

#sudo python MOD-RTC.py --verbose --i2c=0 -r

you can sync system clock to MOD-RTC with:

#sudo python MOD-RTC.py --verbose --i2c=0 -s

the only difference when run on A13, imx233 or RaspberryPi is the I2C address which called as program parameter:

Where I2C-Bus is:
	0 for IMX233
	2 for A13
	0,1 for RPi, depending of the revision

Raspberry Pi project – interfacing Wii-Nunchuk with RPi


Wii Nunchuck  is Wii remote controller with 3-axis accelerometer, joystick and two button combo. Those who have watched old Bruce Lee movies know how dangerous such Nunchaku could be in some hands 😀 http://www.youtube.com/watch?v=bRyDcB7qQFo

Olimex offers Wii-Nunchuck with UEXT adapter board for EUR 6.95 https://www.olimex.com/Products/Modules/Sensors/MOD-WII/MOD-Wii-UEXT-NUNCHUCK/

and now with RPI-UEXT https://www.olimex.com/Products/Modules/Adapters/RPi-UEXT/ you can connect Wii remote to your Raspberry pi

The Python code is on GitHub https://github.com/OLIMEX/raspberrypi when you start it you will see on the console:


the joystick coordinates, accelerometer XYZ values and two button status

Friday Free Board Quiz issue #25 is RPI-UEXT + MOD-IO2



RPI-UEXT allow Raspberry Pi to have access to different modules see original blog post we made about it: https://olimex.wordpress.com/2012/11/21/raspberry-pi-gpio-to-breadboard-and-uext-adapter/

MOD-IO2 allow RaspberryPi to control 2 relays and to read/write 7 additional GPIOs, including Analog inputs. On top of this MOD-IO2 is stackable and addressable so you can stack and connect to Raspberry Pi as many relays as you need for your project.

You have chance to win RPI-UEXT + CABLE26-pin + MOD-IO2 today if you answer correctly our quiz question!

Today at 17.00 o’clock our local Bulgarian time (GMT+2) we will post on Twitter our questions.

You have one hour to reply to our tweet with the correct answer.

At 18.00 o’clock we will count the correct answers and ask random.org to generate random number in range then announce the winner and ship the board by airmail in Monday.

Good Luck!

A13-OLinuXino preliminary schematic is complete


A13-OLinuXino preliminary schematic is complete, here is what we got:

– A13 Cortex A8 processor running at 1GHz
– MALI 400 GPU, 1080p codec
– 512 MB of RAM
– 3+1 HS USB hosts (one reserved for WIFI module on board)
– USB OTG (can power the board)
– Audio input
– Headphone output
– VGA connector
– (optional 4GB NAND flash on board)
– micro SDcard
– 6-16VDC power supply input
– (optional LiPo battery power supply block, allow board to run hours on LiPo 3.7V battery)
– (optional RTL8188CU WIFI module on board)
– 5 buttons
– Real Time Clock module with PCF8563
– LCD expansion port, if no connected to LCD provide 30 GPIOs
– UEXT connector with SPI, I2C, UART for attaching additional UEXT modules
– GPIO connector with 40 GPIOs
– console UART header for USB-SERIAL-CABLE console debug

The readable PDF version of the schematic is push on GitHub. CAD files will not be uploaded until we complete and debug the design.

We try to put this in 120×90 mm board size and this picture show preliminary attempt to put the connectors on correct locations.


when we released iMX233 everyone was comparing this ARM9 board with Raspberry Pi or Beagle Bone, commenting how small memory it have and runs on only 454Mhz.

Now if we have to do same comparison and if we trust what is written here: http://lists.phcomp.co.uk/pipermail/arm-netbook/2012-June/004194.html i.e. that Cortex-A8 + NEON coprocessor at 500Mhz runs applications x4 times faster than ARM1176 at 720Mhz we have to say thay A13-OLinuXino will have x2 times more memory than RaspberryPi and will run code x8 times faster.
If we compare A13-OLinuXino with BeagleBone it will have x4 times more memory and will run code about x1.5 times faster.

EDIT: 13.06.2012 PCB layout changed to 130×90 mm to fit all connectors and buttons: