# Soviet generator, UD-25 engine, ignition using arduino

**URL:** http://forum.driveonwood.com/t/soviet-generator-ud-25-engine-ignition-using-arduino/7604
**Category:** Small Engines
**Created:** [January 3, 2024, 3:36pm UTC](http://forum.driveonwood.com/t/soviet-generator-ud-25-engine-ignition-using-arduino/7604 "2024-01-03T15:36:39Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![andris\_lv](http://forum.driveonwood.com/user_avatar/forum.driveonwood.com/andris_lv/32/51439_2.png) [@andris\_lv](http://forum.driveonwood.com/u/andris_lv)
#### Post date: [January 3, 2024, 3:36pm UTC](http://forum.driveonwood.com/t/soviet-generator-ud-25-engine-ignition-using-arduino/7604/1 "2024-01-03T15:36:39Z")

</div>

hello,  
i built gasifier a year ago ,but could not use it otherwise than just burning flare and heating workshop, because engine of the generator was missing magneto.

as solution i tried to use an arduino hooked to hall sensor and two ASIC ignition coil drivers.  
now the generator is putting out 2.5 - 3.5 kw of power, depending on gas quality.

here is link to the video of the generator running ))

[![](https://img.youtube.com/vi/nqinxsSu1po/maxresdefault.jpg "firewood to electric power - wood gas generator") ](https://www.youtube.com/watch?v=nqinxsSu1po)

---

<div class="post-metadata">

### Author: ![r\_wesseling](http://forum.driveonwood.com/user_avatar/forum.driveonwood.com/r_wesseling/32/30940_2.png) [@r\_wesseling](http://forum.driveonwood.com/u/r_wesseling)
#### Post date: [January 3, 2024, 5:17pm UTC](http://forum.driveonwood.com/t/soviet-generator-ud-25-engine-ignition-using-arduino/7604/2 "2024-01-03T17:17:33Z")

</div>

Hello Andris,  
This looks very good to me. I also want to build an ignition system. I have an old Briggs and Stratton generator. I want to be able to control the ignition timing. You told us about the Arduino, Hall switch, and ASIC coil drivers. That tells me a lot. But I would still be interested in in any more information you can tell us.  
Rindert

---

<div class="post-metadata">

### Author: ![andris\_lv](http://forum.driveonwood.com/user_avatar/forum.driveonwood.com/andris_lv/32/51439_2.png) [@andris\_lv](http://forum.driveonwood.com/u/andris_lv)
#### Post date: [January 3, 2024, 7:17pm UTC](http://forum.driveonwood.com/t/soviet-generator-ud-25-engine-ignition-using-arduino/7604/3 "2024-01-03T19:17:12Z")

</div>

hi Rindert ))

here is link to code, it is far from optimal, i guess, because i just took solar tracker control program i wrote earlier as base.

> **[aizdedze](https://www.dropbox.com/scl/fo/qcuc2rvoviewv34w4pg87/h?rlkey=lwyzy1az7oma8oincmfpu0jk3&dl=0)**
>
> Shared with Dropbox

it was convenient, because tracker program contained sort of user interface using rotary encoder and OLED display and provided easy way to change all sorts of parameters.

the hall sensor is latching type and there are two magnets embedded in aluminum fan on the crankshaft,  
one magnet at TDC turns hall sensor output to high state, second magnet which is placed 90 degrees prior to TDC turns hall sensor output to low state.

for driving the coils, i did use MOSFETS first, but they did not last long, because coils are creating terrible voltage spikes of all sorts in primary windings, IGBTs can handle them, but then again they need gate drivers to operate properly and that gate driver died when i tried to use IGBT. ))

the ASIC i use now is called VB525SP-E, it can be driven by arduino pin directly though 1k resistor, but i drive it through an optoisolator, because of voltage spikes mentioned above.

if you have more specific questions, i will be glad to answer ))

---

<div class="post-metadata">

