My current fun project is a controller for our small familiy aquarium (fish tank) we bought last christmas.
The light for the aquarium was 20 years old and I decided to replace it with LED stripes. Since the LED stripes I bought were far too bright I started to build a controller based on a raspberry pi with a B4J software to dim them. This controler can currently be used to slowly dim on and off the light. Since I have 3 LED stripes, two white ones and one RGB, it is possible to create very realistic surise and sunset simulations and even a nice moonlight. It is planned to develop the software further to support cloud simulations etc.
The Hardware:
The whole thing is based on a raspberry pi. The LED stripes can be dimmed with PWM so I first tried to use jPi4J library with software PWM. I was not satisfied with the result because the LED stripes were flickering because the software pwm uses a very low PWM frequency. A test on the hardware PWM port of the raspberry pi was much better. So I decided to order the ADAFruit 16 channel PWM board for the raspberry pi which has 16 hardware PWM channels. This board uses the i2c bus to communicate with the pi so I had to write a small wrapper library to access it easily.
This is the Raspberry pi with a custom built LED driver module and the Adafruit PWM board. I can currently use 6 of the 16 PWM Channels but I only need 5 so far (1 for each white stripe and 3 for the RGB):
Here you can see the LED stripes:
The whole project "in use":
I can't show much of the software because it is in an very early state. I started with the controller part which now can smoothly dim the LEDs between any value. In the moment schedule times are hardcoded in the B4J program so I could use the controller as early for the aquarium as possible.
Currently I'm working on the user interface which is done with ABMaterial. So if all is finished it will be possible to control the Aquarium lights with every web browser even from the smartphone.
The first idea was to use MQTT for cummunication with an B4A app. Maybe I will do this later so I can check the status of the lights even if I'm not at home. But that are future thoughts.
So I can only say that the B4X products are absolutely great and very flexible in its usage.
The light for the aquarium was 20 years old and I decided to replace it with LED stripes. Since the LED stripes I bought were far too bright I started to build a controller based on a raspberry pi with a B4J software to dim them. This controler can currently be used to slowly dim on and off the light. Since I have 3 LED stripes, two white ones and one RGB, it is possible to create very realistic surise and sunset simulations and even a nice moonlight. It is planned to develop the software further to support cloud simulations etc.
The Hardware:
The whole thing is based on a raspberry pi. The LED stripes can be dimmed with PWM so I first tried to use jPi4J library with software PWM. I was not satisfied with the result because the LED stripes were flickering because the software pwm uses a very low PWM frequency. A test on the hardware PWM port of the raspberry pi was much better. So I decided to order the ADAFruit 16 channel PWM board for the raspberry pi which has 16 hardware PWM channels. This board uses the i2c bus to communicate with the pi so I had to write a small wrapper library to access it easily.
This is the Raspberry pi with a custom built LED driver module and the Adafruit PWM board. I can currently use 6 of the 16 PWM Channels but I only need 5 so far (1 for each white stripe and 3 for the RGB):
Here you can see the LED stripes:
The whole project "in use":
I can't show much of the software because it is in an very early state. I started with the controller part which now can smoothly dim the LEDs between any value. In the moment schedule times are hardcoded in the B4J program so I could use the controller as early for the aquarium as possible.
Currently I'm working on the user interface which is done with ABMaterial. So if all is finished it will be possible to control the Aquarium lights with every web browser even from the smartphone.
The first idea was to use MQTT for cummunication with an B4A app. Maybe I will do this later so I can check the status of the lights even if I'm not at home. But that are future thoughts.
So I can only say that the B4X products are absolutely great and very flexible in its usage.
Last edited: