YAHEF Remote Control

First a big thank you to @Hiorth brothers for the initial design. I have just modified the lid to host some buttons and a larger display.

My box is coming together and I will post an update quite soon but first I’d like to show some progress on the remote control. I have more or less control of all the components involved in the remote. The trigger is stable, the IMU gives me stable acceleration and angles in all directions, buttons are stable, display is showing something, communication to the VESC is stable, I can control the bluetooth unit, it’s waterproof. The battery and charger for the remote are not finished yet.

Brief description of how the remote works
The code runs in a tight loop of 10ms, meaning that one loop with all operations can use more than 10ms to finish. Right now, the longest loop time is about 2.3 ms, so still more than enough time to add more features. But how is it possible to only use 2.3 ms including updating the display? The answer is the Teensy 4.0, and DMA, Direct Memory Access. In short, it’s almost like that the display can be updated in a “separate thread”, also if you look at the benchmarks at Teensy® 4.0, you can see that it is a turbo boosted Arduino on steroids. The IMU is set up to use it’s internal DMP (Digital Motion Processor) to deliver filtered quaternions every 10 ms, so no heavy processing on the Teensy, just calculate the linear acceleration and Yaw, Pitch, Roll (angels) from the quaternions.

The remote has four main states. Startup, Standby, Connected and Running.
In startup, there is just a splash screen showing while the remote is initializing everything. Once everything is done, the state is changed to Standby.
In Standby, the buttons and the menu are available as well as switching between the different views. Every 100 ms, a message is sent over bluetooth to the receiver and checked for a reply. If a reply is received, the state is changed to Connected.
In Connected state, a request for values is sent every 100 ms to the VESC/YAHEF and the reply is parsed and shown on the the different views. Also, the menu option ‘Start Foiling’ is enabled. Once that option is chosen, state changes to Running.
In Running state, the menu is disabled and the remote starts sending trigger values to the VESC/YAHEF as well as requesting values every 100 ms.

Measure g-force from IMU. If acceleration in any direction is above for example 2G, the remote will stop the motor. The exact acceleration has to be tested out.
Start foiling menu option has to be chosen on the remote.
If trigger is not moved for 30 seconds i running state, the remote will fall back to connected state and no trigger values are sent to the VESC/YAHEF.

The code is no way near finished and I will release the complete code as soon as I can call it an alpha version but I have published a few test projects reflecting the electrical schemas further down.
There are more features to come, like cruise control, pop up messages and finish the started views. Perhaps also adding the GPS into the remote as an option, enabling VESC users to track the speed if someone requests that.

PLEASE!! I’m more than happy to get suggestions on either safety improvements or other features, data and views, so please help out…….

I have not built anything in the Arduino IDE therefore I can’t tell if it works in the Arduino IDE. I’m using Visual Studio Community Edition and Visual Micro to develop and build the software. Also the code is written for Teensy 4.0 and I will probably not work for any other devices, but still the code can perhaps be used as reference. In this early stage, the code will contain bugs.


Fusion 360


Parts List:
Battery from a portable phone charger from the local hardware store
Charger 5V no pin https://www.aliexpress.com/item/32816412117.html
Magnetic USB Connector https://www.aliexpress.com/item/32827864878.html
Micro USB Connectors https://www.aliexpress.com/item/32708056826.html
Hall Sensor https://www.aliexpress.com/item/32597268764.html
Magnets https://www.aliexpress.com/item/32764112694.html
Spring 20mm https://www.aliexpress.com/item/32863650976.html
JDY-18 Bluetooth Unit https://www.aliexpress.com/item/32888929812.html
MPU9150/6050 Gyro/Accelerometer https://www.aliexpress.com/item/2035920870.html
ILI9341 2.2 Inch Display https://www.aliexpress.com/item/33012793224.html
Tactile Switches 6mm Height https://www.aliexpress.com/item/32857436208.html
Silicone Switch Covers https://www.aliexpress.com/item/32803431368.html
Vibration Motor https://www.aliexpress.com/item/32849172232.html
Teensy 4.0 https://www.pjrc.com/store/teensy40.html
Resistors 100Ohm, 6.4kOhm, 15kOhm, 25KOhm
Transistors NPN2222, PNP3406
Heatsink tube

Screws M3 x 12mm plus nuts https://www.aliexpress.com/item/32841227345.html
Screws M1.2 x 5mm https://www.aliexpress.com/item/32873583197.html
Seal Ring 78.2mm https://www.aliexpress.com/item/32838978245.html
Acrylic Glass 2mm (Will be replaced by propper glass)
Epoxy Filler
Sand Paper
Spray Paint

In all, I estimate that it takes about 6 - 8 man hours to make the remote and perhaps a week in calendar time with printing, filler curing and paint drying.
I think most of the parts are self explaining but I think I need to mention a few words about the display. The trick is to peel off the white frame around the display, leaving you with only the display itself and some background plastics and cut the PCB around the pins. Then there is the acrylic glass, painted a black frame making only the pixels visible with help of two 3D printed helper-parts (included in the Fusion 360 link) to center the clear window. The display and the glass then goes into the lid.

Right now there is a birds nest inside the remote. As soon as everything is tested and implemented I will create a PCB

The breadboard images are the different parts broken out from the remote making it easier to follow.






Great work! Congrats!!!

Thanks Yahef I love it !!!

Will wait your pcb design then. Do you think we can already print the remote ? Or shall we wait till you finish the pcb’s ?

You did a really great work!

You can print the handle, that will not change for sure. The lid might change but on the other hand the lid is just 7 - 8 hours print while the handle is a good 24 - 28 hour print

1 Like

Nice! I suck at PCB’s and such. Any chance you’ll put some together for sale?

im already on it (i hope thats ok for YAHEF)

Wow! Amazing work!, very glad you found the remote casing to work!

how do you measure the volts and amps? and what is your base module?

Wich one you are using please? https://www.aliexpress.com/item/32816412117.html

Right now I’m only communicating with a VESC 6.6, so amp, voltage, rpm and so on is directly from the VESC. The speed is simulated (rpm / x).
Next step will be to communicate with the YAHEF Receiver, where I will have additional data like data from the BMS, various temperature/moisture sensors, amps from the water pump, GPS

1 Like

Ahhh, sorry. 5V no pin. Updated the first post

1 Like

So, i need an VESC. With my Flier ESC i will have no luck?

Well, I guess the Flier communicates by PPM and that is not a problem if you have a receiver board. You would then need some extra sensors to measure amp, voltage and so on

hm we should make something for measureing amps and voltage without the vesc esc

To messure amps you can use something like this.

Voltage is just a simple voltage divider.

I know but i need to attach this somehow with a module that can communicate with your remote

In due time, I will make the code for the YAHEF Receiver board available as well. Then you will have the API available for communication to the remote, it will be quite similar to the VESC API.
The amp meter I refer to has an analog output and will be easy to apply to the receiver


Great Job @YAHEF :+1: I love the way you fit that 2.2" display. Have you tested that display under direct sunlight? dattisheet doesn’t mention anything about luminance in the datasheet.

I might live on the edge when I’m just using a 100 ohm resistor connected to 5V and to the led pin, but it gives a quite bright display. That’s the way I’ve done in couple of other projects without any problems.
I’ll take a picture on a sunny day and post that.