### Author: ![r\_wesseling](http://forum.driveonwood.com/user_avatar/forum.driveonwood.com/r_wesseling/32/30940_2.png) [@r\_wesseling](http://forum.driveonwood.com/u/r_wesseling)
#### Post date: [January 3, 2024, 11:03pm UTC](http://forum.driveonwood.com/t/soviet-generator-ud-25-engine-ignition-using-arduino/7604/4 "2024-01-03T23:03:59Z")

</div>

Do you know a good place to buy VB525SP-E? It says STM doesn’t make them anymore.  
Rindert

---

<div class="post-metadata">

### Author: ![andris\_lv](http://forum.driveonwood.com/user_avatar/forum.driveonwood.com/andris_lv/32/51439_2.png) [@andris\_lv](http://forum.driveonwood.com/u/andris_lv)
#### Post date: [January 4, 2024, 4:51am UTC](http://forum.driveonwood.com/t/soviet-generator-ud-25-engine-ignition-using-arduino/7604/5 "2024-01-04T04:51:38Z")

</div>

i bought mine on Aliexpress.

---

<div class="post-metadata">

### Author: ![madflower69](https://avatars.discourse-cdn.com/v2/letter/m/ebca7d/32.png) [@madflower69](http://forum.driveonwood.com/u/madflower69)
#### Post date: [January 4, 2024, 8:09am UTC](http://forum.driveonwood.com/t/soviet-generator-ud-25-engine-ignition-using-arduino/7604/6 "2024-01-04T08:09:05Z")

</div>

It looks like Mouser has the ST VB325SPTR-E which i think is similar but I didn’t compare datasheets.

It looks like the ONSemi/Fairchild ISL9V2040S3ST might be similar and only $2.50.

---

<div class="post-metadata">

### Author: ![r\_wesseling](http://forum.driveonwood.com/user_avatar/forum.driveonwood.com/r_wesseling/32/30940_2.png) [@r\_wesseling](http://forum.driveonwood.com/u/r_wesseling)
#### Post date: [January 6, 2024, 6:48pm UTC](http://forum.driveonwood.com/t/soviet-generator-ud-25-engine-ignition-using-arduino/7604/7 "2024-01-06T18:48:09Z")

</div>

Thanks Guys,  
I have some really good info now. I think I’m going to try using a Raspberry Pi, just because I have one. And I want to use C language, just because I took a course in it.  
Rindert

---

<div class="post-metadata">

### Author: ![madflower69](https://avatars.discourse-cdn.com/v2/letter/m/ebca7d/32.png) [@madflower69](http://forum.driveonwood.com/u/madflower69)
#### Post date: [January 7, 2024, 5:19am UTC](http://forum.driveonwood.com/t/soviet-generator-ud-25-engine-ignition-using-arduino/7604/8 "2024-01-07T05:19:38Z")

</div>

the raspberry pi is an applications processor, the Pi Pico is a microcontroller. You are best served to use the microcontroller for timing specific applications. It is basically all about scheduling.

