Modeling light module

Very, very compact (13 x 8.8mm on 0.7mm pcb)  light module that can be used in modeling etc…….
The module has output for 2 channels, a build in bec so it can operate from an wide range of power supply and independent supply for the leds.
It has vary preprogrammed light sequence, for now there are 8 programs. Most of them are maybe typical dutch. Watch the video to see them all.
If you are interested in a module or in a module with other sequence mail me.

  1. Flashing light 1
  2. Flashing light 2
  3. Flashing light 3 (dutch police)
  4. Railroad crossing (45x per second)
  5. Railroad crossing (90x per second)
  6. Flipflop 1 sec.
  7. Highway road sign
  8. Airplane navigation light

 

Schematic
Finished pcb detail
Finished pcb
PlayPause
previous arrow
next arrow
 
Schematic
Finished pcb detail
Finished pcb
previous arrow
next arrow
Raspberry Pi Power distribution board

At the moment I have 4 raspberry pi’s running 24/7 for various tasks. Some of these tasks are Node-red, Pi-hole, Vpn server and 3 music streamers.
All these’s pi’s need power and all those power plugs are occupying the outlets in the hall way closet. To reduce the required outlets I designed this power distribution board.
The second reason for this design is that the pi3 and 4 are trigger happy to give an “under voltage detected”.  This is because there’s an diode in the 5 volt rail that will has some voltage drop over it. Due this voltage drop the under voltage will trigger very vast. Increasing the input voltage to 5.2V will prevent the above.
There are also some 3.3V output’s for future use.

Added a current and voltage display for monitoring and quick trouble shooting in case of a problem, and for the “looks nice” off course.

Under the pcb there’s a 5V 50w power supply from Ali. This supply has a trimmer to adjust the output voltage, so it could be increased to 5.2V.

For the output connectors there where 5.5mm connectors used with screw lock, you don’t want by accident pull out one of the power supply cables. All the outputs have a 3A fuse.
Cables between the power distribution board are home made. To be honest they are half home made. Bought some thick (3A fast charging) usb to usb-micro cables from Ali and cut off the usb connector and mounted the 5.5mm plug.

The pcb’s are ordered from Jlcpcb.com. Good pcb quality, however they messed up the milling for the display, they forgot to subtract half milling diameter to the given dimensions so the hole is a bit to big. Complaining doesn’t help, it’s always the customer his fault. Next pcb I’m going to order my pcb from Elecrow.com again.

Pcb Front
Pcb Back
Up and Running
PlayPause
previous arrow
next arrow
 
Pcb Front
Pcb Back
Up and Running
previous arrow
next arrow

Doublelock Sensor

Sometimes you’re laying in bed and your are almost sure that the front and back door are on the doublelock, you ask your wife did you check the doors and she answers I thought you did that.
From that moment you can’t sleep because your not 100% sure you locked the doors properly with the doublelock. The only thing left is getting out of bed and go downstairs to check the locks, then they are always locked, but if you do not check if they are locked then the door is unlocked for the whole night.

A simple led in the Node-red dashboard on my phone or a physical led in the bedroom to check if the doors are locked and you can go sleep like a princess. Because the status of the doublelock is now known in Node-red you can do everything with it.

The mechanical part of those kind of projects is the biggest challenge. How can you measure reliable if the door is double locked. You can buy locks with a build in sensor, but then you have to adapt your door and/or door frame and bring a thick chequebook.
The lock I have is of the type (Dutch: 3 punts sluiting) 3 point closure lock, see picture. That means that the door is locked on 3 points for maximum security. The top and bottom lock hook is designed so they push the door towards the door frame for a tight closure. Those hooks will hook in a metal lock tray. When those hooks are out and making (electric) contact with the lock tray you are sure that the door is locked and on double lock.
So measuring if there’s an electrical connection between the hook and metal tray will be the best and easiest way to do this.

