BlueCore Tech Command Center: Arduino Robot, Cooling and Relay Control

by vandenbrande in Circuits > Arduino

26 Views, 0 Favorites, 0 Comments

BlueCore Tech Command Center: Arduino Robot, Cooling and Relay Control

Command-Center-video-still.jpg
Arduino Command Center | Talking Robot, Fan Cooling & Relay Timers | BlueCore Tech

Hello world! Today i made a BlueCore Tech Command Center with an OPEN-SMART Rich UNO R3 and an LCD4884 joystick shield!


This is my tested v2.5 project: a little talking desktop controller with an animated robot, clock and date, temperature display, manual or automatic fan cooling, two relay outputs with countdown timers, and saved settings. Everything is operated with the joystick. The built-in MP3 player gives the menus and robot their voice.


This guide covers the hardware, exact pin assignments, important DIP switches, SD SoundPack, firmware, and every menu. The supplied sketch is the final version used here. This is not voice recognition or an internet-connected assistant: the robot plays recorded phrases from its SD card.


Watch the demonstration, then follow the steps below to build your own. By Danny van den Brande — BlueCore Tech.

Supplies

aa1ca5cf-90bb-46f2-aca3-0bae31459d64.png
7a3e85ad-b8ea-4606-994a-16dee2176b96.png
5064bdaa-dfeb-4c57-8602-1a8a9a3e7cad.png
a477093e-9e14-40c9-a867-b2e7f81a721c.png
703b3a09-6bc9-48b3-903a-f4fced255ee5.png
b79a79f9-5439-4220-8c0d-ca1aac872c4b.png
f624a842-0a3c-4f3a-9929-ce7e03fb2192.png

• OPEN-SMART Rich UNO R3 (ATmega328P / Uno-compatible), with its built-in DS1307 RTC, LM75 temperature sensor, TM1637 display and serial MP3 player.

• LCD4884 Joystick Shield V3.A, 84 × 48 pixels.

• Two-channel 5 V relay module with active-LOW inputs.

• Logic-compatible MOSFET switching module, as pictured.

• Three-wire DC fan: power, ground and tachometer. The described build uses a 12 V fan and a matching external 12 V supply.

• Speaker compatible with the onboard MP3 amplifier; approximately 8 Ω / 1 W for this build.

• microSD card for the MP3 player, FAT32, up to 32 GB; card reader.

• USB cable, jumper wires and suitable connectors for the fan supply and loads.

• Computer with Arduino IDE and Arduino AVR Boards support.


Software: the attached v2.5 sketch, TM1637 by Avishay Orpaz, RichUNOMP3 support files, and the BlueCore SoundPack linked in Step 6. Wire, EEPROM and SoftwareSerial come with the Arduino AVR core.


Check the voltage printed on your actual fan. The parts illustration includes a fan with a different label: do not feed 12 V into a 5 V fan. Match the supply to your real fan and recalibrate the usable speed range if your hardware differs.

What the Command Center Does

The main menu has eight entries:


1. ROBOT MODE — animated face and 32 shuffled recorded phrases.

2. CLOCK — time from the onboard DS1307.

3. DATE — date from the same RTC.

4. TEMPERATURE — DEVICE and offset-adjusted ROOM readings.

5. COOLING — manual fan level or temperature-based automatic control.

6. RELAY CONTROL — two independent outputs with countdown timers.

7. SYSTEM STATUS — three information pages.

8. SETTINGS — volume, room-temperature offset and display brightness.


The four-digit display normally shows the time. On the temperature screen it shows the room estimate; on the cooling screen it shows the fan percentage. Settings are stored in EEPROM. Relay states and running countdowns are not restored after a reset.


The challenge was sharing a small Uno's pins and memory between the LCD, joystick, sound, sensors and outputs. The following pin map and switch settings are part of the working design.

Configure the Rich UNO DIP Switches First

Disconnect power before fitting the shield or changing wiring.


The Rich UNO's built-in peripherals share pins with the LCD4884 shield. Disable these connections using the board's SIGNAL ON/OFF switches:


• IR receiver on D2: OFF.