The .ino files he has posted are from the arduino IDE which are C/C++ and you can use the arduino IDE with the Pi Pico as well as many other microcontrollers. `  
That being said you might be able to get away with it on a newer pi and dedicate a single core to the application. Then the scheduler isn’t bumping the process to time share with something else. There is also real-time linux kernel, that you can use.

---

<div class="post-metadata">

### Author: ![andris\_lv](http://forum.driveonwood.com/user_avatar/forum.driveonwood.com/andris_lv/32/51439_2.png) [@andris\_lv](http://forum.driveonwood.com/u/andris_lv)
#### Post date: [January 7, 2024, 11:20am UTC](http://forum.driveonwood.com/t/soviet-generator-ud-25-engine-ignition-using-arduino/7604/9 "2024-01-07T11:20:23Z")

</div>

yep, MCU is more suitable than Linux system when exact timing is critical.

and one can write in good old C in arduino IDE.

just put your code into int main() instead of void setup() and void loop().

manipulating registers and timers directly instead of using arduino functions results in faster and more effective code.

---

<div class="post-metadata">

### Author: ![madflower69](https://avatars.discourse-cdn.com/v2/letter/m/ebca7d/32.png) [@madflower69](http://forum.driveonwood.com/u/madflower69)
#### Post date: [January 7, 2024, 6:25pm UTC](http://forum.driveonwood.com/t/soviet-generator-ud-25-engine-ignition-using-arduino/7604/10 "2024-01-07T18:25:02Z")

</div>

> [@andris\_lv](#):
>
> manipulating registers and timers directly instead of using arduino functions results in faster and more effective code.

I would change that to ‘MAY result in faster code’. Optimizers have improved considerably over the last decade. I don’t know if that has all filtered back to arduino, which uses an older version of the gnu compiler. but I suspect a lot of it has.

---

<div class="post-metadata">

### Author: ![r\_wesseling](http://forum.driveonwood.com/user_avatar/forum.driveonwood.com/r_wesseling/32/30940_2.png) [@r\_wesseling](http://forum.driveonwood.com/u/r_wesseling)
#### Post date: [January 8, 2024, 1:07am UTC](http://forum.driveonwood.com/t/soviet-generator-ud-25-engine-ignition-using-arduino/7604/11 "2024-01-08T01:07:01Z")

</div>

Wheew! Now I have a lot of studying to do. Thanks.

---

<div class="post-metadata">

### Author: ![abreaks](https://avatars.discourse-cdn.com/v2/letter/a/9e8a1a/32.png) [@abreaks](http://forum.driveonwood.com/u/abreaks)
#### Post date: [January 8, 2024, 3:49pm UTC](http://forum.driveonwood.com/t/soviet-generator-ud-25-engine-ignition-using-arduino/7604/12 "2024-01-08T15:49:36Z")

</div>

Most microcontrollers, including the Arduino, have hardware timers with interrupts. An interrupt allows you to “interrupt” the main program loop and run specific subroutines with precise timing. This is exactly what you would want for engine control. Programming an MCU is close to “bare metal” so you have the advantage of directing things exactly but at the cost of having to know exactly what should happen and how.

Raspberry pi is much easier to program but generally speaking, software timing is less precise especially with an operating system like linux doing its own work in the background. That said, an ARM chip like the rpi has is a beast compared with a typical micro controller. The overhead from Linux may be low enough it doesn’t matter.

---

<div class="post-metadata">

### Author: ![r\_wesseling](http://forum.driveonwood.com/user_avatar/forum.driveonwood.com/r_wesseling/32/30940_2.png) [@r\_wesseling](http://forum.driveonwood.com/u/r_wesseling)
#### Post date: [January 8, 2024, 5:23pm UTC](http://forum.driveonwood.com/t/soviet-generator-ud-25-engine-ignition-using-arduino/7604/13 "2024-01-08T17:23:03Z")

</div>

I will eventually want to control timing based on knock sensor feedback, like OBD2 systems. Will this Pi Pico allow me to do this? Maybe the Pi Pico H is better?

[https://www.sparkfun.com/products/17829](https://www.sparkfun.com/products/17829)

---

<div class="post-metadata">

### Author: ![r\_wesseling](http://forum.driveonwood.com/user_avatar/forum.driveonwood.com/r_wesseling/32/30940_2.png) [@r\_wesseling](http://forum.driveonwood.com/u/r_wesseling)
#### Post date: [January 8, 2024, 11:53pm UTC](http://forum.driveonwood.com/t/soviet-generator-ud-25-engine-ignition-using-arduino/7604/14 "2024-01-08T23:53:03Z")

</div>

Would this be a good optoisolator?  
[https://www.sparkfun.com/products/15105](https://www.sparkfun.com/products/15105)

---

<div class="post-metadata">

### Author: ![r\_wesseling](http://forum.driveonwood.com/user_avatar/forum.driveonwood.com/r_wesseling/32/30940_2.png) [@r\_wesseling](http://forum.driveonwood.com/u/r_wesseling)
#### Post date: [January 9, 2024, 12:02am UTC](http://forum.driveonwood.com/t/soviet-generator-ud-25-engine-ignition-using-arduino/7604/15 "2024-01-09T00:02:01Z")

</div>

Browsing [Sparkfun.com](http://Sparkfun.com) I found CO, H2, CH4 sensors. I could build a fuel gas analyzer. But some other time. 🙂

---

<div class="post-metadata">

### Author: ![andris\_lv](http://forum.driveonwood.com/user_avatar/forum.driveonwood.com/andris_lv/32/51439_2.png) [@andris\_lv](http://forum.driveonwood.com/u/andris_lv)
#### Post date: [January 9, 2024, 6:35am UTC](http://forum.driveonwood.com/t/soviet-generator-ud-25-engine-ignition-using-arduino/7604/16 "2024-01-09T06:35:26Z")

</div>

i think any opto coupler will do, i use sharp pc817.

also i forgot to mention flyback diode on ignition coil that helps to mitigate negative voltage spike, i use BYQ28E-200 fast diode.

---

<div class="post-metadata">

### Author: ![madflower69](https://avatars.discourse-cdn.com/v2/letter/m/ebca7d/32.png) [@madflower69](http://forum.driveonwood.com/u/madflower69)
#### Post date: [January 12, 2024, 5:56pm UTC](http://forum.driveonwood.com/t/soviet-generator-ud-25-engine-ignition-using-arduino/7604/17 "2024-01-12T17:56:26Z")

</div>

> [@r\_wesseling](#):
>
> I will eventually want to control timing based on knock sensor feedback, like OBD2 systems. Will this Pi Pico allow me to do this? Maybe the Pi Pico H is better?

I think the pico and pico H are essentially the same except the soldered on male pins on the H. They mention something about the debugging port but that is a hardware debugger so it is really low-level debugger to the point it is irrelevant for 99% of the pico audience. the W adds wireless networking.

How are you going to add a knock sensor or are you looking at a larger engine in the future? Are you looking at adding CANBus like ODB2 has as well? you can buy boards with the canbus chip on them, and they will connect either via spi or i2c buses to the chip. There are some development boards that have the canbus chip already on them which is why I asked.

I am asking in part because the arduino had issues with multiple cylinder engines, and the pico is faster but the m0+ series isn’t the fastest series of arm microcontrollers either. It is about the lowest budget controller with the current ARM designs. It is a good one for small projects and good to get your feet wet with. It isn’t really that hard to jump to a faster chip either even low level stuff should work on the m4 or m7/h7 series arm microcontrollers. They just add features like FPUs and faster/more clocks.

---

<div class="post-metadata">

### Author: ![andris\_lv](http://forum.driveonwood.com/user_avatar/forum.driveonwood.com/andris_lv/32/51439_2.png) [@andris\_lv](http://forum.driveonwood.com/u/andris_lv)
#### Post date: [April 19, 2024, 10:34am UTC](http://forum.driveonwood.com/t/soviet-generator-ud-25-engine-ignition-using-arduino/7604/18 "2024-04-19T10:34:46Z")

</div>

greetings ))

a new video of generator at work, charging solar battery bank  
intercooler is used for heat extraction from exhaust gases,  
also i installed an oxygen sensor, although it is just connected to  
a multimeter for now.  
it seems that this sensor is very well suited for ATMega 328 MCU, its  
output is between .02 and .85 volts, so it can be connected directly to an  
ADC pin, using MCU’s internal 1.1 volt reference voltage.

[![](https://img.youtube.com/vi/jRiLNll43e0/maxresdefault.jpg "charging solar battery bank using woodgas") ](https://www.youtube.com/watch?v=jRiLNll43e0)

i drilled a 2mm hole in the lowest point of intercooler in order to drain condensed water.  
it is squirting in bowl, as you can see in the video. ))

---

<div class="post-metadata">

### Author: ![spaco](http://forum.driveonwood.com/user_avatar/forum.driveonwood.com/spaco/32/28003_2.png) [@spaco](http://forum.driveonwood.com/u/spaco)
#### Post date: [April 20, 2024, 4:03pm UTC](http://forum.driveonwood.com/t/soviet-generator-ud-25-engine-ignition-using-arduino/7604/19 "2024-04-20T16:03:34Z")

</div>

For those interested in open source Arduino -based engine controllers, check out this guy.  
Google “Josh Stewart Speeduino” or:

> **[Bot Verification](https://speeduino.com/home/about/overview)**

## Pete Stanaitis
