Asset Tracking device

Hey Sascha,

In my circuit there are three main parts, the LoPy, relay and the power supply to match. The relay is being powered from a 5V power supply using the dupont connection.
image

I used a logic level converter between to make sure the current was limited from the GPIO pin on the LoPy. I tested it will work with the raw output of the LoPy (3.3v). The logic level converter shouldn’t matter though since it feds through to the optocoupler anyways on this module.

Heres the code I used:

from machine import Pin
from utime import sleep

import pycom

relay_pin = Pin('P12', mode=Pin.OUT)
pycom.heartbeat(False)

while(1):
    relay_pin.value(1)
    pycom.rgbled(0x001000)
    sleep(0.5)

    relay_pin.value(0)
    pycom.rgbled(0x100000)
    sleep(1)
3 Likes