• Touch inputs on D3, D4, D5 and D6: OFF.

• Onboard knob on A0: OFF.

• Buzzer on D9: OFF.


Keep the MP3 connections on D7/D8, four-digit display on D10/D11 and I2C devices available. Follow the signal labels on your board rather than assuming every revision has identical DIP numbering.


The A0 knob conflict is easy to miss: it can cause phantom joystick presses or a menu that moves by itself. Touch and IR conflicts can interfere with the LCD. D9 is now the fan output.


This firmware does not separately control the LCD backlight. D7/D8 are reserved for MP3 communication. Do not add backlight-control writes on those pins. Also do not add tone() or noTone(): timer/interrupt conflicts with the RichUNO IR sources can produce a duplicate __vector_7 linker error. Use recorded beeps through the MP3 player instead.

Wiring and Exact Pin Map

BlueCore_Tech_Command_Center_Schematic.png

Use the attached diagram together with this pin list. The shield plugs into the Rich UNO's shield headers; the external modules use the remaining connections.


LCD4884: D2 = SCK, D3 = MOSI, D4 = DC, D5 = CS, D6 = RESET.

Joystick: A0.

Onboard MP3 player: D7 and D8, as used by MP3 mp3(7, 8).

Onboard TM1637: D10 = CLK, D11 = DIO.

Fan MOSFET control: D9.

Fan tachometer: D12.

Relay module IN1: A2.

Relay module IN2: A3.

DS1307 RTC and LM75 temperature sensor: shared A4/SDA and A5/SCL.


The RTC address is 0x68 and the temperature sensor address is 0x48. These are already on the Rich UNO; no separate RTC or temperature module is required.


D0/D1 remain available for USB serial. A1 is sampled once for the robot shuffle seed; otherwise it is unused. D13 is a possible expansion pin, subject to checking your hardware.


Connect the external modules' logic ground to the Rich UNO ground. Keep power polarity correct and make every connection with power disconnected. The written pin map describes the final firmware; generic labels or voltage markings in the illustrated parts are not substitutes for your actual module markings.

Connect the Fan, MOSFET and External Supply

The Arduino controls the MOSFET; it does not supply the fan's motor current through a GPIO pin.


MOSFET logic connections:

• SIG → D9.

• VCC → 5 V, for the pictured module's logic supply.

• GND → Arduino GND.


On the pictured MOSFET board, VIN/GND are the external fan-supply input and V+/V− are the switched load output. Connect the matching fan supply to VIN/GND and the fan's power leads to V+/V−. Confirm those labels on your own module. Join the external supply negative and Arduino ground as required by this common-ground switching arrangement. Do not connect the fan supply voltage to the Arduino 5 V pin.


For a typical three-wire fan, red is positive, black is negative and yellow is tachometer, but verify your fan's pinout. Connect its tach lead to D12. The sketch enables INPUT_PULLUP on that input.


The tested control is limited to 30–100%, with no fan-OFF menu option. It uses approximately 31 kHz PWM on Timer1/D9 to reduce audible switching noise. A different fan or MOSFET may need different calibration. Start with the tested constants, then check reliable rotation across the whole range before depending on automatic cooling.

Connect the Relay Module and Test Loads

Connect the two-channel module's VCC to its required 5 V supply, GND to common ground, IN1 to A2, and IN2 to A3. The tested module is active LOW: LOW energizes the relay, HIGH releases it. The sketch defines RELAY_ACTIVE_LOW = true.


Use a small low-voltage test load first. For an output that should normally be off, put the relay's COM and NO contacts in series with the load's supply circuit. NC is the normally closed contact and behaves differently. The relay contacts switch the external load circuit; they do not generate power for it.


The firmware initializes both relays OFF and writes the inactive level before enabling the output pins. Check startup behavior on your exact relay module because hardware can still behave differently during reset or power-up.


Examples include a low-voltage lamp, small pump, mister or filter within the module and supply ratings. A mains appliance needs a suitable enclosure, protection, wiring and competent mains installation; do not reproduce exposed mains wiring on a breadboard. This guide's first tests use low voltage.

