I was thinking about making sailing my boat on my own just a little bit easier as i'm getting lazy. I recently stripped the engine out of it and swapped it for an electric motor, some batteries and some wires. then converted the sailing boat to an electric sailing boat. I will upload the full project on my boat at some other time.
Pics of the boat:
Any way, the controller for the motor is throttled by a tiny 0 to 5 volt signal provided by a Potentiometer circuit at the moment. I thought I would keep that circuit and add one on top of it as well for wireless control of the motor.
For ease of designing the circuit I tested on my E-bike as it was less wet for the first test circuits. It will also add onto the E-bike throttle (hall-effect sensor) without having to replace the throttle just splice it into to the signal wires one on the +ve and one on the signal wire.
I powered the board via a separate battery pack for the test and just spliced the two wires coming out of my board in to the throttle cable.
As a side affect, this device means if anyone ever steals your bike and your in range you can make them accelerate at an in opportune time and make them fall off.
The program uses a PWM signal from the board D0 pin that the web server updates the properties of.
I designed a very simple circuit to smooth and couple the signal to make it work with controller throttle inputs.
You can remove the LED and short across the pins if necessary as it may inhibit full throttle depending on you method of powering the WeMos board.
When the board is up and running the program sets up a WiFi access point called bike.
Password: 12345678
You can sign into the network on you phone or computer (whatever you want) after.
When signing in to the network on some phones you have to wait for a little (about 20 seconds) a message pops up message saying there is no internet. Do you want to continue. You must press yes before you can access the WeMos web page on some phones, phones are silly.
Once connected to the WIFI open a browser on your device and type 192.168.4.1 into the address bar. A slider will appear that is all slide your finger across the slider and release to select your desired speed.
Also in the code in the serv1 arg on the HTML lines I have used the command onchange=\"this.form.submit() which updates the throttle whenever you let go of the slider on the phone. there is a chance you might get "oninput" to work instead of "onchange" if you want a smooth slide response but its tricky getting the browser to respond fast enough on your phone.
Also if you copy and paste the code instead of downloading it remember the HTML code wont work unless its all on one line I did it like that because its simple like that.
Comments