Main

Wire Resistance and Voltage Drop Calculator

Length of Cable (Feet)  or   (Meters)
Load Current (Amps)
Source Voltage (DC Volts)
 

  Size Diameter Resistance @ 77 F Resistance
for length
(Ohms)
Voltage
Drop
(Volts)
Output Voltage
(Source
less Drop)
Percentage Loss (%)
  AWG Metric
mm2
inch mm ohm/1000' ohm/km
  24 0.205 0.0232 0.590 26.1823 85.900
  22 0.326 0.0293 0.744 16.4592 54.000
  20 0.518 0.0369 0.938 10.3632 34.000
  18 0.823 0.0465 1.182 6.5227 21.400
  16 1.309 0.0587 1.491 4.0843 13.400
  14 2.081 0.0740 1.880 2.5756 8.450
  12 3.309 0.0933 2.371 1.6215 5.320
  10 5.261 0.1177 2.989 1.0180 3.340
  8 8.366 0.1484 3.770 0.6401 2.100
  6 13.302 0.1871 4.753 0.4023 1.320
  4 21.151 0.2360 5.994 0.2533 0.831
  2 33.631 0.2976 7.558 0.1594 0.523
  1 42.408 0.3341 8.487 0.1265 0.415
  1/0 53.475 0.3752 9.530 0.1003 0.329
  2/0 67.431 0.4213 10.702 0.0796 0.261
  3/0 85.029 0.4732 12.018 0.0631 0.207
  4/0 107.219 0.5313 13.495 0.0500 0.164

Perl Serial->MQTT->Mosquitto->OpenHab

openhab.conf , conenction to mosquitto
mqtt:mysensor.url=tcp://10.0.1.10:1883
mqtt:mysensor.clientId=MQTT
mqtt:mysensor.qos=0
mqtt:mysensor.retain=true
mqtt:mysensor.async=false

Modifying Cheap PIR Motion Sensor to Work at 3.3V

Some of these modules come with pins soldered in that top right corner, so you don’t have to solder anything. You would simply connect a jumper wire to that pin that is highlighted in red (see Figure below). With my particular sensor I had to solder a small wire.
Here’s how it looks, now if you supply 3.3V through that red wire your module works at 3.3V.

OpenWrt - Filesystem on a USB stick

Filesystem on a USB stick (Rootfs on External Storage / extroot) first we need to install basic USB support for EXT4 and FAT32 formatted USB sticks
root@OpenWrt:~# opkg update
root@OpenWrt:~# opkg install kmod-usb-storage block-mount kmod-fs-ext4 kmod-fs-vfat
kmod-nls-cp437 kmod-nls-cp850 kmod-nls-iso8859-1 kmod-nls-iso8859-15 kmod-scsi-core
e2fsprogs fdisk
check if the USB stick was recognized
root@OpenWrt:~# ls /dev/sd*
you should see one or more devices like sda1, sdb1, sdb2, … partition the USB stick
root@OpenWrt:~# fdisk
Command (m for help): m (displays actions)
Command (m for help): p (display partition table)
Command (m for help): d (delete partion - had only 1 on my stick)
Command (m for help): n (new partition)
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-621, default 1): RETURN
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-nnnn, default nnn):
Command (m for help): a (make partition bootable) RETURN
Partition number (1-4): 1 Command (m for help): w (write to disk)
format USB stick with ext4 filesystem
root@OpenWrt:~# mkfs.ext4 /dev/sda1
mount the USB stick and copy the flash /overlay to the USB stick
root@OpenWrt:~# mkdir -p /mnt/usb
root@OpenWrt:~# mount -t vfat /dev/sda1 /mnt/usb
root@OpenWrt:~# tar -C /overlay -cvf - . | tar -C /mnt/usb -xvf -
root@OpenWrt:~# vi /etc/config/fstab
the ‘config mount’ block should look like this
config 'mount'
        option target   /overlay
        option device   /dev/sda1
        option fstype   ext4
        option options  rw,sync
        option enabled  1
        option enabled_fsck 0
restart the router and check if everything’s ok
root@OpenWrt:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                 1962212     65100   1798716   3% /
/dev/root                 1536      1536         0 100% /rom
tmpfs                    14600        72     14528   0% /tmp
tmpfs                      512         0       512   0% /dev
/dev/sda1              1962212     65100   1798716   3% /overlay
overlayfs:/overlay     1962212     65100   1798716   3% /

BcSensor 2xMosfet

powered by power supply module (lm2596)

BcSensor Relay

  • 2x connectors for Dallas temperature sensor
  • 1 - photocell connector (light sensor)
  • 1 DHT-22 connector (humidity and temperature)
  • 1 connector for pir sensor (HC-SR501 PIR Motion Sensor Module)
  • 1 connector for Relay (led light controller )
  • 1 conenctor for Magnetic Door Switch Sensor
  • 1 conenctor for power out (5v)

(this version has a 1117 3.3v regulator and 7805 5.0v)

BcSensor Battery

  • -is connected directly to the battery
  • 2x connectors for Dallas temperature sensor
  • 1 - photocell (light sensor)

(this version is reporting the battery level)

BcSensor Mosfet

  • 2x connectors for Dallas temperature sensor
  • 1 - photocell connector (light sensor)
  • 1 DHT-22 connector (humidity and temperature)
  • 1 connector for pir sensor (HC-SR501 PIR Motion Sensor Module)
  • 1 connector for PWM IRF3205 (led light controller )
  • 1 conenctor for Magnetic Door Switch Sensor
  • 1 conenctor for power out (5v)

(this version has a 1117 3.3v regulator and 7805 5.0v)