Prepare the MP3 SoundPack and SD Card

Download the BlueCore SoundPack here:

https://drive.google.com/file/d/1eg1-g8GGQDnSc2BzQPrGC4mW2xi9JiXm/view?usp=sharing


Extract the pack on your computer. Copy the numbered folders directly to the root of the FAT32 card, then insert it into the Rich UNO MP3 player's card slot with power off.


The required structure is:

01/001.mp3 — system online

01/002.mp3 — system ready

02/001.mp3 through 02/018.mp3 — menu and action announcements

03/001.mp3 through 03/032.mp3 — robot phrases


Do not place these inside an extra SoundPack folder. Folder 01 must be visible immediately when you open the card. Preserve the leading zeroes and file numbering. Windows can hide extensions, so avoid accidentally creating 001.mp3.mp3.


Folder 02 order:

001 Robot; 002 Clock; 003 Date; 004 Temperature; 005 Cooling; 006 Relay Control; 007 System Status; 008 Settings; 009 Settings Saved; 010 Manual; 011 Auto; 012 Relay 1 On; 013 Relay 1 Off; 014 Relay 2 On; 015 Relay 2 Off; 016 Timer Start; 017 Timer Cancel; 018 Timer Complete.


Other files may stay on the card provided they do not overwrite or conflict with these folder/file numbers. Connect the speaker to the board's speaker connector.


Why is there no SD.begin() in the Arduino code? The dedicated MP3 module reads its own card. The Uno sends serial playback commands over D7/D8; it does not open the audio files with Arduino's SD library.

Install Dependencies and Upload the Final V2.5 Sketch

Download BlueCore_Tech_Command_Center.ino from this step and put it in a folder named BlueCore_Tech_Command_Center.


Install TM1637 by Avishay Orpaz in Arduino IDE's Library Manager. The tested installed version is 1.2.0. Source: https://github.com/avishorp/TM1637


For MP3 support, use the RichUNO library supplied for your board, containing RichUNOMP3.h and RichUNOMP3.cpp. The two support source files are also attached here for convenience: if you do not have that library, put both beside the .ino in the sketch folder. Do not install multiple conflicting copies. These OPEN-SMART support sources retain their original LGPL-2.1-or-later notice; the license is at https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.


Wire.h, EEPROM.h and SoftwareSerial.h come with the Arduino AVR board package. This sketch does not require LCD4884, U8glib, RTClib or an LM75 library: it contains its own LCD driver and reads the I2C devices directly.


Open the .ino, choose Arduino Uno under Arduino AVR Boards and select the Rich UNO's USB port. Compile, then upload. Keep the original tested pin definitions and LCD code unchanged for the first run.


If the IDE says RichUNOMP3.h is missing, check that both MP3 files are in the sketch folder or correctly installed as a library. If TM1637Display.h is missing, install the TM1637 library above. A duplicate __vector_7 error after your own modifications is a reason to check timer-using libraries and remove added tone()/noTone() calls.

First Startup and Joystick Navigation

Power the logic and the correctly rated fan supply. Allow the startup sequence and two announcements to finish before checking normal updates. The main menu should appear, with the fan running and both relays initially off.


Use UP/DOWN to select a menu entry and press the joystick to open it. LEFT normally returns to the main menu. Settings and the automatic-cooling editor use LEFT to decrease a value, so press to save/exit those editors instead.


The measured joystick readings used in this firmware are approximately: LEFT 0, PRESS 157, DOWN 352, RIGHT 527, UP 809, released 1023. If your board gives different readings, investigate the A0 knob switch and hardware before changing thresholds.


The firmware reacts to changes in joystick position. Release the joystick between repeated increments; do not expect every held direction to continuously repeat.


Check one function at a time: menu movement, startup sound, clock, temperature, fan adjustment, then the two low-voltage relay loads. This makes a wiring or switch problem much easier to isolate.

Robot Mode, Clock, Date and Temperature

ROBOT MODE shows the BlueCore robot face. Press the joystick for a phrase. The animation blinks and moves its mouth while the code plays a recorded sound. A shuffle bag uses all 32 phrases before reshuffling, and avoids repeating the last phrase immediately across a shuffle boundary.