The idea was to use an of the shelf 433Mhz wireless door/window burglar alarm sensor and replace the reed switch with the “hook” and “tray” contact. Important was that this sensor can detect opening and closure, not all 433Mhz will send an unique code for both events. My choice was the GS-WDS07 sensor that you can find for example on Banggood. It runs on a single AAA battery, and this battery should last for at least 3 years, see below for my findings. The last digit of the code send by the GS-WDS07 will determine what the message is.

13F70A Open
13F70E Closed
13F707 Tamper
13F706 Low battery

As receiver for the 433Mhz signal I’m using a Sonoff RF-bridge with Tasmota software and Portischs firmware for the rf chip inside. With Tasmota it’s very easy to get all the data from the sensors in Mqqt and Node-red.

Installed the wiring and sensor, all works perfect. When the door is double locked the sensor led becomes green and if not locked the sensor becomes red.
However after using the sensors for 7 months, very rare the sensor stops working and you have to remove and reinsert the battery to get the sensor going again. This makes the sensor and the whole idea unreliable, you can’t trust the state of the indicator any more, bummer, still have to go downstairs to check the doors.
Because the sensor only sends data when the state changes, and that can be sometimes ones in 2 days, it’s hard to determine if the sensor is alive. I need something that will give “i’m still alive” message every x time. With this message you can make something simple in Node-red that will notify me when the sensor is off line.

After initial thought like making my own sensor with an ESP8266 or Avr with rf module, I came to the idea to use the unpopulated tamper switch of the GS-WDS07 sensor.
Activating the tamper switch every 15 minutes will send a code that we can use for this purpose.
To get this job done a Tiny45 avr processor with some software was added to the sensor, to save energy the avr had to draw a low current as possible. The Tiny45 draws only 4µA when sleeping with the watchdog timer enabled, adding this to the 36.8µA that the sensor was using, isn’t a big issue.
Internally the sensor runs on 3.3V, so giving the attiny45 some power isn’t also a big problem.
The tamper switch signal pin was internally pull-up to vcc, to activate the tamper signal this has to be grounded. The  Bascom code will wake up every 15 minutes and pull the tamper switch signal to ground for 50ms and goes back to sleep after setting the pin back as input to prevent energy use.

An AAA battery has a capacity around 1500mAH, the sensor can run 1736 days on this. However there will be now a “i’m alive” transmission every 15 minutes.  This transmission takes 1.4Sec and consumes 24mA peak. This is around 40µAH, add this up to the 40µAH the sensor was consuming and you can still run 868 days on 1 AAA battery. That’s fine with me. I love doing low power projects with Avr.

Developed the code in Bascom Avr, on of my favourite compilers that I’m using now for more then 20 years.
Made a little test setup with a dip version of the tiny45 on a breadboard, after writing and testing the code flashed it in a smd tiny45 and soldered that in sensor.

Job, done.

3 Point Closure
Wire connected to come
Come cabletray
Power used sleeping
Power used sending
Door cabletray
Sensor mounted
Modified sensor
programmingmcu
Develop setup
PlayPause
previous arrow
next arrow
 
3 Point Closure
Wire connected to come
Come cabletray
Power used sleeping
Power used sending
Door cabletray
Sensor mounted
Modified sensor
programmingmcu
Develop setup
previous arrow
next arrow

Used Bascom code.

'#####################################################
' Door sensor "is alive" hack
' EvertDekker.com 2020
' V1 20200531 Bascom 2082
' Thanks to EDC for the nice watchdog example
'#####################################################

$PROG &HFF,&H42,&HDF,&HFF' generated fuse bit settings. 
$regfile = "attiny45.dat"
$crystal = 1000000
$hwstack = 64
$swstack = 16
$framesize = 64

Config Portb = Input                                       'to Reduce Power , Setup All Pins As Inputs With No Pullups

