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.

How to configure and use ESP32-CAM with Arduino IDE and Linux

ESP32-CAM is small low cost WiFi camera with OV2460 2Mpix sensor. It allows you to stream video and even to perform some small image filterings and face detection / recognition.

Unfortunately the AI Thinker vendor trying to keep cost as low as possible didn’t include USB programmer in it so the setup is a bit odd.

What do you need to play with ESP32-CAM ?

You need the camera of course and some cables and USB to serial converter which also provide enough 3.3V source to power the camera.

In this example we will use ESP-PROG-C which comes with set of cables and USB-CABLE-micro-1.8M

Step.1

Install Arduino IDE

Please go to arduino.cc and download and install latest Arduino IDE.

Step.2

Linux and CH340

CH340 Linux drivers has bad PLL settings for all Linux kernels before 5.5.

If your system happen to be with Linux Kernel before 5.5. here is the GitHub repository with the patch to install.

If you do not have this patch CH340 will work, but will not be able to communicate at speed over 115200 bps, with the patch up to 2Mbps communication is possible.

Step.3

Wire cables:

You need to connect ESP32-CAM and ESP-PROG this way:

ESP32-CAM GND —-> ESP-PROG GND

ESP32-CAM 3.3V —-> ESP-PROG 3.3V

ESP32-CAM U0T —-> ESP-PROG RXD

ESP32-CAM U0R —-> ESP-PROG TXD

For firmware uploading you need one more connection, which is necessary ESP32 to go in Bootloader mode:

ESP32-CAM IO0 —-> ESP32-CAM GND

Step.4

Configure Arduino for ESP32-CAM

Run Arduino. In the Files-Preferences add:

https://dl.espressif.com/dl/package_esp32_index.json

In Tools-Board-Board Manager search for ESP32 and install it:

Exit Arduino and Run it again so it loads new board data. From File-Examples select ESP32-Camera-CameraWebServer

In select camera model uncomment CAMERA_MODEL_AI_THINKER and comment all other:

Then enter SSID and PASSWORD for your WiFi router.

In Tools-Board select : ESP32Wrover Module

Speed 921600

Flash Frequency 80Mhz

Flash Mode QIO

Partition Scheme: Huge app

Port: the port where your ESP-PROG USB Serial is connected it may be „ttyUSB0“ if you are running Linux or COMxx if you run Windows

Compile and see if there are no errors:

Then Press RESET button on ESP32-CAM, release it and hit Upload button on Arduino IDE.

If you get this error under Linux:

This means that the access to ttyUSB0 is not enabled for your user and you have to run in terminal

$ sudo chown youruser /dev/ttyUSB0 

Where „youruser“ can be seen and try again.

If everything is OK you will see this picture:

Now you have to disconnect ESP32-CAM IO0 and GND and press reset. In serial monitor you will see this message:

when you open http://192.168.100.109/ you will see

Now you can play with the different settings!

New Open Source Hardware board released: BB-TB6612 Dual DC motor controller with PWM to drive small robot cars with 12V up to 1.2A motors

BB-TB6612b

BB-TB6612 is dual channel DC motor controller board it is nice add on for the Robot chassis we have ROBOT-2WD-KIT , ROBOT-2WD-KIT2 , ROBOT-2WDL-KIT , ROBOT-3-WHEEL-KIT and can drive these gear motors: MG-6-120 , MG-6-48  and MG-6V-1:380

The digital logic can be from 2.7 up to 5.5V. The motor voltage can be from 2.5 up to 13.5V.

PWM, CW, CCW, brake-stop, stand-by modes are implemented.

 

Gear motors and accessories for building robot cars are in stock

MG-12V-DE5

We got some new toys in stock for robot builders. The MG-12V-1:100-DE and MG12V-1:380-DE are gear motors for robot cars, working at 12V with 78 RPM and 300 RPM . Both have digital encoders which give two channel feedback for the rotation speed, used for identifying the speed and rotation direction. The MG-12V-1:100 and MG-12V-1:380 are lower cost alternatives to those motors but without encoders.

These motors can be attached to a flat surface with MG-FIX.

MG-FIX

The MG-WHEEL-43mm are rubber wheels with diameter 43mm and a width 19 mm which attach directly to MG-6V and MG-12V gear motors.

MG-WHEEL-43mmb

The MG-WHEEL-65mm is rubber wheel with diameter 65mm and width 25mm. It requires a special MG-COUPLER.

MG-WHEEL-65mmd

 

COVID-19 quarantine projects to try with eduArdu while at home :)

Keep social distance while drinking with friends 🙂

No this is not an eduArdu project, but it is still fun to implement.

The eduArdu Social Distance project is using the onboard Ultra sound distance meter and beeps with its buzzer when someone comes closer than 1.5 meters from you.

The eduArdu Infrared Thermometer project uses MOD-IR-TEMP and scans surface temperature from a distance of few centimeters. If the read temperature is above 38 C it will beep with the buzzer to warn you.

eduArdu-IR

Both projects are easy to implement together with your children.

Softuniada 2020 is this weekend and we have Arduino workshop there with eduArdu

Screenshot from 2020-02-21 15-00-22

Softuniada is programming contest made by SoftUni. It will be held in Sofia Tech Park 22 and 23 of February.

Olimex will have Arduino Workshop with eduArdu board on 23 of February 10.00-16.30

eduArdu is Arduino compatible educational platform. During the workshop we will teach you:

  • How to control servo motors;
  • How to drive LED matrix displays;
  • How to measure temperature;
  • How to measure Lighting;
  • How to measure distance with ultrasound;
  • How to play melodies;
  • How to drive RGB LEDs;
  • How to make piano with banana keys;
  • How to work with Joystick;
  • How to receive and transmit IR remote control commands and to control TVs;
  • How to measure noise;

To participate in the workshop you have to bring with you Laptops. The approx time of the workshop is 1 hour and 45 minutes.

 

Programming with open source hardware educational board eduArdu and Scratch 3

Screenshot from 2019-07-29 14-52-10

New demo code which transforms eduArdu in Makey Makey and tutorial how to use with Scratch 3 is uploaded to GitHub.

Here is the result from above code:

eduArdu-BotKit transforms your eduArdu in small bot

eduArdu-4

eduArdu-BotKit consist of two continual rotation servo motors, two 32mm wheels, ball wheel and converts eduArdu in small robot:

eduArdu-3

Here is small video clip of small demo how to control eduArdu robot with clap of your hands.

If you need more memory and micro SD card for your Arduino project -OLIMEXINO-2560 is with 256K Flash and SD card on board

OLIMEXINO-2560

OLIMEXINO-2560 is Arduino Mega2560 like board which keeps ports conversion but adds UEXT connector to connect our wide range of modules and sensors, works on 5V and 3.3V, and has on board micro SD card for file storage and logging.

Power supply uses DCDC convertor with input range 6-15VDC when OLIMEXINO-2560 works on 5V and 5-15VDC when OLIMEXINO-2560 works on 3.3V.

Previous Older Entries