Author Topic: Modding an aquarium LED controller with an ESP8266  (Read 728 times)

0 Members and 1 Guest are viewing this topic.

Offline zensilenceTopic starter

  • Newbie
  • Posts: 2
  • Country: us
Modding an aquarium LED controller with an ESP8266
« on: March 03, 2020, 03:20:02 am »
Hi Folks!

Long time viewer first time poster :D

I have done hobbyist electronics for a while now but mainly building my own projects. I have never modded an existing board before. Below is the LED touch control board from my Aquarium. The buttons are contact touch pads and it cycles between several patterns of the LED array.

Button 1
On / Off if tapped once
5 levels of increase or decrease of brightness if held

Button 2
Each Tap Cycles the light pattern
1 Full Daylight
2 Afternoon Light
3 Full Daylight
4 Moon Light
5 Red

942680-0

The two interesting IC's on the board are:

BS802B - Contact Touch Controller
I think all this does is debouncing and delay then forwards the signal to the main micro controller
Data Sheet: https://pdf1.alldatasheet.com/datasheet-pdf/view/320430/HOLTEK/BS802B.html

8S103F2P6 - Microcontroller
The number is hard to read on this one but I'm pretty sure its this one
Data Sheet: https://www.st.com/resource/en/datasheet/stm8s103f2.pdf


I have the code written for the ESP8266 and tested with a single LED's just for debugging.
My questions are:

1) I have no idea where to attach the ESP8266 output pin to.
2) Should the output pin be high or low to activate the circuit.
3) I don't really know if I should link the grounding pin from the ESP8266 to this board.

Im pretty sure I can remove a lot of these chips and just control this with a relay but ideally i want the original buttons to still work for manual control and I don't know if the IC has some custom logic to control which pattern of LEDS lights up.

Thanks in advance for any input or comments :)
« Last Edit: March 03, 2020, 03:21:33 am by zensilence »
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7007
  • Country: ca
Re: Modding an aquarium LED controller with an ESP8266
« Reply #1 on: March 03, 2020, 08:35:26 am »
Welcome to the forums!  :)  I think your project should be fun and I did a cheesy sketch of something that might be a starting point.

One problem is the aquarium LED controller board runs off 5V and the ESP8266 is a 3.3V MCU. So you need to not mix and match signals without using a level-translator.

You can see the Touch sensor IC has two open-drain outputs, which means you could add your two ESP8266 output connections to the aquarium LED controller MCU by using a pair of extra N-ch mosfets such as BSS138. So both could get along (ESP8266 and touch buttons) and control things.
I would also add a RESET output so you can reset the LED MCU because if the aquarium MCU gets out of sync, i.e. someone touches a button then your code does not know this happened - unless you also want to add hardware to read the touch buttons to follow.
Possible I/O assignment:
ESP8266_GPIO4 to assert button 1
ESP8266_GPIO5 to assert button 2
ESP8266_GPIO14 to assert MCU reset
Outputting a logic 1 (pulse) would turn on the mosfet which pulls down (to 0V) the STM8 MCU signal to assert it. All three are active low, meaning a logic 0 activates that line on the STM8. This is just from looking at the PC board and guessing how they did it.

I would confirm the LED power supply is properly isolated from AC mains and has extra capacity if you want to use it to also power the ESP8266. I guess it is maybe 9V or 12V which is too much so you need something to lower it to power the 3.3V ESP8266. If the aquarium LED/MCU power supply is properly isolated from mains (it should be) then you can tie the two circuit GND's together.
It's just that some really cheap aquarium LED setups use a "mains capacitive dropper" power supply which is not safe to connect to. It depends on how many LED's there are.
 
The following users thanked this post: zensilence

Offline zensilenceTopic starter

  • Newbie
  • Posts: 2
  • Country: us
Re: Modding an aquarium LED controller with an ESP8266
« Reply #2 on: March 04, 2020, 04:32:32 am »
Thank you floobydust for the quick and detailed response!

I can't seem to find a though hole package for the BSS138 some googling seems to say that the 2N7000 might be an option and easy to get off amazon even if they are on the expensive side
https://www.amazon.com/FAIRCHILD-SEMICONDUCTOR-2N7000-CHANNEL-MOSFET/dp/B00M1GP3X0

Quote
One problem is the aquarium LED controller board runs off 5V and the ESP8266 is a 3.3V MCU. So you need to not mix and match signals without using a level-translator.
I was planning on powering the ESP off its own dedicated power supply rather then tap into the controller. Would it be easier to tap into the controller power?

There are a fair amount of LEDs run by this board its a salt water aquarium for growing corals so they are fairly beefy also. It has two independent power supplies that both feed into this board you can see the mains lines coming into the board on the bottom right corner one set of red and white wires for each power supply.

I will see what numbers and voltages I can read off them when I get home.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf