Powering a Nixie Tube from USB with a 10¢ RISC-V, the CH32V003
Вставка
- Опубліковано 30 вер 2024
- Running a Nixie Tube off USB with a software-defined flyback power supply running on the CH32V003 RISC-V microcontroller.
Console Font: audiolink.dev/
Patreon: / cnlohr
ch32v003: github.com/cnl...
cnixxi: github.com/cnl... (Look in the firmware and nixitest1 folders)
Cool. That's the only thing I can say. Man, you are one of the few truly "Full stack" developers. Now we know that, in adition to all your knowledge, you are not afraid of analog electronics.
I learned a TON From Sam Ben-Yaakov lectures. You should totally check him out on youtube.
@@CNLohr now I will
There is no such thing as digital electronics. I never *saw* so much analog circuit analysis as in my "digital electronics" course in engineering.
@@stickyfox You do all the analog engineering of digital circuits so the code running on it doesn't have to deal with it (except things like the flyback control code here).
@@gblargg That's kind of the flip side. People get so wrapped up in math and signal processing they forget that a processor can generate an AC waveform too! It's good to keep the fundamentals in mind.
I was _actively_ in the middle of having a breakdown over power supply design being a gap in my knowledge base, and _you upload _*_this._* 😂
You should watch a bunch of Sam Ben-Yaakov lectures on youtube. That's how I became comfortable with power supply design.
You almost tempted me to buy a set of nixie tubes, very cool project.
A well written HAL doesn't need to be resource intensive by the way, the vendor supplied ones usually are though.
There is the law of leaky abstraction. No matter how careful or well thought out a HAL is, it will always be a net loss.
Your creations are amazing as always, truly an inspiration for engineers :D
Thanks! I try.
Years ago I found a nice single transistor oscillator design that worked with a centre tapped primary transformer, using an smallish audio coupling transformer from an old radio on a 12V supply there was enough HV transients coming out to light a neon bulb. I then added a nixie tube etc, and had a really simple single digit nixie counter.
The nixie is, apart from a diode, directly driven from the transformer, no limiting resistor required.
I can run my thumb under the nixie & 7441 decoder driver with no tingles etc, something unthinkable when using a conventional 200VDC supply and limiting resistor.
Currently the 7441 is driven by a 7490 decade counter (This thing was built 20+ years ago) for a single digit counter. Lately I've been toying with the idea of replacing the 7490 with a micro from an Arduino etc, so I can make it do something a bit like yours, and also drive the inverter instead of it being self excited, so I can stop the HV and blank the display, a function not available from a 7441, as doing so in a conventional 200V setup would see its outputs raise way too high for the chip (This is why most retro nixie devices have a pile of always lit leading zero's)
Pity I cannot post a pic of it in the comments.
You can always make a youtube video about it. I'd watch!
Oh look I'm in the video 👀
Thanks so much for all the guidance.
“CH32V003? You wouldn’t be able to afford it.”
There's an unsoldered-looking pin on the header at 8:50 :P
Just so everyone can breath easy, it is soldered. It just didn't wick all the way through.
This is so cool, usually to try to control these tubes people try to make you buy ancient chips that aren't made anymore. I have 8 of the tubes you have pictured here that would love to be used for some kind of display. I definitely need to see how to get my hands on these boards/the parts for them.
I have my kicad projects on git!
The K155ID1 ic for controlling nixies is actually still being manufactured in one single factory
@@apo_chromatic Now if only I could find one in a QFN package.
@@CNLohr Fair, though they do exist in SOIC-16
Very cool extra helpful info guys, good to know that there is still a chip that can do it, I had just remembered some kind seemed hard to get last time I looked into it a few years ago, maybe I was thinking of an older kind.
This project is so cool though, such a compact high voltage supply design compared to others. Love this project a lot!
Did you measure the gamma of the tube for the dimming? With LEDs, i find that i have to keep in mind that the human eye is non-linear when doing fading.
I did not. But realistically, I only have about 8 bits of dynamic range. Any gamma curves should be applied by the users of the nixie, instead of by the ch32v003.
@@CNLohr I may have to add dithering just because. ;)
cool, the chip even has a configurable IO rise time so you can slow it down to prevent EMI issues. Super duper useful these days, and missing on many cheap controllers.
I love these little buggers.
This is a really nice little Nixie driver project! If you wanted to make the HV supply inherently safe if the control loop fails you could add some kind of voltage clamp across the HV node, like a zener diode or something else that avalanches at around 200 volts. You could even use this to reduce the drive, say feed it into a BJT that pulls down on the HVCTL and shunts the drive, although this would risk bringing the FET out of saturation and increasing its dissipation, but I suspect an equilibrium would be rapidly established that could be designed to be tolerable continuously as the current limit is mostly set by the transformer inductance and pulse width.
I have wondered if I was naturally hitting the reverse conduction voltage with my existing diode. I was toying with using a 200V diode, to push that reverse conductance even lower. If I can tailor my supply to leverage that, it would be even cooler! I try to avoid having any extra components in my designs that I can. And, things seem safe enough considering how much I had to do to try to overvolt the supply anyway.
@@CNLohr yeah that would work, also the drain source breakdown of the switch fet but that would be a low voltage because of the transformer ratio.
@@vk2zay Is it safe to use the VGS breakdown of the switching FET? I thought that would permanently damage the FET.
@@CNLohr depends on the FET, some power fets are specified explicitly to allow it and the datasheet has limits for it. However in general 1st breakdown isn't damaging as long as the dissipation isn't excessive, so as long as the current is limited so the drain current limit isn't violated and the IV dissipation doesn't overheat the device it can probably tolerate it indefinitely.
@@vk2zay Interesting. I will look into it more. But these are some lame chinese datasheets 😕
That thumbnail caught my attention, I saw it initially on twitter and clicked on the video immediately. Brilliant project.
Thanks!
Very cool, especially the 5 being an upside down 2. But I’m surprised that the RISC-V core lacks a multiply instruction, even bottom-level ATtiny chips these days (e.g. tiny202) have hardware multiplication. But in basically every other respect it’s a great replacement for an ATtiny. The CH32V103 seems to be more inline with what I’d expect from an entry-level 32-bit MCU, like the RP2040 or bluepill or ESP.
Be interesting to see if CH32Vs or GD32Vs (or ESP32C3s) become the mainstay of RISC-V in the hobby space. I hear some allow direct programming through USB without needing a boot loader like how the RP2040 does, which would go a good way towards making them more accessible to noobs. Not sure if you can also do debugging though, not that debugging has ever been accessible to noobs. I gotta look into getting a GDB workflow up and running.
The core, in spite of its lack of multiply is still VERY capable. At 48MHz, and 32-bit for math operations it is more than capable enough for most projects - so long as you don't burn all your perf in HALs.
And indeed, the 103 and 203 are along those lines.
Side-note: Bitluni and I have talked about writing a USB-bootloader for the 003!
Couldn't care less about glowing symbols, but the rest of the project is a joy to witness.
You really succeeded in making boring common project like nixie display to be packed with intriguing details.
Any time you look at anything, when you try to simplify it you find beautiful symmetries and properties of reality.
Insane
What is that header you're using for the nixie leads? I'm having trouble finding one of the correct size.
This is great! Thank you so much for sharing! Just wondering if is there any way I can purchase some of those boards?
Deep dive into code please- liked ,subscribed , and commented!
Way past my skill level, but that's a really nice project. The PWM ramp between segments is amazing!
I know! Spirit knew what they were doing!
Thats redonkulous
Or juust right?
The CH32V203 seems just a bit easier to work with for not much more cost. EG has hardware multiply...
the upcoming 002, 005, 006 and 007 all have a hardware multiplier.
Very cool, man. I gave you a RISC-V shout out in the comments on Dave's video. Not surprised that you'd seen that video.
I'm really glad he found and showed off the parts.
Hi
Thank you for sharing this project, I ordered pcbs for the nixies and the esp32 host. Could you upload a basic code for the esp32 nixie host so I can test drive the nixie pcbs?
it's just my programmer at esp32s2-cookbook/ch32v003programmer
Looking forward to seeing the finished clock.
This is truly amazing, like the rest of your projects, I wonder what you'd do with unlimited funds, you look like the kind of person that has everything he needs and if he doesn't he'll create it.
Even with unlimited funds, I'd find a way of doing everything cheaply.
you would be well suited for mass manufacturing of consumer electronics
I didn’t see any snubber across the primary of the flyback transformer - I suggest that one be used, whether a diode or RC or combination.
Should not be needed. There's enough clearance on the FET and it has enough Coss to be that snubbing capacitor from leakage inductance.
nice apple
What is this in reference to?
How much power is required to power one of these? I'm wondering how many nixies you could be powered from a single USB
My PSU uses about 300mW. Only about 300mW actually goes into the tube.
Add a crystal oscillator to keep reasonably time since it doesn't have the ability to sync from the internet.
I may do that, but with an external ESP32-S2
Can i buy the ch dev board made by you from somewhere? Thank You!
The idea was I wanted to make them for my patrons. But I suppose I can get them made elsewhere.
I'm interested in buying some as well. That or the schematic.
@@steffenthorhauge9549 i think I'm gonna subscribe to Patreon as i love his content and i wanna suport him and if i get the chance to buy one , I'll do , if not I'll wait for the dev boatd i got from china
Great video. You got a new sub in me.
Nice project, i was working on something similar based on a MAX1771, @CNLohr do you know of the nixie chess set. The one that exist that i know off uses wireless energy but i think this cost effective solution combined with a battery would be a nicer solution. You can even go really fancy and add some position tracking of the chess pieces and let an esp track the game over the wifi's.
The magic of the CH is you can programmatically adjust voltage, current, compensation, and all sorts of other properties without any extra components! That is very cool, though! I had not heard of the nixie chess set til now.
And why need an ESP? You could totally let each one of the CH32V's have a signature that is indicated by patterns of current draw so when it is over a charging cell, the host processor could see which part is where!
@@CNLohr I was thinking of using the esp to send the game over internet e.g. remote play. Does chatgpt support chess yet? :)
You did some amazing work here.. Thank you for sharing!
Thanks!
hey can those tiny transformers can be use for vfd display's fl?
They probably could.
This is great. Now I can drive the nixies I can't afford.
Apparently there are cheaper sources for them yet!
How much current will that little powersupply be able to provide?
Only about 4mA @ 180V before it gets really inefficient.
You point out a transformer IC but it sounds like you drive the FET from the MCU, so what does the transformer do?
The transformer both acts as an inductor to be the boost AND provides a 10:1 voltage multiplier.
@@CNLohr Ooooh! Silly me I realise now. It's because the bottom side with the visible windings are whats in the screengrab from LCSC so when you pointed to it on the PCB I thought it was something else, like a SMPS IC of sorts.
This thing does 0.7A and up to 500V?! There are so many of these old display tubes you could power with this. So thanks a ton for showing this!
Would love to put a couple of these in my computer to replace the mobo code display
Do ett
insane video! ❤
Isn't RISKV open source too? I see a big rise on open source software and hardware adaptation as of the last 5 years.
The ISA is open. There are some open cores. But most of the cores are still closed (which is OK) because the tooling is all still free.
what about powering a vfd?
Totally possible, but for now, I think it's time for me to go back and visit some more projects.
Insane
Wow what a great project, would love to see code deep dive, I am looking at codebase for/on CH32V003fun and it's pretty dense... You know a lot of tricks and short cuts!
Make sure to sub and ring the bell, then you'll see if/when I do the deep dive!
the hv control code makes my head hurt. i'd have done that in hw with a smps ic etc.
So much extra wasted hardware.
@@CNLohr chip count is about the same really, look how full power supplys in led lights are now just one 6 or 8 pin IC. I'm not knocking your design the software is way above what I would want to choose to do for such an important task as accurately maintaining a critical supply that could toast the project, but I would feel confident doing it on the PCB because I have more knowledge in that area.
Nice thumbnail photo.
Thanks!
Sweet. I look forward to watching the rest of your videos.
This is really awesome! Have a sub! :3 If you do make a clock, it's be a great DIY project to replicate if it can be safely done, I've looked at Nixie stuff before and it's always insanely expensive. Plus it could be fun to build something yourself. Look forward to more cool shenanigans! To anyone reading this comment, Have a lovely day!
I think it will just be for me but whooo knowwws.
LOL the initial warning after I had to run screaming from your desk to avoid your demonstration of how it "barely tingled" if you touched it
A day or two later, I got hit hand-to-hand by accident and WOW did that hurt. So much worse than 170V in the palm of your hand.
Congratulations!! Please allow us to use these Nixies on Arduino framework of the ESP32 as a library or something.
My hope is I want to make it so they "look like" WS2812's so you can just use the basic WS2812 libraries.
Very Cool Project. Do you have the dev. Board and the programmer available? Although I am not a patreon member but would like to get this board to try it. I am in the US.
I do - bleh. I am set up to handle things through patreon. You could just do $1/video and I'd send it. No need to stay. If you really don't like patreon, I could consider a kofi?
So, we can have, say, CPU usage indicator on Nixies.
Absolutely could make it!
Many moons ago I made bought a few old stock nixie counter racks with 12 nixie tubes in each rack. Then I build a nixie clock using regular ttl logic, a bunch of transistors and a custom transformer. I would love to use this project to drive a new 6 digit nixie clock with the rest of the tubes I still have lying around.
No time like the present to get started
Prob this would work for a magic eye tube also. Use the adc for sampling the magic eye measurement.
I agree. I haven't gotten a chance to play with any of them.
Im way too dumb for this. Cool project though, seems pretty amazing for the seemingly simple components to do this at such a high voltage?
You are done, not when there's nothing left to add to your project. But when there's nothing left to take out.
Wow found you via Sammy K's channel. Your content is amazing! Who does those boards again?
Do you mind sharing the link?
Love this! 💙⚡
I got these made via JLCPCB.
Link to board design is indescription.
@@CNLohr you sir are incredible. Thank you 🏆
@@CNLohr I've used them for a few projects they're pretty awesome. I use PCBway for flexible boards.
@@repairstudio4940 they're great!
What font are you using in your Notepad++ config? It's really interesting and I've never seen it before.
AudioLink Console, available from audiolink dot dev.
how do you drive the individual cathodes of the nixie? do you have 10 individual low-side fets or is there some sort of multiplexing going on?
I do have 10 fets. But they're about 5c ea
Well done, thanks for all the work you've done to get this awesome little mcu off the ground and out of the HAL framework that consumes such a massive amount of resources!
Be sure to spread the knowledge and viewpoint about EVTs/HALs and show people the beautiful way.
Okay, that's super cool. Why are you not calling them nixels?
Nixels I like that one!
That made me sub
Suuuuper helps the algo
Those PCBs look like they were routed with topor
They were not. I hand routed everything.
@@CNLohr nice! I love PCBs that don't follow the grid...
Would you share a link to those nixie tubes you found on AliExpress?
Aliexpress links expire quickly, and youtube doesn't do well with links in comments :-/ But if you look for a bunch of IN12 tubes I am sure you can find the listing that I found that sells them in pairs for $20.75/pair.
nice octopus!
Thanks!
Phenomenal work 👍
Thanks
I must've watched the bit about turning the IIR into 3 instructions about 5 times trying to work out how it works, because boy do I need to do something similar for my driver project I'm working on because it runs WAY too slow and no divide to do regular RMS averaging.
I'm tempted to just throw the code in and see if it works, but I'd also like to understand how it works, so I'll know if it's actually going to help my application
I've played around with it a little, for some reason I had to add an extra right shift 1 to the filtered value to make it in range, but it is smoother than raw. Cool as
Yes. You will need to right-shift your output if you want it to be less OOR than the typical input. The way the shift-iir works is to inflate the size of the filtered value.
@@CNLohr Ah, That explains why it was coming out so high, I like it, I'll see if I can figure out how to implement it in my code next, thank you
Can you pretty please design these boards for the round style Nixie tubes?
Which one? IN-4?
Nerd bait
Guilty as charged.
Thanks!
I appreciate the tip. Contact me directly and I can give you a dev board.
I'm def stealing this, but iirc "dynamic" driving - pulsing the display harder but shorter to reduce total energy going through - is recommended just as it is for LEDs for longevity
Totes a thing you can do with this!
Not with nixies. If you're pulsing it to normal operating current, then it's fine, but compensating for PWM with higher drive currents will definitely cause cathode poisoning.
Great design
Great walk-through of the process
Thanks for sharing your expirence with all of us 👍 😀
I do a lot of projects, just hard to make time to make YT vids!
Suuuper cool
Thanks!
A lot of these ИН-12 lamps were produced in the USSR. They are common and cost us 1$ apiece.
Any chance you could collect up a few hundred and mail them over here?
@@CNLohr If there are no problems with sending the parcel and transferring money now, then maybe. I don't know about the package, but the transfer of money will definitely be problematic.
@@CNLohr Try to find out if it is now allowed to send electronic components to you from Russia and how much the delivery will cost.
@@Ruth_Asada Maybe give it another couple of months... 😕
@@CNLohr Write as in there will be ideas. I'll stay in touch.
Love this. Curious though, why is your audio favoring the right side?
I've been recording in stereo recently.
I have greatly enjoyed and been inspired by all your content. Thank you
Thanks!
Very cool, this looks like a much better driver for my IN18 clock than the expensive HV switching chip from TI I have now. Two questions: did you document the control loop somewhere? Does it require a PID or something simpler? Why does your interface to the chip require microsecond accurate timing, is it because of the SWI? Can't we use something simple like UART to interface with it?
The PID is overkill. I will likely switch it for a PI + expectancy or just P + expectancy loop.
Can't use UART with current firmware but it isn't hard to add that as a feature. You can just copy&paste the single file header to access the debug registers as it stands. But I do intend to continue to develop them.
@@CNLohr Great, thanks for responding. I think I2C would be even better. Then we would only need a single bus to communicate to the controllers and would make it scalable from 2 to perhaps even 8 digit clocks. I am looking to built this project soon so I will look into that
@@pietheijn-vo1gt good point!
@@pietheijn-vo1gt yoo, if you get I2C working on it, that would be so cool. I'm very new to the scene of electronics, but I'd be happy to learn from you if you get it working :D
I would love to see whatever people can come up with to apply to some sort of project. You're projects always bring a new angle for me to see things from.
I would love to see as well!
@@CNLohr I'd love to see a nixie clock design with this technique for example. Maybe something crazier, who knows? lol
Magnificent
Thank you! Any interest in one of the dev kits I mentioned in the video?
@@tomashubelbauer Send me an email and I can try!
Excellent video 👍 Thank you 🙂
Thanks
Really enjoy these videos/projects.
Thanks! I still do a lot of them but they rarely get to youtube.
Great project and thank you for your effort. 👏
Thank you!
6:08 lol is that diagram copy pasted from a stm32 reference manual ?
These chips (and their tooling) seem to be heavily "inspired" by STM32
and that's a good thing :D
well, for everyone apart from ST micro.
The peripherals are subtly different. The principles are similar. But these Chinese parts (GD, PY and CH) fix a lot of the rough edges that ST left. Things that ST did poorly they really improved upon.
This is sweet...
Thanks
This is awesome! I have some of the same nixie tubes! Would love to see a follow up on this on controlling them via an external microcontroller like an esp32. How did you learn how to build the boards? I would love to be able to have access to these tiny components and not have to solder them myself.
If I do, maybe by then I will have the boards for sale too!
I would love to get a few of these if you ever do sell the boards, I have a few sets of Nixie tubes that aren't doing anything so it would be great to use them.
@@user-jb2le9el3x Are they IN-12 or IN-15's or a different size?
@@CNLohr IN 12 rings a bell, I am pretty that's them
excellent as always.
Thanks!
I have no clue what a "CH32V003 from WCH on EEEBlog" is... So I guess that "WARNING" was for me :/
Nice!!!
Thanks!
This is awesome. I'm glad this got recommended to me
Glad it did too! Did I get a sub?
@@CNLohr Yes! Of course! I just watched some of your videos and it is mind blowing how you come up with some of the stuff. I will adapt some of your ideas to my own projects
@@maksgrabowy9842 That is my biggest hope!
nice :D
Thanks
The font you are using in Notepad++ looks gorgeous. What is it called?
audiolink mono (or audiolink console) depending on the flavor you want. It's at audiolink dot dev.
$10/pc is a bad price for IN-12, good price is $5/pc or less, aliexpress has bad nixie prices
Got any links with better prices?
Have you tried shopping for tubes since _the war_ started? idk about you, but literally all my sources for cheap Soviet surplus nixie and VFD tubes were in Russia and Ukraine. 😬
@Bakamoichigei yes, buying from ukraine is safe and easy tho
@@nobodynoone2500 youtube shadowbans links in comments
Can you reach out to me directly with someone I can email to get some of them? I am lohr85 ǣ gmail.
I want more videos like this. I‘m literally watching this video the 6th time because I enjoy it that much. Are there more small youtubers with that in depth hardware videos???
What is missing in my other videos? Like what made this video so cool to watch?
@@CNLohr I think it‘s the Quality. I‘ve watched many of your videos but this one stands out in terms of video and sound quality as well as video editing. Also the Thumbnail is insane and I really like how you are presenting your projekt. You did a really good job in explaining the technologies, without going into too much detail about the implementation.
I love projekts with PID controllers, low level programmed microcontrollers and power converters. The fact you designed your own PCB particulary stands out because other youtubers mostly connect breadboards while you really understand what you are doing. Not only in software you are complete genious but also your Hardware knowledge is insane.
I would love more Projekts like these.
I recently tried to control a Piezo atomizer with a transformer, to build up an oscillator circuit. A microcontroller is needed to drive the other side of the coil to put energy into the system. Maybe this project would be something for you. In the Internet, there are virtually no tutorials about how to do it with an LC Oscillator circuit and a PWM signal.
Have a nice day!
Niklas
hi! i was curious, your channel description says christ is your light. so are you religious? or is it just a joke
I am, quite so. I came to Christ when I was 24, and He really turned around the direction of my life.
After seeing those tiny transformers and learning the operation, what comes to my mind is a USB killer. Given the transformer size, you can get a stealth killer that just looks like and has the size of normal USB drive.
Too much for my tiny brain.. how did you learn all this?
Slowly, over a long time. And by being conscious about my interests and directing them, instead of being blown around. Being careful to limit my time playing games or watching media. And being sure that as I do consume media it directs me in a direction I want to go.
I stumbled here and I feel so dumb.. so very dumb. plz help😿
d'you make custom bluetooth controllers from wired ones on etsy perhaps?😭
I do not.
@@CNLohr that's cool, I thought your video was interesting tho😸
180 volts ? (1.21 jigga watts) 😂😂😂
More like 450 mW ;-P
@@CNLohr I did hear you. say 180 volts though right (hence the warning). Thats what you use that tiny transformer to step up to ?
@@JohnoScott Yep!