CLOCK and DATE read the onboard DS1307. The final Command Center sketch displays the RTC; it does not contain a clock-setting menu. If the clock is wrong or stopped, set it using a suitable DS1307 setting example first, then upload the Command Center sketch again. Use only a backup cell type appropriate to your board's holder and charging circuit.


TEMPERATURE displays DEVICE from the onboard LM75 and ROOM as DEVICE plus a user offset. The initial offset is −3.5 °C. Because the sensor is on the powered board, ROOM is an estimate, not a separate ambient probe. Compare with a trusted thermometer and adjust for your installation; board heating and airflow can change the difference.


The automatic cooling algorithm uses DEVICE temperature, not the offset-adjusted ROOM display. Changing the room offset therefore does not change the fan's automatic control temperature.

Cooling: Manual and Automatic Modes

Use UP/DOWN to browse the cooling pages. LEFT returns to the main menu, except inside the auto-settings editor.


On the mode page, PRESS switches MANUAL/AUTO and saves the change.


In MANUAL on the control page, RIGHT increases the requested fan level by 5%; PRESS decreases it by 5%. The allowed range is 30–100%. These changes are saved automatically.


The automatic-settings page lets you choose START, FULL and MIN with UP/DOWN. LEFT decreases and RIGHT increases the selected value. START and FULL change in 0.5 °C steps; MIN changes in 5% steps. PRESS saves and leaves the editor. The code keeps at least 1 °C between START and FULL.


Default AUTO settings are START 27 °C, FULL 32 °C and MIN 30%. Below START, the fan stays at MIN. Between START and FULL it ramps linearly towards 100%. At or above FULL it requests 100%. If an LM75 read fails while AUTO is active, the code requests full fan power. This is a software fallback, not a certified thermal protection system.


The on-screen percentage is a calibrated control request. It is not measured RPM or guaranteed airflow. The tested sketch maps 30–100% into its hardware-command range 65–10, then converts that to the inverted PWM output used in this setup. Preserve this working mapping unless you are calibrating different hardware.

Why Fan RPM Can Show PWM/NA

The fan has a tach wire, but this three-wire fan is controlled by switching its power through the MOSFET. Its tach signal can be disturbed by that PWM switching, especially with a switched ground reference.


The firmware measures HIGH and LOW pulse times, assumes two pulses per revolution, and rejects zero or implausibly high results. When a usable measurement is unavailable, the display shows RPM: PWM/NA.


This is an honest limitation of this fan-control arrangement, not proof that the fan has stopped. Even a plausible number can be inaccurate under PWM. Fan control is open-loop; it does not regulate speed using this RPM reading.


For a future revision requiring dependable RPM, use a properly designed fan interface such as a suitable four-wire PWM fan with continuous power and a correctly interfaced tach signal. That is a hardware/software expansion, not a feature of this build.

Relay Control and Countdown Timers

In RELAY CONTROL, UP/DOWN selects relay 1 or relay 2. PRESS toggles the selected relay manually and cancels any timer running for that output. RIGHT opens its timer page; LEFT returns to the menu.


With a timer stopped:

• UP adds one minute.

• DOWN subtracts one minute, stopping at zero.

• RIGHT adds ten seconds.

• PRESS starts the timer and turns the relay on.


The initial duration is 30 minutes. Starting from zero restores that default. While a timer is running, PRESS cancels it and turns the relay off. The remaining duration is retained for another start; a cancellation is not a pause with the output left on.


The timer continues if you leave the page. When it reaches zero, the relay switches off and the timer-complete sound plays. The two channels have separate countdown state.


These are countdowns, not daily RTC schedules. Power loss or reset discards the countdowns and starts the relays off. Do not depend on this prototype alone for critical unattended equipment. Test the actual load and startup behavior before using it in an installation.

System Status, Settings and EEPROM

SYSTEM STATUS has three pages; change pages with UP/DOWN.


