Posts

Arduino-based pill timer that makes phone calls

Image
In this article I will explain the operation and construction of a pill timer that can make phone calls via a cordless telephone handset. I will explain the individual parts of the device and explain the logic that controls the pill timer and telephone. Operation of the pill timer The pill timer connects to a keypad, an LCD, and a telephone handset. when the user powers on the pill timer, they must enter the current time using the keypad. To start the timer, the user presses tha "1" key on the keypad. The pill timer determines at what times the user needs to take their pills according to a schedule that has been hard-coded into the pill timer. When it is time for the user to take a pill, the timer will initiate a call to a pre-programmed number. Once the user has picked up, it will play a recorded message. Specifically, this recorded message is "It is time for pill box number" followed by a number. Schematic and explanation gEDA schematic file Memory chip T...

Software for identifying the ideal setup of a solar panel based on surroundings

Image
In this article I will present a program that can identify the most efficient angle of a solar panel, taking into account any objects that may cast a shadow on the panels. I will explain each step of the program. The source code can be found at https://github.com/mnigmann/solar Finding the sky The program takes as an input an image of a spherical projection of the surroundings, such as the image below: To identify the regions of sky, the program applies a Sobel filter, dilates the image, and applies a threshold. This causes regions where the color does not change much (such as the sky) to be black and regions where the color changes a lot to be white (such as trees, grass, buildings, etc.). For the above image: The user must then click on the regions of the image containing sky. Using the cv2.floodFill function, the program identifies the rest of the sky, as seen below: Finding the position of the sun The program calculates the position of the sun based on some formulas fr...

People counter made from discrete components

Image
In a previous article , I described how I created a people counter that used capacitive sensing. In this article, I will describe the operation of a people counter I made from discrete components that works on a similar principle. As described in the previous article, this circuit will contain two separate oscillators, with each one connected to a sense wire. However, in this circuit, one of the oscillators will be a voltage controlled oscillator (VCO). A frequency comparator will compare the frequencies of the two oscillators and tune the VCO so they match. Schematic and explanation gEDA schematic file Regulator U1 regulates the 12 volt input into the 5 volts needed for the logic gates. The capacitors C1 and C2 are actually placed near the power pins of U2 and U3. Reference oscillator (bottom left box) The reference oscillator oscillates independently of any other signal, except for the capacitance on the sense wire. The circuit is identical to the one described in the prev...

DC doorbell driver

Image
In this article, I will describe the need for and operation of a timer circuit when using a mechanical doorbell. This circuit switches the solenoid in the doorbell off after about a second and keeps it off even if the user continues to hold down the doorbell button. By switching off the solenoid, the power dissipation is reduced, preventing the solenoid from melting. Background My doorbell is not powered with an AC transformer, but from a 12 volt battery. The doorbell was recently damaged, most likely by the following prcess: The doorbell button got stuck in the closed position or was held down for too long. Since the solenoid has a resistance of around 6 ohms, the solenoid dissipated around 24 watts, causing it to heat up significantly. The plastic armature softened and compressed, causing the plunger to stick. The plunger heated up and melted the plastic tips on the plunger that would normally strike the bells. The spring that pulls the plunger back started to lose i...

PWM-based light dimmer/speed controller

Image
A few months ago I modified a window fan to use a light dimmer as a speed controller. I mentioned that at low speeds, a hum could be heard from the motors since the voltage fed to the fan was not a sine wave. I removed the speed control circuit built into the fan and replaced it with an external light dimmer. When the fan was running at full speed, it drew about 70 watts and had a near-100% power factor. However, as the dimmer was reduced to a lower setting, the motors got louder and the power factor dropped. In this article, I will describe a PWM-based dimmer that maintains a near-100% power factor no matter the speed setting of the dimmer. The schematic is shown below: gEDA schematic file | Link to simulation A 555 timer (U1) is used to generate the PWM signal and drive the gate drive transformer (T1). Suppose the capacitor C4 is charged at 1/3 Vcc. The 555 timer switches its output on, and the capacitor is charged through D4 and the upper half of the potentiometer. When the capc...

People counter based on capacitive sensing

Image
In this article I will describe the operation of a people counter that uses capacitive sensing. This people counter uses two sense wires to detect the motion of a person through a hallway or entrance. These sense wires are mounted vertically to the wall and sense when a person is close to the sensor. These wires are placed so that the person walks past one wire and then the other when entering the room and vice versa when leaving. The control circuit and microcontroller can determine whether the person is "close" to a sense wire, and this can be used to determine the direction in which the person went. An image of the setup I used is shown below In this image, the black parts represents a wall and the red part represents the door. The green and cyan crosses indicate the positions of the sense wires. If a person walks along the blue arrow, they will first be closer to the cyan cross than to the green cross, then closer to the green cross than the ...

Modified I²C receiver from discrete logic

Image
In this article, I will describe the operation of an I2C receiver built from discrete gates and components. The receiver has one register that can be read from and written to. Unlike other I2C devices, the contents of the register can be ORed or ANDed with another byte without reading and writing in separate transactions. The circuit described in this article is designed for slave devices that only accept data (for example, a motor driver) and do not return any data (for example, a temperature sensor). Modified I2C protocol Note: the protocol described in this section is not the same as the proper I2C protocol Clock signal (SCL) Unlike with true I2C, the clock signal SCL runs all the time. This provides all devices on the bus with a continuous clock signal. This allows other devices to transmit on the bus without having their own crystal or oscillator. Since the bitrate is 100kbps, but 200kHz is required for transmission, the two clock signals are mixed into one signal on one wi...