Adcsra.aden = 0                                             'Disable a/d convertor
Acsr.acd = 1                                                'Disabel analog comperator
Didr0 = &H3F                                                'Disable digital input buffers on all ADC0-ADC5 pins
Prr.pradc = 1                                               'Power adc disable
Prr.prtim0 = 1                                              'Power timer0 disable
Prr.prtim1 = 1                                              'Power timer1 disable

Const Minutsleep =(15*60)/8.192                            '15 minutes * 60 sec / 8.192

Dim Sleep_cnt As Byte

Config Watchdog = 8192                                      ' ~8s"
Start Watchdog
On Wdt Wdt_isr Nosave
Enable Interrupts


Do

   If Sleep_cnt = 0 Then
      Sleep_cnt = Minutsleep                                 'Set counter back to start value
      Config Portb.3 = Output                               'PortB.3 as output
      portb.3=0                                               'Pull it low to activate the tamper input
      waitms 50
      Config Portb.3 = input                                'PortB.3 back as input to prevent energy use
   Else
      Decr Sleep_cnt
   End If

   Enable Wdt
   Config Powermode = Powerdown                            'Will go to sleep here

  'here uC will start after wake up

Loop

Wdt_isr:
 'dont enable Wdt here
Return
Nixie Clock #3

After my Nixie clock #1 and Nixie clock #2 it was now time for #3.

I still had laying around some IN-8 tubes that I bought a couple of years ago by mistake. The plan was to order IN8-2 tubes as spare for my Nixie #1 clock, but for some reason I didn’t read the specs good enough from the e-bay seller.

Nixie clock #1 did get his time update over the Joshua domotica network from the Tcp/ip gateway. This works perfect, however for the new design a stand alone time update would be nice, so no gateway but direct over wifi to a ntp server.
To accomplish this I was thinking about an Esp82666 or Esp32. The Esp8266 in the form of an Esp12 didn’t had enough gpio pins, so the Esp32 was the winner.

Major parts of the schematic is recycled from my first 2 nixie clocks. High voltage power supply, multiplexer and anode drivers are kept the same. The foot led lighting (I know some of you guys hate it) are this time rgb and to save some IO pins they are from the daisy chain type, the SK6812 in 3.5×3.5mm package. These leds requires 5V and the Esp32 requires 3.3V, so for these voltages I used ready made Tracopower switching step down regulators.

Pcb was designed in Altium and made by Elecrow. The design of the pcb is so that it will fit in the (old) enclosure of my Nixie clock #1, that’s why the pcb is for the biggest part empty.
Assembling the board was not that hard except for the SK6812 leds. Due the poor mechanical structure of the chip is hard to solder them. Hand soldering is not possible, even with the heat gun it was difficult because the melting point of the plastic was close to the melting point of the solder. I managed to get it done by applying solder paste to the pcb, preheated the board from the bottom with a pre-heater and finished the soldering with the heat gun. Working fast was a must, but due the preheating the time that the air gun needed to be hold on the led was very short.
The nixietubes are mounted in socket for easy replacement and mounting.

The software was written with the help of the Arduino ide and Esp32 core. Because the ESP32 doesn’t have a PORT like the Atmel cpu’s is harder to control the rows and columns. Normally you send the digit to the port and with the help of a mask the BCD to decimal decoder it’s easy to set pins from a port according the values for the digit. For the Esp32 it was necessary to control every pin individuality with DigitalWrite, have a look at code to see want I meant and how it’s done.
Multiplexing the tubes is better for the lifetime and easier for the power supply etc. Multiplexing the tubes with an interval of 2ms gave the best result, you don’t see the tubes flickering and they still give enough light. The Esp32 runs on FreeRtos the idea was to use a separate task for multiplexing and updating the tubes. It looked that this was working fine wasn’t it that it looks that sometime one of the tubes gave some more light. Measuring with the scope on the base of on of the drivers confirmed me that sometimes the interval wasn’t 2ms but 3ms. I tried almost everything, high priority, more stack etc. but the problem stays.
Time to go back to the drawing board and start over with the multiplex part of the code. This time I have used a hardware timer to update the display every 2ms so far it works flawless.