Page 1 shows RTC, temperature and fan information. Page 2 lists initialization labels such as MP3 INIT, LCD INIT, 7SEG INIT and RELAYS READY. These are program status labels, not independent electrical or audio health tests. Page 3 shows free RAM, uptime, relay states and firmware version.


In SETTINGS, UP/DOWN selects volume, temperature offset or four-digit brightness. LEFT decreases and RIGHT increases. PRESS saves, applies the settings and returns to the menu with a spoken confirmation.


Volume range: 0–30; initial value 15.

Room offset: −10 to +10 °C in 0.5 °C steps; initial −3.5 °C.

Four-digit brightness: 0–7; initial 4.


Cooling mode, manual fan level, automatic minimum and the START/FULL temperatures are also saved. EEPROM is loaded at startup, and defaults are used when the expected settings marker is absent. Uploading the sketch again does not necessarily erase existing EEPROM settings.


Relay states, timers and the robot's shuffle order are runtime data. They do not resume from EEPROM. The code uses PROGMEM for font data and compact integer-based values to stay within the Uno's limited memory.

Troubleshooting the Working Hardware Combination

Blank or corrupted LCD: check shield alignment, D2–D6 conflicts and the IR/touch switches. Use the supplied custom LCD code first. Generic LCD4884 libraries did not work correctly with this exact combination during development.


Menu moves by itself: disconnect the Rich UNO knob from A0 and verify the joystick wiring. A0 must belong to the joystick.


No sound: check speaker connection, MP3 D7/D8 switches, volume, FAT32 card and exact 01/001.mp3 folder structure. Insert the card with power off, restart and wait through boot. An MP3 INIT label does not prove audio playback or card detection. Do not replace this module's library with an unrelated MP3 protocol.


Fan runs backwards through the percentage range: check that your MOSFET/fan behaves like the tested hardware before changing the two calibration constants. Fan stalls low down: raise the minimum for your hardware. RPM missing under PWM: see the dedicated RPM explanation; do not treat it as a closed-loop speed sensor.


Relays operate inverted: verify that your module is active LOW. A different input polarity requires changing RELAY_ACTIVE_LOW, but test without a consequential load attached.


Clock wrong: set the DS1307 separately. ROOM reading wrong: compare DEVICE and the saved offset, remembering that an onboard sensor warms with the electronics.


Reboots when a motor or speaker starts: check the power supply, shared ground and wiring. Keep fan/load current out of GPIO pins and avoid powering motors from the USB logic rail.

Customize the Sounds and Expand the Project

You can replace a spoken announcement with your own voice, a beep or another sound by keeping its exact folder/file number. Back up the original SoundPack first. Keep the 32 robot filenames if you want to preserve the existing shuffle logic.


A future music-player menu could use additional folders such as 04 and 05, but adding files alone will not create that menu. Playback controls and displayed titles would need new code; this firmware does not automatically read song metadata.


The relay outputs could be adapted to a grow lamp, small irrigation pump, misting system, workshop light, filter or terrarium accessory. These are possible applications of the outputs, not claims that v2.5 already includes soil moisture, pH, daily scheduling or aquarium control.


For a grow-room example, relay 1 could switch a suitable lamp and relay 2 a pump or mister for a selected countdown duration. For an attic, the outputs could control lights and an air filter while the fan cools the electronics cabinet. Irrigation, ventilation, heaters and terrarium/aquarium accessories need load-appropriate protection and independent safeguards; this prototype is not a complete unattended environmental controller.


Possible expansions requiring new wiring and code include an external IR receiver on a verified free pin such as D13, rerouting the knob from A0 to A1, an I2C I/O expander for more relays, or humidity, soil-moisture, water-level, light and CO2 sensing. Check library timer use before adding IR: the onboard D2 receiver remains disconnected because of the LCD. Automatic schedules and sensor-triggered relay actions would also require new code.


Other future ideas include an enclosure, an external ambient sensor, more elaborate robot animations or a different fan interface. Plan pins, timers, power and Uno memory before adding features. D13 is a possible spare pin; A1 is used only for the startup random seed. Keep the tested sketch as a backup.


Have fun building your own Command Center, and share your version in the comments! — Danny van den Brande, BlueCore Tech.