Advertisement

Pendulum

Not rated 15,164

#pendulum #PIC microcontroller #endless swing #small PIC #educational
Pendulum
Pendulum

Description: This project aims to create a pendulum that swings indefinitely. It is a personal interpretation of a concept that has been explored in various forms previously. The project utilizes a small PIC microcontroller, which offers flexibility in substituting traditional components such as transistors and logic gates. The signal at TP1, connected to the coil, is crucial; selecting the appropriate magnet and coil generates sufficient voltage to activate a digital port of the PIC, with a peak voltage of 3V observed. The PIC conserves power by sleeping for extended periods, activating for only 10 milliseconds during each semi-cycle. The "Wake on input change" feature restarts the program whenever the magnet passes over the coil. At TP3, a pulse is generated to trigger a transistor, providing a kick to the pendulum. A PNP transistor is employed for high-side driving of the coil, requiring a negative pulse. The PIC10F222 operates within a 2 to 5.5V power supply range, with the digital input threshold varying according to the supply voltage. There is a direct correlation between the input signal amplitude and the swing amplitude, necessitating faster oscillation for larger swings due to the constant period of the pendulum. The induced electromotive force (EMF) in a circuit is proportional to the rate of change of magnetic flux, as described by Faraday's Law of Induction. The amplitude of the signal at TP1 indicates the effectiveness of each kick, which gradually increases until equilibrium is reached. Various schematics are available online, some utilizing sensors to detect the pendulum's approach to the coil, while others employ dual coils for sensing and actuation. This project prioritizes simplicity, with the microcontroller remaining in a low-power state most of the time to conserve battery life. The circuit is straightforward, designed on a perfboard with minimal external components, and the majority of the wires below the board serve to connect ICSP and test plugs. After programming and testing, these can be removed to save space. The underlying principle mirrors that of early electromechanical clocks, where a balance wheel, equipped with permanent magnets, is driven by a coil through a simple electronic circuit. The electric pulse synchronizes with the balance wheel's period by detecting the magnets, creating an energy-efficient oscillating system powered by a battery rather than a spring. The basic gear mechanism remains consistent with traditional clocks. The fascination with such simple mechanisms has led to a collection of magnets and coils for this project. Inspiration was drawn from a 2009 article in Nuts & Volts by Tony Gasparovic about a pendulum driven by transistors, igniting the desire to develop a unique system using a microcontroller, as the use of transistors alone would not contribute significantly to the learning experience.

The circuit design primarily focuses on the interaction between the PIC microcontroller and the pendulum mechanism. The PIC10F222 is programmed to monitor the input from the coil, generating a digital signal whenever the pendulum swings close enough to induce a voltage. The selection of the coil and magnet is critical, as it determines the induced voltage that can trigger the microcontroller. The use of a PNP transistor allows for efficient switching, ensuring that the coil receives the necessary current to produce a magnetic field that pushes the pendulum.

The schematic should include the PIC microcontroller connected to the coil via the PNP transistor, with appropriate resistors to limit current and protect the microcontroller's pins. A capacitor may also be incorporated to smooth out any voltage spikes generated during the operation. The input from the coil should be routed to one of the general-purpose I/O pins of the PIC, configured to detect rising edges.

The design should also consider the power supply arrangement, ensuring that the circuit can operate effectively within the specified voltage range. A bypass capacitor across the power supply pins of the PIC will help maintain stability during operation.

Overall, the project embodies a balance of simplicity and functionality, leveraging modern microcontroller capabilities to enhance the classical concept of a pendulum clock while minimizing components and maximizing efficiency.This project is almost useless, I want just to realize a pendulum that swings endless. Nothing more. No use at all. This is not an original project but my version of a project of the past century, already seen in many different ways on the Net. This is my first time with a so small PIC. It`s very interesting. It can be used for a lot of different situations, substituting transistors, logic ports, NE555 and so on with a lot more flexibility. To the left, the signal at TP1 (see schematic diagram ), at the coil. Choosing the right magnet and coil, the voltage is enough to trigger a digital port of a PIC (a peak of 3V in this picture), no ADC is used. In this way the PIC can go sleeping for a long time between pulses, it works just for 10ms for each semi-cycle.

The "Wake on input change" feature restarts the program every time the magnet passes over the coil. At TP3 we have the pulse that triggers the transistor for a new kick to the pendulum. I have used a PNP transistor to have a high side driving for the coil, so the pulse must be negative. The PIC10F222 works fine in the 2 to 5. 5V power supply range. The high level threshold for a digital input is related to the power supply. With 3V power supply we can see that the trigger starts when the voltage at GP1 rise above 1V. With a 5V power supply it needs an higher lever and therefore more time to start. There is a direct relationship between the amplitude of the input signal and the amplitude of the swing.

Because the period of the pendulum is constant, for a larger swing (more distance to travel) it needs to run faster (V = S/t). The induced electromotive force (EMF) in any closed circuit is equal to the time rate of change of the magnetic flux through the circuit (Faraday`s Law of Induction).

So, you can know if the kick is correct looking at the amplitude of the signal at TP1, it increases slightly at every cycle until it reaches the equilibrium. There are a lot of different schematics on the Net. Someone uses a sensor (Hall effect or optical) to reveal when the pendulum is approaching the coil, someone else uses two coils, one as a sensor and one as an actuator.

There are also some circuits with MCUs (Atmel or Microchip) with additional sensors or using an analog port to read the coil voltage. In my optimization mania I want to Keep It Simple as much as possible. Furthermore (in order to satisfy goal #3) the MCU must go sleep most of the time to save batteries. As the picture shows the circuit is very simple even on a perfboard. No quartz, very few external components. Most of the wires below the board are to connect ICSP and test plugs. Once programmed and tested they can be removed from the schematic saving even more space. Do you remember the first kind of electromechanical clocks Have you ever "deeply examined" one of them I did.

I have destroyed. hem. examined someone of them during my childhood. The basic theory is the same I`ve used. The balance wheel has permanent magnets and it is driven by a coil with a very simple electronic circuit. The electric pulse to the coil is synchronized with the balance wheel period by sensing the magnets. In this way we have an oscillating system that requires a very little amount of energy to keep moving.

The power is provided by a battery instead of a spring. The rest of the gear mechanism is the same as a traditional clock. I have always been fascinated by this kind of extremely simple mechanism. I`m collecting magnets, coils and everything that can be useful to realize it since a long time. My interest was re-awakened by an article published on Nuts & Volts of September 2009 by Tony Gasparovic about a pendulum driven by two transistors: I`m not alone! Which circuit may I use None of them of course. I want my own system, using something more sophisticated like an MCU. Using one or two transistors doesn`t add anything to my experience. The configuration fuses sets internal

Related Circuits