Clever way of starting-up relays discussed in this app note from Maxim Integrated. Link here
Relays are often used as electrically controlled switches. Unlike transistors, their switch contacts are electrically isolated from the control input. On the other hand, the power dissipation in a relay coil may be unattractive for battery-operated applications. You can lower this dissipation by adding an analog switch that allows the relay to operate at a lower voltage.
Another app note from ON Semiconductors on using PWM technique to reduce power consumed when latching mechanical relays. Link here (PDF)
Integrated circuit driver circuits often use relay loads in their application. Output drivers are a source of power dissipation on the IC. Latching relays can be used to keep sustaining load current at a minimum by engaging and removing drive current, but a PWM system can also preserve reduced power conditions by engaging and reducing duty cycle using standard type relays.
By considering the Maximum Turn−On Voltage and Minimum Turn−Off Voltage specifications typically quoted in the relay electrical specification, your system design can utilize a signal to pull−in and activate the relay followed by a reduced power PWM sustaining signal.
The project we are introducing in this article wants on to take on that task by creating, through dedicated connections, the possibility to remotely control your entrance gate, your fish tank, the garden lights, the watering system and so on, using numerous examples. It is an ethernet-controlled relay board, which can be used as an actuator to directly control 220 V loads, to command 0V ÷ 5V digital signals or to read the status of digital or analog inputs; everything can be done remotely by using an Internet capable LAN.
If you are an audio enthusiast and if you have multiple audio systems and speakers, you may definitely need to have a speaker selector switch. These switches allow you to route a audio signal through a switching system and distribute it to various speakers. Using this listener can select single amplifier – speaker combination through the switch. We mainly design this switch to share our speaker system with multiple audio amplifiers. We design this switch to handle 6 stereo audio channels.
See the full post on his blog here. Project files are available at Github.
Today’s project, ESP32lights, is a smart device based on the esp32 chip.
Thanks to ESP32lights you can turn a load on and off (I used it for my christmas lights)
based on daily schedules
based on the light intensity
ESP32lights connects to your wifi network, can be configured and operated via a web browser and it’s optimized for mobile devices (responsive web interface based on jQuery Mobile).
The heart of ESP32lights is the Lolin32 Lite devboard by Wemos. One of its digital pins is connected to a relay module, which controls the load. Two digital pins are assigned to the first i2c controller of the esp32 chip and are connected to a BH1750 light intensity sensor. All the elements are powered by an HLK-PM01 module by Hi-Link, which directly converts the mains’ 220V AC to 5V DC without the need of any external components:
All the components are placed in a waterproof enclosure, to be able to use the device outdoor:
If everything is ok, when you connect to the serial console of the devboard (make monitor) you should see the following output:
ESP32light publishes an HTTP interface you can use to set the schedules or the light intensity threshold or to manually turn the load on and off.
You can open the web interface connecting – through a PC or a smartphone -to the address http://<esp_ip> (the IP address of the board is displayed in the serial output as shown in the previous paragraph).
The interface has 3 tabs, one for each working mode:
The page footer displays the actual working mode and the relay status:
In this short video, you can see how the device works:
I developed the firmware for ESP32lights leveraging what I explained in my previous tutorials about the esp32 chip. If you follow my blog, you probably understood that I really like the divide et impera method, that is divide a complex project into small, simpler tasks.
All the configuration settings of ESP32lights (actual working mode, start and stop time…) are stored in the NVS partition of the flash memory, as I explained in this tutorial. In this way, it’s possible to keep them even if the chip is restarted:
The different elements of the web interface (html page, css style sheets…) are stored in an SPIFFS partition. In a previous tutorial you learned how to prepare the image and, in your program, get its content:
The setup phase is completed after having configured the BH1750 light intensity sensor. This sensor offers an i2c interface and therefore can be connected to one of the two i2c controllers of the esp32 chip as shown in this tutorial. In my program I included a driver developed by pcbreflux.
Finally, this is how the web interface works. The interface is made by an html page (index.html) which uses jQuery to perform AJAX requests to the server and update the different page elements. You don’t need to enter the page name in the browser because of the http server automatically performs a redirect to it if the default page is requested:
This is my first time designing a PCB for MSP430. I really like the NRF24L01+ booster pack but I would like something smaller to use for remote temperature sensors. With that in mind I’ve designed a 24.5 x 50 mm PCB (2 on a 5×5 cm prototype) featuring MSP430G2553 and an adapter for a 8-pin NRF24L01+ module using essentially the same pinout, with the intention of using the Spirilis library. There’s a jack socket to connect a 1-wire sensor (e.g. DS18B20), a 4-pin header to connect a temperature/humidity sensor (SHT22 or similar), a programming header that gives serial access, and 3 other general purpose I/O pins.
The time for putting up festive lights all around your house is nigh, and this is a very popular time for those of us who use the holiday season as an excuse to buy a few WiFi chips and Arduinos to automate all of our decorations. The latest in this great tradition is [Real Time Logic]’s cloud-based Christmas light setup.
In order to give public access to the Christmas light setup, a ESP8266 WiFi Four Relay board was configured with NodeMCU. This allows for four channels for lights, which are controlled through the Light Controller Server software. Once this is setup through a domain, all anyone has to do to change the lighting display is open up a web browser and head to the website. The creators had homeowners, restaurants, and church displays in mind, but it’s not too big of a leap to see how this could get some non-holiday use as well.
[Wolf] came into possession of an Extech power supply that wasn’t quite in working order. It has been used in battery manufacturing and was fairly corroded. He was able to fix it but found there was an issue with the power supply that wasn’t a defect. By design when you turn off the outputs, the voltmeters read zero. That means you can’t adjust the voltage to a known value without turning on the outputs. Sure, you ought to disconnect things before you adjust, but you can only hope you’ll remember.
At first, he tried to use the existing output control switch, but that really cut power. Instead, he turned to a small microcontroller board usually used for servo control. He added a few nice looking pushbuttons to the front panel. There was plenty of room in the enclosure to mount the controller board and four relays. You can see the final result in the video below.
You can guess the rest. The micro is able to read the controls, set the power supply, and switch the outputs off without killing the metering. This required some major mechanical surgery on the output terminals, by the way. In addition, the micro monitors the voltage output with an analog to digital converter and stores state when the power is dropping out. That way it can restore things on the next power event.
[Wolf] did eight videos covering each step of the process. You can find the result in the video below, but be sure to watch the ones that lead up to it as well.
I had a small project going on–never mind exactly what–and I needed to detect a magnet. Normally, that wouldn’t be a big problem. I have a huge hoard of components and gear to the point that it is a running joke among my friends that we can be talking about building something and I will have all the parts we need. However, lately a lot of my stuff is in… let’s say storage (again, never mind exactly why) and I didn’t have anything handy that would do the job.
If I had time, there are plenty of options for detecting a magnet. Even if you ignore exotic things like SQUID (superconducting quantum interference device) there’s plenty of ways to detect a magnet. One of the oldest and the simplest is to use a reed switch. This is just a switch made with a thin piece of ferrous material. When a magnet is nearby, the thin piece of metal moves and makes or breaks the contact.
These used to be common in alarm systems to detect an open or closed door. However, a trip to Radio Shack revealed that they no longer carry things like that as–apparently–it cuts into floorspace for the cell phones.
I started to think about robbing a sensor from an old computer fan or some other consumer item with a magnetic sensor onboard. I also thought about making some graphene and rolling my own Hall effect sensor, but decided that was too much work.
I was about to give up on Radio Shack, but decided to skim through the two cabinets of parts they still carry just to get an idea of what I could and could not expect to find in the future. Then something caught my eye. They still carry a wide selection of relays. (Well, perhaps wide is too kind of a word, but they had a fair number.) It hit me that a relay is a magnetic device, it just generates its own electromagnetic field to open and close the contacts.
I picked up a small 5 V reed relay. They don’t show it online, but they do have several similar ones, so you can probably pick up something comparable at your local location. I didn’t want to get a very large relay because I figured it would take more external magnetic field to operate the contacts. You have to wonder why they have so many relays, unless they just bought a lot and are still selling out of some warehouse. Not that relays don’t have their use, but there’s plenty of better alternatives for almost any application you can think of.
The Fridge Test
I got home and pulled a rare earth magnet off the refrigerator and grabbed an ohm meter. Sure enough, I could reliably operate the relay contacts with the strong magnet. My project was in business!
Of course, your mileage may vary. The construction of any particular relay may or may not be conducive to external activation. You may have to experiment with the exact magnet, but those are easy to find in lots of local outlets, including home improvement and hobby stores.
The Mother of Invention
When you are cooking, sometimes it helps to know that you can substitute one thing for another. The same is true of electronic components. Need a bridge rectifier? Make one out of diodes. You can probably substitute an op amp for most comparator applications. LEDs can detect light and speakers can act as microphones although in both cases the results are not as good as parts that are supposed to do those functions.
I do think it is interesting, though, that Radio Shack has such a blend of odd things. You can get a lot of Arduino shields, for example. You can also get a lot of relays. However, I noticed there was only one MOSFET in the cabinet and it wasn’t a “logic level” FET. Seems like it would be like going into an office supply store and finding PCs and carbon paper, but no LCD screen wipes.
Regardless of Radio Shack’s ability to keep up with the times or not, I was glad they had relays. When you are looking to scrounge something in a hurry, don’t forget to think about auto supply places, home improvement stores, craft stores, and even dollar stores — I’ve seen a one-dollar, open-door detector before, but I knew from a previous attempt they have the sensor integrated with the electronics and are hard to scrounge.
Postscript: After I completed my little project, while looking for something totally unrelated, I ran across this homebrew reed switch. Certainly another option.