Last problem that need to be solved was that the time server was not working, at least not the provided sample from the Arduino ide. After some reading and experiments I noticed that is was working when you entered an ip address as time server, but not with a time server name. Adding dns server entry to WiFi.config solved this problem also.

Schematic
Bare pcb
High voltage (400V) power supply
Top view
Back view
Tube socket led detail
Tube leds
Tube socket
It's alive
It's alive 2
PlayPause
previous arrow
next arrow
 
Schematic
Bare pcb
High voltage (400V) power supply
Top view
Back view
Tube socket led detail
Tube leds
Tube socket
It's alive
It's alive 2
previous arrow
next arrow

Code can be found on Github

Altium designer 16 pcb files if you want to make your own.

1782 Downloads

Iot house exhaust air systems controller

First of all I’m going to explain what a house extractor is used for. Because our houses are very well isolated (here in The Netherlands at least) we need some air flow to get rid off the polluted air in house and get some fresh oxygen in. The polluted air consists meanly cooking smell, co2, water vapor from showering and exhaling.
To accomplish this we have an central extractor (mechanische ventilator for our dutch readers).

Normally the extractor is always running on low speed and with the help of a switch in the kitchen you can put it in speed 2 or 3. There’s no way to switch it completely off.
To let my Joshua domotica Iot (internet of things) get control of the extractor I designed this hardware interface. With this interface and the help of Mqtt and Node-red you can control the extractor and still use the original switch in the kitchen to control it.
In the design I used 3 solid state relays so it’s also possible to switch the extractor completely off. With the help of node-red the extractor will be switched off when nobody is at home and the outside temperature is <18°C and the humidity in the bathroom is below 85%. Why? When nobody is at home the central heating system is also switched to a lower temperature with the help of node-red and Toon thermostat. To prevent that the house was cooling down (fast) due the extractor is switched off because this was sucking off the warmth.

The Iot hardware interface was placed near the central heating system and solar collector it was also interesting to add some temperature sensors to measure different parameters and see what’s going on and eventually use this data in Node-red. 5 DS18B20 where added to measure these values.
The rest of the schematic is not that special the part regarding the mains is copied from my Iot light switch with mains input. Added a nice 1.3″ i2c o-led display for some feedback.
As you can see in the schematic and pcb there was also the plan to add 433Mhz receiver and transmitter to control the extractor with “klik aan klik uit”, however I don’t think this option is necessary anymore and leave it for what it is.

This was my first project that I use an ESP32 in the form of an Esp32-wroom32. The software development was all done in the Arduino ide and Sloeber ide.
What a lot of work was this.  Because the Esp32 Arduino core and a lot of used library’s are still buggy I had to do a lot of debugging, scrolling to Github issues, open new issues and finding new library’s. The Esp32 was giving me a panic handler ones in a couple of days, connecting the serial port to a computer to log everything helped me to solve this. Then after updating the Arduino esp32 core to version 1.0.0 there where again new problems. Most of them where related to the dual core’s that where not working probably together with some library’s. Now it looks like it all working stable.

Below a screenshot from Node-red where all the data and functions for the extractor are handled. At the top the sensor data is stored in a SQlite and Influx database. In the middle the Node-red dashboard is build and data query from the SQlite database and shown in charts.
Below that we have the control over the extractor speed with left and right connection to the Mqtt broker.
And in the bottom flow the status of the extractor will be stored in the SQlite database.

Here you can also see what amazing charts you can make with Grafana and Influx database.

Schematic
Finished pcb front
Finished pcb back
Ventilator
Finished mounted
Finished temperature sensors
Grafana charts
Nodered flow
PlayPause
previous arrow
next arrow
 
Schematic
Finished pcb front
Finished pcb back
Ventilator
Finished mounted
Finished temperature sensors
Grafana charts
Nodered flow
previous arrow
next arrow