ESP8266 bubble machine
After receiving multiple sugestions that a nodemcu would be better, I went and ordered a couple of ESB8266 boards. My reasons for picking up these instead of something from Arduino is posibility to use Python and the price.
The main construction is the same as the one with Raspberry pi except for upgraded battery pack made from old laptop cells.
Front | Back |
---|---|
The ESP8266 has been partially sealed in a shrink tube to make it look less messy.
The program running on the ESP8266 is written using MicroPython which is close to regular Python
1import machine
2import time
3
4
5servp = machine.Pin(4)
6servo = machine.PWM(servp, freq=50)
7relay = machine.Pin(16, machine.Pin.OUT)
8
9relay.value(0)
10wand = 40
11
12while True:
13 wand = 40
14 servo.duty(wand)
15 time.sleep_ms(200)
16 for i in range(47):
17 servo.duty(wand)
18 print(wand)
19 wand +=1
20 time.sleep_ms(25)
21 time.sleep_ms(200)
22 relay.value(1)
23 time.sleep(2)
24 relay.value(0)
25 time.sleep(1)
26
The diagram I have which I made using Fritzing
Connection diagram |
---|