<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Arduino on Codewrite Dev Doc</title><link>https://dev.codewrite.co.uk/categories/arduino/</link><description>Recent content in Arduino on Codewrite Dev Doc</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 27 Sep 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://dev.codewrite.co.uk/categories/arduino/index.xml" rel="self" type="application/rss+xml"/><item><title>Home Assistant UPS Mk II</title><link>https://dev.codewrite.co.uk/posts/2026-09-27-ha-ups-mk2/</link><pubDate>Sun, 27 Sep 2026 00:00:00 +0000</pubDate><guid>https://dev.codewrite.co.uk/posts/2026-09-27-ha-ups-mk2/</guid><description>&lt;p&gt;I decided to have an uninterruptible power supply (UPS) for my Home Assistant (running on a Raspberry Pi).
The design I came up with is shown below:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://dev.codewrite.co.uk/images/HA-UPS-mk2/PCB-Block-Diagram.png" alt="HA UPS Mk2 Block Diagram" /&gt;&lt;/p&gt;
&lt;p&gt;The input from the mains is supplied by a 15V AC to DC adapter (wall wart). This is shown as Vcc/Vss on the diagram above. There are two DC to DC converters, one that powers the Raspberry Pi and one that powers an Arduino Nano. The rPi converter is a LM2596 and the Nano converter is a smaller device (which says it can deliver 3A but it only needs to deliver about 20mA).&lt;/p&gt;</description></item><item><title>Debugging ESP32 S3 in VS Code</title><link>https://dev.codewrite.co.uk/posts/2026-09-19-esp32-s3-debugging/</link><pubDate>Sat, 19 Sep 2026 00:00:00 +0000</pubDate><guid>https://dev.codewrite.co.uk/posts/2026-09-19-esp32-s3-debugging/</guid><description>&lt;p&gt;Debugging is much better than littering your code with print statements for lots of reasons - which I&amp;rsquo;m not going to go into here. But setting debugging up is not always straightforward.&lt;/p&gt;
&lt;p&gt;To make things easier, I use an esp32 s3 board that had JTAG built into it. I found this article on the internet and loosely followed the instructions: &lt;a href="https://community.platformio.org/t/how-to-use-jtag-built-in-debugger-of-the-esp32-s3-in-platformio/36042"&gt;How to use JTAG built-in debugger of the ESP32-S3 in PLATFORMIO&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Home Assistant Serial Link to an Arduino</title><link>https://dev.codewrite.co.uk/posts/2026-02-27-homeassistantwithserialarduino/</link><pubDate>Fri, 27 Feb 2026 00:00:00 +0000</pubDate><guid>https://dev.codewrite.co.uk/posts/2026-02-27-homeassistantwithserialarduino/</guid><description>&lt;p&gt;The purpose of this project was to connect an Arduino Nano to the USB port that Home Assistant was running on. For me that is a Raspberry Pi 4 but this solution should work with any Home Assistant hardware. And the reason for using a serial connection over USB (rather than wirelessly with WiFi or similar) could be for many reasons:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Wifi may not be available (e.g. if the network is down)&lt;/li&gt;
&lt;li&gt;It is more secure&lt;/li&gt;
&lt;li&gt;It is un-jammable&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The ultimate plan for me was to create an uninterruptable power supply for Home Assistant from bits that I had:&lt;/p&gt;</description></item><item><title>Arduino Low Power Encryption</title><link>https://dev.codewrite.co.uk/posts/2020-08-19-arduinolowpowerencryption/</link><pubDate>Wed, 19 Aug 2020 00:00:00 +0000</pubDate><guid>https://dev.codewrite.co.uk/posts/2020-08-19-arduinolowpowerencryption/</guid><description>&lt;p&gt;&lt;img src="https://dev.codewrite.co.uk/images/ArduinoLowPowerEncryption/LowPowerEncryptionBoard.jpg" alt="LowPowerEncryptionBoard" /&gt;&lt;/p&gt;
&lt;p&gt;This was my experiment in creating a low power Arduino that can communicate wirelessly to a Raspberry Pi using an HC-12.
By low power I mean run for a couple of years on a 18650 battery. Encryption should be unhackable by today&amp;rsquo;s standards.&lt;/p&gt;
&lt;p&gt;I did a presentation for the Raspberry Pint group, &lt;a href="https://www.youtube.com/watch?v=aB-yj1D6h-8&amp;amp;t=164s"&gt;the video is here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The code is on &lt;a href="https://github.com/codewrite/ArduinoLowPowerWirelessEncryption"&gt;my Github repo&lt;/a&gt;.
I had to do some mods to the Arduino board to make it low power (removing the regulator and power LED resistor):&lt;/p&gt;</description></item><item><title>Arduino Default Libraries</title><link>https://dev.codewrite.co.uk/posts/2020-08-14-arduinodefaultlibraries/</link><pubDate>Fri, 14 Aug 2020 00:00:00 +0000</pubDate><guid>https://dev.codewrite.co.uk/posts/2020-08-14-arduinodefaultlibraries/</guid><description>&lt;p&gt;I used to think that the default libraries in the Arduino IDE would be the best available but having come across a couple of cases where this isn&amp;rsquo;t true I would definitely search for better lib libraries now&amp;hellip;&lt;/p&gt;
&lt;h2 id="what-libraries"&gt;What libraries?&lt;a class="anchor" href="#what-libraries"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;What am I talking about? Well the two that have better alternatives are:&lt;/p&gt;
&lt;h3 id="keyboard"&gt;Keyboard&lt;a class="anchor" href="#keyboard"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The reason why this didn&amp;rsquo;t work for me was because the BIOS on my desktop PC didn&amp;rsquo;t recognize the Arduino Leonardo as a keyboard. So I tried [the HID project][HID-Project] - which works flawlessly.&lt;/p&gt;</description></item><item><title>Generating sounds on the Arduino</title><link>https://dev.codewrite.co.uk/posts/2020-08-13-arduinoclassdsound/</link><pubDate>Thu, 13 Aug 2020 00:00:00 +0000</pubDate><guid>https://dev.codewrite.co.uk/posts/2020-08-13-arduinoclassdsound/</guid><description>&lt;p&gt;&lt;img src="https://dev.codewrite.co.uk/images/arduinoSoundClassD/ArduinoWAVPlayer1.jpg" alt="Arduino WAV Player 1" /&gt;
&lt;img src="https://dev.codewrite.co.uk/images/arduinoSoundClassD/ArduinoWAVPlayer2.jpg" alt="Arduino WAV Player 2" /&gt;&lt;/p&gt;
&lt;p&gt;This is a small project to read wav files from a micro SD card via an Arduino Nano and then play them directly to a loudspeaker.
I&amp;rsquo;ll state upfront that this isn&amp;rsquo;t the easiest way to do this (there are MP3 modules and libraries), but I wanted to:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Understand sound generation using a microcontroller from first principles&lt;/li&gt;
&lt;li&gt;Have some tools / ideas about how to generate sounds for any future projects&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;As an idea of the sort of thing I was thinking of - I&amp;rsquo;ve been thinking of a DIY &amp;ldquo;ring&amp;rdquo; doorbell. I already have a camera that can see anyone approaching the front door. A 433.92MHz receiver could detect when the doorbell is pressed (so no new doorbell required). A Raspberry Pi (i.e. the one with the camera) controlling it all and sending and receiving to my mobile phone. A lot more work than just buying a Ring doorbell - but a lot more satisfying!&lt;/p&gt;</description></item></channel></rss>